/* ═══════════════════════════════════════════════════════════
   JARVIS Web — God Tier UI
   ═══════════════════════════════════════════════════════════ */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  /* Renk paleti */
  --bg-0: #06080d;
  --bg-1: #0a0e16;
  --bg-2: #11161f;
  --bg-3: #1a2330;
  --bg-4: #25324a;

  --cyan:  #00d4ff;
  --cyan-glow: rgba(0, 212, 255, 0.5);
  --cyan-soft: rgba(0, 212, 255, 0.1);
  --cyan-border: rgba(0, 212, 255, 0.25);

  --green: #4ade80;
  --red:   #ff5566;
  --yellow:#fbbf24;

  --text-0: #f0f7ff;
  --text-1: #c8d8e8;
  --text-2: #8ea0b5;
  --text-3: #5a6b80;

  --shadow-1: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-2: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 40px var(--cyan-glow);

  --sidebar-w: 280px;
  --header-h: 56px;
}

html, body {
  background: var(--bg-0);
  color: var(--text-1);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  background:
    radial-gradient(ellipse 800px 400px at top, var(--cyan-soft), transparent 60%),
    radial-gradient(ellipse 600px 300px at bottom right, rgba(0,212,255,0.05), transparent 50%),
    var(--bg-0);
}

button { font-family: inherit; cursor: pointer; border: none; background: transparent; color: inherit; }
input, textarea, select { font-family: inherit; outline: none; border: none; background: transparent; color: inherit; }

/* ── Screens ─────────────────────────────────────────────── */
.screen { display: none; height: 100vh; }
.screen.active { display: flex; }

/* ════════════════════════════════════════════════════════════
   AUTH SCREEN
   ════════════════════════════════════════════════════════════ */
#auth-screen {
  align-items: center; justify-content: center;
  padding: env(safe-area-inset-top) 20px env(safe-area-inset-bottom);
  position: relative;
  overflow: hidden;
}

.auth-bg {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.4;
}
.auth-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--cyan-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--cyan-border) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black, transparent 70%);
  animation: gridScroll 60s linear infinite;
}
@keyframes gridScroll {
  to { background-position: 40px 40px; }
}

.auth-container {
  width: 100%; max-width: 420px;
  display: flex; flex-direction: column; align-items: center;
  position: relative; z-index: 1;
}

.auth-logo {
  position: relative;
  width: 120px; height: 120px;
  margin-bottom: 28px;
  display: flex; align-items: center; justify-content: center;
}

.logo-ring {
  position: absolute; inset: 0;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 32px var(--cyan-glow), inset 0 0 32px rgba(0,212,255,0.2);
  animation: pulseRing 3s ease-in-out infinite;
}
.logo-ring::before, .logo-ring::after {
  content: ''; position: absolute; inset: 14px;
  border: 1px dashed rgba(0,212,255,0.4);
  border-radius: 50%;
  animation: spinRing 18s linear infinite;
}
.logo-ring::after {
  inset: 28px; animation-direction: reverse; animation-duration: 11s;
}
@keyframes pulseRing {
  0%, 100% { box-shadow: 0 0 32px var(--cyan-glow), inset 0 0 32px rgba(0,212,255,0.2); }
  50%      { box-shadow: 0 0 50px var(--cyan), inset 0 0 50px var(--cyan-glow); }
}
@keyframes spinRing { to { transform: rotate(360deg); } }

.logo-core {
  position: absolute; width: 14px; height: 14px;
  border-radius: 50%; background: var(--cyan);
  box-shadow: 0 0 18px var(--cyan), 0 0 36px var(--cyan-glow);
  animation: corePulse 2s ease-in-out infinite;
}
@keyframes corePulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.4); }
}

.logo-text {
  position: absolute; bottom: -28px;
  font-family: 'Orbitron', monospace; font-weight: 700;
  font-size: 13px; letter-spacing: 4px;
  color: var(--cyan); text-shadow: 0 0 10px var(--cyan-glow);
  white-space: nowrap;
}
.logo-sub {
  position: absolute; bottom: -46px;
  font-size: 9px; letter-spacing: 5px;
  color: var(--text-3);
  white-space: nowrap;
}

.auth-form {
  width: 100%; display: none; flex-direction: column; gap: 12px;
  margin-top: 36px;
  animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.auth-form.active { display: flex; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-form h2 {
  font-family: 'Orbitron', monospace;
  font-size: 15px; letter-spacing: 4px;
  color: var(--cyan); text-align: center;
  margin-bottom: 6px; text-transform: uppercase;
}

.auth-info {
  font-size: 12px; color: var(--text-2); line-height: 1.5;
  text-align: center; padding: 12px 14px;
  background: var(--cyan-soft);
  border: 1px solid var(--cyan-border);
  border-radius: 10px; margin-bottom: 4px;
}
.auth-info b { color: var(--cyan); font-weight: 600; }

.auth-form input {
  padding: 14px 16px;
  background: var(--bg-1);
  border: 1px solid var(--bg-3);
  color: var(--text-0);
  border-radius: 10px;
  font-size: 15px;
  transition: all 0.2s;
}
.auth-form input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-soft);
}

.btn-primary {
  padding: 13px 18px;
  background: linear-gradient(180deg, var(--cyan), #0099bb);
  color: #001218;
  border-radius: 10px;
  font-size: 13px; font-weight: 700;
  letter-spacing: 2px;
  margin-top: 6px;
  box-shadow: 0 4px 24px var(--cyan-glow);
  transition: all 0.15s;
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary:hover { box-shadow: 0 6px 30px var(--cyan-glow), 0 0 20px var(--cyan); }

.auth-links { text-align: center; margin-top: 4px; }
.auth-links a {
  color: var(--cyan); font-size: 13px;
  text-decoration: none; letter-spacing: 0.3px;
}

.auth-error {
  text-align: center; font-size: 12px;
  color: var(--red); min-height: 18px;
  letter-spacing: 0.3px;
}

.auth-footer {
  margin-top: 30px;
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--text-3); letter-spacing: 1px;
}
.status-mini { color: var(--yellow); font-size: 14px; }
.status-mini.ok  { color: var(--green); text-shadow: 0 0 6px var(--green); }
.status-mini.err { color: var(--red); }

/* ════════════════════════════════════════════════════════════
   APP — Sidebar Layout
   ════════════════════════════════════════════════════════════ */
#app-screen {
  display: none;
  flex-direction: row;
  background: var(--bg-0);
}
#app-screen.active { display: flex; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-1);
  border-right: 1px solid var(--bg-3);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  padding-top: env(safe-area-inset-top);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50;
}

.sidebar-top {
  padding: 12px;
  display: flex; gap: 8px;
  border-bottom: 1px solid var(--bg-3);
}

.new-chat-btn {
  flex: 1;
  padding: 10px 14px;
  background: var(--cyan);
  color: #001218;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  display: flex; align-items: center; gap: 8px; justify-content: center;
  transition: all 0.15s;
  box-shadow: 0 2px 8px var(--cyan-soft);
}
.new-chat-btn span { font-size: 18px; line-height: 1; }
.new-chat-btn:hover { box-shadow: 0 4px 16px var(--cyan-glow); }
.new-chat-btn:active { transform: scale(0.97); }

.sidebar-toggle {
  width: 38px;
  background: var(--bg-2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  transition: all 0.15s;
}
.sidebar-toggle:hover { background: var(--bg-3); color: var(--cyan); }

.sidebar-section-title {
  padding: 14px 16px 6px;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-3);
  text-transform: uppercase;
  font-weight: 600;
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 8px;
  display: flex; flex-direction: column; gap: 2px;
}

.chat-item {
  padding: 10px 12px;
  border-radius: 7px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  transition: all 0.12s;
  position: relative;
  font-size: 13px;
  color: var(--text-1);
  border: 1px solid transparent;
}
.chat-item:hover { background: var(--bg-2); }
.chat-item.active {
  background: var(--cyan-soft);
  border-color: var(--cyan-border);
  color: var(--text-0);
}

.chat-item-icon {
  width: 14px; height: 14px;
  flex-shrink: 0;
  color: var(--cyan); opacity: 0.6;
}
.chat-item-title {
  flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-item-del {
  opacity: 0;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px; color: var(--text-3);
  transition: all 0.15s;
}
.chat-item:hover .chat-item-del { opacity: 1; }
.chat-item-del:hover { background: var(--red); color: white; }

.sidebar-bottom {
  border-top: 1px solid var(--bg-3);
  padding: 8px;
  display: flex; flex-direction: column; gap: 2px;
}

.sidebar-item {
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--text-1);
  transition: all 0.12s;
  width: 100%;
  text-align: left;
}
.sidebar-item:hover { background: var(--bg-2); color: var(--cyan); }
.si-icon { font-size: 16px; width: 20px; text-align: center; }
.si-text { flex: 1; }
.si-badge {
  font-size: 10px;
  padding: 1px 6px;
  background: var(--cyan);
  color: var(--bg-0);
  border-radius: 8px;
  font-weight: 600;
}
.si-badge:empty { display: none; }

.user-card {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg-2);
  border-radius: 8px;
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), #0099bb);
  color: var(--bg-0);
  font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px var(--cyan-soft);
}
.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 13px; font-weight: 600;
  color: var(--text-0);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-status {
  font-size: 10px; color: var(--green);
  letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 4px;
}
.user-status.offline { color: var(--text-3); }
.user-logout {
  width: 28px; height: 28px;
  border-radius: 6px;
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: all 0.15s;
}
.user-logout:hover { background: var(--red); color: white; }

/* ── Main content ─────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex; flex-direction: column;
  height: 100vh;
  min-width: 0;
  padding-top: env(safe-area-inset-top);
}

.main-header {
  height: var(--header-h);
  flex-shrink: 0;
  padding: 0 16px;
  border-bottom: 1px solid var(--bg-2);
  display: flex; align-items: center; gap: 12px;
  background: rgba(10, 14, 22, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 10;
}

.hamburger {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center; justify-content: center;
  color: var(--text-1);
  transition: all 0.15s;
}
.hamburger:hover { background: var(--bg-2); color: var(--cyan); }

.header-title { flex: 1; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.ht-name {
  font-family: 'Orbitron', monospace;
  font-size: 15px; font-weight: 700;
  letter-spacing: 2px;
  color: var(--cyan);
}
.ht-model {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.header-actions { display: flex; gap: 4px; }
.hdr-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-1);
  transition: all 0.15s;
}
.hdr-btn:hover { background: var(--cyan-soft); color: var(--cyan); }
.hdr-btn:active { transform: scale(0.92); }

/* ── Views ───────────────────────────────────────────────── */
.content-view {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.content-view.active { display: flex; }

.view-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--bg-2);
  display: flex; align-items: center; gap: 12px;
}
.view-header h2 {
  font-size: 18px; flex: 1;
  color: var(--text-0); font-weight: 600;
}
.view-header input {
  padding: 8px 14px;
  background: var(--bg-2);
  border: 1px solid var(--bg-3);
  color: var(--text-1);
  border-radius: 18px;
  font-size: 13px;
  max-width: 240px;
}

/* ── Chat log ────────────────────────────────────────────── */
.chat-log {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column;
  scroll-behavior: smooth;
}

/* Welcome screen (boş chat) */
.welcome-screen {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 20px;
  text-align: center;
  animation: fadeIn 0.4s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.welcome-logo {
  position: relative;
  width: 80px; height: 80px;
  margin-bottom: 24px;
}
.wl-ring {
  position: absolute; inset: 0;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 24px var(--cyan-glow);
  animation: pulseRing 2.5s ease-in-out infinite;
}
.wl-core {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 12px; height: 12px;
  background: var(--cyan); border-radius: 50%;
  box-shadow: 0 0 16px var(--cyan);
  animation: corePulse 2s infinite;
}

.welcome-screen h2 {
  font-size: 28px;
  color: var(--text-0);
  font-weight: 600;
  margin-bottom: 6px;
}
.welcome-screen h2 span { color: var(--cyan); }
.welcome-screen p {
  font-size: 14px; color: var(--text-2); margin-bottom: 28px;
}

.welcome-suggestions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%; max-width: 500px;
}
.welcome-suggestions button {
  padding: 14px 16px;
  background: var(--bg-1);
  border: 1px solid var(--bg-3);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-1);
  text-align: left;
  transition: all 0.15s;
  line-height: 1.4;
}
.welcome-suggestions button:hover {
  background: var(--cyan-soft);
  border-color: var(--cyan-border);
  color: var(--text-0);
  transform: translateY(-1px);
}
.welcome-suggestions button:active { transform: translateY(0) scale(0.98); }

/* ── Messages ────────────────────────────────────────────── */
.msg-wrap {
  padding: 18px 20px;
  display: flex; gap: 14px;
  border-bottom: 1px solid var(--bg-2);
  animation: msgIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.msg-wrap.user { background: transparent; }
.msg-wrap.bot  { background: rgba(0, 212, 255, 0.02); }

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

.msg-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.msg-wrap.user .msg-avatar {
  background: var(--bg-3); color: var(--text-0);
}
.msg-wrap.bot .msg-avatar {
  background: linear-gradient(135deg, var(--cyan), #0099bb);
  color: var(--bg-0);
  box-shadow: 0 2px 12px var(--cyan-soft);
}

.msg-body {
  flex: 1; min-width: 0;
}
.msg-author {
  font-size: 11px; font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.msg-content {
  color: var(--text-0);
  line-height: 1.6;
  font-size: 15px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg-content.streaming::after {
  content: '▋';
  color: var(--cyan);
  animation: caret 0.7s infinite;
  margin-left: 2px;
}
@keyframes caret { 50% { opacity: 0; } }

.msg-content img {
  max-width: 400px; max-height: 400px;
  border-radius: 12px;
  margin-top: 10px;
  border: 1px solid var(--bg-3);
  display: block;
}

.msg-sys {
  text-align: center;
  padding: 8px 20px;
  color: var(--green);
  font-size: 12px;
  opacity: 0.85;
  letter-spacing: 0.3px;
}

/* ── Chat input ──────────────────────────────────────────── */
.chat-input-wrap {
  flex-shrink: 0;
  padding: 12px 16px env(safe-area-inset-bottom);
  background: linear-gradient(0deg, var(--bg-0), transparent);
}

.chat-input-box {
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-1);
  border: 1px solid var(--bg-3);
  border-radius: 16px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 6px;
  transition: all 0.2s;
  box-shadow: var(--shadow-1);
}
.chat-input-box:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-soft), var(--shadow-2);
}

#chat-input {
  flex: 1;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--text-0);
  resize: none;
  max-height: 200px;
  min-height: 24px;
  line-height: 1.5;
  scrollbar-width: none;
}
#chat-input::-webkit-scrollbar { display: none; }
#chat-input::placeholder { color: var(--text-3); }

.ci-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  transition: all 0.15s;
  flex-shrink: 0;
}
.ci-btn:hover { background: var(--bg-2); color: var(--cyan); }
.ci-btn:active { transform: scale(0.92); }

.ci-mic.recording {
  background: var(--red); color: white;
  animation: micPulse 1s infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--red); }
  50%      { box-shadow: 0 0 0 10px transparent; }
}

.ci-send {
  background: var(--cyan); color: var(--bg-0);
}
.ci-send:hover { background: var(--cyan); color: var(--bg-0); box-shadow: 0 0 12px var(--cyan-glow); }
.ci-send:disabled { opacity: 0.4; cursor: not-allowed; }

.ci-hint {
  text-align: center;
  font-size: 10px;
  color: var(--text-3);
  margin-top: 6px;
  letter-spacing: 0.3px;
}

/* ── WhatsApp ────────────────────────────────────────────── */
.wa-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.wa-contact {
  background: var(--bg-1);
  border: 1px solid var(--bg-3);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.wa-contact:hover { border-color: var(--cyan-border); background: var(--bg-2); }
.wa-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-4), var(--bg-3));
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: var(--cyan);
  flex-shrink: 0;
  border: 1px solid var(--cyan-border);
}
.wa-name { flex: 1; font-size: 14px; color: var(--text-0); }
.wa-arrow { color: var(--cyan); font-size: 18px; opacity: 0.6; }

/* ── Memory ──────────────────────────────────────────────── */
.mem-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.mem-item {
  background: var(--bg-1);
  border: 1px solid var(--bg-3);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex; gap: 12px; align-items: flex-start;
}
.mem-content {
  flex: 1;
  font-size: 14px;
  color: var(--text-0);
  line-height: 1.5;
}
.mem-cat {
  display: inline-block; margin-top: 8px;
  font-size: 9px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--cyan);
  padding: 2px 8px;
  background: var(--cyan-soft);
  border: 1px solid var(--cyan-border);
  border-radius: 6px;
  font-weight: 600;
}
.mem-del {
  background: transparent;
  color: var(--red);
  font-size: 22px;
  width: 30px; height: 30px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.mem-del:hover { background: var(--red); color: white; }

/* ── Settings ────────────────────────────────────────────── */
.settings-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  max-width: 720px; margin: 0 auto; width: 100%;
}
.section-title {
  font-size: 11px; letter-spacing: 2px;
  color: var(--cyan); text-transform: uppercase;
  margin: 14px 4px 4px; font-weight: 700;
}
.setting-row {
  background: var(--bg-1);
  border: 1px solid var(--bg-3);
  border-radius: 12px;
  padding: 14px 16px;
}
.setting-row label {
  display: block;
  font-size: 11px; letter-spacing: 1.2px;
  color: var(--text-2);
  margin-bottom: 8px;
  text-transform: uppercase;
  font-weight: 600;
}
.setting-row input,
.setting-row select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-0);
  border: 1px solid var(--bg-3);
  color: var(--text-0);
  border-radius: 8px;
  font-size: 14px;
}
.setting-row input:focus,
.setting-row select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px var(--cyan-soft);
}
.setting-row.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
}
.setting-row.toggle-row label {
  margin: 0; font-size: 14px; text-transform: none;
  letter-spacing: 0; color: var(--text-0); font-weight: 500;
}
.toggle-switch {
  position: relative;
  width: 48px; height: 26px;
  background: var(--bg-3);
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  background: var(--text-2);
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.toggle-switch.on { background: var(--cyan); }
.toggle-switch.on::after {
  background: var(--bg-0); left: 25px;
}

/* ── Empty states ────────────────────────────────────────── */
.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.7;
}
.empty .icon {
  display: block;
  font-size: 40px;
  margin-bottom: 10px;
  opacity: 0.4;
}

/* ════════════════════════════════════════════════════════════
   VOICE OVERLAY (konuşma modu)
   ════════════════════════════════════════════════════════════ */
.voice-overlay {
  position: fixed; inset: 0;
  background: radial-gradient(circle at center, var(--bg-1), var(--bg-0));
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  z-index: 200;
  padding: 20px;
}
.voice-overlay.active { display: flex; animation: fadeIn 0.3s; }

.voice-bg-ripple {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at center, var(--cyan-soft) 0%, transparent 50%);
  animation: bgPulse 4s ease-in-out infinite;
}
@keyframes bgPulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

.voice-close {
  position: absolute; top: 20px; right: 20px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--text-1);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
  padding-top: env(safe-area-inset-top);
  margin-top: env(safe-area-inset-top);
}
.voice-close:hover { background: var(--red); color: white; }

.voice-content {
  display: flex; flex-direction: column; align-items: center; gap: 30px;
  z-index: 1;
}

.voice-orb {
  position: relative;
  width: 280px; height: 280px;
  display: flex; align-items: center; justify-content: center;
}
.voice-orb-core {
  position: absolute;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--cyan), #0066aa);
  box-shadow:
    0 0 60px var(--cyan-glow),
    inset -10px -10px 30px rgba(0,0,0,0.3),
    inset 10px 10px 30px rgba(255,255,255,0.2);
  animation: orbBreathe 3s ease-in-out infinite;
  z-index: 2;
}
.voice-orb-core.listening {
  animation: orbListen 0.8s ease-in-out infinite;
}
.voice-orb-core.thinking {
  animation: orbThink 1.5s ease-in-out infinite;
  background: radial-gradient(circle at 30% 30%, var(--yellow), #aa6600);
}
.voice-orb-core.speaking {
  animation: orbSpeak 0.4s ease-in-out infinite;
}
@keyframes orbBreathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}
@keyframes orbListen {
  0%, 100% { transform: scale(1); box-shadow: 0 0 60px var(--cyan-glow); }
  50%      { transform: scale(1.2); box-shadow: 0 0 100px var(--cyan); }
}
@keyframes orbThink {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50%      { transform: scale(1.05) rotate(180deg); }
}
@keyframes orbSpeak {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}

.voice-orb-ring {
  position: absolute;
  border: 1px solid var(--cyan);
  border-radius: 50%;
  opacity: 0.4;
  animation: ringExpand 3s ease-out infinite;
}
.voice-orb-ring.r1 { width: 140px; height: 140px; animation-delay: 0s; }
.voice-orb-ring.r2 { width: 200px; height: 200px; animation-delay: 1s; }
.voice-orb-ring.r3 { width: 260px; height: 260px; animation-delay: 2s; }
@keyframes ringExpand {
  0%   { transform: scale(0.6); opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 0; }
}

#voice-wave {
  position: absolute;
  bottom: -10px;
  pointer-events: none;
  opacity: 0.6;
}

.voice-status {
  font-size: 14px;
  color: var(--text-2);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.voice-transcript {
  font-size: 18px;
  color: var(--text-0);
  text-align: center;
  max-width: 600px;
  min-height: 60px;
  line-height: 1.5;
  padding: 0 20px;
}

.voice-controls {
  display: flex; gap: 16px;
  margin-top: 10px;
}
.voice-mic-btn {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: var(--cyan);
  color: var(--bg-0);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 30px var(--cyan-glow);
  transition: all 0.2s;
}
.voice-mic-btn:active { transform: scale(0.92); }
.voice-mic-btn.recording {
  background: var(--red);
  box-shadow: 0 4px 30px rgba(255,85,102,0.6);
  animation: micPulse 1s infinite;
}

/* ════════════════════════════════════════════════════════════
   MODALS
   ════════════════════════════════════════════════════════════ */
.modal {
  position: fixed; inset: 0;
  background: rgba(6, 8, 13, 0.85);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 300; padding: 20px;
}
.modal.active { display: flex; }

.modal-card {
  background: var(--bg-1);
  border: 1px solid var(--cyan);
  border-radius: 14px;
  padding: 22px;
  max-width: 440px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 30px var(--cyan-glow);
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-card h3 {
  font-family: 'Orbitron', monospace;
  font-size: 13px; letter-spacing: 2px;
  color: var(--cyan); margin-bottom: 16px;
}

.modal-card textarea,
.modal-card input,
.modal-card select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-0);
  border: 1px solid var(--bg-3);
  color: var(--text-0);
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 10px;
  resize: vertical;
}

.modal-actions { display: flex; gap: 8px; margin-top: 4px; }
.modal-actions button { flex: 1; padding: 11px; }
.btn-cancel {
  background: var(--bg-3);
  color: var(--text-1);
  border-radius: 10px;
  font-size: 14px; font-weight: 600;
}
.btn-cancel:hover { background: var(--bg-4); }

/* ════════════════════════════════════════════════════════════
   Sidebar backdrop (mobile only)
   ════════════════════════════════════════════════════════════ */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(6, 8, 13, 0.7);
  backdrop-filter: blur(4px);
  z-index: 40;
}

/* ════════════════════════════════════════════════════════════
   Scrollbars
   ════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-4); }

/* ════════════════════════════════════════════════════════════
   SIDEBAR — gizlenebilir (her boyutta)
   ════════════════════════════════════════════════════════════ */
.sidebar.collapsed {
  width: 0;
  border-right: none;
  overflow: hidden;
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-2);
    width: var(--sidebar-w);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar.collapsed { transform: translateX(-100%); width: var(--sidebar-w); }

  .sidebar-backdrop.show {
    display: block;
    animation: fadeIn 0.2s;
  }

  .ht-model { display: none; }
  .welcome-suggestions { grid-template-columns: 1fr; }
  .welcome-screen h2 { font-size: 22px; }
  .welcome-screen p { font-size: 13px; }
  .msg-content { font-size: 14.5px; }
}

@media (min-width: 769px) {
  .sidebar-backdrop { display: none !important; }
}
