/* ============================================================
   R.I.Y.A-AIx Generative — Light Theme Design System
   White/Clean UI · LibreChat Inspired · Green Buttons
   ============================================================ */

/* ── Variables ───────────────────────────────────────────── */
:root {
  --bg-base:      #ffffff;
  --bg-elevated:  #f7f7f8;
  --bg-card:      #ffffff;
  --bg-hover:     #f0f0f0;
  --bg-active:    #e8f5f0;
  --bg-input:     #ffffff;
  --bg-sidebar:   #f7f7f8;

  --border:       #e5e5e5;
  --border-focus: rgba(25,163,122,0.5);

  --accent:       #19a37a;
  --accent-2:     #0d8f6a;
  --accent-light: rgba(25,163,122,0.1);
  --accent-glow:  rgba(25,163,122,0.2);
  --accent-grad:  linear-gradient(135deg, #19a37a 0%, #0d8f6a 100%);

  --text-primary:   #0d0d0d;
  --text-secondary: #353740;
  --text-muted:     #8e8ea0;
  --text-accent:    #19a37a;

  --user-bubble:   #19a37a;
  --ai-bubble:     #f7f7f8;

  --success:  #19a37a;
  --warning:  #f59e0b;
  --danger:   #ef4444;
  --info:     #3b82f6;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-2xl: 28px;

  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --shadow-sm:  0 1px 4px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 24px rgba(25,163,122,0.12);

  --sidebar-w: 260px;
  --header-h:  60px;
  --transition: 0.18s cubic-bezier(0.4,0,0.2,1);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-2); }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }
input, textarea, select { font-family: inherit; outline: none; }
ul { list-style: none; }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d9d9e3; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #acacbe; }

/* ── Typography ──────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; color: var(--text-primary); }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 2.5vw, 2rem); }
h3 { font-size: 1.15rem; }
p  { color: var(--text-secondary); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}
.btn-secondary {
  background: #fff;
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: #c5c5d2;
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 7px 10px;
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border); }
.btn-danger { background: #fff0f0; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 24px; font-size: 0.95rem; }
.btn-icon { padding: 7px; }
.btn-full { width: 100%; justify-content: center; }

/* ── Form Controls ───────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.form-control {
  width: 100%;
  padding: 10px 13px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { background-image: none; }

.input-icon-wrap { position: relative; }
.input-icon-wrap .form-control { padding-left: 40px; }
.input-icon-wrap .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 15px;
  height: 15px;
  pointer-events: none;
}

/* ── Card ────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}

/* ── Badge ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge-accent   { background: rgba(25,163,122,0.12); color: var(--accent); }
.badge-success  { background: rgba(25,163,122,0.12); color: var(--accent); }
.badge-info     { background: rgba(59,130,246,0.12); color: #2563eb; }
.badge-warning  { background: rgba(245,158,11,0.12); color: #d97706; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  border: 1px solid;
}
.alert svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }
.alert-error   { background: #fff0f0; border-color: #fecaca; color: #dc2626; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #16a34a; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #2563eb; }

/* ── Divider ─────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 18px 0;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Spinner ─────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(25,163,122,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════ */
/*  AUTH PAGES                                               */
/* ══════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #f7f7f8;
}

.auth-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}
.auth-logo { height: 44px; width: auto; }
.auth-brand {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-md);
}
.auth-card h2 { font-size: 1.4rem; margin-bottom: 4px; }
.auth-card .auth-subtitle { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 24px; }
.auth-footer-text { text-align: center; margin-top: 18px; font-size: 0.875rem; color: var(--text-muted); }
.auth-footer-text a { color: var(--accent); font-weight: 600; }

/* ══════════════════════════════════════════════════════════ */
/*  APP SHELL                                                */
/* ══════════════════════════════════════════════════════════ */
.app-shell { display: flex; height: 100vh; width: 100vw; overflow: hidden; }

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  transition: width var(--transition), min-width var(--transition), transform var(--transition);
  z-index: 100;
  overflow: hidden;
}
.sidebar.collapsed { width: 0; min-width: 0; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo { display: flex; align-items: center; gap: 9px; overflow: hidden; }
.sidebar-logo img { height: 26px; width: auto; flex-shrink: 0; }
.sidebar-brand { font-size: 0.72rem; font-weight: 700; color: var(--text-primary); white-space: nowrap; }

.new-chat-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: calc(100% - 24px);
  margin: 10px 12px 7px;
  padding: 9px 13px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  transition: all var(--transition);
  flex-shrink: 0;
  border: none;
}
.new-chat-btn:hover { background: var(--accent-2); transform: translateY(-1px); box-shadow: 0 4px 12px var(--accent-glow); }
.new-chat-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.sidebar-search { padding: 0 12px 8px; flex-shrink: 0; }
.sidebar-search .form-control { padding: 7px 10px 7px 34px; font-size: 0.8rem; }
.sidebar-search .input-icon { left: 10px; }

.sidebar-section-label {
  padding: 5px 14px 3px;
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  flex-shrink: 0;
}

.conv-list { flex: 1; overflow-y: auto; padding: 3px 6px; }
.conv-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  color: var(--text-secondary);
  font-size: 0.83rem;
  white-space: nowrap;
  margin-bottom: 1px;
}
.conv-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.conv-item.active { background: var(--accent-light); color: var(--accent); font-weight: 500; }
.conv-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.conv-item svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-muted); }
.conv-item-title { flex: 1; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.conv-item-actions { display: none; gap: 2px; flex-shrink: 0; }
.conv-item:hover .conv-item-actions { display: flex; }
.conv-item-actions button {
  background: transparent; color: var(--text-muted);
  padding: 3px; border-radius: 4px;
  display: flex; align-items: center;
  transition: all var(--transition);
}
.conv-item-actions button:hover { color: var(--danger); background: #fff0f0; }
.conv-item-actions button svg { width: 12px; height: 12px; }

.sidebar-footer { padding: 8px; border-top: 1px solid var(--border); flex-shrink: 0; position: relative; }

.user-dropdown {
  position: absolute;
  bottom: 60px; left: 8px; right: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  display: none;
}
.user-dropdown.open { display: block; animation: scaleIn 0.15s ease; }

.dropdown-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 13px; font-size: 0.84rem;
  color: var(--text-secondary); cursor: pointer;
  transition: all var(--transition);
  background: transparent; width: 100%; text-align: left;
}
.dropdown-item svg { width: 14px; height: 14px; }
.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-item.danger:hover { background: #fff0f0; color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 3px 0; }

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96) translateY(4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.user-menu-btn {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 7px 9px;
  border-radius: var(--radius-md);
  background: transparent; color: var(--text-secondary);
  font-size: 0.83rem; transition: all var(--transition); text-align: left;
}
.user-menu-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem; font-weight: 700; flex-shrink: 0;
  background: var(--accent); color: #fff;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.user-menu-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.user-menu-btn svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ── Main Area ────────────────────────────────────────────── */
.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100%; overflow: hidden; }

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
  z-index: 50;
}
#sidebar-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--radius-md);
  background: transparent; color: var(--text-muted);
  transition: all var(--transition);
}
#sidebar-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }
#sidebar-toggle svg { width: 17px; height: 17px; }

.chat-title { flex: 1; font-size: 0.88rem; font-weight: 600; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Model indicator in header — simplified, no full dropdown */
.model-tag-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: var(--accent-light);
  border: 1px solid rgba(25,163,122,0.2);
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}
.model-tag-header svg { width: 13px; height: 13px; }
.model-tag-header .pulse-dot { width: 6px; height: 6px; }

/* ── Chat Area ────────────────────────────────────────────── */
.chat-area { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }

.welcome-screen {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 20px; text-align: center;
}
.welcome-logo { height: 62px; width: auto; margin-bottom: 18px; }
.welcome-title { font-size: clamp(1.3rem, 3vw, 1.9rem); font-weight: 800; color: var(--text-primary); margin-bottom: 6px; }
.welcome-sub { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 32px; }
.welcome-suggestions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 9px; width: 100%; max-width: 620px;
}
.suggestion-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 13px 14px;
  text-align: left; cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: flex-start; gap: 9px;
}
.suggestion-card:hover { border-color: var(--accent); background: var(--accent-light); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.suggestion-card svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.suggestion-text { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.4; }

/* Messages */
.msg-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px 14px 16px;
  transition: background var(--transition);
  max-width: 100%;
}
.msg-row:hover { background: #fafafa; }
.msg-row.user { flex-direction: row-reverse; }

.msg-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.66rem; font-weight: 700; flex-shrink: 0; margin-top: 2px;
}
.msg-row.user .msg-avatar { background: var(--accent); color: #fff; }
.msg-row.assistant .msg-avatar { background: var(--bg-hover); border: 1px solid var(--border); color: var(--accent); }

.msg-body { flex: 1; min-width: 0; }
.msg-sender {
  font-size: 0.76rem; font-weight: 600; color: var(--text-muted);
  margin-bottom: 4px; display: flex; align-items: center; gap: 6px;
}
.msg-row.user .msg-sender { text-align: right; justify-content: flex-end; }
.msg-model-tag {
  font-size: 0.66rem;
  background: var(--accent-light);
  color: var(--accent);
  padding: 1px 6px; border-radius: 99px; font-weight: 600;
}

.msg-bubble {
  display: inline-block; max-width: 84%;
  padding: 10px 14px; border-radius: var(--radius-lg);
  font-size: 0.9rem; line-height: 1.65; position: relative;
}
.msg-row.user .msg-bubble {
  background: var(--accent); color: #fff;
  border-bottom-right-radius: var(--radius-sm); float: right;
}
.msg-row.assistant .msg-bubble {
  background: var(--ai-bubble); border: 1px solid var(--border);
  border-bottom-left-radius: var(--radius-sm); color: var(--text-primary);
}

/* Markdown */
.msg-bubble p { margin-bottom: 8px; color: inherit; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble h1,.msg-bubble h2,.msg-bubble h3 { margin: 12px 0 6px; color: inherit; }
.msg-bubble ul,.msg-bubble ol { margin: 8px 0; padding-left: 20px; color: inherit; }
.msg-bubble li { margin-bottom: 3px; }
.msg-bubble code {
  font-family: var(--font-mono); font-size: 0.82em;
  background: rgba(0,0,0,0.06); padding: 1px 5px; border-radius: 4px;
}
.msg-bubble pre {
  background: #1e1e2e; border: 1px solid #2d2d3f;
  border-radius: var(--radius-md); padding: 14px 16px;
  overflow-x: auto; margin: 8px 0; position: relative;
}
.msg-bubble pre code { background: transparent; padding: 0; font-size: 0.82rem; color: #cdd6f4; }
.copy-code-btn {
  position: absolute; top: 7px; right: 7px;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
  color: #cdd6f4; padding: 2px 8px; border-radius: 4px;
  font-size: 0.68rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 4px; transition: all var(--transition);
}
.copy-code-btn:hover { background: rgba(255,255,255,0.2); }
.copy-code-btn svg { width: 10px; height: 10px; }

.msg-actions { display: flex; gap: 3px; margin-top: 5px; opacity: 0; transition: opacity var(--transition); }
.msg-row:hover .msg-actions { opacity: 1; }
.msg-row.user .msg-actions { justify-content: flex-end; }
.msg-action-btn {
  background: transparent; color: var(--text-muted); padding: 3px 6px;
  border-radius: 5px; font-size: 0.74rem; display: flex; align-items: center; gap: 3px;
  transition: all var(--transition);
}
.msg-action-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.msg-action-btn svg { width: 12px; height: 12px; }

/* Typing indicator */
.typing-indicator {
  display: flex; align-items: center; gap: 4px;
  padding: 9px 14px; border-radius: var(--radius-lg);
  background: var(--ai-bubble); border: 1px solid var(--border); width: fit-content;
}
.typing-dot {
  width: 6px; height: 6px; background: var(--accent);
  border-radius: 50%; animation: typingBounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%,60%,100% { transform: translateY(0); opacity: 0.4; }
  30%          { transform: translateY(-5px); opacity: 1; }
}

/* Request counter badge */
.req-counter {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.74rem; color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: #fff;
  white-space: nowrap;
}
.req-counter.warn { color: #d97706; border-color: #fcd34d; background: #fffbeb; }
.req-counter.critical { color: var(--danger); border-color: #fecaca; background: #fff0f0; }
.req-counter svg { width: 12px; height: 12px; }

/* ── Input Area ───────────────────────────────────────────── */
.chat-input-area {
  padding: 10px 16px 14px;
  background: #fff;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.input-box {
  display: flex; align-items: flex-end; gap: 8px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 7px 10px;
  transition: border-color var(--transition), box-shadow var(--transition);
  max-width: 800px; margin: 0 auto;
  box-shadow: var(--shadow-sm);
}
.input-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input-box-left { display: flex; gap: 2px; flex-shrink: 0; padding-bottom: 3px; }
.input-tool-btn {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.input-tool-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.input-tool-btn svg { width: 15px; height: 15px; }
#chat-input {
  flex: 1; background: transparent; border: none;
  color: var(--text-primary); font-size: 0.9rem; line-height: 1.5;
  resize: none; max-height: 200px; padding: 4px 0; min-height: 30px;
}
#chat-input::placeholder { color: var(--text-muted); }
.send-btn {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all var(--transition);
  box-shadow: 0 2px 8px var(--accent-glow); margin-bottom: 1px;
}
.send-btn:hover { background: var(--accent-2); transform: scale(1.06); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.send-btn svg { width: 14px; height: 14px; }
.input-hint { text-align: center; font-size: 0.7rem; color: var(--text-muted); margin-top: 7px; }
.input-hint a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }

/* ══════════════════════════════════════════════════════════ */
/*  MODAL                                                    */
/* ══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeInOverlay 0.2s ease;
}
.modal-overlay.hidden { display: none; }
@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  animation: slideUp 0.22s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.modal-icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.5rem;
}
.modal-icon.green { background: var(--accent-light); color: var(--accent); }
.modal-icon.orange { background: #fff7ed; color: #f59e0b; }
.modal-icon svg { width: 26px; height: 26px; }
.modal-box h3 { font-size: 1.15rem; margin-bottom: 8px; }
.modal-box p { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 22px; line-height: 1.6; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }

/* ══════════════════════════════════════════════════════════ */
/*  CONTENT PAGES (nav, footer, models, about, settings)    */
/* ══════════════════════════════════════════════════════════ */
.content-nav {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  position: sticky; top: 0; z-index: 100;
}
.content-nav .nav-logo { height: 26px; }
.content-nav .nav-brand { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); }
.content-nav .nav-links { display: flex; gap: 3px; margin-left: auto; }
.content-nav .nav-links a {
  padding: 5px 11px; border-radius: var(--radius-sm);
  font-size: 0.82rem; color: var(--text-secondary);
  transition: all var(--transition); font-weight: 500;
}
.content-nav .nav-links a:hover { background: var(--bg-hover); color: var(--text-primary); }

.page-wrapper { max-width: 1060px; margin: 0 auto; padding: 56px 22px; }
.page-hero { text-align: center; margin-bottom: 52px; }
.page-hero .tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--accent-light); border: 1px solid rgba(25,163,122,0.2);
  color: var(--accent); padding: 4px 12px; border-radius: 99px;
  font-size: 0.76rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; margin-bottom: 14px;
}
.page-hero .tag svg { width: 12px; height: 12px; }
.page-hero p { font-size: 1rem; color: var(--text-secondary); max-width: 580px; margin: 0 auto 24px; }

/* Models */
.provider-section { margin-bottom: 32px; }
.provider-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 10px;
}
.provider-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.models-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.model-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  transition: all var(--transition); position: relative; overflow: hidden;
}
.model-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md), var(--shadow-glow); }
.model-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.model-card-icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: var(--accent-light); border: 1px solid rgba(25,163,122,0.15);
  display: flex; align-items: center; justify-content: center; color: var(--accent);
}
.model-card-icon svg { width: 16px; height: 16px; }
.model-card-name { font-size: 0.92rem; font-weight: 700; margin-bottom: 2px; color: var(--text-primary); }
.model-card-provider { font-size: 0.73rem; color: var(--text-muted); }
.model-card-desc { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; margin-top: 7px; }

.api-upgrade-banner {
  background: linear-gradient(135deg, #f0fdf9 0%, #ecfdf5 100%);
  border: 1px solid rgba(25,163,122,0.25);
  border-radius: var(--radius-xl);
  padding: 40px; text-align: center;
}
.api-upgrade-features { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.api-feature-chip {
  display: flex; align-items: center; gap: 5px;
  background: rgba(25,163,122,0.12); border: 1px solid rgba(25,163,122,0.2);
  color: var(--accent); padding: 5px 12px; border-radius: 99px;
  font-size: 0.78rem; font-weight: 500;
}
.api-feature-chip svg { width: 12px; height: 12px; }

/* Settings */
.settings-wrap { max-width: 660px; margin: 0 auto; padding: 44px 22px; }
.settings-section { margin-bottom: 32px; }
.settings-section h3 {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 14px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 6px;
}
.settings-section h3 svg { width: 13px; height: 13px; }
.settings-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,0.04);
}
.settings-row:last-child { border-bottom: none; }
.settings-label { flex: 1; }
.settings-label strong { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 1px; }
.settings-label span { font-size: 0.76rem; color: var(--text-muted); }

/* About */
.about-hero { padding: 72px 22px; text-align: center; background: #f7f7f8; border-bottom: 1px solid var(--border); }
.about-hero p { max-width: 520px; margin: 0 auto 28px; font-size: 1rem; }

/* Footer */
.app-footer { background: var(--bg-sidebar); border-top: 1px solid var(--border); padding: 22px; }
.footer-inner { max-width: 1060px; margin: 0 auto; text-align: center; }
.footer-links { display: flex; align-items: center; justify-content: center; gap: 5px; flex-wrap: wrap; margin-bottom: 8px; }
.footer-links a { font-size: 0.8rem; color: var(--text-muted); transition: color var(--transition); }
.footer-links a:hover { color: var(--text-primary); }
.footer-dot { color: var(--text-muted); font-size: 0.4rem; }
.footer-copy { font-size: 0.73rem; color: var(--text-muted); }

/* ── Pulse dot ───────────────────────────────────────────── */
.pulse-dot {
  width: 6px; height: 6px;
  background: var(--success); border-radius: 50%; position: relative;
}
.pulse-dot::after {
  content: ''; position: absolute; inset: -2px;
  border-radius: 50%; border: 1px solid var(--success);
  animation: pulseDot 1.6s ease-out infinite;
}
@keyframes pulseDot { to { opacity: 0; transform: scale(2.2); } }

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.35s ease both; }
.fade-in-delay { animation: fadeIn 0.35s ease 0.08s both; }

/* ── Toast ───────────────────────────────────────────────── */
#toast-container { position: fixed; top: 18px; right: 18px; z-index: 9999; display: flex; flex-direction: column; gap: 7px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 280px; }
  .sidebar { position: fixed; top: 0; left: 0; height: 100%; transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar.collapsed { width: var(--sidebar-w); min-width: var(--sidebar-w); }
  .models-grid { grid-template-columns: 1fr; }
  .welcome-suggestions { grid-template-columns: 1fr 1fr; }
  .msg-bubble { max-width: 90%; }
}
@media (max-width: 480px) {
  .welcome-suggestions { grid-template-columns: 1fr; }
}
