/* ══════════════════════════════════════════════════════════════
   ArraPrompt AI — Cinematic Workspace Design System
   Inspired by: Linear · Raycast · Vercel · Perplexity
   Formula: 80% matte dark · 15% soft gold · 5% cinematic highlight
   ══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

h1, h2, h3, h4, h5, h6,
.auth-brand-title, .auth-form-title, .settings-form-title,
.ai-tools-header h2, .draft-center-header h2, .content-vault-header h2, .modal-title {
  font-family: 'Lora', 'Georgia', serif;
}

/* ── Tier 1: Literal Design Tokens ────────────────────────── */
:root {
  /* Matte Dark Palette (80%) — No pure black, graphite tones */
  --gray-950: #0c0c0e;
  --gray-900: #111114;
  --gray-850: #161619;
  --gray-800: #1c1c20;
  --gray-750: #222226;
  --gray-700: #2a2a2f;
  --gray-600: #3a3a42;
  --gray-500: #52525e;
  --gray-400: #71717e;
  --gray-300: #a1a1ae;
  --gray-200: #d4d4dc;
  --gray-100: #ececf0;
  --gray-50: #fafafa;

  /* Soft Gold Accent (15%) — Warm, muted, not neon */
  --gold-50: rgba(201, 168, 76, 0.04);
  --gold-100: rgba(201, 168, 76, 0.08);
  --gold-200: rgba(201, 168, 76, 0.15);
  --gold-300: #c9a84c;
  --gold-400: #d4b65e;
  --gold-500: #b89640;
  --gold-600: #9a7d35;

  /* Cinematic Highlight (5%) */
  --warm-white: rgba(255, 248, 230, 0.92);
}

/* ── Tier 2: Semantic Design Tokens ───────────────────────── */
:root {
  --bg-primary: var(--gray-950);
  --bg-secondary: var(--gray-900);
  --bg-tertiary: var(--gray-850);
  --bg-elevated: var(--gray-800);
  --bg-hover: var(--gray-750);
  --bg-active: var(--gray-700);

  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-medium: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);

  /* Typography Colors — clear hierarchy */
  --text-primary: var(--gray-100);
  --text-secondary: var(--gray-400);
  --text-tertiary: var(--gray-500);
  --text-inverse: var(--gray-950);

  /* Accent — soft gold, understated */
  --accent: var(--gold-300);
  --accent-hover: var(--gold-400);
  --accent-muted: var(--gold-500);
  --accent-glow: var(--gold-200);
  --accent-soft: var(--gold-100);
  --accent-subtle: var(--gold-50);

  /* Status Colors */
  --success: #4ade80;
  --error: #f87171;
  --warning: #fbbf24;
  --info: #60a5fa;

  /* Layout */
  --sidebar-w: 260px;
  --header-h: 52px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows — subtle, no heavy glows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.2);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 120ms ease;
  --transition-normal: 200ms var(--ease-out);
  --transition-slow: 350ms var(--ease-out);
}

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

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-700) transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow: hidden;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  font-size: inherit;
}

::-webkit-scrollbar {
  width: 5px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--gray-700);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-600);
}

/* ══════════════════════════════════════════════════════════════
   TYPOGRAPHY HIERARCHY
   ══════════════════════════════════════════════════════════════ */
.t-hero {
  font-size: clamp(1.5rem, 1rem + 2vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-primary);
  text-wrap: balance;
}

.t-heading {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text-primary);
}

.t-body {
  font-size: 0.935rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
}

.t-caption {
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text-tertiary);
}

.t-micro {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* ══════════════════════════════════════════════════════════════
   LOGIN SCREEN
   ══════════════════════════════════════════════════════════════ */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
}

.login-card {
  width: 400px;
  max-width: 90vw;
  padding: 48px 40px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.5s var(--ease-out);
}

.login-logo-wrap {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--gold-600));
  border-radius: var(--radius-md);
}

.login-logo-wrap span {
  font-size: 32px;
}

.login-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 32px;
  line-height: 1.5;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  background: var(--text-primary);
  color: var(--text-inverse);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.btn-google:hover {
  background: var(--gray-50);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-google svg {
  width: 20px;
  height: 20px;
}

.login-footer {
  margin-top: 24px;
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

/* ══════════════════════════════════════════════════════════════
   APP LAYOUT — Workspace Shell
   ══════════════════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  height: 100dvh;
  width: 100%;
}

.app-layout.hidden {
  display: none;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  flex-shrink: 0;
  transition: transform var(--transition-slow);
  position: relative;
  z-index: 100;
}

.sidebar-header {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.btn-new-workflow {
  width: 100%;
  background-color: #dcb439;
  color: #000;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 4px;
}

.btn-new-workflow:hover {
  background-color: #e5bf42;
  transform: translateY(-1px);
}

.btn-new-chat {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.btn-new-chat:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn-new-chat .icon {
  font-size: 1rem;
}

.sidebar-nav {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav-icon {
  font-size: 1rem;
}

.sidebar-conversations {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

.sidebar-section-label {
  padding: 10px 10px 4px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.conv-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.84rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  gap: 6px;
}

.conv-item:hover:not(.active) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.conv-item.active {
  background: var(--bg-active);
  color: var(--text-primary);
}

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

.conv-item .conv-delete {
  opacity: 0;
  font-size: 0.75rem;
  padding: 3px 5px;
  border-radius: 4px;
  color: var(--text-tertiary);
  transition: all var(--transition-fast);
}

.conv-item:hover .conv-delete {
  opacity: 0.7;
}

.conv-item .conv-delete:hover {
  opacity: 1;
  color: var(--accent);
  background: var(--accent-soft);
}

.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border-subtle);
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-align: left;
}

.user-profile-btn:hover {
  background: var(--bg-hover);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-muted), var(--gold-600));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-inverse);
  flex-shrink: 0;
}

.user-profile-info {
  flex: 1;
  overflow: hidden;
}

.user-profile-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-profile-plan {
  font-size: 0.68rem;
  color: var(--accent-muted);
  font-weight: 500;
}

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: row;
  min-width: 0;
  height: 100dvh;
  position: relative;
  background: var(--bg-primary);
}

/* Chat column: grows to fill space beside preset panel */
.chat-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

/* When messages exist, preset panel hides and chat takes full width */
.main-content.has-messages .preset-panel {
  display: none;
}

/* ── Chat Header ───────────────────────────────────────────── */
.chat-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-primary);
  flex-shrink: 0;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-toggle-sidebar {
  display: none;
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.btn-toggle-sidebar:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.chat-model-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.chat-model-badge {
  font-size: 0.65rem;
  font-weight: 500;
  padding: 2px 8px;
  background: var(--accent-subtle);
  color: var(--accent-muted);
  border-radius: 20px;
  border: 1px solid var(--gold-100);
}

.chat-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-header-icon {
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  font-size: 1rem;
  transition: all var(--transition-fast);
}

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

/* ── Chat Messages Area ───────────────────────────────────── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0 20px;
  /* Base padding */
  scroll-behavior: smooth;
  min-width: 0;
  transition: padding-bottom 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Add padding for input area only when messages exist (input is at bottom) */
.main-content.has-messages .chat-messages {
  padding-bottom: 260px;
}

.message-row {
  padding: 16px 20px;
  animation: fadeIn 0.3s var(--ease-out);
}

.message-row.user {
  background: transparent;
}

.message-row.assistant {
  background: transparent;
  border: none;
}

.message-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  gap: 16px;
  position: relative;
}

/* ── Premium Card for Assistant ── */
.message-row.assistant .message-inner {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.message-row.assistant .message-inner:hover {
  border-color: var(--border-strong);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ── Clean alignment for User Prompt ── */
.message-row.user .message-inner {
  padding: 8px 0;
  align-items: center;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 0;
}

.message-row.user .message-avatar {
  background: var(--bg-hover);
  color: var(--text-tertiary);
}

.message-row.assistant .message-avatar {
  background: linear-gradient(135deg, var(--accent-muted), var(--gold-600));
  color: var(--text-inverse);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.2);
}

.message-body {
  flex: 1;
  min-width: 0;
}

.message-sender {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.message-text {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-primary);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.message-row.user .message-text {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
}

.message-text code {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
  border: 1px solid var(--border-subtle);
}

.message-text pre {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  overflow-x: auto;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 12px 0;
}

/* ── Premium Workflow Cards ────────────────────────────────── */
.wf-card {
  background: rgba(24, 24, 24, 0.5);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}

.wf-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-subtle);
}

.wf-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.wf-card-actions {
  display: flex;
  gap: 8px;
}

.wf-card-body {
  padding: 16px;
}

.wf-split {
  display: flex;
  gap: 16px;
  padding-bottom: 4px;
}

.wf-split-col {
  flex: 1;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.15);
}

.wf-col-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-tertiary);
  letter-spacing: 1px;
  margin-bottom: 10px;
  font-weight: 600;
}

.hashtag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}

.hashtag-badge {
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(212, 175, 55, 0.08);
  color: var(--gold-400);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ── Tool Grid (One-Click Open) ────────────────────────────── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.tool-grid-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.tool-grid-item:hover {
  background: rgba(212, 175, 55, 0.05);
  border-color: rgba(212, 175, 55, 0.4);
  transform: translateY(-2px);
}

.tool-icon {
  font-size: 1.5rem;
}

.tool-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tool-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.tool-type {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.btn-wf-action {
  background: var(--bg-hover);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-wf-action:hover {
  background: var(--bg-active);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-wf-action.tool-btn {
  background: rgba(201, 168, 76, 0.1);
  border-color: rgba(201, 168, 76, 0.3);
  color: var(--gold-400);
  font-weight: 500;
}

.btn-wf-action.tool-btn:hover {
  background: rgba(201, 168, 76, 0.2);
  border-color: var(--gold-400);
  color: var(--gold-300);
}

.btn-wf-action.claude-btn {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.35);
  color: #a78bfa;
  font-weight: 500;
}

.btn-wf-action.claude-btn:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: #a78bfa;
  color: #c4b5fd;
}

.btn-msg-action.claude-btn {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.35);
  color: #a78bfa;
  font-weight: 500;
}

.btn-msg-action.claude-btn:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: #a78bfa;
  color: #c4b5fd;
}

.message-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  flex-wrap: wrap;
}

.message-row .message-actions {
  opacity: 1;
}

.btn-msg-action {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
  background: var(--bg-primary);
  border: 1px solid var(--border-medium);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-msg-action:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* ── Typing Indicator ──────────────────────────────────────── */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: var(--text-tertiary);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite;
}

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

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

/* ── Welcome / Empty State (Claude-style Clean) ───────────── */
.welcome-screen {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 32px 24px calc(50vh + 100px) 24px;
  text-align: center;
  box-sizing: border-box;
  gap: 16px;
  min-height: 100%;
}

.welcome-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 600px;
}

.welcome-screen .dashboard-home {
  margin-top: 0;
  margin-bottom: 0;
}

.welcome-greeting-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.welcome-greeting-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.2));
  flex-shrink: 0;
}

.welcome-greeting-text {
  font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.2;
}

.welcome-greeting-text span {
  color: var(--accent);
}

.welcome-subtitle {
  color: var(--accent);
  font-size: 0.95rem;
  max-width: 480px;
  margin-bottom: 0;
  line-height: 1.5;
  font-weight: 700;
}

/* ── Calendar Reminder Card ── */
.calendar-reminder-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 500px;
  background: rgba(201, 168, 76, 0.05);
  border: 1px solid rgba(201, 168, 76, 0.15);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  animation: fadeIn 300ms ease;
  box-sizing: border-box;
  text-align: left;
  margin-top: 20px;
}

.calendar-reminder-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar-reminder-icon-wrapper {
  color: var(--accent);
  background: rgba(201, 168, 76, 0.1);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.calendar-reminder-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calendar-reminder-title {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.calendar-reminder-text {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin: 0;
}

.calendar-reminder-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-reminder-action {
  background: var(--accent);
  color: var(--text-inverse);
  border: none;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 200ms ease;
}

.btn-reminder-action:hover {
  background: var(--accent-hover);
}

.btn-reminder-close {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color 200ms ease;
}

.btn-reminder-close:hover {
  color: var(--text-primary);
}


/* ── Preset Right Panel ─────────────────────────────────────── */
.preset-panel {
  width: 280px;
  height: calc(100dvh - var(--header-h));
  border-left: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  align-self: flex-end;
}

.preset-panel-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.preset-panel-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.preset-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
}

@media (max-width: 1024px) {
  .preset-panel {
    width: 240px;
  }
}

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

/* ── Preset Cards (compact right-panel style) ─────────────── */
.preset-card {
  position: relative;
  padding: 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.preset-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-medium);
}

.locked-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 12, 19, 0.6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  color: var(--text-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.preset-card.locked:hover .locked-overlay {
  opacity: 1;
}

.lock-icon {
  font-size: 1rem;
  margin-bottom: 2px;
}

.lock-text {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--gold-400);
  background: rgba(212, 175, 55, 0.1);
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.preset-icon-area {
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  flex-shrink: 0;
}

.preset-content {
  flex: 1;
  min-width: 0;
}

.preset-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.preset-category {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
}

.preset-tier {
  font-size: 0.55rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.tier-free {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tier-pro {
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold-400);
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.tier-ultra {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(212, 175, 55, 0.15));
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.preset-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preset-desc {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Input Area ────────────────────────────────────────────── */
.input-area {
  position: absolute;
  /* Centered by default */
  bottom: 50%;
  left: 0;
  right: 0;
  transform: translateY(50%);
  padding: 24px 20px 32px;
  background: transparent;
  pointer-events: none;
  z-index: 50;
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  /* Smooth drop down */
}

/* When messages are present, input spans full width and drops to bottom */
.main-content.has-messages .input-area {
  bottom: 0;
  transform: translateY(0);
  background: linear-gradient(to top, var(--bg-primary) 50%, transparent);
}

.input-container {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  pointer-events: auto;
  background: rgba(18, 18, 18, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-medium);
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform var(--transition-medium), box-shadow var(--transition-medium);
}

.input-container:focus-within {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-color: var(--border-strong);
}

.input-options {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.input-options::-webkit-scrollbar {
  display: none;
}

/* ── Segmented Control (Category Toggle) ── */
.category-segmented-control {
  display: inline-flex;
  position: relative;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  border-radius: 12px;
  padding: 4px;
  width: 580px;
  max-width: 100%;
}

.segment-btn {
  position: relative;
  z-index: 2;
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 6px 4px;
  border-radius: 7px;
  cursor: pointer;
  transition: color 0.25s var(--ease-out);
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  width: 16.666%;
  white-space: nowrap;
}

.segment-btn:hover:not(.active) {
  color: var(--text-secondary);
}

.segment-btn.active {
  color: var(--gold-400);
  font-weight: 600;
}

.segmented-indicator {
  position: absolute;
  top: 3px;
  left: 3px;
  bottom: 3px;
  width: calc(16.666% - 1px);
  background: var(--bg-hover);
  border: 1px solid var(--gold-200);
  border-radius: 7px;
  z-index: 1;
  transition: transform 0.35s var(--ease-out);
}

.category-segmented-control[data-active="0"] .segmented-indicator {
  transform: translateX(0);
}

.category-segmented-control[data-active="1"] .segmented-indicator {
  transform: translateX(100%);
}

.category-segmented-control[data-active="2"] .segmented-indicator {
  transform: translateX(200%);
}

.category-segmented-control[data-active="3"] .segmented-indicator {
  transform: translateX(300%);
}

.category-segmented-control[data-active="4"] .segmented-indicator {
  transform: translateX(400%);
}

.category-segmented-control[data-active="5"] .segmented-indicator {
  transform: translateX(500%);
}

.input-option {
  padding: 5px 10px;
  border: 1px solid var(--border-medium);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 4px;
}

.input-option:hover:not(:disabled) {
  border-color: var(--accent-muted);
  color: var(--accent);
  background: var(--accent-subtle);
}

.input-option.active {
  border-color: var(--accent-muted);
  background: var(--accent-subtle);
  color: var(--accent);
}

/* ── Tone Dropdown ────────────────────────────────────────── */
.tone-dropdown-wrap {
  position: relative;
  flex-shrink: 0;
}

.tone-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
}

.tone-badge {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 5px;
  background: linear-gradient(135deg, var(--accent-muted), var(--gold-600));
  color: var(--text-inverse);
  border-radius: 4px;
  letter-spacing: 0.04em;
  margin-left: 2px;
}

.tone-chevron {
  margin-left: 1px;
  transition: transform var(--transition-fast);
}

.tone-dropdown-wrap.open .tone-chevron {
  transform: rotate(180deg);
}

.tone-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 4px;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.15s var(--ease-out);
  z-index: 50;
}

.tone-dropdown.hidden {
  display: none;
}

.tone-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  text-align: left;
}

.tone-option:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tone-option.active {
  color: var(--accent);
  background: var(--accent-subtle);
}

.tone-check {
  width: 14px;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 700;
}

/* ── Enhance Button ───────────────────────────────────────── */
.enhance-btn {
  background: rgba(168, 85, 247, 0.06);
  border-color: rgba(168, 85, 247, 0.18) !important;
  color: #c084fc !important;
}

.enhance-btn:hover:not(:disabled) {
  background: rgba(168, 85, 247, 0.12) !important;
  border-color: rgba(168, 85, 247, 0.3) !important;
  color: #d8b4fe !important;
}

.enhance-btn.loading {
  opacity: 0.5;
  pointer-events: none;
  animation: subtlePulse 1.2s infinite;
}

.input-box {
  display: flex;
  flex-direction: column;
  background: rgba(18, 18, 18, 0.6);
  border: 1px solid var(--border-medium);
  border-radius: 16px;
  padding: 16px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-box:focus-within {
  border-color: var(--border-strong);
}

.input-textarea {
  width: 100%;
  resize: none;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1.05rem;
  line-height: 1.5;
  max-height: 180px;
  min-height: 28px;
  margin-bottom: 24px;
}

.input-textarea::placeholder {
  color: var(--text-tertiary);
  font-weight: 500;
}

.input-box-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
}

.message-sender {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 6px;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.workflow-stage-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
  text-transform: uppercase;
}

.workflow-stage-badge.ai-stage {
  background: rgba(201, 168, 76, 0.1);
  color: var(--gold-400);
  border-color: rgba(201, 168, 76, 0.2);
}

.input-footer {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.btn-send {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-300);
  color: #111;
  border-radius: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  margin-left: 8px;
  box-shadow: 0 2px 8px rgba(201, 168, 76, 0.25);
}

.btn-send:hover:not(:disabled) {
  background: var(--accent);
  transform: scale(1.04);
}

.btn-send:disabled {
  opacity: 0.6;
  background: var(--gold-300);
  color: #111;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-send.loading {
  animation: subtlePulse 1.5s infinite;
}

/* ══════════════════════════════════════════════════════════════
   MODALS & OVERLAYS
   ══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s var(--ease-out);
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  width: 420px;
  max-width: 90vw;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.25s var(--ease-out);
}

.modal-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.modal-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* ══════════════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(80px);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-slow);
  z-index: 1000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.error {
  border-left: 3px solid var(--error);
}

.toast.info {
  border-left: 3px solid var(--info);
}

/* ══════════════════════════════════════════════════════════════
   USER MENU DROPDOWN
   ══════════════════════════════════════════════════════════════ */
.user-menu {
  position: absolute;
  bottom: 100%;
  left: 8px;
  right: 8px;
  margin-bottom: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 4px;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.15s var(--ease-out);
}

.user-menu.hidden {
  display: none;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.user-menu-item:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.user-menu-item.danger:hover {
  background: rgba(248, 113, 113, 0.08);
  color: var(--error);
}

/* ══════════════════════════════════════════════════════════════
   GUEST & AUTH PROMO STYLES
   ══════════════════════════════════════════════════════════════ */
.guest-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 10px;
}

.btn-guest-signin {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-guest-signin:hover {
  color: var(--accent);
  background: var(--bg-hover);
}

.btn-guest-signup {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-inverse);
  background: linear-gradient(135deg, var(--accent-muted), var(--gold-600));
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-guest-signup:hover {
  background: linear-gradient(135deg, var(--accent), var(--gold-500));
  transform: translateY(-1px);
}

.btn-guest-join {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px;
  background: var(--accent-subtle);
  border: 1px dashed var(--accent-muted);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.btn-guest-join:hover {
  background: var(--accent-soft);
  transform: scale(1.01);
}

.auth-promo-content {
  width: 480px !important;
  max-width: 90vw;
  padding: 36px !important;
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-medium) !important;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 1.1rem;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color var(--transition-fast);
}

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

.auth-promo-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-promo-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin-bottom: 14px;
  filter: drop-shadow(0 2px 8px var(--gold-200));
}

.auth-promo-title {
  font-size: 1.3rem !important;
  font-weight: 700;
  margin-bottom: 6px !important;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  -webkit-text-fill-color: unset;
}

.auth-promo-subtitle {
  font-size: 0.85rem !important;
  color: var(--text-secondary) !important;
  line-height: 1.5;
  margin-bottom: 0 !important;
}

.auth-promo-benefits {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
  text-align: left;
}

.benefit-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.benefit-icon {
  font-size: 1.1rem;
  background: var(--bg-tertiary);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.benefit-desc {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.benefit-desc strong {
  font-size: 0.84rem;
  color: var(--text-primary);
  font-weight: 600;
}

.benefit-desc span {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.auth-promo-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.btn-promo-signup {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent-muted), var(--gold-600));
  color: var(--text-inverse);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  transition: all var(--transition-fast);
}

.btn-promo-signup:hover {
  background: linear-gradient(135deg, var(--accent), var(--gold-500));
  transform: translateY(-1px);
}

.btn-promo-login {
  font-size: 0.82rem;
  color: var(--accent-muted);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.btn-promo-login:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ══════════════════════════════════════════════════════════════
   ANIMATIONS — Subtle, purposeful
   ══════════════════════════════════════════════════════════════ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typingBounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.3;
  }

  30% {
    transform: translateY(-5px);
    opacity: 0.8;
  }
}

@keyframes subtlePulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.75;
  }
}

/* Keep legacy name for JS references */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.75;
  }
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0);
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
  }

  .sidebar-backdrop.hidden {
    display: none;
  }

  .btn-toggle-sidebar {
    display: flex;
  }

  .desktop-only {
    display: none !important;
  }

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

  .message-inner {
    padding: 0 4px;
  }

  .message-actions {
    opacity: 1 !important;
  }

  .segment-btn {
    font-size: 0.7rem;
    padding: 6px 2px;
  }

  .input-area {
    padding: 10px 12px 14px;
  }

  /* ── Mobile: Claude-style welcome ── */
  .welcome-screen {
    padding: 24px 16px calc(50vh + 80px) 16px;
    gap: 12px;
  }

  .welcome-center {
    margin-bottom: 0;
  }

  .welcome-screen .dashboard-home {
    margin-top: 0;
  }

  .calendar-reminder-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-top: 14px;
  }

  .calendar-reminder-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .welcome-greeting-logo {
    width: 32px;
    height: 32px;
  }

  .welcome-greeting-text {
    font-size: 1.3rem;
  }

  .suggestion-chips {
    gap: 8px;
  }

  .suggestion-chip {
    font-size: 0.78rem;
    padding: 8px 14px;
  }
}

/* ── Utilities ─────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

/* ── AI Tools View ─────────────────────────────────────────── */
#ai-tools-view {
  padding: 40px;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  overflow-y: auto;
  animation: fadeUp 0.3s ease;
}

.ai-tools-header {
  margin-bottom: 32px;
}

.ai-tools-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-tools-header p {
  font-size: 0.9rem;
  color: var(--text-tertiary);
}

.ai-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.ai-tool-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.ai-tool-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.ai-tool-icon {
  font-size: 1.8rem;
  margin-bottom: 16px;
  background: var(--bg-tertiary);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.ai-tool-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.ai-tool-info p {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-bottom: 16px;
  line-height: 1.4;
}

.ai-tool-tag {
  font-size: 0.7rem;
  padding: 4px 12px;
  border-radius: 12px;
  background: rgba(201, 168, 76, 0.1);
  color: var(--gold-400);
  border: 1px solid rgba(201, 168, 76, 0.2);
  font-weight: 500;
}

@media (max-width: 1024px) {
  .ai-tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .ai-tools-grid {
    grid-template-columns: 1fr;
  }

  #ai-tools-view {
    padding: 20px;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ══════════════════════════════════════════════════════════════
   PRICING MODAL
   ══════════════════════════════════════════════════════════════ */
.pricing-modal {
  width: 860px !important;
  max-width: 95vw;
  padding: 0 !important;
  background: var(--bg-primary) !important;
  border: 1px solid var(--border-medium) !important;
  overflow: hidden;
}

.pricing-header {
  text-align: center;
  padding: 36px 20px 16px;
  background: radial-gradient(circle at top, var(--accent-subtle) 0%, transparent 60%);
}

.pricing-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.pricing-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 16px 32px 32px;
}

.pricing-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.pricing-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
}

.pricing-card.ultra {
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--gold-200);
}

.pricing-card.ultra::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-muted), var(--gold-400), var(--accent-muted));
}

.pricing-card.ultra:hover {
  box-shadow: 0 8px 24px rgba(201, 168, 76, 0.1);
  border-color: var(--accent-muted);
}

.plan-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.plan-headline {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  line-height: 1.4;
}

.pricing-card.ultra .plan-name {
  color: var(--accent-muted);
}

.plan-price {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.plan-price span {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  font-weight: 400;
}

.plan-features {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.feature-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-primary);
  font-weight: 600;
}

.feature-check {
  color: var(--success);
  font-weight: bold;
}

.feature-cross {
  color: var(--error);
  font-weight: bold;
  opacity: 0.4;
}

.btn-upgrade {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  transition: all var(--transition-fast);
}

.btn-upgrade.free {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
}

.btn-upgrade.pro {
  background: var(--text-primary);
  color: var(--text-inverse);
}

.btn-upgrade.ultra {
  background: linear-gradient(135deg, var(--accent-muted), var(--gold-600));
  color: var(--text-inverse);
}

.btn-upgrade:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.btn-header-upgrade {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent-muted), var(--gold-600));
  color: var(--text-inverse);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-header-upgrade:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.segment-btn.locked {
  opacity: 0.6;
}

.segment-btn.locked::after {
  content: '🔒';
  font-size: 0.65rem;
  margin-left: 3px;
}

@media (max-width: 768px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 12px;
  }
}

.enhance-action-btn {
  color: #c084fc !important;
  background: rgba(168, 85, 247, 0.08);
}

.enhance-action-btn:hover {
  background: rgba(168, 85, 247, 0.15);
  color: #d8b4fe !important;
}

.popular-badge {
  font-size: 0.58rem;
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  font-weight: 700;
  letter-spacing: 0.05em;
  box-shadow: 0 1px 4px rgba(239, 68, 68, 0.35);
  display: inline-block;
  text-transform: none;
}

/* ══════════════════════════════════════════════════════════════
   HELP / FAQ MODAL
   ══════════════════════════════════════════════════════════════ */
.help-modal-content {
  width: 580px;
  max-width: 92vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.help-modal-header {
  padding: 28px 28px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.help-header-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-muted), var(--gold-600));
  border-radius: var(--radius-md);
  font-size: 22px;
  box-shadow: 0 4px 16px rgba(201, 168, 76, 0.2);
}

.help-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.help-modal-subtitle {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.help-search-wrap {
  position: relative;
}

.help-search-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.help-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}

.help-faq-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px 24px;
}

/* ── FAQ Category Labels ── */
.faq-category-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-muted);
  padding: 16px 0 6px;
  margin-top: 4px;
}

.faq-category-label:first-child {
  padding-top: 8px;
  margin-top: 0;
}

/* ── FAQ Accordion Items ── */
.faq-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  overflow: hidden;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.faq-item:hover {
  border-color: var(--border-medium);
}

.faq-item.active {
  border-color: var(--gold-200);
  box-shadow: 0 2px 12px rgba(201, 168, 76, 0.08);
}

.faq-item.faq-hidden {
  display: none;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
  gap: 10px;
}

.faq-question:hover {
  background: var(--bg-hover);
}

.faq-chevron {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  transition: transform 250ms var(--ease-out);
  flex-shrink: 0;
}

.faq-item.active .faq-chevron {
  transform: rotate(90deg);
  color: var(--accent);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 350ms var(--ease-out), padding 250ms ease;
  padding: 0 14px;
}

.faq-item.active .faq-answer {
  max-height: 600px;
  padding: 0 14px 14px;
}

.faq-answer p,
.faq-answer li {
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.faq-answer p {
  margin-bottom: 8px;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

.faq-answer ul,
.faq-answer ol {
  padding-left: 20px;
  margin-bottom: 8px;
}

.faq-answer li {
  margin-bottom: 4px;
}

.faq-answer strong {
  color: var(--text-primary);
}

.faq-answer a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.faq-answer a:hover {
  color: var(--accent-hover);
}

/* ── FAQ Comparison Table ── */
.faq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin: 8px 0;
}

.faq-table th {
  text-align: left;
  padding: 8px 10px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-medium);
  white-space: nowrap;
}

.faq-table td {
  padding: 7px 10px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.faq-table tr:last-child td {
  border-bottom: none;
}

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

@media (max-width: 768px) {
  .help-modal-content {
    max-height: 90vh;
    border-radius: var(--radius-md);
  }

  .help-modal-header {
    padding: 20px 16px 16px;
  }

  .help-faq-body {
    padding: 8px 12px 20px;
  }

  .faq-question {
    font-size: 0.82rem;
    padding: 10px 12px;
  }

  .faq-table {
    font-size: 0.72rem;
  }

  .faq-table th,
  .faq-table td {
    padding: 6px 6px;
  }
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR NAV DIVIDER
   ══════════════════════════════════════════════════════════════ */
.sidebar-nav-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 12px;
}

/* ══════════════════════════════════════════════════════════════
   SETTINGS MODAL
   ══════════════════════════════════════════════════════════════ */

.settings-modal-content {
  width: 620px;
  max-width: 94vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.settings-modal-header {
  padding: 24px 28px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.settings-header-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-muted), var(--gold-600));
  border-radius: var(--radius-md);
  font-size: 22px;
  box-shadow: 0 4px 16px rgba(201, 168, 76, 0.2);
}

.settings-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.settings-modal-subtitle {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin-bottom: 0;
}

/* ── Settings Tabs ── */
.settings-tabs {
  display: flex;
  gap: 0;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.settings-tabs::-webkit-scrollbar {
  display: none;
}

.settings-tab {
  flex: 1;
  padding: 12px 8px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-tertiary);
  border-bottom: 2px solid transparent;
  transition: all 200ms ease;
  white-space: nowrap;
  text-align: center;
}

.settings-tab:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
}

.settings-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ── Settings Body ── */
.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.settings-tab-panel {
  display: none;
  padding: 20px 24px 28px;
  animation: fadeIn 0.2s var(--ease-out);
}

.settings-tab-panel.active {
  display: block;
}

/* ── Profile Card ── */
.settings-profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.settings-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.settings-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-muted), var(--gold-600));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-inverse);
  box-shadow: 0 4px 16px rgba(201, 168, 76, 0.25);
}

.settings-avatar-overlay {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  background: var(--bg-elevated);
  border: 2px solid var(--bg-tertiary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  cursor: pointer;
  transition: background 150ms ease;
}

.settings-avatar-overlay:hover {
  background: var(--bg-hover);
}

.settings-profile-info {
  flex: 1;
  min-width: 0;
}

.settings-profile-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.settings-profile-email {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-plan-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--gold-100);
  border-radius: 20px;
  letter-spacing: 0.02em;
}

/* ── Field Groups ── */
.settings-field-group {
  margin-bottom: 14px;
}

.settings-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.settings-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.settings-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}

.settings-input[readonly] {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ── Credits Card ── */
.settings-credits-card {
  padding: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.settings-credits-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.settings-credits-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.settings-credits-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
}

.settings-credits-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.settings-credits-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  transition: width 500ms var(--ease-out), background 500ms ease;
}

.settings-credits-note {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

/* ── Actions Row ── */
.settings-actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-action-btn {
  flex: 1;
  min-width: 100px;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 200ms ease;
  cursor: pointer;
  text-align: center;
}

.settings-action-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.settings-action-btn.danger {
  color: var(--error);
  border-color: rgba(248, 113, 113, 0.15);
}

.settings-action-btn.danger:hover {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.3);
}

/* ── Settings Sections ── */
.settings-section {
  margin-bottom: 20px;
}

.settings-section-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.settings-section-desc {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ── Tone Grid ── */
.settings-tone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.settings-tone-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 200ms ease;
  text-align: center;
}

.settings-tone-option:hover {
  border-color: var(--border-medium);
  background: var(--bg-hover);
}

.settings-tone-option.active {
  border-color: var(--accent);
  background: var(--accent-subtle);
  box-shadow: 0 0 0 1px var(--accent), 0 2px 12px rgba(201, 168, 76, 0.1);
}

.settings-tone-icon {
  font-size: 1.3rem;
  margin-bottom: 2px;
}

.settings-tone-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.settings-tone-desc {
  font-size: 0.68rem;
  color: var(--text-tertiary);
  line-height: 1.3;
}

.settings-tone-check {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 0.7rem;
  color: var(--accent);
  opacity: 0;
  transition: opacity 200ms ease;
}

.settings-tone-option.active .settings-tone-check {
  opacity: 1;
}

/* ── Select Group (Language / Length) ── */
.settings-select-group {
  display: flex;
  gap: 8px;
}

.settings-select-btn {
  flex: 1;
  padding: 10px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 200ms ease;
  text-align: center;
}

.settings-select-btn:hover {
  border-color: var(--border-medium);
  background: var(--bg-hover);
}

.settings-select-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--accent);
}

/* ── Toggle List ── */
.settings-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: background 200ms ease;
}

.settings-toggle-item:hover {
  background: var(--bg-hover);
}

.settings-toggle-info {
  flex: 1;
  min-width: 0;
}

.settings-toggle-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.settings-toggle-desc {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  line-height: 1.4;
}

/* ── Toggle Switch ── */
.settings-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.settings-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.settings-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--gray-700);
  border-radius: 24px;
  transition: all 300ms var(--ease-out);
}

.settings-switch-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--gray-300);
  border-radius: 50%;
  transition: all 300ms var(--ease-out);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.settings-switch input:checked+.settings-switch-slider {
  background: var(--accent);
}

.settings-switch input:checked+.settings-switch-slider::before {
  transform: translateX(18px);
  background: var(--gray-950);
}

.settings-switch input:focus+.settings-switch-slider {
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

/* ── Billing Card ── */
.settings-billing-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
}

.settings-billing-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.06), rgba(201, 168, 76, 0.02));
  border-bottom: 1px solid var(--border-subtle);
}

.settings-billing-plan-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.settings-billing-plan-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
}

.settings-billing-plan-price span {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-tertiary);
}

.settings-billing-plan-badge {
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--success);
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.2);
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.settings-billing-details {
  padding: 4px 0;
}

.settings-billing-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.settings-billing-detail-row:last-child {
  border-bottom: none;
}

.settings-billing-detail-label {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.settings-billing-detail-value {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* ── Upgrade Button ── */
.settings-upgrade-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--accent), var(--gold-600));
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
  box-shadow: 0 4px 16px rgba(201, 168, 76, 0.3);
}

.settings-upgrade-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(201, 168, 76, 0.4);
}

/* ── Empty State ── */
.settings-empty-state {
  text-align: center;
  padding: 28px 20px;
  background: var(--bg-tertiary);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
}

.settings-empty-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.settings-empty-state p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.settings-empty-hint {
  font-size: 0.75rem !important;
  color: var(--text-tertiary) !important;
}

/* ── Settings Modal Responsive ── */
@media (max-width: 768px) {
  .settings-modal-content {
    max-height: 92vh;
    border-radius: var(--radius-md);
  }

  .settings-modal-header {
    padding: 20px 16px 12px;
  }

  .settings-tab-panel {
    padding: 16px;
  }

  .settings-tabs {
    padding: 0 12px;
  }

  .settings-tab {
    padding: 10px 6px;
    font-size: 0.72rem;
  }

  .settings-profile-card {
    flex-direction: column;
    text-align: center;
  }

  .settings-tone-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .settings-actions-row {
    flex-direction: column;
  }

  .settings-action-btn {
    min-width: unset;
  }

  .settings-billing-plan-row {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

/* ── Edit Profile & Change Password Forms ── */
.settings-edit-form,
.settings-password-form {
  margin-top: 16px;
  padding: 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  animation: settingsFormSlideIn 250ms var(--ease-out);
}

@keyframes settingsFormSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.settings-edit-form.hidden,
.settings-password-form.hidden {
  display: none;
}

.settings-form-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Password Input with Toggle ── */
.settings-input-password-wrap {
  position: relative;
  margin-bottom: 12px;
}

.settings-input-password-wrap .settings-input {
  padding-right: 44px;
}

.settings-password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 150ms ease;
}

.settings-password-toggle:hover {
  color: var(--text-secondary);
}

/* ── Form Buttons ── */
.settings-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.settings-btn-save {
  flex: 1;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--accent), var(--gold-600));
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
  box-shadow: 0 2px 10px rgba(201, 168, 76, 0.25);
}

.settings-btn-save:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(201, 168, 76, 0.35);
}

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

.settings-btn-cancel {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 200ms ease;
}

.settings-btn-cancel:hover {
  background: var(--bg-hover);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

/* ── Password Validation Hints ── */
.settings-password-hint {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-top: -6px;
  margin-bottom: 10px;
  line-height: 1.4;
  padding-left: 2px;
}

.settings-password-match {
  color: var(--success);
  font-size: 0.72rem;
  margin-top: -6px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.settings-password-mismatch {
  color: var(--error);
  font-size: 0.72rem;
  margin-top: -6px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.settings-rate-limit-warning {
  font-size: 0.72rem;
  color: var(--warning);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: settingsFormSlideIn 250ms var(--ease-out);
}

.settings-rate-limit-warning.hidden {
  display: none;
}

/* ── Edit Profile Responsive ── */
@media (max-width: 768px) {

  .settings-edit-form,
  .settings-password-form {
    padding: 16px;
  }

  .settings-form-actions {
    flex-direction: column;
  }
}

/* ══════════════════════════════════════════════════════════════
   VIEW CONTAINERS & CALENDAR WORKFLOW
   ══════════════════════════════════════════════════════════════ */
.view-container {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  max-height: 100%;
  width: 100%;
  flex: 1;
  box-sizing: border-box;
  animation: fadeUp 0.3s var(--ease-out);
}

.calendar-hero {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.calendar-hero-content {
  position: relative;
  z-index: 2;
}

#calendar-hero-title {
  margin: 0 0 8px 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

#calendar-hero-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.calendar-progress-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.calendar-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#calendar-progress-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-calendar-reset {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 150ms ease;
}

.btn-calendar-reset:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.calendar-progress-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.calendar-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #d4af37);
  border-radius: 4px;
  transition: width 300ms ease;
}

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

.calendar-day-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 200ms ease;
}

.calendar-day-card.is-today {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.2);
}

.calendar-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.calendar-day-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
}

.is-today .calendar-day-name {
  color: var(--accent);
}

.btn-calendar-add {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-calendar-add:hover {
  color: var(--accent);
}

.calendar-day-tasks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 40px;
}

.calendar-empty-task {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  font-style: italic;
  text-align: center;
  padding: 8px 0;
}

.calendar-task-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-tertiary);
  padding: 8px;
  border-radius: var(--radius-md);
  transition: opacity 150ms ease;
}

.calendar-task-item.task-done {
  opacity: 0.6;
}

.calendar-task-item.task-done .calendar-task-title {
  text-decoration: line-through;
}

.calendar-task-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.calendar-task-title {
  font-size: 0.85rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-task-actions {
  display: flex;
  gap: 4px;
}

.calendar-task-actions button {
  background: transparent;
  border: none;
  font-size: 0.85rem;
  cursor: pointer;
  opacity: 0.5;
  padding: 2px;
}

.calendar-task-actions button:hover {
  opacity: 1;
}

.calendar-day-notes {
  margin-top: auto;
  padding-top: 8px;
}

.calendar-day-notes textarea {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.8rem;
  padding: 8px;
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
}

.calendar-day-notes textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* ══════════════════════════════════════════════════════════════
   HOME DASHBOARD
   ══════════════════════════════════════════════════════════════ */
/* ── Dashboard / Suggestion Chips (Claude-style) ──────────── */
.dashboard-home {
  width: 100%;
  max-width: 760px;
  padding: 0 24px;
  text-align: center;
  animation: fadeIn 300ms ease;
  z-index: 10;
}

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.suggestion-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: transparent;
  border: 1px solid var(--border-medium);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 200ms var(--ease-out);
  white-space: nowrap;
}

.suggestion-chip:hover {
  background: var(--bg-hover);
  border-color: var(--accent-muted);
  color: var(--accent);
  transform: translateY(-1px);
}

.suggestion-chip svg {
  opacity: 0.6;
  flex-shrink: 0;
  transition: opacity 200ms ease;
}

.suggestion-chip:hover svg {
  opacity: 1;
}

#dashboard-stat-streak {
  color: #f97316;
  /* Orange glow */
}

/* ══════════════════════════════════════════════════════════════
   DRAFT CENTER
   ══════════════════════════════════════════════════════════════ */
.draft-center-header,
.content-vault-header {
  margin-bottom: 20px;
}

.draft-center-header h2,
.content-vault-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.draft-center-header p,
.content-vault-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.draft-center-toolbar,
.vault-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  gap: 12px;
  flex: 1;
  min-width: 280px;
  flex-wrap: wrap;
}

.draft-center-toolbar input,
.vault-toolbar input {
  flex: 1;
  min-width: 180px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: all 150ms ease;
}

.draft-center-toolbar input:focus,
.vault-toolbar input:focus {
  border-color: var(--accent);
}

.draft-center-toolbar select,
.vault-toolbar select {
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  font-family: inherit;
}

.draft-center-toolbar select:focus,
.vault-toolbar select:focus {
  border-color: var(--accent);
}

.btn-create-folder,
.btn-create-blueprint {
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.05));
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 200ms ease;
}

.btn-create-folder:hover,
.btn-create-blueprint:hover {
  background: var(--accent);
  color: var(--text-inverse);
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.25);
}

.draft-center-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  min-height: 500px;
}

.folders-sidebar {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.folders-sidebar h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.folders-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  max-height: 400px;
}

.folder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all 150ms ease;
}

.folder-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.folder-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-left: 3px solid var(--accent);
  font-weight: 600;
}

.folder-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.folder-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 150ms ease;
}

.folder-item:hover .folder-actions {
  opacity: 0.7;
}

.folder-actions:hover {
  opacity: 1 !important;
}

.btn-folder-action {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px;
  font-size: 0.75rem;
}

.btn-folder-action:hover {
  color: var(--accent);
}

.drafts-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drafts-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.drafts-section-title span {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.drafts-count {
  font-size: 0.8rem !important;
  color: var(--text-tertiary) !important;
  font-weight: 400 !important;
}

.drafts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  width: 100%;
}

.vault-grid.is-empty,
.drafts-grid.is-empty {
  display: block;
}

.draft-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 200ms ease;
  position: relative;
}

.draft-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.08);
}

.draft-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.draft-category-badge {
  font-size: 0.65rem;
  padding: 3px 8px;
  background: var(--bg-tertiary);
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.draft-status-badge {
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
}

/* Status Badge Styles */
.status-idea {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.status-draft {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-review {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.status-ready {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-published {
  background: rgba(212, 175, 55, 0.15);
  color: var(--accent);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.status-archived {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.draft-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.4;
  margin-top: 4px;
}

.draft-preview {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
  background: var(--bg-tertiary);
  padding: 8px;
  border-radius: var(--radius-md);
}

.draft-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
}

.draft-time {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.draft-actions {
  display: flex;
  gap: 6px;
}

.draft-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 150ms ease;
}

.draft-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.draft-btn.primary {
  border-color: var(--accent);
  color: var(--accent);
}

.draft-btn.primary:hover {
  background: var(--accent);
  color: var(--text-inverse);
}

.draft-btn-delete {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.6;
  transition: opacity 150ms ease;
}

.draft-btn-delete:hover {
  opacity: 1;
}

/* ══════════════════════════════════════════════════════════════
   CONTENT VAULT & BLUEPRINTS
   ══════════════════════════════════════════════════════════════ */
.vault-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 500px;
}

.vault-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
  overflow-x: auto;
}

.vault-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 150ms ease;
  white-space: nowrap;
}

.vault-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.vault-tab.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  width: 100%;
}

.vault-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: all 200ms ease;
}

.vault-card:hover {
  transform: translateY(-2px);
  border-color: #a855f7;
  /* Purple glow for vault assets */
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.08);
}

.vault-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vault-type-badge {
  font-size: 0.65rem;
  padding: 3px 8px;
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 12px;
  font-weight: 600;
}

.blueprint-badge {
  font-size: 0.65rem;
  padding: 3px 8px;
  background: rgba(212, 175, 55, 0.12);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

.vault-fav-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 2px;
}

.vault-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.4;
}

.vault-body {
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 10px;
  border-radius: var(--radius-md);
  border-left: 2px solid rgba(168, 85, 247, 0.3);
  font-family: inherit;
  white-space: pre-wrap;
  max-height: 140px;
  overflow-y: auto;
}

.blueprint-body {
  border-left-color: var(--accent) !important;
  font-style: italic;
}

.vault-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.vault-tag {
  font-size: 0.65rem;
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  padding: 2px 6px;
  border-radius: 6px;
}

.vault-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  margin-top: auto;
}

.vault-actions {
  display: flex;
  gap: 6px;
  width: 100%;
  justify-content: flex-end;
}

.vault-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 150ms ease;
}

.vault-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.vault-btn.primary {
  border-color: #a855f7;
  color: #c084fc;
}

.vault-btn.primary:hover {
  background: #a855f7;
  color: white;
}

.vault-btn.blueprint {
  border-color: var(--accent);
  color: var(--accent);
}

.vault-btn.blueprint:hover {
  background: var(--accent);
  color: var(--text-inverse);
}

/* ══════════════════════════════════════════════════════════════
   MOBILE & GENERAL RESPONSIVENESS
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .draft-center-layout {
    grid-template-columns: 1fr;
  }

  .folders-sidebar {
    max-height: 180px;
  }

  .draft-center-toolbar,
  .vault-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-left {
    flex-direction: column;
  }
}


/* ══════════════════════════════════════════════════════════════
   LIGHT THEME — Override semantic tokens
   Applied via data-theme="light" on <html>
   ══════════════════════════════════════════════════════════════ */

html {
  transition: background-color 0.35s ease, color 0.35s ease;
}

html[data-theme="light"] {
  /* ── Tier 1: Literal palette (inverted for light) ── */
  --gray-950: #ffffff;
  --gray-900: #f8f8fa;
  --gray-850: #f1f1f4;
  --gray-800: #e8e8ed;
  --gray-750: #dddde3;
  --gray-700: #d0d0d8;
  --gray-600: #b0b0bc;
  --gray-500: #8c8c9a;
  --gray-400: #64647a;
  --gray-300: #44445a;
  --gray-200: #2a2a3c;
  --gray-100: #1a1a2e;
  --gray-50: #0e0e1a;

  /* ── Soft Gold Accent (adjusted for light backgrounds) ── */
  --gold-50: rgba(154, 125, 53, 0.04);
  --gold-100: rgba(154, 125, 53, 0.10);
  --gold-200: rgba(154, 125, 53, 0.18);
  --gold-300: #9a7d35;
  --gold-400: #87701e;
  --gold-500: #7a6520;
  --gold-600: #6b5818;

  /* ── Cinematic Highlight (adjusted) ── */
  --warm-white: rgba(26, 26, 46, 0.92);

  /* ── Tier 2: Semantic tokens (light-friendly) ── */
  --bg-primary: #f5f5f8;
  --bg-secondary: #ffffff;
  --bg-tertiary: #eeeef2;
  --bg-elevated: #e5e5eb;
  --bg-hover: #dcdce4;
  --bg-active: #d0d0da;

  --border-subtle: rgba(0, 0, 0, 0.07);
  --border-medium: rgba(0, 0, 0, 0.11);
  --border-strong: rgba(0, 0, 0, 0.16);

  /* Typography Colors */
  --text-primary: #1a1a2e;
  --text-secondary: #555568;
  --text-tertiary: #8888a0;
  --text-inverse: #ffffff;

  /* Accent — darker gold that reads well on white */
  --accent: #8b7020;
  --accent-hover: #7a6318;
  --accent-muted: #6b5818;
  --accent-glow: rgba(139, 112, 32, 0.20);
  --accent-soft: rgba(139, 112, 32, 0.10);
  --accent-subtle: rgba(139, 112, 32, 0.05);

  /* Status Colors (slightly deeper for light bg contrast) */
  --success: #22a55b;
  --error: #e53e3e;
  --warning: #d69e2e;
  --info: #3182ce;

  /* Shadows — lighter, subtler */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.10);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.06);

  color-scheme: light;
}

/* ── Light theme: component-specific overrides ── */
html[data-theme="light"] body {
  background: var(--bg-primary);
  color: var(--text-primary);
}

html[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: var(--gray-700);
}

html[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: var(--gray-600);
}

/* ── Light: Button fixes ── */
html[data-theme="light"] .btn-new-workflow {
  background-color: #9a7d35;
  color: #fff;
}

html[data-theme="light"] .btn-new-workflow:hover {
  background-color: #87701e;
}

/* ── Light: Message cards ── */
html[data-theme="light"] .message-row.assistant .message-inner {
  background: var(--bg-secondary);
  border-color: var(--border-medium);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

html[data-theme="light"] .message-row.assistant .message-inner:hover {
  border-color: var(--border-strong);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* ── Light: Workflow cards ── */
html[data-theme="light"] .wf-card {
  background: rgba(255, 255, 255, 0.7);
}

html[data-theme="light"] .wf-card-header {
  background: rgba(0, 0, 0, 0.03);
}

html[data-theme="light"] .wf-split-col {
  background: rgba(0, 0, 0, 0.03);
}

/* ── Light: Tool grid ── */
html[data-theme="light"] .tool-grid-item {
  background: rgba(0, 0, 0, 0.03);
}

html[data-theme="light"] .tool-grid-item:hover {
  background: rgba(139, 112, 32, 0.06);
  border-color: rgba(139, 112, 32, 0.3);
}

/* ── Light: Hashtag badges ── */
html[data-theme="light"] .hashtag-badge {
  border-color: rgba(139, 112, 32, 0.3);
  background: rgba(139, 112, 32, 0.08);
  color: var(--accent);
}

/* ── Light: Settings toggle switch ── */
html[data-theme="light"] .settings-switch-slider {
  background: var(--gray-700);
}

html[data-theme="light"] .settings-switch-slider::before {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

html[data-theme="light"] .settings-switch input:checked+.settings-switch-slider::before {
  background: #fff;
}

/* ── Light: User avatar ── */
html[data-theme="light"] .user-avatar,
html[data-theme="light"] .settings-avatar,
html[data-theme="light"] .message-row.assistant .message-avatar {
  color: #fff;
}

/* ── Light: Settings header icon ── */
html[data-theme="light"] .settings-header-icon {
  box-shadow: 0 4px 16px rgba(139, 112, 32, 0.15);
}

/* ── Light: Billing gradient ── */
html[data-theme="light"] .settings-billing-plan-row {
  background: linear-gradient(135deg, rgba(139, 112, 32, 0.08), rgba(139, 112, 32, 0.03));
}

/* ── Light: Upgrade button ── */
html[data-theme="light"] .settings-upgrade-btn {
  color: #fff;
  box-shadow: 0 4px 16px rgba(139, 112, 32, 0.2);
}

/* ── Light: Modal overlay ── */
html[data-theme="light"] .modal-overlay {
  background: rgba(0, 0, 0, 0.35);
}

/* ── Light: Modal content ── */
html[data-theme="light"] .modal-content {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

/* ── Light: Pricing cards ── */
html[data-theme="light"] .pricing-card {
  background: var(--bg-secondary);
  border-color: var(--border-medium);
}

/* ── Light: Google button ── */
html[data-theme="light"] .btn-google {
  background: #1a1a2e;
  color: #fff;
}

html[data-theme="light"] .btn-google:hover {
  background: #2a2a3c;
}

/* ── Light: Theme selector visual ── */
html[data-theme="light"] .settings-theme-option .theme-preview-dark {
  background: #1c1c20;
}

html[data-theme="light"] .settings-theme-option .theme-preview-light {
  background: #f5f5f8;
  border: 2px solid var(--border-medium);
}

/* ── Theme Selector UI in Settings ── */
.settings-theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.settings-theme-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 14px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 200ms ease;
  text-align: center;
}

.settings-theme-option:hover {
  border-color: var(--border-medium);
  background: var(--bg-hover);
}

.settings-theme-option.active {
  border-color: var(--accent);
  background: var(--accent-subtle);
  box-shadow: 0 0 0 1px var(--accent), 0 2px 12px rgba(201, 168, 76, 0.1);
}

.theme-preview {
  width: 100%;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  border: 1px solid var(--border-subtle);
}

.theme-preview-sidebar {
  width: 30%;
  height: 100%;
}

.theme-preview-main {
  width: 70%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 8px;
}

.theme-preview-line {
  height: 3px;
  border-radius: 2px;
  width: 80%;
}

/* Dark theme preview colors */
.settings-theme-option[data-theme="dark"] .theme-preview-sidebar {
  background: #111114;
}

.settings-theme-option[data-theme="dark"] .theme-preview-main {
  background: #0c0c0e;
}

.settings-theme-option[data-theme="dark"] .theme-preview-line {
  background: rgba(255, 255, 255, 0.15);
}

.settings-theme-option[data-theme="dark"] .theme-preview-line:first-child {
  background: #c9a84c;
  width: 60%;
}

/* Light theme preview colors */
.settings-theme-option[data-theme="light"] .theme-preview-sidebar {
  background: #ffffff;
  border-right: 1px solid #e0e0e0;
}

.settings-theme-option[data-theme="light"] .theme-preview-main {
  background: #f5f5f8;
}

.settings-theme-option[data-theme="light"] .theme-preview-line {
  background: rgba(0, 0, 0, 0.12);
}

.settings-theme-option[data-theme="light"] .theme-preview-line:first-child {
  background: #9a7d35;
  width: 60%;
}

.settings-theme-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.settings-theme-desc {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  line-height: 1.3;
}

.settings-theme-check {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.8rem;
  color: var(--accent);
  opacity: 0;
  transition: opacity 200ms ease;
}

.settings-theme-option.active .settings-theme-check {
  opacity: 1;
}

/* ── Light: Chatbox & Input Elements Readability ── */
html[data-theme="light"] .input-container {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

html[data-theme="light"] .input-container:focus-within {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border-color: var(--accent);
}

html[data-theme="light"] .input-box {
  background: rgba(245, 245, 248, 0.85);
  border-color: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .input-box:focus-within {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 1);
}

html[data-theme="light"] .input-textarea {
  color: var(--text-primary);
}

html[data-theme="light"] .input-textarea::placeholder {
  color: var(--text-tertiary);
}

/* ── Light: Category Toggle & Segmented Control ── */
html[data-theme="light"] .category-segmented-control {
  background: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .segment-btn {
  color: var(--text-secondary);
}

html[data-theme="light"] .segment-btn:hover:not(.active) {
  color: var(--text-primary);
}

html[data-theme="light"] .segment-btn.active {
  color: var(--accent);
}

html[data-theme="light"] .segmented-indicator {
  background: var(--bg-secondary);
  border-color: var(--border-medium);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ── Light: Tone Trigger & Options ── */
html[data-theme="light"] .input-option {
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.02);
}

html[data-theme="light"] .input-option:hover:not(:disabled) {
  border-color: var(--accent-hover);
  color: var(--accent);
  background: var(--accent-subtle);
}

html[data-theme="light"] .input-option.active {
  border-color: var(--accent-hover);
  background: var(--accent-subtle);
  color: var(--accent);
}

html[data-theme="light"] .tone-dropdown {
  background: var(--bg-secondary);
  border-color: var(--border-strong);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .tone-option {
  color: var(--text-secondary);
}

html[data-theme="light"] .tone-option:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

html[data-theme="light"] .tone-option.active {
  color: var(--accent);
  background: var(--accent-soft);
}

/* ── Light: Enhance Prompt Button ── */
html[data-theme="light"] .enhance-action-btn {
  color: #7e22ce !important;
  background: rgba(147, 51, 234, 0.06);
  border-color: rgba(147, 51, 234, 0.18) !important;
}

html[data-theme="light"] .enhance-action-btn:hover {
  background: rgba(147, 51, 234, 0.12);
  color: #6b21a8 !important;
  border-color: rgba(147, 51, 234, 0.35) !important;
}

/* ── Light: Send Button ── */
html[data-theme="light"] .btn-send {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(139, 112, 32, 0.2);
}

html[data-theme="light"] .btn-send:hover:not(:disabled) {
  background: var(--accent-hover);
}

html[data-theme="light"] .btn-send:disabled {
  background: var(--gray-800);
  color: var(--text-tertiary);
  box-shadow: none;
}

/* ── Light: Dashboard / Suggestion Chips ── */
html[data-theme="light"] .dashboard-home {
  background: transparent;
}

html[data-theme="light"] .suggestion-chip {
  border-color: var(--border-medium);
  color: var(--text-secondary);
}

html[data-theme="light"] .suggestion-chip:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--accent);
}


/* ── Light: Presets Locked Overlay ── */
html[data-theme="light"] .locked-overlay {
  background: rgba(255, 255, 255, 0.7);
}

/* ── Light: Workflow action buttons ── */
html[data-theme="light"] .btn-wf-action.tool-btn {
  background: rgba(139, 112, 32, 0.06);
  border-color: rgba(139, 112, 32, 0.25);
  color: var(--accent);
}

html[data-theme="light"] .btn-wf-action.tool-btn:hover {
  background: rgba(139, 112, 32, 0.12);
  border-color: var(--accent);
  color: var(--accent-hover);
}

html[data-theme="light"] .btn-wf-action.claude-btn,
html[data-theme="light"] .btn-msg-action.claude-btn {
  background: rgba(147, 51, 234, 0.06);
  border-color: rgba(147, 51, 234, 0.25);
  color: #7e22ce;
}

html[data-theme="light"] .btn-wf-action.claude-btn:hover,
html[data-theme="light"] .btn-msg-action.claude-btn:hover {
  background: rgba(147, 51, 234, 0.12);
  border-color: #7e22ce;
  color: #6b21a8;
}

/* ── Skeleton Loader Shimmer ── */
.wf-card.skeleton-card {
  border: 1px dashed var(--border-medium);
  background: var(--bg-secondary);
  opacity: 0.85;
  margin-top: 12px;
}

.skeleton-shimmer {
  position: relative;
  overflow: hidden;
}

.skeleton-shimmer::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.05) 20%,
      rgba(255, 255, 255, 0.1) 60%,
      rgba(255, 255, 255, 0) 100%);
  animation: shimmer 1.6s infinite;
}

/* Light mode support if theme changes */
[data-theme="light"] .skeleton-shimmer::after {
  background-image: linear-gradient(90deg,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.03) 20%,
      rgba(0, 0, 0, 0.08) 60%,
      rgba(0, 0, 0, 0) 100%);
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.skeleton-title {
  width: 140px;
  height: 16px;
  background: var(--border-subtle);
  border-radius: 4px;
}

.skeleton-line {
  width: 100%;
  height: 12px;
  background: var(--border-subtle);
  border-radius: 4px;
  margin-bottom: 8px;
}

.skeleton-line.short {
  width: 70%;
  margin-bottom: 0;
}

/* ── Glowing AI loading ring ── */
.ai-loading-container {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  padding: 12px 16px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border, rgba(212, 175, 55, 0.15));
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  animation: floatLoader 3s ease-in-out infinite;
}

@keyframes floatLoader {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

.ai-loading-ring {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent) 0%, transparent 70%);
  animation: rotateRing 1s linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-loading-ring::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-tertiary);
}

.ai-loading-icon {
  position: relative;
  font-size: 0.9rem;
  z-index: 1;
  animation: pulseIcon 1.5s ease-in-out infinite;
}

@keyframes rotateRing {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulseIcon {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}

.ai-loading-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-loading-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.5px;
}

/* ── UI Migration Styles: Emojis to SVGs ─────────────────── */
.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  stroke-width: 2px;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.125em;
}

.icon-sm {
  width: 0.875rem;
  height: 0.875rem;
}

.icon-md {
  width: 1.125rem;
  height: 1.125rem;
}

.icon-lg {
  width: 1.375rem;
  height: 1.375rem;
}

/* Button & Badge styling presets */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-soft {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid transparent;
}
.btn-soft:hover {
  background: var(--accent-glow);
  color: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-glow);
}