/* ═══════════════════════════════════════════════════════════════
   Deutsch Assistent v7 — "Northern Warmth" Design System
   Light: Warm cream / amber-orange
   Dark:  Deep navy / electric blue
   Fonts: Fraunces (display) + Nunito (body)
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,700;1,9..144,400;1,9..144,700&family=Nunito:wght@400;500;600;700;800;900&display=swap');

/* ── CSS Custom Properties ─────────────────────────────────────── */
:root {
  /* Light palette — warm cream + amber-orange */
  --bg:       #fdf7f0;
  --bg-grad:  radial-gradient(ellipse 80% 50% at 10% -10%, rgba(251,191,36,.18) 0%, transparent 60%),
              radial-gradient(ellipse 60% 40% at 90% 110%, rgba(249,115,22,.12) 0%, transparent 60%),
              #fdf7f0;
  --surface:  rgba(255,255,255,0.72);
  --surface2: rgba(255,255,255,0.45);
  --surface-solid: #ffffff;
  --border:   rgba(249,115,22,0.18);
  --border2:  rgba(249,115,22,0.10);
  --accent:   #f97316;      /* orange-500 */
  --accent-h: #ea6b0e;      /* hover */
  --accent2:  #f59e0b;      /* amber-500 */
  --green:    #059669;      /* emerald-600 */
  --red:      #dc2626;      /* red-600 */
  --text:     #1c1917;      /* warm-black */
  --text2:    #44403c;      /* warm-700 */
  --muted:    #78716c;      /* warm-500 */
  --muted2:   #a8a29e;      /* warm-400 */
  --glass:    blur(20px) saturate(1.4);
  --radius:   18px;
  --radius-lg:24px;
  --radius-xl:32px;
  --shadow:   0 6px 20px rgba(0,0,0,.04), 0 0 12px rgba(249,115,22,.12);
  --shadow-lg:0 12px 30px rgba(0,0,0,.06), 0 0 16px rgba(249,115,22,.20);
  --font-scale:1;
}

body.light {
  --bg:       #eaf5ef;
  --bg-grad:  radial-gradient(circle at bottom right, #b3eec5 0%, #fcf4e8 50%, #f0dbbd 75%, #f0c9ab 100%);
  --surface:  rgba(255,255,255,0.65);
  --surface2: rgba(255,255,255,0.45);
  --glass:    blur(16px) saturate(1.2);
  --surface-solid: #ffffff;
  --border:   rgba(255,255,255,0.5);
  --border2:  rgba(255,255,255,0.3);
  --accent:   #f97316;
  --accent2:  #f59e0b;
  --green:    #059669;
  --red:      #dc2626;
  --text:     #1c1917;
  --muted:    #78716c;
  --muted2:   #a8a29e;
}

/* Dark palette — deep navy + electric blue */
body:not(.light) {
  --bg:       #060b14;
  --bg-grad:  radial-gradient(circle at bottom right, #052618 0%, #060b14 40%, #10182b 75%, #28180f 100%);
  --surface:  rgba(15,27,48,0.75);
  --surface2: rgba(26,44,72,0.60);
  --surface-solid: #0f1b30;
  --border:   rgba(96,165,250,0.15);
  --border2:  rgba(96,165,250,0.08);
  --accent:   #60a5fa;      /* blue-400 */
  --accent-h: #93c5fd;
  --accent2:  #fbbf24;      /* amber-400 */
  --green:    #34d399;      /* emerald-400 */
  --red:      #f87171;      /* red-400 */
  --text:     #f0f6ff;
  --text2:    #c7d9f5;
  --muted:    #6b83a8;
  --muted2:   #4a5f80;
  --shadow:   0 6px 20px rgba(0,0,0,.35), 0 0 12px rgba(96,165,250,.20);
  --shadow-lg:0 12px 30px rgba(0,0,0,.45), 0 0 16px rgba(96,165,250,.30);
}

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

html { font-size: calc(15px * var(--font-scale)); scroll-behavior: smooth; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg-grad, var(--bg));
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background .4s, color .3s;
  line-height: 1.55;
}

/* Subtle animated mesh overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle 400px at 25% 25%, rgba(249,115,22,.06) 0%, transparent 70%),
    radial-gradient(circle 300px at 75% 70%, rgba(245,158,11,.05) 0%, transparent 70%);
  transition: opacity .4s;
}
body:not(.light)::before {
  background:
    radial-gradient(circle 500px at 20% 20%, rgba(96,165,250,.07) 0%, transparent 65%),
    radial-gradient(circle 400px at 80% 80%, rgba(251,191,36,.05) 0%, transparent 65%);
}

/* ── Glass card mixin ─────────────────────────────────────────── */
.glass {
  background: var(--surface);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.glass-sm {
  background: var(--surface2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border2);
}

/* ── Setup / Onboarding Screen ─────────────────────────────────── */
#setup-screen {
  --bg: #fdf7f0;
  --surface: rgba(255,255,255,0.72);
  --surface2: rgba(255,248,240,0.55);
  --surface-solid: #ffffff;
  --border: rgba(249,115,22,0.18);
  --border2: rgba(249,115,22,0.10);
  --accent: #f97316;
  --accent-h: #ea6b0e;
  --accent2: #f59e0b;
  --text: #1c1917;
  --text2: #44403c;
  --muted: #78716c;
  --muted2: #a8a29e;

  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  z-index: 200;
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  overflow-y: auto;
  /* SABİT sıcak krem-turuncu arka plan — temadan tamamen bağımsız */
  background:
    radial-gradient(ellipse 90% 55% at 50% -5%,  rgba(249,115,22,.28) 0%, transparent 65%),
    radial-gradient(ellipse 70% 45% at 15%  50%,  rgba(245,158,11,.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 88%  60%,  rgba(249,115,22,.14) 0%, transparent 60%),
    radial-gradient(ellipse 80% 50% at 50% 110%,  rgba(251,191,36,.12) 0%, transparent 65%),
    #f5e6d0;
  background-attachment: fixed;
}
/* Temadan bağımsız — override gerekmez */

/* Welcome hero above card */
.setup-hero {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 45vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.setup-hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  animation: orb-float 8s ease-in-out infinite;
}
.orb1 { width: 380px; height: 380px; background: rgba(249,115,22,.30); top: -100px; left: -80px; animation-delay: 0s; }
.orb2 { width: 300px; height: 300px; background: rgba(245,158,11,.25); top: -50px; right: -50px; animation-delay: -3s; }
.orb3 { width: 220px; height: 220px; background: rgba(251,191,36,.20); top: 70px; left: 38%; animation-delay: -6s; }
body:not(.light) .orb1 { background: rgba(249,115,22,.30); }
body:not(.light) .orb2 { background: rgba(245,158,11,.25); }
body:not(.light) .orb3 { background: rgba(251,191,36,.20); }

@keyframes orb-float {
  0%,100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

.setup-card {
  position: relative; z-index: 1;
  margin: auto;
  /* SABİT sıcak krem/beyaz — temadan bağımsız */
  background: rgba(255, 250, 242, 0.90);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid rgba(249,115,22,.32);
  border-radius: var(--radius-xl);
  padding: 36px 32px 28px;
  max-width: 540px;
  width: 100%;
  box-shadow: 0 8px 40px rgba(180,80,0,.20), 0 2px 10px rgba(0,0,0,.10), inset 0 1px 0 rgba(255,255,255,.90);
  animation: card-in .5s cubic-bezier(.22,1,.36,1);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(28px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Logo */
.setup-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.setup-logo-mark {
  width: 52px; height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; line-height: 1;
  box-shadow: 0 8px 20px rgba(249,115,22,.35);
}
.setup-logo-text {
  font-family: 'Fraunces', serif;
  font-size: 22px; font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}
.setup-logo-sub {
  font-size: 11px; font-weight: 600;
  color: var(--muted);
  letter-spacing: .5px;
}

.setup-subtitle {
  font-size: 13px;
  color: rgba(200,185,170,.75);
  margin-bottom: 26px;
  line-height: 1.7;
}
/* Setup kart içindeki yazılar SABİT koyu — temadan bağımsız */
.setup-card { color: #2d1f0e; }
.setup-card .setup-section-title,
.setup-card .setup-label { color: rgba(70,40,10,.80); }

/* Avatar selector */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}
.avatar-opt {
  aspect-ratio: 1;
  border-radius: 14px;
  border: 2px solid transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800;
  transition: all .18s;
  position: relative;
  font-family: 'Fraunces', serif;
}
.avatar-opt:hover { transform: scale(1.08); }
.avatar-opt.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249,115,22,.25);
  transform: scale(1.1);
}
.avatar-opt.selected::after {
  content: '✓';
  position: absolute;
  bottom: -6px; right: -6px;
  width: 16px; height: 16px;
  background: var(--accent);
  border-radius: 50%;
  font-size: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800;
  border: 2px solid var(--bg);
}

/* Section labels */
.setup-section { margin-bottom: 20px; text-align: left; }
.setup-section-title {
  font-size: 10px; font-weight: 800;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}

/* Language grid */
.lang-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 7px; }
.lang-btn {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 9px 5px;
  cursor: pointer;
  color: var(--text);
  transition: all .18s;
  text-align: center;
  backdrop-filter: blur(8px);
}
.lang-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.lang-btn.selected {
  border-color: var(--accent);
  background: rgba(249,115,22,.12);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249,115,22,.2);
}
.lang-btn .lang-flag { font-size: 20px; display: block; margin-bottom: 3px; }
.lang-btn .lang-name { font-size: 9px; color: var(--muted); font-weight: 700; }
.lang-btn.selected .lang-name { color: var(--accent); }

/* Level grid */
.level-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.level-btn {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  color: var(--text);
  transition: all .18s;
  text-align: left;
  backdrop-filter: blur(8px);
}
.level-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.level-btn.selected {
  border-color: var(--accent);
  background: rgba(249,115,22,.12);
  box-shadow: 0 4px 12px rgba(249,115,22,.2);
}
.lvl-code {
  font-family: 'Fraunces', serif;
  font-size: 18px; font-weight: 700;
  color: var(--accent);
  display: block; margin-bottom: 1px;
}
.lvl-name { font-size: 11px; color: var(--muted); }

/* Name input */
.name-input {
  width: 100%;
  /* SABİT: setup ekranında her zaman açık tonlar */
  background: rgba(255,248,235,.85);
  border: 1.5px solid rgba(249,115,22,.28);
  border-radius: 14px;
  padding: 12px 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  color: #2d1f0e;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.name-input:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249,115,22,.18);
  background: rgba(255,252,244,.95);
}
.name-input::placeholder { color: rgba(120,80,30,.50); }


/* ── Firebase Auth UI ─────────────────────────────────────────── */
.auth-tagline {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.6;
  text-align: center;
}
.google-signin-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--surface-solid);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 13px 20px;
  font-family: 'Nunito', sans-serif;
  font-size: 16px; font-weight: 800;
  color: var(--text);
  cursor: pointer;
  transition: all .2s;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.google-signin-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(66,133,244,.06), rgba(52,168,83,.06));
  opacity: 0; transition: opacity .2s;
}
.google-signin-btn:hover { border-color: #4285F4; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.google-signin-btn:hover::before { opacity: 1; }
.google-signin-btn:active { transform: translateY(0); }
.google-signin-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.google-icon { width: 22px; height: 22px; flex-shrink: 0; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0 12px;
  color: var(--muted); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-privacy {
  font-size: 11px; color: var(--muted2);
  text-align: center; margin-top: 18px; line-height: 1.6;
}
/* Signed-in user row in profile step */
.auth-user-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(249,115,22,.1), rgba(245,158,11,.07));
  border: 1px solid rgba(249,115,22,.2);
  border-radius: 14px;
  margin-bottom: 22px;
}
body:not(.light) .auth-user-row {
  background: linear-gradient(135deg, rgba(96,165,250,.1), rgba(251,191,36,.06));
  border-color: rgba(96,165,250,.2);
}
.auth-user-photo {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  flex-shrink: 0;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 20px; font-weight: 700; color: #fff;
}
.auth-user-photo img { width: 100%; height: 100%; object-fit: cover; }
.auth-user-name { font-size: 15px; font-weight: 800; color: var(--text); }
.auth-user-email { font-size: 12px; color: var(--muted); margin-top: 1px; }
/* Loading spinner on auth button */
.google-signin-btn .auth-spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: #4285F4;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Start button */
.start-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 16px; font-weight: 800;
  cursor: pointer;
  transition: all .2s;
  margin-top: 6px;
  letter-spacing: .3px;
  box-shadow: 0 6px 20px rgba(249,115,22,.35);
}
.start-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(249,115,22,.45); }
.start-btn:active:not(:disabled) { transform: translateY(0); }
.start-btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }

/* ── Main App Layout ────────────────────────────────────────────── */
#app {
  display: none;
  flex-direction: column;
  height: 100dvh; /* dynamic viewport height — excludes mobile browser chrome */
  height: 100vh;  /* fallback for browsers without dvh */
  height: var(--app-height, 100dvh); /* JS-set on mobile for keyboard awareness */
  position: relative;
  z-index: 1;
  overflow-x: hidden;
}

/* ── App Header ─────────────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  position: sticky; top: 0; z-index: 50;
  transition: background .3s;
  box-shadow: 0 1px 0 var(--border2);
  overflow: visible; /* Mutlak konumlu logonun taşmaması için */
}
/* Ortalanmış logo kapsayıcısı */
.header-logo-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 1;
}
.header-logo-img {
  height: 42px;
  width: auto;
  object-fit: contain;
  display: block;
}

.logo {
  font-family: 'Fraunces', serif;
  font-size: 18px; font-weight: 700;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.logo-mark {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; line-height: 1;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(249,115,22,.3);
}
.logo span { color: var(--accent); }

/* User avatar in header */
.header-avatar {
  width: 30px; height: 30px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 15px; font-weight: 700; color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.3);
  transition: transform .2s;
}
.header-avatar:hover { transform: scale(1.08); }

.header-badge {
  /* Header'dan kaldırıldı — JS referansları için gizli tut */
  display: none !important;
}

.header-left {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.header-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 7px;
  flex-shrink: 0;
}

.zoom-control {
  display: flex; align-items: center; gap: 3px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px 9px;
}
.zoom-btn {
  background: none; border: none;
  cursor: pointer; color: var(--muted);
  padding: 0 2px; line-height: 1;
  transition: color .15s;
  display: flex; align-items: center;
}
.zoom-btn:hover { color: var(--accent); }
.zoom-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.zoom-divider { width: 1px; height: 13px; background: var(--border); margin: 0 1px; }

.theme-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 12px; font-weight: 700;
  cursor: pointer; color: var(--text);
  transition: all .2s; white-space: nowrap;
  font-family: 'Nunito', sans-serif;
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }

.home-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 5px 12px;
  font-size: 12px; cursor: pointer;
  color: var(--text); font-weight: 700;
  transition: all .18s; white-space: nowrap;
  font-family: 'Nunito', sans-serif;
}
.home-btn:hover { border-color: var(--accent); color: var(--accent); }
.home-btn.active-home {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent; color: #fff;
  box-shadow: 0 3px 10px rgba(249,115,22,.3);
}

/* ── Mode Tabs (Desktop — horizontal scrollable) ─────────────────── */
.mode-tabs {
  display: flex;
  gap: 5px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border2);
  background: var(--surface2);
  backdrop-filter: blur(12px);
  overflow-x: auto;
  scroll-behavior: smooth;
  -ms-overflow-style: none; scrollbar-width: none;
  transition: background .3s;
}
.mode-tabs::-webkit-scrollbar { display: none; }

.mode-tab {
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 100px;
  padding: 6px 14px;
  font-size: calc(12px * var(--font-scale));
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all .18s;
  font-family: 'Nunito', sans-serif;
  display: flex; align-items: center; gap: 5px;
}
.mode-tab:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}
.mode-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(249,115,22,.3);
}
body:not(.light) .mode-tab.active {
  background: linear-gradient(135deg, var(--accent), #93c5fd);
  box-shadow: 0 3px 10px rgba(96,165,250,.3);
}

/* ── Mode Toolbar ───────────────────────────────────────────────── */
.mode-toolbar {
  display: none;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border2);
  flex-wrap: wrap;
  transition: background .3s;
}
.mode-toolbar.visible { display: flex; }
.toolbar-label {
  font-size: 10px; font-weight: 800;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted);
}
.dir-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 11px; font-weight: 700;
  cursor: pointer; color: var(--muted);
  transition: all .18s; white-space: nowrap;
  font-family: 'Nunito', sans-serif;
}
.dir-btn:hover { border-color: var(--accent); color: var(--accent); }
.dir-btn.active {
  background: rgba(249,115,22,.12);
  border-color: var(--accent);
  color: var(--accent);
}
.de-badge {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff;
  font-size: 9px; font-weight: 900;
  padding: 1px 5px; border-radius: 5px;
  letter-spacing: .5px;
}
.yapisi-select, .scenario-select {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 5px 10px;
  font-size: 12px; font-weight: 700;
  color: var(--text);
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  outline: none;
  transition: border-color .2s;
}
.yapisi-select:focus, .scenario-select:focus { border-color: var(--accent); }

/* ── Chat Area ──────────────────────────────────────────────────── */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  scroll-behavior: smooth;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 0; /* critical for flex children to scroll properly */
  overscroll-behavior: contain;
}
.chat-area::-webkit-scrollbar { width: 4px; }
.chat-area::-webkit-scrollbar-track { background: transparent; }
.chat-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Messages ───────────────────────────────────────────────────── */
.msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: msg-in .3s cubic-bezier(.22,1,.36,1);
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.msg.user { flex-direction: row-reverse; }

.msg-avatar {
  width: 34px; height: 34px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.msg.assistant .msg-avatar {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; color: #fff; font-size: 18px;
  box-shadow: 0 3px 10px rgba(249,115,22,.25);
}
body:not(.light) .msg.assistant .msg-avatar {
  background: linear-gradient(135deg, var(--accent), #93c5fd);
  box-shadow: 0 3px 10px rgba(96,165,250,.25);
}

.msg-bubble {
  max-width: 78%;
  padding: 11px 15px;
  border-radius: var(--radius);
  font-size: calc(13.5px * var(--font-scale));
  line-height: 1.65;
  position: relative;
  font-family: 'Nunito', sans-serif;
}
.msg.user .msg-bubble {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border-radius: var(--radius) 6px var(--radius) var(--radius);
  box-shadow: 0 4px 14px rgba(249,115,22,.3);
}
body:not(.light) .msg.user .msg-bubble {
  background: linear-gradient(135deg, var(--accent), #93c5fd);
  box-shadow: 0 4px 14px rgba(96,165,250,.25);
}
.msg.assistant .msg-bubble {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 6px var(--radius) var(--radius) var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
}

/* Message content styles */
.msg-bubble strong { font-weight: 800; }
.msg-bubble .c-ok { color: var(--green); font-weight: 700; }
.msg-bubble .c-err-token {
  color: var(--red); font-weight: 700;
  text-decoration: underline wavy;
  text-decoration-color: var(--red);
  text-underline-offset: 3px;
}
.msg-bubble .c-err { color: var(--red); font-weight: 700; }
.msg-bubble .q-verb { color: var(--accent); font-weight: 800; }
.msg-bubble .q-sentence { color: var(--accent2); font-weight: 700; }
.msg-bubble .q-artikel-word {
  background: var(--surface2);
  border: 2px solid var(--accent);
  border-radius: 10px;
  padding: 3px 12px;
  font-size: calc(15px * var(--font-scale));
  font-weight: 800; color: var(--accent);
  font-family: 'Fraunces', serif;
  display: inline-block;
}
.msg-bubble .answer-block {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(5,150,105,.1);
  border-left: 3px solid var(--green);
  border-radius: 0 10px 10px 0;
}
.msg-bubble .correct-sentence {
  font-weight: 800;
  font-size: calc(15px * var(--font-scale));
  color: var(--green);
}
.msg-bubble .scene-label {
  display: inline-block;
  font-size: calc(10px * var(--font-scale));
  font-weight: 800; letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--accent2);
  border: 1px solid rgba(245,158,11,.35);
  border-radius: 100px;
  padding: 2px 10px; margin-bottom: 7px;
}
.msg-bubble .de-question {
  display: block; margin-top: 6px;
  font-size: calc(15px * var(--font-scale)); font-weight: 800;
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: 10px; line-height: 1.5;
}
.msg-bubble .correction-note {
  display: block; margin-top: 8px;
  padding: 7px 12px;
  background: rgba(220,38,38,.08);
  border-left: 3px solid var(--red);
  border-radius: 0 10px 10px 0;
  font-size: calc(12px * var(--font-scale)); color: var(--red);
}

/* Wortfamilie, Konjugation, grammar blocks */
.msg-bubble .wortfamilie {
  display: block; margin-top: 10px; padding: 9px 13px;
  background: rgba(249,115,22,.07);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  font-size: calc(12px * var(--font-scale));
}
.msg-bubble .wortfamilie-title {
  font-size: calc(10px * var(--font-scale)); font-weight: 800;
  letter-spacing: .8px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 5px; display: block;
}
.msg-bubble .wf-item {
  display: inline-block;
  background: rgba(249,115,22,.12);
  border-radius: 7px; padding: 2px 8px;
  margin: 2px 3px 2px 0;
  font-size: calc(12px * var(--font-scale)); color: var(--text);
}
.msg-bubble .wf-item em { color: var(--muted); font-style: normal; font-size: calc(11px * var(--font-scale)); }
.msg-bubble .konjugation {
  display: block; margin-top: 10px; padding: 9px 13px;
  background: rgba(245,158,11,.07);
  border-left: 3px solid var(--accent2);
  border-radius: 0 10px 10px 0;
}
.msg-bubble .konj-title {
  font-size: calc(10px * var(--font-scale)); font-weight: 800;
  letter-spacing: .8px; text-transform: uppercase;
  color: var(--accent2); margin-bottom: 6px; display: block;
}
.msg-bubble .konj-table { border-collapse: collapse; font-size: calc(12px * var(--font-scale)); width: 100%; }
.msg-bubble .konj-table td { padding: 3px 10px 3px 0; color: var(--text); vertical-align: top; }
.msg-bubble .konj-table td:first-child { color: var(--muted); width: 80px; }
.msg-bubble .konj-table .konj-highlight { color: var(--accent2); font-weight: 800; }
.msg-bubble .mnemonic {
  display: block; margin-top: 8px; padding: 7px 11px;
  background: rgba(5,150,105,.09);
  border-left: 3px solid var(--green);
  border-radius: 0 10px 10px 0;
  font-size: calc(12px * var(--font-scale)); color: var(--muted); font-style: italic;
}
.msg-bubble .mnemonic::before { content: "💡 "; font-style: normal; }

/* Alt translations, word order, structures */
.msg-bubble .alt-translations {
  display: block; margin-top: 10px; padding: 9px 13px;
  background: rgba(5,150,105,.08);
  border-left: 3px solid var(--green); border-radius: 0 10px 10px 0;
  font-size: calc(12px * var(--font-scale));
}
.msg-bubble .alt-title {
  font-size: calc(10px * var(--font-scale)); font-weight: 800;
  letter-spacing: .8px; text-transform: uppercase;
  color: var(--green); margin-bottom: 5px; display: block;
}
.msg-bubble .alt-item { display: block; padding: 3px 0; color: var(--text); }
.msg-bubble .alt-item .alt-register {
  font-size: calc(10px * var(--font-scale)); display: inline-block;
  padding: 1px 7px; border-radius: 20px; margin-left: 7px;
  background: rgba(5,150,105,.15); color: var(--green); font-weight: 700; vertical-align: middle;
}
.msg-bubble .wortstellung {
  display: block; margin-top: 10px; padding: 9px 13px;
  background: rgba(245,158,11,.07); border-left: 3px solid var(--accent2);
  border-radius: 0 10px 10px 0; font-size: calc(12px * var(--font-scale));
}
.msg-bubble .ws-title {
  font-size: calc(10px * var(--font-scale)); font-weight: 800;
  letter-spacing: .8px; text-transform: uppercase;
  color: var(--accent2); margin-bottom: 7px; display: block;
}
.msg-bubble .ws-row { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 5px; align-items: flex-end; }
.msg-bubble .ws-slot { text-align: center; min-width: 44px; }
.msg-bubble .ws-word {
  display: inline-block; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 4px 9px; font-size: calc(13px * var(--font-scale));
  font-weight: 700; color: var(--text); white-space: nowrap;
}
.msg-bubble .ws-word.ws-verb { border-color: var(--accent2); background: rgba(245,158,11,.12); color: var(--accent2); }
.msg-bubble .ws-word.ws-highlight { border-color: var(--red); background: rgba(220,38,38,.1); color: var(--red); }
.msg-bubble .ws-label {
  display: block; font-size: calc(9px * var(--font-scale));
  color: var(--muted); text-align: center; margin-top: 3px;
  font-weight: 700; letter-spacing: .3px;
}
.msg-bubble .ws-rule {
  display: block; margin-top: 7px; font-size: calc(11px * var(--font-scale));
  color: var(--muted); padding-top: 6px; border-top: 1px solid var(--border2);
}
.msg-bubble .register-note {
  display: block; margin-top: 7px; padding: 5px 10px;
  border-radius: 8px; font-size: calc(11px * var(--font-scale));
  color: var(--muted); background: var(--surface2);
}

/* Yapı şeması */
.msg-bubble .yapi-schema {
  display: block; margin-top: 10px; padding: 10px 13px;
  background: rgba(249,115,22,.06); border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
}
.msg-bubble .ys-title {
  font-size: calc(10px * var(--font-scale)); font-weight: 800;
  letter-spacing: .8px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px; display: block;
}
.msg-bubble .ys-row { display: flex; flex-wrap: wrap; gap: 5px; align-items: flex-end; margin-bottom: 4px; }
.msg-bubble .ys-slot { text-align: center; min-width: 40px; }
.msg-bubble .ys-chip {
  display: inline-block; border-radius: 8px;
  padding: 5px 10px; font-size: calc(12px * var(--font-scale));
  font-weight: 700; white-space: nowrap; border: 1px solid transparent;
}
.msg-bubble .ys-chip.ys-fixed { background: rgba(249,115,22,.15); border-color: rgba(249,115,22,.3); color: var(--accent); }
.msg-bubble .ys-chip.ys-verb { background: rgba(245,158,11,.15); border-color: rgba(245,158,11,.35); color: var(--accent2); }
.msg-bubble .ys-chip.ys-free { background: var(--surface2); border-color: var(--border); color: var(--text); }
.msg-bubble .ys-chip.ys-end { background: rgba(139,92,246,.12); border-color: rgba(139,92,246,.3); color: #8b5cf6; }
.msg-bubble .ys-chip.ys-optional { opacity: .55; border-style: dashed; }
.msg-bubble .ys-label { display: block; font-size: calc(9px * var(--font-scale)); color: var(--muted); text-align: center; margin-top: 3px; }
.msg-bubble .ys-plus { display: flex; align-items: center; padding-bottom: 14px; color: var(--muted); font-size: 13px; font-weight: 700; align-self: flex-end; }
.msg-bubble .ys-rule { display: block; margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--border2); font-size: calc(11px * var(--font-scale)); color: var(--muted); line-height: 1.6; }
.msg-bubble .ys-example { display: block; margin-top: 5px; font-size: calc(12px * var(--font-scale)); color: var(--text); font-style: italic; padding-left: 8px; border-left: 2px solid rgba(249,115,22,.25); }

/* Error warning block */
.msg-bubble .hata-uyari {
  display: block; margin-top: 10px; padding: 9px 13px;
  background: rgba(245,158,11,.09); border-left: 3px solid var(--accent2);
  border-radius: 0 10px 10px 0; font-size: calc(12px * var(--font-scale));
}
.msg-bubble .hu-title { font-size: calc(10px * var(--font-scale)); font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--accent2); margin-bottom: 6px; display: block; }
.msg-bubble .hu-wrong { display: block; padding: 3px 0 3px 8px; color: var(--red); border-left: 2px solid rgba(220,38,38,.35); margin-bottom: 4px; font-size: calc(12px * var(--font-scale)); }
.msg-bubble .hu-wrong::before { content: "✗ "; }
.msg-bubble .hu-right { display: block; padding: 3px 0 3px 8px; color: var(--green); border-left: 2px solid rgba(5,150,105,.35); font-size: calc(12px * var(--font-scale)); }
.msg-bubble .hu-right::before { content: "✓ "; }
.msg-bubble .hu-note { display: block; margin-top: 6px; font-size: calc(11px * var(--font-scale)); color: var(--muted); line-height: 1.5; }

/* Konuşma / Register / Bonus */
.msg-bubble .kayit-notu { display: block; margin-top: 9px; padding: 8px 12px; background: rgba(249,115,22,.07); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; font-size: calc(12px * var(--font-scale)); }
.msg-bubble .kn-title { font-size: calc(10px * var(--font-scale)); font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--accent); margin-bottom: 5px; display: block; }
.msg-bubble .kn-used { display: block; color: var(--muted); margin-bottom: 2px; font-size: calc(12px * var(--font-scale)); }
.msg-bubble .kn-used .kn-word { color: var(--text); font-weight: 700; }
.msg-bubble .kn-badge { display: inline-block; font-size: calc(10px * var(--font-scale)); font-weight: 700; padding: 1px 8px; border-radius: 20px; margin-left: 6px; vertical-align: middle; }
.msg-bubble .kn-badge.formal { background: rgba(249,115,22,.15); color: var(--accent); }
.msg-bubble .kn-badge.informal { background: rgba(5,150,105,.15); color: var(--green); }
.msg-bubble .kn-badge.neutral { background: var(--surface2); color: var(--muted); }
.msg-bubble .kn-badge.written { background: rgba(139,92,246,.12); color: #8b5cf6; }
.msg-bubble .kn-note { display: block; margin-top: 5px; font-size: calc(11px * var(--font-scale)); color: var(--muted); }

/* Bonus ifade */
.msg-bubble .bonus-ifade { display: block; margin-top: 9px; padding: 8px 12px; background: rgba(245,158,11,.09); border-left: 3px solid var(--accent2); border-radius: 0 10px 10px 0; font-size: calc(12px * var(--font-scale)); }
.msg-bubble .bi-title { font-size: calc(10px * var(--font-scale)); font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--accent2); margin-bottom: 5px; display: block; }
.msg-bubble .bi-item { display: block; padding: 4px 0; }
.msg-bubble .bi-de { font-size: calc(13px * var(--font-scale)); font-weight: 800; color: var(--text); display: block; }
.msg-bubble .bi-tr { font-size: calc(11px * var(--font-scale)); color: var(--muted); display: block; margin-top: 2px; }
.msg-bubble .bi-context { display: inline-block; font-size: calc(9px * var(--font-scale)); background: rgba(245,158,11,.15); color: var(--accent2); padding: 1px 7px; border-radius: 20px; font-weight: 700; margin-top: 3px; }

/* Gramer tablo */
.msg-bubble .gramer-tablo { display: block; margin-top: 10px; padding: 9px 13px; background: var(--surface2); border-radius: 12px; border: 1px solid var(--border); font-size: calc(12px * var(--font-scale)); }
.msg-bubble .gt-title { font-size: calc(10px * var(--font-scale)); font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; display: block; }
.msg-bubble .gt-table { border-collapse: collapse; width: 100%; }
.msg-bubble .gt-table th { background: var(--surface); padding: 4px 8px; font-size: calc(10px * var(--font-scale)); font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); }
.msg-bubble .gt-table td { padding: 4px 8px; border-bottom: 1px solid var(--border2); }
.msg-bubble .gt-hl { background: rgba(245,158,11,.15); color: var(--accent2); font-weight: 800; }
.msg-bubble .gt-ok { color: var(--green); font-weight: 700; }
.msg-bubble .gt-err { color: var(--red); font-weight: 700; text-decoration: line-through; }
.msg-bubble .gt-note { display: block; margin-top: 6px; font-size: calc(11px * var(--font-scale)); color: var(--muted); }

/* Telaffuz */
.msg-bubble .telaffuz { display: block; margin-top: 10px; padding: 9px 13px; background: rgba(249,115,22,.06); border: 1px solid rgba(249,115,22,.15); border-radius: 12px; font-size: calc(12px * var(--font-scale)); }
.msg-bubble .tel-title { font-size: calc(10px * var(--font-scale)); font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; display: block; }
.msg-bubble .tel-row { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.msg-bubble .tel-word { display: inline-block; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 5px 11px; font-size: calc(13px * var(--font-scale)); font-weight: 800; color: var(--text); }
.msg-bubble .tel-ipa { display: block; font-size: calc(11px * var(--font-scale)); color: var(--muted); margin-top: 2px; text-align: center; font-family: monospace; }
.msg-bubble .tel-tip { display: block; margin-top: 5px; font-size: calc(12px * var(--font-scale)); color: var(--muted); line-height: 1.6; }
.msg-bubble .tel-stress { color: var(--accent2); font-weight: 800; text-decoration: underline dotted; text-underline-offset: 3px; }
.msg-bubble .tel-native { display: inline-block; font-size: calc(11px * var(--font-scale)); padding: 1px 8px; border-radius: 20px; margin-left: 5px; background: rgba(245,158,11,.12); color: var(--accent2); font-weight: 700; }

/* Bağlantılı konular */
.msg-bubble .baglanti-konular { display: block; margin-top: 10px; padding: 9px 13px; background: rgba(5,150,105,.07); border-left: 3px solid var(--green); border-radius: 0 10px 10px 0; }
.msg-bubble .bk-title { font-size: calc(10px * var(--font-scale)); font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--green); margin-bottom: 6px; display: block; }
.msg-bubble .bk-item { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; border-bottom: 1px solid rgba(5,150,105,.12); }
.msg-bubble .bk-item:last-child { border-bottom: none; padding-bottom: 0; }
.msg-bubble .bk-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.msg-bubble .bk-text { flex: 1; }
.msg-bubble .bk-topic { font-size: calc(12px * var(--font-scale)); font-weight: 700; color: var(--text); display: block; }
.msg-bubble .bk-why { font-size: calc(11px * var(--font-scale)); color: var(--muted); display: block; margin-top: 1px; line-height: 1.5; }
.msg-bubble .bk-mode { font-size: calc(10px * var(--font-scale)); display: inline-block; padding: 1px 7px; border-radius: 20px; margin-top: 2px; background: rgba(5,150,105,.15); color: var(--green); font-weight: 700; }

/* Son ek kuralı */
.msg-bubble .sonek-kural { display: block; margin-top: 10px; padding: 9px 13px; background: rgba(249,115,22,.06); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; }
.msg-bubble .sk-title { font-size: calc(10px * var(--font-scale)); font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; display: block; }
.msg-bubble .sk-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.msg-bubble .sk-suffix { display: inline-block; background: rgba(249,115,22,.15); border: 1px solid rgba(249,115,22,.3); border-radius: 8px; padding: 4px 11px; font-size: calc(13px * var(--font-scale)); font-weight: 800; color: var(--accent); }
.msg-bubble .sk-arrow { color: var(--muted); font-size: 14px; font-weight: 700; }
.msg-bubble .sk-artikel { display: inline-block; border-radius: 8px; padding: 4px 13px; font-size: calc(13px * var(--font-scale)); font-weight: 800; }
.msg-bubble .sk-artikel.der { background: rgba(249,115,22,.12); border: 1px solid rgba(249,115,22,.25); color: var(--accent); }
.msg-bubble .sk-artikel.die { background: rgba(220,38,38,.08); border: 1px solid rgba(220,38,38,.2); color: var(--red); }
.msg-bubble .sk-artikel.das { background: rgba(5,150,105,.1); border: 1px solid rgba(5,150,105,.25); color: var(--green); }
.msg-bubble .sk-examples { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.msg-bubble .sk-ex { display: inline-block; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; font-size: calc(11px * var(--font-scale)); color: var(--muted); }
.msg-bubble .sk-ex em { color: var(--text); font-style: normal; font-weight: 700; }
.msg-bubble .sk-note { display: block; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border2); font-size: calc(11px * var(--font-scale)); color: var(--muted); line-height: 1.5; }

/* Çoğul panel */
.msg-bubble .cogul-panel { display: block; margin-top: 9px; padding: 9px 13px; background: rgba(5,150,105,.07); border-left: 3px solid var(--green); border-radius: 0 10px 10px 0; }
.msg-bubble .cp-title { font-size: calc(10px * var(--font-scale)); font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--green); margin-bottom: 6px; display: block; }
.msg-bubble .cp-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.msg-bubble .cp-form { display: inline-block; background: rgba(5,150,105,.12); border: 1px solid rgba(5,150,105,.25); border-radius: 8px; padding: 4px 12px; font-size: calc(13px * var(--font-scale)); font-weight: 800; color: var(--green); }
.msg-bubble .cp-ending { display: inline-block; font-size: calc(11px * var(--font-scale)); padding: 2px 8px; border-radius: 20px; background: var(--surface2); border: 1px solid var(--border); color: var(--muted); font-weight: 700; }
.msg-bubble .cp-type { display: block; margin-top: 4px; font-size: calc(11px * var(--font-scale)); color: var(--muted); }

/* Inline TTS */
.inline-tts {
  background: none; border: none; cursor: pointer;
  font-size: 14px; padding: 0 3px;
  color: var(--muted); vertical-align: middle;
  line-height: 1; transition: color .15s;
}
.inline-tts:hover { color: var(--accent); }
.inline-tts.speaking { color: var(--green); }

/* ── Typing indicator ───────────────────────────────────────────── */
.typing { display: flex; gap: 5px; align-items: center; }
.typing span {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
  opacity: .6;
}
body:not(.light) .typing span { background: var(--accent); }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-5px); opacity: 1; } }

/* ── Input Area ─────────────────────────────────────────────────── */
.input-section {
  border-top: 1px solid var(--border2);
  background: var(--surface);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  padding-bottom: env(safe-area-inset-bottom, 0);
  transition: background .3s;
  flex-shrink: 0; /* never shrink — always visible above keyboard */
}

.quick-actions {
  display: flex; gap: 5px; flex-wrap: wrap;
  padding: 7px 14px 3px;
}
.qa-btn {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 12px; font-weight: 700;
  color: var(--muted); cursor: pointer;
  transition: all .18s; white-space: nowrap;
  font-family: 'Nunito', sans-serif;
}
.qa-btn:hover { border-color: var(--accent2); color: var(--accent2); background: rgba(245,158,11,.08); }

#standard-input-area {
  display: flex; gap: 8px;
  align-items: flex-end;
  padding: 7px 14px 8px;
}
.input-wrap {
  flex: 1;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 16px;
  display: flex; align-items: flex-end;
  transition: border-color .2s, box-shadow .2s;
  padding: 3px 3px 3px 13px;
}
.input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249,115,22,.15);
}
#user-input {
  flex: 1; background: none; border: none;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: calc(14px * var(--font-scale));
  padding: 8px 0; resize: none; outline: none;
  max-height: 120px; line-height: 1.5;
}
#user-input::placeholder { color: var(--muted2); }

.send-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; border-radius: 12px;
  width: 38px; height: 38px;
  cursor: pointer; color: #fff; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(249,115,22,.3);
}
.send-btn:hover:not(:disabled) { transform: scale(1.08); box-shadow: 0 5px 14px rgba(249,115,22,.4); }
.send-btn:disabled { opacity: .3; cursor: not-allowed; transform: none; box-shadow: none; }

.mic-btn {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 12px;
  width: 38px; height: 38px;
  cursor: pointer; color: var(--muted);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; flex-shrink: 0;
}
.mic-btn:hover { border-color: var(--accent); color: var(--accent); }
.mic-btn.recording {
  border-color: var(--red); color: var(--red);
  background: rgba(220,38,38,.1);
  animation: pulse-mic .8s ease-in-out infinite;
}
@keyframes pulse-mic { 0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,.35); } 50% { box-shadow: 0 0 0 6px rgba(220,38,38,0); } }

.char-counter {
  font-size: 10px; color: var(--muted2);
  padding: 1px 14px 7px; text-align: right;
  transition: color .2s;
}
.char-counter.warn { color: var(--accent2); }
.char-counter.over { color: var(--red); }

/* Fiil input */
#fiil-input-area {
  display: none; flex-direction: column; gap: 6px;
  padding: 7px 14px 12px;
}
.fiil-label {
  font-size: 10px; font-weight: 800;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 3px;
}
.fiil-input-wrap {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 9px 13px;
  transition: border-color .2s, box-shadow .2s;
  position: relative;
}
.fiil-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249,115,22,.15);
}
.fiil-input-wrap input, .fiil-input-wrap textarea {
  width: 100%; background: none; border: none; outline: none;
  color: var(--text); font-family: 'Nunito', sans-serif;
  font-size: calc(14px * var(--font-scale));
  resize: none; line-height: 1.5;
}
.fiil-input-wrap input::placeholder, .fiil-input-wrap textarea::placeholder { color: var(--muted2); }
.fiil-input-wrap textarea { min-height: 50px; max-height: 90px; }
.fiil-row { display: flex; gap: 8px; align-items: flex-end; }
.fiil-send-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; border-radius: 12px;
  padding: 0 18px; height: 38px;
  cursor: pointer; color: #fff;
  font-size: 13px; font-weight: 800;
  font-family: 'Nunito', sans-serif;
  transition: all .2s; white-space: nowrap; flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(249,115,22,.25);
}
.fiil-send-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(249,115,22,.35); }
.fiil-send-btn:disabled { opacity: .3; cursor: not-allowed; transform: none; }
.fiil-sentence-wrap { flex: 1; }

/* Artikel input */
#artikel-input-area { padding: 7px 14px 12px; }
.artikel-row { display: flex; gap: 8px; align-items: flex-end; }
.artikel-field { display: flex; flex-direction: column; gap: 4px; }
.artikel-field-flex { flex: 1; }
.artikel-field-narrow { width: 90px; }
.artikel-field-label {
  font-size: 10px; font-weight: 800;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted);
}
#artikel-artikel-input, #artikel-kelime-input, #artikel-anlam-input {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 9px 12px;
  font-family: 'Nunito', sans-serif;
  font-size: calc(14px * var(--font-scale));
  color: var(--text); outline: none;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}
#artikel-artikel-input:focus, #artikel-kelime-input:focus, #artikel-anlam-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249,115,22,.15);
}
.artikel-send-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; border-radius: 12px;
  padding: 0 16px; height: 38px;
  cursor: pointer; color: #fff;
  font-size: 13px; font-weight: 800;
  font-family: 'Nunito', sans-serif;
  transition: all .2s; white-space: nowrap; flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(249,115,22,.25);
}

/* Error / Retry */
.msg-bubble-error { border-color: var(--red) !important; }
.retry-btn {
  background: var(--accent);
  border: none; border-radius: 10px;
  padding: 6px 16px; color: #fff;
  cursor: pointer; font-weight: 800;
  font-family: 'Nunito', sans-serif;
  font-size: 13px; margin-top: 12px;
  display: inline-block; transition: opacity .2s;
}
.retry-btn:hover { opacity: .82; }

/* Message actions (TTS) */
.msg-actions { display: flex; gap: 5px; margin-top: 5px; padding-left: 2px; opacity: 0; transition: opacity .18s; }
.msg:hover .msg-actions { opacity: 1; }
.msg-act-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px 8px; font-size: 12px;
  cursor: pointer; color: var(--muted);
  transition: all .15s; line-height: 1;
}
.msg-act-btn:hover { border-color: var(--accent); color: var(--accent); }
.msg-act-btn.speaking { border-color: var(--green); color: var(--green); animation: pulse-speak 1s ease-in-out infinite; }
@keyframes pulse-speak { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* ── Toast ──────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 80px; left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 20px;
  font-size: 13px; font-weight: 700;
  font-family: 'Nunito', sans-serif;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  z-index: 999;
  opacity: 0;
  transition: all .3s cubic-bezier(.22,1,.36,1);
  pointer-events: none;
  white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { border-color: var(--red); color: var(--red); }
#toast.warn  { border-color: var(--accent2); color: var(--accent2); }
#toast.info  { border-color: var(--accent); color: var(--accent); }

/* ── Home Panel ─────────────────────────────────────────────────── */
#home-panel {
  display: none;
  flex-direction: column;
  gap: 16px;
  padding: 18px 16px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
}
#home-panel.visible { display: flex; flex: 1; min-height: 0; }

/* ── Profil Satırı (home panel üst) ────────────────────────────── */
@keyframes profileGradientWander {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}
.hp-profile-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(90deg, #91451f 0%, #91451f 48%, rgba(255,255,255,0.65) 100%);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
body:not(.light) .hp-profile-row {
  background: linear-gradient(135deg,
    rgba(96,165,250,.10) 0%,
    rgba(251,191,36,.06) 50%,
    rgba(96,165,250,.03) 100%);
  border-color: rgba(96,165,250,.18);
}
.hp-profile-photo-wrap {
  width: 52px; height: 52px;
  flex-shrink: 0;
}
.hp-profile-photo {
  width: 52px; height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--accent);
  cursor: pointer;
  transition: transform .18s;
  display: block;
}
.hp-profile-photo:hover { transform: scale(1.06); }
.hp-profile-initial {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 22px; font-weight: 700; color: #fff;
  cursor: pointer;
  border: 2.5px solid rgba(249,115,22,.3);
  transition: transform .18s;
}
.hp-profile-initial:hover { transform: scale(1.06); }
.hp-greeting-wrap {
  flex: 1;
  min-width: 0; /* overflow kesme için kritik */
}
/* Profil satırındaki karşılama — 2 satır */
.hp-profile-row .welcome-greeting {
  margin-bottom: 0;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
  gap: 1px;
  color: #fdf0d5; /* Bej */
}
.hp-profile-row .welcome-greeting span { color: #fcebd2; }
.hp-gr-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(253,240,213,0.85);
  line-height: 1.3;
  white-space: nowrap;
}
.hp-gr-name {
  font-family: 'Fraunces', serif;
  font-size: clamp(15px, 5vw, 22px);
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  line-height: 1.2;
}

/* ── Dil / Seviye Mini Butonlar (Profil İçinde) ───────────────────── */
.hp-mini-settings {
  position: absolute;
  bottom: 8px;
  right: 12px;
  display: flex;
  gap: 6px;
  z-index: 2; /* To ensure it's clickable above other elements if needed */
}
.hp-mini-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 8px; /* Slightly pill-shaped/rounded */
  height: 24px;
  padding: 0 8px;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
  transition: all .18s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* Slight shadow for a premium feel */
}
.hp-mini-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(249,115,22,.07);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}
.hp-greeting-wrap {
  flex: 1;
  min-width: 0;
  padding-bottom: 8px; /* Profil alanı içinde butonlara daha rahat yer açmak için */
}

/* ── ALIŞTIRMALAR Başlığı ─────────────────────────────────────────── */
.hp-section-title {
  font-size: 11px; font-weight: 900;
  letter-spacing: .9px; text-transform: uppercase;
  color: var(--text);
  opacity: 0.95;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Streak banner */
.streak-banner {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg,
    rgba(249,115,22,.20) 0%,
    rgba(245,158,11,.12) 50%,
    rgba(249,115,22,.08) 100%);
  border: 1px solid rgba(249,115,22,.39);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.12);
}
body:not(.light) .streak-banner {
  background: linear-gradient(135deg,
    rgba(96,165,250,.12) 0%,
    rgba(251,191,36,.07) 60%,
    rgba(96,165,250,.04) 100%);
  border-color: rgba(96,165,250,.2);
}
.streak-fire { font-size: 36px; line-height: 1; }
.streak-info { flex: 1; }
.streak-count {
  font-family: 'Fraunces', serif;
  font-size: 38px; font-weight: 700;
  color: var(--accent2); line-height: 1;
}
.streak-label {
  font-size: 10px; font-weight: 800;
  color: var(--muted); letter-spacing: .5px; text-transform: uppercase;
}
.streak-calendar { display: flex; flex-direction: column; gap: 3px; align-items: center; }
.streak-cal-header {
  font-size: 9px; font-weight: 800;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1px; align-self: flex-start;
}
.streak-days { display: flex; gap: 3px; align-items: center; flex-wrap: nowrap; }
.streak-day {
  width: 28px; height: 34px;
  border-radius: 8px; border: 1.5px solid var(--border);
  background: var(--surface2);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 8px; color: var(--muted); font-weight: 700;
  transition: all .2s; flex-shrink: 0; gap: 1px;
}
.streak-day .sd-dow { font-size: 7px; opacity: .7; }
.streak-day .sd-num { font-size: 10px; font-weight: 800; }
.streak-day .sd-mark { font-size: 9px; }
.streak-day.done { background: rgba(5,150,105,.15); border-color: var(--green); color: var(--green); }
.streak-day.today {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent; color: #fff;
  transform: scale(1.12);
  box-shadow: 0 3px 10px rgba(249,115,22,.35);
}
.streak-day.future { opacity: .35; }
.streak-day.missed { background: var(--surface2); border-color: var(--border); color: var(--muted); opacity: .45; }

/* Goal & Badges row */
.goal-badges-row {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Mobilde de yan yana */
  gap: 10px;
}

.goal-card {
  backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.10);
}
/* Goal card — amber-orange gradient */
.goal-card:first-child {
  background: linear-gradient(145deg,
    rgba(245,158,11,.22) 0%,
    rgba(249,115,22,.12) 60%,
    rgba(245,158,11,.08) 100%);
  border: 1px solid rgba(245,158,11,.43);
}
body:not(.light) .goal-card:first-child {
  background: linear-gradient(145deg,
    rgba(251,191,36,.12) 0%,
    rgba(249,115,22,.07) 60%,
    rgba(251,191,36,.03) 100%);
  border-color: rgba(251,191,36,.22);
}
/* Badges card — green tint */
.goal-card:last-child {
  background: linear-gradient(135deg, rgba(168,235,188,0.85) 0%, rgba(113,205,148,0.85) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
}
body:not(.light) .goal-card:last-child {
  background: linear-gradient(145deg,
    rgba(52,211,153,.20) 0%,
    rgba(5,150,105,.12) 60%,
    rgba(52,211,153,.05) 100%);
  border-color: rgba(52,211,153,.35);
  box-shadow: var(--shadow);
}
.goal-card-title {
  font-size: 11px; font-weight: 900;
  letter-spacing: .8px; text-transform: uppercase;
  color: var(--text);
  opacity: 0.95;
  margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.goal-edit-btn { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 14px; padding: 0; transition: color .15s; }
.goal-edit-btn:hover { color: var(--accent); }
.goal-bar-wrap { height: 9px; background: var(--surface2); border-radius: 5px; overflow: hidden; margin-bottom: 6px; }
.goal-bar { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .6s cubic-bezier(.4,0,.2,1); }
.goal-bar.done { background: linear-gradient(90deg, var(--green), #34d399); }
.goal-nums { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-family: 'Nunito', sans-serif; }
.goal-nums strong { color: var(--text); }
.goal-done-msg { font-size: 13px; font-weight: 800; color: var(--green); text-align: center; padding: 4px 0; }
.goal-set-form { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.goal-set-input {
  flex: 1; background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 9px; padding: 5px 9px;
  font-family: 'Nunito', sans-serif; font-size: 13px; color: var(--text); outline: none;
  transition: border-color .2s;
}
.goal-set-input:focus { border-color: var(--accent); }
.goal-set-type { display: flex; gap: 4px; }
.goal-type-btn {
  background: var(--surface2); border: 1.5px solid var(--border); border-radius: 8px;
  padding: 4px 9px; font-size: 11px; font-weight: 700; cursor: pointer; color: var(--muted);
  transition: all .15s; font-family: 'Nunito', sans-serif;
}
.goal-type-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.goal-save-btn {
  background: var(--accent); color: #fff; border: none; border-radius: 9px;
  padding: 5px 12px; font-size: 12px; font-weight: 800; cursor: pointer;
  transition: opacity .2s; font-family: 'Nunito', sans-serif;
}
.goal-save-btn:hover { opacity: .85; }

/* Badges */
.badges-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
@media (max-width: 480px) { .badges-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; } }
.badge-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 4px;
  cursor: default; transition: all .2s;
}
.badge-item.earned { border-color: var(--accent2); background: rgba(245,158,11,.1); }
.badge-item.earned:hover { transform: scale(1.06); }
.badge-emoji { font-size: 16px; line-height: 1; }
.badge-label { font-size: 8px; font-weight: 700; color: var(--muted); text-align: center; line-height: 1.3; }
.badge-item.earned .badge-label { color: var(--accent2); }
.badge-item.locked .badge-emoji { filter: grayscale(1); opacity: .35; }

/* Home main grid */
.home-main-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 14px; align-items: start;
}
@media (max-width: 600px) { .home-main-grid { grid-template-columns: 1fr; } }

.welcome-card {
  background: linear-gradient(155deg,
    rgba(249,115,22,.18) 0%,
    rgba(245,158,11,.12) 40%,
    rgba(255,255,255,.08) 100%);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(249,115,22,.39);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.12);
}
body:not(.light) .welcome-card {
  background: linear-gradient(155deg,
    rgba(96,165,250,.10) 0%,
    rgba(251,191,36,.06) 50%,
    rgba(96,165,250,.03) 100%);
  border-color: rgba(96,165,250,.18);
}
.welcome-greeting {
  font-family: 'Fraunces', serif;
  font-size: 22px; font-weight: 700;
  margin-bottom: 10px; line-height: 1.3; color: var(--text);
}
.welcome-greeting span { color: var(--accent); }
.welcome-first { font-size: 13px; color: var(--muted); padding: 10px 0; }
.home-start-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; border: none; border-radius: 12px;
  padding: 11px; font-family: 'Nunito', sans-serif;
  font-size: 14px; font-weight: 800;
  cursor: pointer; transition: all .2s; margin-top: 4px;
  box-shadow: 0 4px 14px rgba(249,115,22,.3);
}
.home-start-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(249,115,22,.4); }

.home-right-col { display: flex; flex-direction: column; gap: 14px; }

.stats-box {
  background: linear-gradient(145deg,
    rgba(249,115,22,.16) 0%,
    rgba(245,158,11,.10) 50%,
    rgba(255,255,255,.06) 100%);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(249,115,22,.35);
  border-radius: var(--radius-lg);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.10);
}
body:not(.light) .stats-box {
  background: linear-gradient(145deg,
    rgba(96,165,250,.09) 0%,
    rgba(251,191,36,.05) 55%,
    rgba(96,165,250,.03) 100%);
  border-color: rgba(96,165,250,.15);
}

/* Stats */
.stat-boxes-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; margin-bottom: 0; }
.stat-big-box {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 10px 10px;
  display: flex; flex-direction: column;
  justify-content: space-between; align-items: center;
  min-height: 70px; min-width: 0; overflow: hidden;
}
.stat-big-box-alt { border-color: rgba(249,115,22,.12); }
.sb-num {
  font-family: 'Fraunces', serif;
  font-size: 22px; font-weight: 700; color: var(--accent2);
  line-height: 1.1; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  width: 100%; margin-top: auto;
}
.sb-lbl {
  font-size: 8px; font-weight: 800;
  letter-spacing: .4px; text-transform: uppercase;
  color: var(--text); opacity: .7;
  line-height: 1.4; text-align: center; width: 100%;
}
.sb-today-green { color: var(--green) !important; }
.sb-today-red { color: var(--red) !important; }
.sb-sep { color: var(--muted); margin: 0 1px; font-size: 16px; }
.sb-avg-accent { color: var(--accent) !important; }

@media (max-width: 700px) {
  .stat-boxes-grid { grid-template-columns: repeat(2,1fr); }
  .sb-num { font-size: 18px; }
  .sb-lbl { font-size: 7.5px; }
}

/* Mode bars */
.stats-modes-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border2); }
.stats-mode-row { display: flex; align-items: center; gap: 0; margin-bottom: 7px; min-height: 22px; }
.stats-mode-icon { font-size: 14px; width: 22px; text-align: center; flex-shrink: 0; }
.stats-mode-label { font-size: 11px; color: var(--text); width: 80px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.stats-mode-bar-wrap { flex: 1; height: 7px; background: var(--surface2); border-radius: 4px; overflow: hidden; margin: 0 10px; }
.stats-mode-bar { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .7s cubic-bezier(.4,0,.2,1); }
.stats-mode-bar.bar-top { background: linear-gradient(90deg, var(--green), #34d399); }
.stats-mode-count { font-size: 12px; font-weight: 800; color: var(--text); width: 26px; text-align: right; flex-shrink: 0; }
.stats-mode-pct { font-size: 10px; color: var(--muted); width: 36px; text-align: right; flex-shrink: 0; margin-left: 5px; }
.home-last-visit { font-size: 11px; color: var(--muted); text-align: center; padding-top: 6px; }

/* Home mode nav */
.home-mode-nav { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 8px; }
.home-mode-btn {
  display: block; /* Flex kaldırıldı, Float mizanpaj devrede */
  background: var(--surface2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 16px; min-height: 120px;
  padding: 14px;
  overflow: hidden; /* Float'un dışarı taşmasını kesinkes engeller */
  cursor: pointer; text-align: left; width: 100%;
  transition: all .25s; font-family: 'Nunito', sans-serif;
}
.home-mode-btn:hover { border-color: var(--accent); background: var(--surface-solid); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.home-mode-img {
  float: left;
  width: 52px; height: 52px;
  object-fit: contain;
  margin-top: -14px;
  margin-left: -14px;
  margin-right: 12px;
  margin-bottom: 6px;
  border-top-left-radius: 15px;
  border-bottom-right-radius: 8px;
  transition: transform 0.3s ease;
}
.home-mode-btn:hover .home-mode-img { transform: scale(1.06); }
.home-mode-btn-label { 
  display: block; 
  font-size: 16px; 
  font-weight: 900; 
  color: var(--text); 
  margin-bottom: 4px; 
  line-height: 1.1; 
  margin-top: -6px; /* Görsel alanın üst noktasına olabildiğince yakınlaştırır */
  text-transform: uppercase; 
}
.home-mode-btn-desc { display: block; font-size: 11px; color: var(--text2); line-height: 1.4; opacity: 0.9; }

/* Masaüstünde anasayfadayken mode-tabs gizleme (medya query flex verse bile override eder) */
@media screen and (min-width: 769px) {
  body.home-active #mode-tabs-desktop {
    display: none !important;
  }
}

/* ── Hazine Panel ───────────────────────────────────────────────── */
#hazine-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
  padding: 18px 16px;
  overflow-y: auto; overflow-x: hidden; flex: 1;
}

/* SRS badge on tab */
.srs-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff;
  border-radius: 100px;
  font-size: 9px; font-weight: 900;
  min-width: 16px; height: 16px; padding: 0 4px;
  margin-left: 4px; vertical-align: middle; line-height: 1;
}

/* Panel header */
.panel-header {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.panel-title {
  font-family: 'Fraunces', serif;
  font-size: 20px; font-weight: 700; color: var(--text);
}
.panel-count { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 6px; font-family: 'Nunito', sans-serif; }
.panel-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.panel-empty { text-align: center; color: var(--muted); font-size: 14px; padding: 40px 20px; line-height: 1.8; }

/* Hazine stats & Animated Gradients */
.hazine-stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
@media (max-width: 480px) { .hazine-stats-row { grid-template-columns: repeat(2,1fr); } }

.hz-stat {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 10px; text-align: center;
  box-shadow: var(--shadow);
  background-size: 200% 200%;
  animation: hz-gradient-move 6s ease-in-out infinite alternate;
  transition: transform .2s, box-shadow .2s;
}
.hz-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

@keyframes hz-gradient-move {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.hz-stat-total {
  background-image: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(0,0,0,0.02), rgba(255,255,255,0.08));
}
.hz-stat-verb {
  /* Yellow/Orange for Verb */
  background-image: linear-gradient(135deg, rgba(234,179,8,0.25), rgba(202,138,4,0.1), rgba(250,204,21,0.2));
  border-color: rgba(234,179,8,0.3);
}
.hz-stat-noun {
  /* Blue for Noun */
  background-image: linear-gradient(135deg, rgba(59,130,246,0.25), rgba(37,99,235,0.1), rgba(96,165,250,0.2));
  border-color: rgba(59,130,246,0.3);
}

.hz-stat-num { font-family: 'Fraunces', serif; font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.1; margin-bottom: 2px; }
.hz-stat-lbl { font-size: 10px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }

/* hz-capacity-bar */
.hz-capacity-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface2); padding: 5px 12px; border-radius: 99px;
  margin: 2px 0; font-size: 11px; font-weight: 700; color: var(--muted);
  position: relative; overflow: hidden;
  border: 1px solid var(--border);
}
.hz-cap-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, rgba(16,185,129,0.15), rgba(16,185,129,0.25));
  z-index: 0; transition: width 0.5s ease;
}
.hz-cap-text { position: relative; z-index: 1; width: 100%; text-align: center; font-family: 'Nunito', sans-serif; }

/* hz-tools-row: Search and Filter Tabs */
.hz-tools-row { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.hz-search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 8px 12px;
  transition: border-color .2s;
}
.hz-search-box:focus-within { border-color: var(--accent); }
.hz-search-icon { font-size: 14px; opacity: 0.7; }
.hz-search-box input {
  flex: 1; background: transparent; border: none; outline: none;
  font-family: 'Nunito', sans-serif; font-size: 14px; color: var(--text);
}

.hz-filter-tabs {
  display: flex; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px; overflow: hidden;
}
.hz-filter-btn {
  flex: 1; border: none; background: transparent; padding: 6px 0;
  font-size: 12px; font-weight: 800; color: var(--muted);
  border-radius: 8px; cursor: pointer; transition: all .2s;
}
.hz-filter-btn.active {
  background: var(--surface-solid); color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.hz-filter-btn-verb.active { color: #d97706; /* intense yellow */ }
.hz-filter-btn-noun.active { color: #2563eb; /* intense blue */ }

.hz-today-toast {
  background: rgba(5,150,105,.1); border: 1px solid rgba(5,150,105,.25);
  border-radius: 14px; padding: 10px 14px;
  font-size: 14px; font-weight: 700;
  color: var(--green); text-align: center; display: none;
}
.hz-section-title {
  font-size: 10px; font-weight: 800;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); padding: 10px 0 4px;
  border-bottom: 1px solid var(--border2);
}
.hz-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hz-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; border: none; border-radius: 12px;
  padding: 8px 16px; font-size: 13px; font-weight: 800;
  cursor: pointer; font-family: 'Nunito', sans-serif;
  transition: all .2s; white-space: nowrap;
  box-shadow: 0 3px 10px rgba(249,115,22,.25);
}
.hz-btn:hover { opacity: .88; transform: translateY(-1px); }
.hz-btn.secondary {
  background: var(--surface2); color: var(--text);
  border: 1.5px solid var(--border);
  box-shadow: none;
}
.hz-btn.secondary:hover { border-color: var(--accent); color: var(--accent); }
.hz-btn.danger { background: rgba(220,38,38,.12); color: var(--red); border: 1px solid rgba(220,38,38,.25); box-shadow: none; }

/* Hazine word list */
.hz-word-list { display: flex; flex-direction: column; gap: 6px; }
.hz-word-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-left: 4px solid var(--border);
  border-radius: 12px; padding: 10px 12px;
  transition: transform .15s, border-color .15s;
}
.hz-word-item:hover { transform: translateY(-1px); }
.hz-item-verb { border-left-color: #eab308; background: linear-gradient(90deg, rgba(234,179,8,0.08), transparent 35%); }
.hz-item-noun { border-left-color: #3b82f6; background: linear-gradient(90deg, rgba(59,130,246,0.08), transparent 35%); }

.hz-word-item.hz-due { border-right: 3px solid var(--red); }
.hz-word-item.hz-new { border-right: 3px solid var(--green); }

.hz-item-left { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.hz-word-de-wrap { display: flex; align-items: center; gap: 6px; }
.hz-word-de { font-size: 15px; font-weight: 800; color: var(--text); font-family: 'Fraunces', serif; }
.hz-word-tr { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hz-word-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.hz-type-badge {
  font-size: 9px; font-weight: 800; padding: 3px 8px;
  border-radius: 20px; text-transform: uppercase; letter-spacing: .4px;
}
.hz-badge-verb { background: rgba(234,179,8,.2); color: #b45309; border: 1px solid rgba(234,179,8,.4); }
.hz-badge-noun { background: rgba(59,130,246,.2); color: #1d4ed8; border: 1px solid rgba(59,130,246,.4); }

.hz-type-new { background: rgba(5,150,105,.15); color: var(--green); border: 1px solid rgba(5,150,105,.3); }
.hz-score { font-size: 11px; color: var(--muted); display: flex; gap: 4px; font-weight: 700; width: 36px; justify-content: flex-end; }
.hz-score .ok { color: var(--green); }
.hz-score .err { color: var(--red); }

.hz-tts-inline {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
  font-size: 12px; padding: 2px 6px; color: var(--text); transition: all .15s;
}
.hz-tts-inline:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: scale(1.05); }

.hz-delete-btn {
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; font-size: 14px; padding: 4px;
  border-radius: 6px; transition: all .15s; opacity: 0.6;
}
.hz-delete-btn:hover { background: rgba(220,38,38,.1); color: var(--red); opacity: 1; }

/* Hazine exercise (flashcard) */
.hz-exercise { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 10px 0; }
.hz-fc-card {
  width: 100%; max-width: 440px;
  background: var(--surface); backdrop-filter: blur(16px);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 22px; text-align: center;
  position: relative; transition: border-color .2s;
  box-shadow: var(--shadow-lg);
}
.hz-fc-card.correct { border-color: var(--green); background: rgba(5,150,105,.06); }
.hz-fc-card.wrong { border-color: var(--red); background: rgba(220,38,38,.05); }
.hz-fc-new-badge {
  position: absolute; top: 14px; right: 14px;
  background: linear-gradient(135deg, var(--green), #34d399);
  color: #fff; font-size: 9px; font-weight: 800;
  padding: 3px 10px; border-radius: 20px; letter-spacing: .5px; text-transform: uppercase;
}
.hz-fc-word {
  font-family: 'Fraunces', serif;
  font-size: 34px; font-weight: 700; color: var(--text);
  margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.hz-fc-tts { background: none; border: none; cursor: pointer; font-size: 22px; padding: 2px; color: var(--muted); transition: color .15s; }
.hz-fc-tts:hover { color: var(--accent); }
.hz-fc-artikel-row { display: flex; gap: 10px; justify-content: center; margin: 14px 0; }
.hz-fc-art-btn {
  background: var(--surface2); border: 2px solid var(--border);
  border-radius: 12px; padding: 10px 22px;
  font-size: 17px; font-weight: 800; cursor: pointer;
  color: var(--text); transition: all .2s;
  font-family: 'Fraunces', serif;
}
.hz-fc-art-btn:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(249,115,22,.2); }
.hz-fc-art-btn.art-correct { border-color: var(--green); background: rgba(5,150,105,.15); color: var(--green); }
.hz-fc-art-btn.art-wrong { border-color: var(--red); background: rgba(220,38,38,.1); color: var(--red); }
.hz-fc-art-btn:disabled { cursor: default; }
.hz-fc-meaning { font-size: 15px; color: var(--accent); font-weight: 700; margin-top: 4px; min-height: 22px; }
.hz-fc-sentence-wrap { width: 100%; max-width: 440px; }
.hz-fc-sentence-label { font-size: 11px; color: var(--muted); margin-bottom: 5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.hz-fc-sentence-input {
  width: 100%; background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 12px; padding: 10px 14px;
  font-family: 'Nunito', sans-serif; font-size: 14px;
  color: var(--text); outline: none; resize: none;
  transition: border-color .2s, box-shadow .2s;
}
.hz-fc-sentence-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(249,115,22,.15); }
.hz-fc-result { font-size: 14px; font-weight: 800; text-align: center; min-height: 20px; }
.hz-fc-result.ok { color: var(--green); }
.hz-fc-result.err { color: var(--red); }
.hz-fc-nav { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* SRS items */
.srs-section-title {
  font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); padding: 6px 0 4px; border-bottom: 1px solid var(--border2);
}
.srs-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface); backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 14px; flex-wrap: wrap;
}
.srs-item.srs-due { border-left: 3px solid var(--red); }
.srs-item-left { display: flex; align-items: center; gap: 9px; min-width: 120px; }
.srs-mode-badge { font-size: 16px; flex-shrink: 0; }
.srs-item-word { font-size: 14px; font-weight: 800; color: var(--text); font-family: 'Fraunces', serif; }
.srs-item-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.srs-fail-count { font-size: 11px; color: var(--red); font-weight: 800; background: rgba(220,38,38,.1); padding: 2px 8px; border-radius: 20px; }
.srs-next-date { font-size: 11px; color: var(--muted); }
.srs-mastery-bar { width: 60px; height: 5px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.srs-mastery-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--green)); transition: width .4s; }
.srs-study-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; border: none; border-radius: 8px;
  padding: 4px 12px; font-size: 11px; font-weight: 800;
  cursor: pointer; white-space: nowrap;
  font-family: 'Nunito', sans-serif; transition: opacity .2s;
}
.srs-study-btn:hover { opacity: .82; }

/* ── Mobile bottom navigation ──────────────────────────────────── */
#mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--surface);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border-top: 1px solid var(--border);
  padding: 4px 0 calc(4px + env(safe-area-inset-bottom, 0));
  box-shadow: 0 -4px 20px rgba(0,0,0,.1);
  transition: transform .25s ease;
}
/* Hide nav when keyboard is open */
#mobile-nav.keyboard-hidden {
  transform: translateY(100%);
  pointer-events: none;
}
.mobile-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  max-width: 500px; margin: 0 auto;
}
.mobile-nav-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 1px;
  padding: 4px 4px;
  cursor: pointer;
  transition: all .18s;
  border: none; background: none;
  min-width: 0; flex: 1;
  font-family: 'Nunito', sans-serif;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.mobile-nav-item .mnav-icon {
  width: 42px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  transition: all .22s cubic-bezier(.22,1,.36,1);
  font-size: 19px; line-height: 1;
  position: relative;
  /* Gradient border via outline + box-shadow */
  border: 1.5px solid transparent;
  background-clip: padding-box;
}
/* Gradient border on all items */
.mobile-nav-item:not(.active) .mnav-icon {
  background: var(--surface2);
  border-color: var(--border);
}
.mobile-nav-item .mnav-label {
  font-size: 9px; font-weight: 800;
  color: var(--muted); transition: color .18s;
  white-space: nowrap; letter-spacing: .2px;
}
.mobile-nav-item.active .mnav-icon {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent;
  box-shadow: 0 3px 12px rgba(249,115,22,.35);
}
body:not(.light) .mobile-nav-item.active .mnav-icon {
  background: linear-gradient(135deg, var(--accent), #93c5fd);
  box-shadow: 0 3px 12px rgba(96,165,250,.35);
}
.mobile-nav-item.active .mnav-label { color: var(--accent); font-weight: 900; }
/* Sheet button arrow indicator */
.mnav-sheet-arrow {
  position: absolute;
  top: -3px; right: -3px;
  width: 14px; height: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; color: #fff; font-weight: 900; line-height: 1;
  border: 1.5px solid var(--bg);
  transition: transform .2s;
}
.mobile-nav-item.active .mnav-sheet-arrow {
  background: linear-gradient(135deg, var(--green), #34d399);
}

/* Mode sheets */
#more-modes-sheet, #cumle-sheet, #ai-sheet {
  display: none;
  position: fixed;
  inset: 0; z-index: 150;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  align-items: flex-end;
}
#more-modes-sheet.open,
#cumle-sheet.open,
#ai-sheet.open { display: flex; }
.more-sheet-card {
  width: 100%;
  background: var(--surface-solid);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0));
  animation: sheet-up .3s cubic-bezier(.22,1,.36,1);
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-handle { width: 40px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 16px; }
.sheet-title { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.sheet-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sheet-mode-btn {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 14px; padding: 12px 14px;
  cursor: pointer; text-align: left; width: 100%;
  transition: all .18s; font-family: 'Nunito', sans-serif;
  border: none;
}
.sheet-mode-btn:hover { background: rgba(249,115,22,.08); }
.sheet-mode-btn.active { background: rgba(249,115,22,.12); border: 1.5px solid var(--accent); }
.sheet-mode-icon { font-size: 18px; flex-shrink: 0; }
.sheet-mode-label { font-size: 13px; font-weight: 700; color: var(--text); }

/* ── Responsive spacers ─────────────────────────────────────────── */
@media (max-width: 768px) {
  #mobile-nav { display: block; }
  .mode-tabs { display: none; }
  /* Bottom padding = nav height (~58px) + safe area */
  .chat-area { padding-bottom: 72px; }
  #home-panel { padding-bottom: 72px; }
  #hazine-panel { padding-bottom: 72px; }
  .app-header { padding: 7px 12px; }
  .msg-bubble { max-width: 90%; font-size: calc(13px * var(--font-scale)); }
  .setup-card { padding: 24px 18px 20px; }
  /* Input area — stay compact on mobile */
  #standard-input-area { padding: 6px 10px 6px; }
  .quick-actions { padding: 5px 10px 2px; gap: 4px; }
  .qa-btn { padding: 3px 9px; font-size: 11px; }
  #fiil-input-area { padding: 5px 10px 10px; }
  #artikel-input-area { padding: 5px 10px 10px; }
  /* Badges: 3 sütun mobilde (3x3) */
  .badges-grid { grid-template-columns: repeat(3,1fr); gap: 5px; }
  .badge-item { padding: 6px 3px; border-radius: 9px; }
  .badge-emoji { font-size: 15px; }
  .badge-label { font-size: 7px; }
  /* Header sağ taraf kompakt */
  .header-logo-img { height: 36px; }
  .theme-btn { padding: 4px 8px; font-size: 14px; }
  .header-badge { padding: 3px 7px; font-size: 10px; }
  /* hp-ll butonları mobilde kompakt */
  .hp-ll-btn { padding: 8px 10px; }
  .hp-ll-prefix { font-size: 9px; }
  .hp-ll-value { font-size: 12px; }
  /* header-left kompakt */
  .header-left { gap: 6px; }
  /* header-logo mobil */
  .header-logo-img { height: 34px; }
}
@media (min-width: 769px) {
  #mobile-nav { display: none; }
  .mode-tabs { display: flex; }
}

/* ── Animations ─────────────────────────────────────────────────── */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.anim-in { animation: fade-in .35s cubic-bezier(.22,1,.36,1) both; }

/* Stagger helper classes */
.delay-1 { animation-delay: .05s; }
.delay-2 { animation-delay: .10s; }
.delay-3 { animation-delay: .15s; }
.delay-4 { animation-delay: .20s; }
.delay-5 { animation-delay: .25s; }

/* ── Misc ──────────────────────────────────────────────────────── */
.srs-badge { display: inline-flex; align-items: center; justify-content: center; background: var(--red); color: #fff; border-radius: 100px; font-size: 9px; font-weight: 900; min-width: 15px; height: 15px; padding: 0 4px; margin-left: 4px; vertical-align: middle; line-height: 1; }

/* ── App container fix ─────────────────────────────────────────── */
#app {
  overflow: hidden;
}
#app > .chat-area,
#app > #home-panel,
#app > #hazine-panel {
  flex: 1;
  min-height: 0;
}

/* ── Profile sheet animations ──────────────────────────────────── */
#profile-sheet-overlay > div,
#lang-change-overlay > div {
  animation: sheet-up .3s cubic-bezier(.22,1,.36,1);
}

/* ── Firebase Auth Styles ───────────────────────────────────────── */
.setup-tagline {
  font-size: 14px; color: rgba(130,80,30,.75); margin-bottom: 22px; line-height: 1.6;
}

/* ── Giriş ekranı büyük logo görseli ───────────────────────────── */
.setup-signin-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}
.setup-signin-logo-img {
  width: 100%;
  max-width: 180px;
  height: auto;
  object-fit: contain;
  display: block;
  /* Görselin çevresine çok hafif ışıma ekle */
  filter: drop-shadow(0 0 28px rgba(180,50,10,.45)) drop-shadow(0 0 14px rgba(249,115,22,.30));
  animation: logo-breathe 4s ease-in-out infinite;
}
@keyframes logo-breathe {
  0%, 100% { filter: drop-shadow(0 0 24px rgba(180,50,10,.40)) drop-shadow(0 0 12px rgba(249,115,22,.25)); }
  50%       { filter: drop-shadow(0 0 40px rgba(180,50,10,.62)) drop-shadow(0 0 22px rgba(249,115,22,.42)); }
}
@media (max-width: 480px) {
  .setup-signin-logo { margin: 0; }
  .setup-signin-logo-img { max-width: 160px; }
}

/* Google Sign-In button */
.google-signin-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: #fff;
  border: 1.5px solid #dadce0;
  border-radius: 12px;
  padding: 12px 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 15px; font-weight: 700;
  color: #3c4043;
  cursor: pointer;
  transition: all .18s;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  margin-bottom: 6px;
}
.google-signin-btn:hover {
  box-shadow: 0 3px 12px rgba(0,0,0,.15);
  border-color: #c6c9cc;
  transform: translateY(-1px);
}
.google-signin-btn:active { transform: translateY(0); }
.google-signin-btn.loading {
  opacity: .65; cursor: wait; transform: none;
}
.google-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* Google butonu setup'ta her zaman beyaz — dark tema override'ı yok */
body:not(.light) .google-signin-btn {
  background: #fff;
  border-color: #dadce0;
  color: #3c4043;
}
body:not(.light) .google-signin-btn:hover {
  background: #f8f8f8;
  border-color: #c6c9cc;
}

.setup-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 14px 0;
  /* SABİT */
  color: rgba(160,100,40,.70); font-size: 12px;
}
.setup-divider::before, .setup-divider::after {
  content: ''; flex: 1; height: 1px; background: rgba(249,115,22,.22);
}

.setup-auth-note {
  font-size: 11px; color: rgba(130,80,30,.65);
  text-align: center; margin-top: 12px; line-height: 1.5;
}

/* Step 2: user info row */
.setup-user-row {
  display: flex; align-items: center; gap: 12px;
  /* SABİT krem — temadan bağımsız */
  background: rgba(245,225,195,.60);
  border: 1px solid rgba(249,115,22,.25);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 18px;
}
.setup-user-photo {
  width: 42px; height: 42px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}
.setup-user-photo img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%;
}
.setup-user-name {
  font-family: 'Fraunces', serif;
  font-size: 16px; font-weight: 700; color: #2d1f0e;
}
.setup-user-email { font-size: 11px; color: rgba(130,80,30,.70); margin-top: 2px; }

/* Header: show user photo in header when logged in */
.header-user-photo {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid var(--accent);
  transition: transform .18s;
  flex-shrink: 0;
}
.header-user-photo:hover { transform: scale(1.08); }
.header-user-initial {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 13px; font-weight: 700; color: #fff;
  cursor: pointer;
  border: 2px solid rgba(249,115,22,.3);
  transition: transform .18s; flex-shrink: 0;
}
.header-user-initial:hover { transform: scale(1.08); }

/* Sign-out button in profile sheet */
.signout-btn {
  width: 100%;
  background: rgba(220,38,38,.08);
  border: 1px solid rgba(220,38,38,.2);
  border-radius: 12px;
  padding: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px; font-weight: 700;
  cursor: pointer; color: var(--red);
  transition: background .2s;
  margin-top: 6px;
}
.signout-btn:hover { background: rgba(220,38,38,.14); }

/* ── Email + Anonymous Auth UI ──────────────────────────────────── */
.email-tab-row {
  display: flex; gap: 4px;
  /* SABİT krem tonu */
  background: rgba(245,225,195,.60);
  border: 1px solid rgba(249,115,22,.22);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 12px;
}
.email-tab {
  flex: 1; padding: 8px;
  border: none; border-radius: 9px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px; font-weight: 800;
  cursor: pointer; color: rgba(120,70,20,.70);
  background: transparent;
  transition: all .18s;
}
.email-tab.active {
  background: rgba(255,250,242,.95);
  color: #2d1f0e;
  box-shadow: 0 2px 8px rgba(180,80,0,.12);
}
.password-wrap {
  position: relative; margin-bottom: 0;
}
.password-wrap .name-input { padding-right: 40px; width: 100%; }
.pass-toggle {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer; font-size: 16px; line-height: 1;
  color: rgba(120,70,20,.55); padding: 2px;
  transition: color .15s;
}
.pass-toggle:hover { color: #f97316; }

/* Anonymous button */
.anon-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  /* SABİT krem — temadan bağımsız */
  background: rgba(245,225,195,.50);
  border: 1.5px dashed rgba(249,115,22,.40);
  border-radius: 12px;
  padding: 11px 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px; font-weight: 700;
  color: rgba(140,80,20,.80);
  cursor: pointer;
  transition: all .2s;
}
.anon-btn:hover {
  border-color: #f97316;
  color: #ea6b0e;
  background: rgba(249,115,22,.10);
}

/* Email section spacing */
#email-auth-section { margin-bottom: 0; }
#email-login-form input,
#email-register-form input { margin-bottom: 8px; display: block; }
#email-login-form input:last-of-type,
#email-register-form input:last-of-type { margin-bottom: 0; }

/* Auth error message */
.auth-error-msg {
  background: rgba(220,38,38,.1);
  border: 1px solid rgba(220,38,38,.25);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px; font-weight: 700;
  color: var(--red);
  margin-top: 8px;
  display: none;
  text-align: center;
}
.auth-error-msg.visible { display: block; }

/* User slot in header */
.header-user-photo {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: transform .2s;
}
.header-user-photo:hover { transform: scale(1.08); }
.header-user-initial {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 13px; font-weight: 700; color: #fff;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,.2);
  transition: transform .2s;
}
.header-user-initial:hover { transform: scale(1.08); }

/* ═══════════════════════════════════════════════════════════════
   Artikel Flashcard System
   ═══════════════════════════════════════════════════════════════ */

.fc-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 16px 12px 24px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* Timer */
.fc-timer-wrap {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  padding-right: 4px;
}
.fc-timer {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--muted);
  min-width: 32px;
  text-align: center;
  transition: color .3s;
}
.fc-timer-urgent {
  color: var(--red);
  animation: fc-pulse 0.5s ease-in-out infinite alternate;
}
@keyframes fc-pulse {
  from { transform: scale(1);   opacity: 1; }
  to   { transform: scale(1.18); opacity: 0.8; }
}

/* Main card */
.fc-card {
  width: 100%;
  border-radius: 24px;
  border: 2px solid var(--border);
  padding: 0;
  background: var(--surface);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: background .4s, border-color .4s, box-shadow .4s;
  position: relative;
}
/* animated gradient shimmer on card */
.fc-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    120deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.07) 40%,
    rgba(255,255,255,0) 80%
  );
  animation: fc-shimmer 3s ease-in-out infinite;
}
@keyframes fc-shimmer {
  0%   { transform: translateX(-100%); }
  60%  { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

.fc-card-top {
  display: flex;
  align-items: stretch;
  min-height: 160px;
}

/* Artikel buttons — left column */
.fc-artikel-btns {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 72px;
  flex-shrink: 0;
  border-right: 1.5px solid var(--border);
}
.fc-artikel-btn {
  flex: 1;
  background: var(--fc-bg, rgba(255,255,255,0.06));
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--fc-c, var(--text));
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s, transform .1s, box-shadow .18s;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}
.fc-artikel-btn:last-child { border-bottom: none; }
.fc-artikel-btn:hover {
  background: var(--fc-bg, rgba(255,255,255,0.12));
  filter: brightness(1.15);
}
.fc-artikel-btn:active { transform: scale(0.96); }
.fc-artikel-btn.fc-btn-selected {
  background: var(--fc-bg, rgba(255,255,255,0.2));
  box-shadow: inset 3px 0 0 var(--fc-c);
  filter: brightness(1.2);
}
/* Shake animation for validation prompt */
@keyframes fc-shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-5px); }
  40%      { transform: translateX(5px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.fc-shake { animation: fc-shake 0.45s ease; }

/* Word area — right side */
.fc-word-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 18px;
}
.fc-word {
  font-family: 'Fraunces', serif;
  font-size: clamp(28px, 7vw, 44px);
  font-weight: 700;
  color: var(--text);
  text-align: center;
  line-height: 1.15;
  word-break: break-word;
}

/* Meaning input row */
.fc-meaning-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1.5px solid var(--border);
  align-items: center;
}
.fc-meaning-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 12px 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
}
.fc-meaning-input::placeholder { color: var(--muted); font-weight: 400; }
.fc-meaning-send {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  border: none;
  color: #fff;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 12px;
  transition: transform .15s, box-shadow .2s;
  box-shadow: 0 4px 16px rgba(5,150,105,.4);
  position: relative;
  overflow: hidden;
}
.fc-meaning-send::after {
  content: '';
  position: absolute;
  top: -50%; left: -70%;
  width: 50%; height: 200%;
  background: rgba(255,255,255,.18);
  transform: skewX(-20deg);
  animation: btn-shine 2.8s ease-in-out infinite;
}
.fc-meaning-send:hover { 
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(5,150,105,.55);
}
.fc-meaning-send:disabled {
  background: rgba(156,163,175,.3) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  opacity: 0.5;
}
.fc-meaning-send:disabled::after {
  animation: none !important;
}

/* Result overlay */
.fc-result-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 20px 24px;
  text-align: center;
  min-height: 180px;
}
.fc-status-icon { font-size: 36px; line-height: 1; }
.fc-status-text {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text2);
}
.fc-answer-word {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}
.fc-answer-artikel {
  font-family: 'Fraunces', serif;
  font-size: 26px;
  font-weight: 700;
}
.fc-answer-noun {
  font-family: 'Fraunces', serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
}
.fc-answer-meaning {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

/* Actions row */
.fc-actions {
  display: flex;
  justify-content: center;
  width: 100%;
}
.fc-next-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 12px 32px;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity .2s, transform .15s;
  box-shadow: 0 4px 14px rgba(249,115,22,.3);
}
.fc-next-btn:hover { opacity: .9; transform: translateY(-1px); }

/* LLM details panel */
.fc-llm-details {
  width: 100%;
  background: var(--surface2);
  border-radius: 18px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid var(--border);
}

/* Done ring state */
.fc-done-visual { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fc-done-ring, .goal-ring-wrap { position: relative; width: 44px; height: 44px; flex-shrink: 0; }
.goal-ring-svg { width: 44px; height: 44px; transform: rotate(-90deg); }
.goal-ring-bg  { fill: none; stroke: var(--border); stroke-width: 4; }
.goal-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 0 113;
  transition: stroke-dasharray .6s cubic-bezier(.4,0,.2,1);
}
.goal-ring-done { stroke: var(--green); stroke-dasharray: 113 113; }
.goal-ring-pct {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800; color: var(--text);
}
.goal-ring-icon {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

/* Goal visual row */
.goal-visual-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}
.goal-seg-col {
  flex: 1;
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  align-items: center;
}
.goal-seg {
  height: 8px;
  flex: 1;
  min-width: 6px;
  border-radius: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  transition: background .3s;
}
.goal-seg.filled {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-color: transparent;
}
.goal-done-visual { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.goal-done-label {
  font-size: 11px; font-weight: 800;
  color: var(--green); text-align: center;
}

/* ── Günlük Hedef — yeni sade mobil tasarım ───────────────────── */
.goal-mobile-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 2px;
}
.goal-mobile-nums {
  display: flex;
  align-items: baseline;
  gap: 3px;
}
.goal-mobile-current {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.goal-mobile-sep {
  font-size: 16px;
  color: var(--muted);
  font-weight: 600;
}
.goal-mobile-target {
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
}
.goal-mobile-unit {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-left: 4px;
}
.goal-mobile-bar-wrap {
  height: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.goal-mobile-bar {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .6s cubic-bezier(.4,0,.2,1);
  min-width: 4px;
}
.goal-mobile-pct {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-align: right;
}
/* Tamamlandı durumu */
.goal-mobile-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 0;
}
.goal-done-emoji {
  font-size: 28px;
  line-height: 1;
}

/* ═══════════════════════════════════════════════════════════════
   Artikel Sor Home Panel
   ═══════════════════════════════════════════════════════════════ */
.hp-artikel-sor-panel {
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg,
    rgba(96,165,250,0.10) 0%,
    rgba(59,130,246,0.06) 100%);
  border: 1px solid rgba(96,165,250,0.22);
  padding: 14px 16px;
  margin-top: 0;
}
body.light .hp-artikel-sor-panel {
  background: linear-gradient(135deg,
    rgba(249,115,22,0.08) 0%,
    rgba(245,158,11,0.05) 100%);
  border-color: rgba(249,115,22,0.2);
}
.hp-as-inner { display: flex; flex-direction: column; gap: 10px; }
.hp-as-title {
  font-size: 11px; font-weight: 800;
  letter-spacing: .7px; text-transform: uppercase;
  color: var(--muted);
}
.hp-as-row { display: flex; gap: 6px; }
.hp-as-input {
  flex: 1;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 11px;
  padding: 9px 13px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}
.hp-as-input:focus { border-color: var(--accent); }
.hp-as-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 11px;
  padding: 9px 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px; font-weight: 800;
  cursor: pointer;
  transition: opacity .18s;
  white-space: nowrap;
}
.hp-as-btn:hover { opacity: .85; }
.hp-as-result {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
  min-height: 0;
  margin-top: -4px;
  transition: all .2s;
}
.hp-as-result:empty {
  display: none;
}
.hp-as-result.loading { color: var(--muted); font-style: italic; }
.hp-as-result.error   { color: var(--red); }
.hp-as-result.done    { color: var(--text); }

/* ═══════════════════════════════════════════════════════════════
   Hazine Mini Home Panel
   ═══════════════════════════════════════════════════════════════ */
@keyframes goldShine {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.hp-hazine-mini-panel {
  border-radius: var(--radius-lg);
  background: linear-gradient(110deg, #d3a541 0%, #ab7f1c 25%, #fff3ce 50%, #ab7f1c 75%, #d3a541 100%);
  background-size: 200% auto;
  animation: goldShine 14s linear infinite;
  border: 1px solid #dcb562;
  padding: 14px 16px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(171, 127, 28, 0.4);
  transition: box-shadow .2s, transform .15s;
}
.hp-hazine-mini-panel:hover {
  box-shadow: 0 8px 24px rgba(171, 127, 28, 0.6);
  transform: translateY(-2px);
}
.hp-hazine-mini-panel .hp-hz-title, 
.hp-hazine-mini-panel .hp-hz-num, 
.hp-hazine-mini-panel .hp-hz-sub, 
.hp-hazine-mini-panel .hp-hz-go { color: #3a2707; text-shadow: 0 1px 0 rgba(255,255,255,0.4); }
.hp-hz-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.hp-hz-left { display: flex; flex-direction: column; gap: 3px; }
.hp-hz-title {
  font-size: 11px; font-weight: 800;
  letter-spacing: .7px; text-transform: uppercase;
  color: var(--muted);
}
.hp-hz-count { display: flex; align-items: baseline; gap: 5px; }
.hp-hz-num {
  font-family: 'Fraunces', serif;
  font-size: 26px; font-weight: 700;
  color: var(--green); line-height: 1;
}
.hp-hz-sub { font-size: 12px; color: var(--muted); }
.hp-hz-due  { font-size: 11px; color: var(--accent2); font-weight: 700; }
.hp-hz-new  { font-size: 11px; color: var(--green); font-weight: 700; }
.hp-hz-right { display: flex; align-items: center; }
.hp-hz-go {
  font-size: 12px; font-weight: 800;
  color: var(--green);
  background: rgba(52,211,153,0.12);
  border: 1px solid rgba(52,211,153,0.3);
  border-radius: 9px;
  padding: 6px 12px;
  white-space: nowrap;
}

/* ── Artikel Sor toolbar button ─── */
.dir-btn-sor {
  margin-left: auto;
  background: linear-gradient(135deg, rgba(96,165,250,0.15), rgba(59,130,246,0.08));
  border-color: rgba(96,165,250,0.35) !important;
  color: #60a5fa;
}
body.light .dir-btn-sor {
  background: linear-gradient(135deg, rgba(249,115,22,0.12), rgba(245,158,11,0.07));
  border-color: rgba(249,115,22,0.3) !important;
  color: var(--accent);
}
.dir-btn-sor:hover { opacity: .85; }

/* ── Mobile responsive for flashcard ── */
@media (max-width: 480px) {
  .fc-wrapper { padding: 10px 8px 20px; gap: 12px; }
  .fc-artikel-btns { width: 60px; }
  .fc-artikel-btn { font-size: 15px; }
  .fc-word { font-size: clamp(24px, 8vw, 36px); }
  .fc-meaning-input { font-size: 14px; padding: 10px 12px; }
}

/* ════════════════════════════════════════════════════════════════
   Artikel Bank — API'sız detay paneli & yeni bileşenler
   ════════════════════════════════════════════════════════════════ */

/* ── Seviye rozeti (flashcard üstünde) ── */
.fc-level-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 2px 7px;
  border-radius: 99px;
  opacity: .75;
  margin-top: 4px;
}
.fc-level-a1 { background: rgba(16,185,129,.18); color: #10b981; }
.fc-level-a2 { background: rgba(59,130,246,.18); color: #3b82f6; }
.fc-level-b1 { background: rgba(236,72,153,.18); color: #ec4899; }
.fc-level-b2 { background: rgba(249,115,22,.18); color: #f97316; }

/* ── fc-detail-block: cevap sonrası bilgi paneli ── */
.fc-detail-block {
  background: var(--surface2, rgba(255,255,255,.05));
  border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  animation: fc-shimmer .35s ease;
}

.fc-detail-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.fc-detail-artikel {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.fc-detail-word {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.fc-detail-meta {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
  white-space: nowrap;
  background: var(--surface3, rgba(255,255,255,.07));
  padding: 2px 8px;
  border-radius: 99px;
}

.fc-detail-plural {
  color: #fff !important;
  opacity: 1;
  font-size: 15px;
  font-weight: 600;
}
.fc-detail-ending {
  font-size: 13px;
  color: rgba(255,255,255,.85) !important;
  margin-left: 4px;
}

.fc-detail-rule {
  background: rgba(249,115,22,.15);
  border-left: 3px solid #f97316;
  border-radius: 0 8px 8px 0;
  padding: 8px 12px;
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
}

.fc-detail-mnemonic {
  background: rgba(139,92,246,.15);
  border-left: 3px solid #8b5cf6;
  border-radius: 0 8px 8px 0;
  padding: 8px 12px;
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
}

.fc-detail-example {
  background: rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fc-detail-ex-de {
  font-style: italic;
  color: #fff !important;
  font-size: 14.5px;
  font-weight: 600;
}
.fc-detail-ex-native {
  color: rgba(255,255,255,.85) !important;
  font-size: 13.5px;
  font-weight: 500;
}

/* ── fc-answer-meaning: anlam satırı ── */
.fc-answer-meaning {
  font-size: 15px;
  color: var(--muted);
  margin-top: 4px;
  text-align: center;
}

/* ── "Devam et" (fc-next-btn) — parlama efektli, merkezli ── */
.fc-next-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 60%, #1d4ed8 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .15s, box-shadow .2s;
  box-shadow: 0 4px 16px rgba(59,130,246,.45);
  margin: 0 auto 4px;
}
.fc-next-btn::after {
  content: '';
  position: absolute;
  top: -50%; left: -70%;
  width: 50%; height: 200%;
  background: rgba(255,255,255,.22);
  transform: skewX(-20deg);
  animation: btn-shine 2.2s ease-in-out infinite;
}
@keyframes btn-shine {
  0%   { left: -70%; }
  60%  { left: 130%; }
  100% { left: 130%; }
}
.fc-next-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(59,130,246,.55); }
.fc-next-btn:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(59,130,246,.4); }

/* ── fc-llm-details container ── */
.fc-llm-details {
  width: 100%;
}

/* ── Artikel Sor result block ── */
.hp-as-result {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  background: var(--surface2, rgba(255,255,255,.05));
  border: 1px solid var(--border, rgba(255,255,255,.08));
  line-height: 1.55;
}

/* ── Mobile tweaks for detail panel ── */
@media (max-width: 480px) {
  .fc-detail-block { padding: 12px 13px; gap: 8px; font-size: 13px; }
  .fc-detail-artikel { font-size: 17px; }
  .fc-detail-word    { font-size: 18px; }
}

/* ════════════════════════════════════════════════════════════════
   Fiil Alıştırması — Flashcard + Mobile Fullscreen
   ════════════════════════════════════════════════════════════════ */

/* ── Fullscreen flashcard wrapper — Artikel ve Fiil için ── */
#chat-area {
  /* Mobile'da chat-area flex column olduğunda flashcard scroll'u kapsar */
  display: flex;
  flex-direction: column;
}
.fiil-fc-wrapper,
.fc-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 14px 20px;
  width: 100%;
  box-sizing: border-box;
  /* Klavye açıkken kaydırılabilir */
  min-height: 0;
  flex: 1;
}

/* ── Fiil flashcard header (timer + badges) ── */
.fiil-fc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.fiil-fc-category {
  font-size: 11px;
  color: var(--muted);
  background: var(--surface2, rgba(255,255,255,.06));
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: capitalize;
}

/* ── Soru kartı ── */
.fiil-fc-question {
  background: var(--surface2, rgba(255,255,255,.05));
  border: 1.5px solid var(--border, rgba(255,255,255,.1));
  border-radius: 18px;
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background .25s, border-color .25s, box-shadow .25s;
  flex-shrink: 0;
}

.fiil-fc-q-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.fiil-fc-q-label-sent { margin-top: 6px; }

.fiil-fc-q-verb {
  font-size: clamp(20px, 5.5vw, 30px);
  font-weight: 800;
  color: #d4a017;
  line-height: 1.15;
  letter-spacing: -.01em;
}
.fiil-fc-q-sentence {
  font-size: clamp(18px, 4.5vw, 24px);
  color: #d4a017;
  font-style: italic;
  font-weight: 600;
  line-height: 1.45;
}

/* ── Input alanları ── */
.fiil-fc-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.fiil-fc-input-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fiil-fc-inp-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.fiil-fc-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface3, rgba(255,255,255,.04));
  border: 1.5px solid var(--border, rgba(255,255,255,.12));
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
  resize: none;
}
.fiil-fc-input:focus {
  border-color: var(--accent, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.fiil-fc-textarea {
  min-height: 52px;
  max-height: 110px;
  line-height: 1.4;
}

/* ── Gönder butonu ── */
.fiil-fc-submit-btn {
  align-self: flex-end;
  background: var(--accent, #3b82f6);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  margin-top: 2px;
}
.fiil-fc-submit-btn:hover  { opacity: .88; transform: translateY(-1px); }
.fiil-fc-submit-btn:active { transform: translateY(0); }
.fiil-fc-submit-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ── Sonuç paneli ── */
.fiil-fc-result {
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
}
.fiil-fc-res-block {
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
  color: #fff;
  animation: fc-shimmer .3s ease;
}
/* Koyu gradient sonuç panelleri — Fiil */
.fiil-fc-res-block.fiil-res-correct {
  background: linear-gradient(135deg, #065f46 0%, #064e3b 50%, #022c22 100%);
  border: 1px solid rgba(16,185,129,.4);
}
.fiil-fc-res-block.fiil-res-wrong {
  background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 50%, #450a0a 100%);
  border: 1px solid rgba(239,68,68,.4);
}
.fiil-fc-res-block.fiil-res-neutral {
  background: var(--surface2, rgba(255,255,255,.05));
  border: 1px solid var(--border, rgba(255,255,255,.08));
  color: var(--text);
}
.fiil-fc-res-timeout {
  text-align: center;
  padding: 18px;
  font-size: 18px;
  color: var(--text);
  background: rgba(245,158,11,.12);
  border-radius: 14px;
}

/* Sonuç satırları */
/* ── Cevap bloğu: başlık üstte, cevap altında, koyu arka plan ── */
.fiil-res-answer-block {
  background: rgba(0,0,0,.25);
  border-radius: 10px;
  padding: 10px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fiil-res-answer-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.fiil-res-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: rgba(255,255,255,.55);
  white-space: nowrap;
}
.fiil-res-status { font-size: 17px; flex-shrink: 0; }
.fiil-res-correct-hint {
  font-size: 13px;
  font-weight: 700;
  color: #6ee7b7;
  margin-left: 2px;
}
.fiil-res-typo { font-size: 11px; color: rgba(255,255,255,.45); font-style: italic; }
/* Cevap metni — büyük, soldan hizalı */
.fiil-res-answer-body {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  word-break: break-word;
}
.fiil-res-answer-body-sent {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 5px;
}
/* dtonative yönünde sade metin (token diff yok) */
.fiil-res-answer-plain {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}
/* Geriye dönük uyumluluk (kullanılmayan eski sınıf) */
.fiil-res-user   { font-weight: 600; color: var(--text); flex: 1; min-width: 0; word-break: break-word; }
.fiil-res-correct{ color: #10b981; font-weight: 600; font-size: 13px; }

/* Doğru cevaplar kutusu */
.fiil-res-answers {
  background: rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.fiil-res-ans-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.85) !important;
  margin-bottom: 2px;
}
.fiil-res-alt { font-size: 14px; color: #fff !important; line-height: 1.45; font-weight: 600; }
.fiil-res-alt-primary { font-weight: 700; color: #10b981; }

/* Not ve gramer odağı */
.fiil-res-note {
  background: rgba(139,92,246,.15);
  border-left: 3px solid #8b5cf6;
  border-radius: 0 8px 8px 0;
  padding: 8px 12px;
  font-size: 14px;
  color: #fff !important;
  font-weight: 600;
}
.fiil-res-grammar {
  background: rgba(249,115,22,.12);
  border-left: 3px solid #f97316;
  border-radius: 0 8px 8px 0;
  padding: 8px 12px;
  font-size: 14px;
  color: #fff !important;
  font-weight: 600;
}

/* AI kontrol butonu */
.fiil-fc-ai-btn {
  background: rgba(99,102,241,.18);
  color: var(--text);
  border: 1px solid rgba(99,102,241,.35);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12.5px;
  cursor: pointer;
  transition: opacity .15s;
  margin-left: 6px;
}
.fiil-fc-ai-btn:hover { opacity: .8; }
.fiil-res-ai-verdict {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
}
.fiil-res-ai-ok { background: rgba(16,185,129,.12); border-left: 3px solid #10b981; }
.fiil-res-ai-no { background: rgba(239,68,68,.12);  border-left: 3px solid #ef4444; }

/* ════════════════════════════════════════════════════════════════
   Token Diff — Kelime Bazlı Renklendirme
   Fiil Alıştırması cümle satırı + ileride Cümle Çevirisi için ortak.
   5 durum: ok(yeşil) / typo(sarı) / misplace(kırmızı) / wrong(kırmızı) / miss(kırmızı)
   ════════════════════════════════════════════════════════════════ */

/* Cümle satırı: token'lar gelince sarma ve hizalama */
.fiil-res-row-sent {
  align-items: flex-start;
  flex-wrap: wrap;
  row-gap: 6px;
}

/* Chip kabı */
.td-wrap {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 5px;
  flex: 1;
  min-width: 0;
  line-height: 1;
}

/* Tüm chip'ler için taban stil */
.td-tok {
  display: inline-block;
  padding: 3px 9px 4px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  line-height: 1.3;
  cursor: default;
  transition: transform .12s;
  white-space: nowrap;
}
.td-tok:hover { transform: translateY(-1px); }

/* 🟢 Doğru kelime, doğru konum */
.td-ok {
  background: rgba(16,185,129,.22);
  color: #6ee7b7;
  border: 1.5px solid rgba(16,185,129,.45);
}

/* 🟡 Doğru kelime, doğru konum — küçük yazım hatası */
.td-typo {
  background: rgba(245,158,11,.20);
  color: #fcd34d;
  border: 1.5px dashed rgba(245,158,11,.55);
}
.td-typo sup { font-size: 9px; opacity: .85; margin-left: 1px; }

/* 🔴 Doğru kelime, yanlış konum (V2 ihlali vb. gramer hatası) */
.td-misplace {
  background: rgba(239,68,68,.22);
  color: #fca5a5;
  border: 1.5px solid rgba(239,68,68,.50);
}

/* 🔴 Yanlış / fazladan kelime */
.td-wrong {
  background: rgba(239,68,68,.22);
  color: #fca5a5;
  border: 1.5px solid rgba(239,68,68,.50);
}

/* 🔴 Kullanıcının unuttuğu kelime — noktalı kenarlık */
.td-miss {
  background: rgba(239,68,68,.12);
  color: #fca5a5;
  border: 1.5px dashed rgba(239,68,68,.45);
  font-style: italic;
  opacity: .85;
}

/* '+' ayırıcı: eksik kelimeler öncesi */
.td-miss-sep {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  padding: 0 3px;
  flex-shrink: 0;
}

/* ── Token chip boyutu artışı (cevap bloğu içinde) ─────────────── */
.fiil-res-answer-body-sent .td-tok {
  font-size: 15px;
  padding: 4px 10px 5px;
}

/* ── AI verdict: koyu arka plan vurgusu ─────────────────────────── */
.fiil-res-ai-verdict {
  background: rgba(0,0,0,.28) !important;
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 13.5px;
  font-weight: 600;
}

/* ════════════════════════════════════════════════════════════════
   Konjugasyon Tablosu — Fiil Alıştırması cevap paneli
   ════════════════════════════════════════════════════════════════ */
.fiil-konj-block {
  background: rgba(0,0,0,.22);
  border-radius: 10px;
  padding: 11px 13px;
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Meta satırı: Partizip II / Präteritum / Hilfsverb */
.fiil-konj-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.fiil-konj-meta-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.fiil-konj-meta-lbl {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.45);
}
.fiil-konj-meta-val {
  font-size: 14px;
  font-weight: 700;
  color: #fcd34d;
}

/* 3 kolon yan yana */
.fiil-konj-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.fiil-konj-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.fiil-konj-col-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.5);
  margin-bottom: 3px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.fiil-konj-row {
  display: flex;
  gap: 4px;
  align-items: baseline;
  font-size: 12.5px;
}
.fiil-konj-pr {
  color: rgba(255,255,255,.45);
  font-size: 11px;
  min-width: 22px;
  flex-shrink: 0;
}
.fiil-konj-form {
  color: #e2e8f0;
  font-weight: 600;
  word-break: break-word;
}

/* Mobil: kolonlar dar ekranda 3'te 3 kalabilir, font küçülür */
@media (max-width: 380px) {
  .fiil-konj-cols { gap: 5px; }
  .fiil-konj-row  { font-size: 11px; }
  .fiil-konj-form { font-size: 11px; }
}

/* Actions bar */
.fiil-fc-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}
.fiil-fc-done {
  text-align: center;
  padding: 24px;
  font-size: 18px;
  color: var(--text);
}

/* ── Mobile fullscreen için kritik düzeltmeler ── */
/* chat-area'yı klavye + içerik arasında sıkıştırmaktan koru */
@media (max-width: 640px) {
  /* App wrapper: sabit yükseklik, scroll yok — flashcard kendi içinde scroll */
  .app-wrapper,
  #app {
    height: 100dvh;      /* dynamic viewport height — klavye açılınca küçülür */
    overflow: hidden;
  }

  /* Chat alanı geri kalan tüm yüksekliği doldursun */
  .chat-container,
  #chat-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  #chat-area {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }

  /* Flashcard wrapper tüm alanı kaplasın */
  .fiil-fc-wrapper,
  .fc-wrapper,
  .cumle-fc-wrapper {
    min-height: 100%;
    padding: 10px 10px 16px;
    gap: 10px;
    /* İç scroll: kart + sonuç ekrana sığmazsa */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Timer yazısını büyüt */
  #fiil-fc-timer,
  #fc-timer-display {
    font-size: 18px;
    min-width: 40px;
    text-align: center;
  }

  /* Verb ve cümle daha kompakt */
  .fiil-fc-q-verb   { font-size: clamp(18px, 6vw, 26px); }
  .fiil-fc-q-sentence { font-size: clamp(13px, 3.8vw, 16px); }

  /* Input padding küçült */
  .fiil-fc-input    { padding: 9px 12px; font-size: 14px; }
  .fiil-fc-submit-btn { width: 100%; text-align: center; }

  /* Sonuç paneli */
  .fiil-fc-res-block { padding: 11px 12px; font-size: 12.5px; }

  /* Artikel flashcard da aynı şekilde */
  .fc-card           { padding: 14px 14px; }
  .fc-artikel-btn    { font-size: 14px; padding: 8px 0; }
  .fc-word           { font-size: clamp(22px, 7vw, 32px); }
}

/* Tablet orta boyut */
@media (min-width: 641px) and (max-width: 960px) {
  .fiil-fc-wrapper,
  .fc-wrapper,
  .cumle-fc-wrapper {
    max-width: 640px;
    margin: 0 auto;
  }
}

/* ════════════════════════════════════════════════════════════════
   Artikel & Fiil — Yeni Sistem: Ambient, Circular Timer,
   Auto-advance Bar, Answer Hero, Sound Feedback
   ════════════════════════════════════════════════════════════════ */

/* ── Circular Timer SVG ─────────────────────────────────────────── */
.fc-timer-ring-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  margin: 0 auto 8px;
}
.fiil-timer-ring-wrap {
  margin: 0 0 10px 0;
}
.fc-timer-ring {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  overflow: visible;
}
.fc-timer-ring-bg {
  fill: none;
  stroke: rgba(255,255,255,.1);
  stroke-width: 4px;
}
.fc-timer-ring-arc {
  fill: none;
  stroke: #10b981;
  stroke-width: 4px;
  stroke-linecap: round;
  transition: stroke-dashoffset .9s linear, stroke .9s linear;
}
#fc-timer-display,
#fiil-fc-timer {
  position: relative;
  z-index: 1;
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.fc-timer-warn    { color: #f97316 !important; }
.fc-timer-urgent  { color: #ef4444 !important; animation: fc-pulse .5s infinite alternate; }

/* ── Auto-advance Progress Bar (Hardal — Kalın — Merkezli) ──────── */
.fc-autoadv-wrap {
  width: 80%;
  max-width: 400px;
  margin: 12px auto 4px;
}
.fc-autoadv-bar-bg {
  width: 100%;
  height: 10px;
  background: rgba(255,255,255,.12);
  border-radius: 99px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.15);
}
.fc-autoadv-bar {
  height: 100%;
  background: linear-gradient(90deg, #d4a017 0%, #e6b422 50%, #d4a017 100%);
  border-radius: 99px;
  transition: width 1s linear;
  opacity: 1;
  box-shadow: 0 0 8px rgba(212,160,23,.45), 0 0 20px rgba(212,160,23,.2);
}

/* ── Ambient Body Effects ────────────────────────────────────────── */
body.fc-ambient-correct {
  background-color: rgba(14, 150, 64, 0.18) !important;
}
body.fc-ambient-wrong {
  background-color: rgba(228, 43, 43, 0.20) !important;
}
body.fc-ambient-timeout {
  background-color: rgba(85, 97, 121, 0.18) !important;
}
/* Wrapper glow — güçlendirilmiş pulse animasyonlu */
.fc-wrapper.fc-ambient-correct,
.fiil-fc-wrapper.fc-ambient-correct,
.cumle-fc-wrapper.fc-ambient-correct {
  box-shadow: 0 0 80px rgba(85, 223, 126, 0.5), 0 0 30px rgba(16,185,129,.3);
  animation: fc-glow-correct 1.5s ease-in-out infinite alternate;
}
.fc-wrapper.fc-ambient-wrong,
.fiil-fc-wrapper.fc-ambient-wrong,
.cumle-fc-wrapper.fc-ambient-wrong {
  box-shadow: 0 0 80px rgba(227, 35, 35, 0.45), 0 0 30px rgba(239,68,68,.3);
  animation: fc-glow-wrong 1.5s ease-in-out infinite alternate;
}
.fc-wrapper.fc-ambient-timeout,
.fiil-fc-wrapper.fc-ambient-timeout,
.cumle-fc-wrapper.fc-ambient-timeout {
  box-shadow: 0 0 60px rgba(79, 86, 101, 0.39);
}
@keyframes fc-glow-correct {
  from { box-shadow: 0 0 60px rgba(85,223,126,.4), 0 0 20px rgba(16,185,129,.2); }
  to   { box-shadow: 0 0 90px rgba(85,223,126,.6), 0 0 40px rgba(16,185,129,.35); }
}
@keyframes fc-glow-wrong {
  from { box-shadow: 0 0 60px rgba(227,35,35,.35), 0 0 20px rgba(239,68,68,.2); }
  to   { box-shadow: 0 0 90px rgba(227,35,35,.55), 0 0 40px rgba(239,68,68,.35); }
}

/* ── Answer Hero (Büyük cevap gösterimi) ─────────────────────────── */
.fc-answer-hero {
  display: flex;
  align-items: baseline;
  gap: 10px;
  justify-content: center;
  margin: 6px 0 4px;
  flex-wrap: wrap;
}
.fc-answer-artikel {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -.02em;
}
.fc-answer-noun {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}

/* Anlam satırı (result kartı içinde) */
.fc-res-meaning-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-top: 4px;
}
.fc-res-meaning-status { font-size: 18px; }
.fc-res-meaning-value  { font-size: 20px; font-weight: 600; color: var(--text); }

/* ── fc-detail-block: Answer Hero section ───────────────────────── */
.fc-detail-answer-hero {
  background: var(--surface2, rgba(255,255,255,.06));
  border-radius: 12px;
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}
.fc-detail-hero-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.fc-detail-hero-status {
  font-size: 20px;
  flex-shrink: 0;
}
.fc-detail-hero-artikel {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -.02em;
}
.fc-detail-hero-word {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
}
.fc-detail-meaning-row { align-items: center; }
.fc-detail-hero-meaning {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}
.fc-detail-meta-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}
/* ── Yanlış cevap gösterimi (doğru cevabın yanında, kırmızı token) ── */
.fc-detail-wrong-ans {
  font-size: 15px;
  color: #f24141 !important;
  font-weight: 900;
  text-decoration: line-through;
  margin-left: 5px;
  background: rgba(239,68,68,.17);
  border: 1px solid rgba(239,68,68,.37);
  padding: 1px 8px;
  border-radius: 6px;
  opacity: .9;
}

/* ── Fiil flashcard badges row ──────────────────────────────────── */
.fiil-fc-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

/* ── fc-actions: Devam et butonu + progress bar layout ────────── */
/* Cevap DOĞRU: buton üste (sayfanın üstü yakını), bar alta, her ikisi de ortalı */
.fc-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 0 4px;
  width: 100%;
}
/* Fiil actions aynı layout */
.fiil-fc-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 0 4px;
  width: 100%;
}

/* ── Mobile updates ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .fc-timer-ring-wrap  { width: 50px; height: 50px; }
  #fc-timer-display,
  #fiil-fc-timer       { font-size: 14px; }
  .fc-answer-artikel,
  .fc-answer-noun      { font-size: 24px; }
  .fc-detail-hero-artikel,
  .fc-detail-hero-word { font-size: 22px; }
  .fc-detail-hero-meaning { font-size: 18px; }
  .fc-res-meaning-value   { font-size: 17px; }
  .fiil-fc-q-verb          { font-size: clamp(17px,5.5vw,24px); }
}
/* ── Input Kontrast — koyu temada daha parlak, açıkta daha derin ─ */
.fc-meaning-input,
.fiil-fc-input,
.fc-meaning-row input {
  background: rgba(255,255,255,.12) !important;
  color: #fff !important;
}
body.light .fc-meaning-input,
body.light .fiil-fc-input,
body.light .fc-meaning-row input {
  background: rgba(0,0,0,.07) !important;
  color: var(--text) !important;
}

/* ── Cevapla Butonu — yeşil, parlama ───────────────── */
.fiil-fc-submit-btn,
.fc-submit-btn {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  color: #fff !important;
  border: none;
  border-radius: 12px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .15s, box-shadow .2s;
  box-shadow: 0 4px 16px rgba(5,150,105,.4);
  margin: 0 auto;
}
.fiil-fc-submit-btn::after,
.fc-submit-btn::after {
  content: '';
  position: absolute;
  top: -50%; left: -70%;
  width: 50%; height: 200%;
  background: rgba(255,255,255,.18);
  transform: skewX(-20deg);
  animation: btn-shine 2.8s ease-in-out infinite;
}
.fiil-fc-submit-btn:hover,
.fc-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(5,150,105,.55);
}

/* Pasif durum - grimsi soluk */
.fiil-fc-submit-btn:disabled,
.fc-submit-btn:disabled,
.fiil-fc-dontknow-btn:disabled,
.fc-dontknow-btn:disabled {
  background: rgba(156,163,175,.3) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  opacity: 0.5;
}
.fiil-fc-submit-btn:disabled::after,
.fc-submit-btn:disabled::after,
.fiil-fc-dontknow-btn:disabled::after,
.fc-dontknow-btn:disabled::after {
  animation: none !important;
}

/* ── Bilmiyorum Butonu — kırmızı, parlama, daha küçük ───────────────── */
.fiil-fc-dontknow-btn,
.fc-dontknow-btn {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
  color: #fff !important;
  border: none;
  border-radius: 12px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .15s, box-shadow .2s;
  box-shadow: 0 4px 16px rgba(220,38,38,.4);
  margin: 0 auto;
}
.fiil-fc-dontknow-btn::after,
.fc-dontknow-btn::after {
  content: '';
  position: absolute;
  top: -50%; left: -70%;
  width: 50%; height: 200%;
  background: rgba(255,255,255,.18);
  transform: skewX(-20deg);
  animation: btn-shine 2.8s ease-in-out infinite;
}
.fiil-fc-dontknow-btn:hover,
.fc-dontknow-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220,38,38,.55);
}

/* ── fc-detail-block: Dış panel gradient — ic panel ayni kalır ── */
/* Dogru: koyu yeşil dış, ic panel (answer-hero) ayni */
.fc-detail-block.fc-detail-correct {
  background: linear-gradient(160deg, #064e3b 0%, #065f46 40%, #022c22 100%);
  border-color: rgba(16,185,129,.35);
  color: #fff;
}
/* Yanlış: koyu kırmızı dış, ic panel ayni */
.fc-detail-block.fc-detail-wrong {
  background: linear-gradient(160deg, #450a0a 0%, #7f1d1d 40%, #991b1b 100%);
  border-color: rgba(239,68,68,.35);
  color: #fff;
}
/* meanings bg — bayrakların okunması için icın yarı sayıdam arka plan */
.fc-meanings-row {
  background: rgba(0,0,0,.25);
  border-radius: 8px;
  padding: 8px 12px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff !important;
}

/* ── Artikel/Fiil/Cümle modunda alt butonları gizle ────────────── */
body.mode-artikel .quick-actions,
body.mode-fiil    .quick-actions,
body.mode-cumle   .quick-actions {
  display: none !important;
}
/* Flashcard başlatıldığında standart input alanı gizlensin */
body.mode-artikel .input-section,
body.mode-fiil    .input-section,
body.mode-cumle   .input-section {
  display: none !important;
}

/* ════════════════════════════════════════════════════════════════
   CÜMLE ÇEVİRİSİ — Hint Bubble, Word Structure, Chunks, Tips
   ════════════════════════════════════════════════════════════════ */

/* ── Hint Trigger Butonu — textarea sağ üstünde küçük yuvarlak ── */
.cumle-input-row-wrap {
  position: relative;   /* buton ve label konumlandırması için */
  flex-wrap: wrap;
}
.cumle-hint-trigger {
  position: absolute;
  top: -6px; right: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(139,92,246,.18);
  border: 1px solid rgba(139,92,246,.4);
  color: #c4b5fd;
  font-size: 13px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 20px;
  cursor: pointer;
  transition: background .15s, transform .12s, box-shadow .2s;
  z-index: 2;
  line-height: 1;
}
.cumle-hint-trigger:hover:not(:disabled) {
  background: rgba(139,92,246,.30);
  transform: scale(1.08);
  box-shadow: 0 2px 12px rgba(139,92,246,.35);
}
.cumle-hint-trigger:disabled,
.cumle-hint-trigger.cumle-hint-done {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
#cumle-hint-counter {
  font-size: 11px;
  font-weight: 800;
  min-width: 12px;
  text-align: center;
}

/* ── Konuşma Balonu (Speech Bubble) ─────────────────────────── */
.cumle-hint-bubble-area {
  min-height: 0;
  margin: 0 0 4px;
}
.cumle-hint-bubble {
  position: relative;
  background: linear-gradient(135deg, rgba(109,70,210,.22) 0%, rgba(139,92,246,.14) 100%);
  border: 1px solid rgba(139,92,246,.35);
  border-radius: 14px;
  padding: 10px 14px;
  margin: 0 0 2px;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  box-shadow: 0 4px 20px rgba(139,92,246,.15);
}
/* Konuşma balonu kuyruğu — sağ alta, hint butonuna doğru */
.cumle-hint-bubble-tail {
  position: absolute;
  bottom: -8px;
  right: 24px;
  width: 0; height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 9px solid rgba(139,92,246,.35);
}
.cumle-hint-bubble-tail::after {
  content: '';
  position: absolute;
  top: -10px;
  left: -8px;
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid rgba(109,70,210,.22);
}
.cumle-hint-bubble-content {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cumle-hint-line {
  color: #ede9fe;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}
.cumle-hint-num {
  color: #c4b5fd;
  font-weight: 800;
  margin-right: 3px;
}

@keyframes hintBubblePop {
  0%   { opacity: 0; transform: scale(0.85) translateY(6px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Sonuç paneli: Ek bölümler — koyu arka plan (CEVABIN paneli ile aynı ton) ─ */
/* NOT: Bu bölümler HER ZAMAN koyu gradient (fiil-res-correct/wrong) içinde.
   Light mode'da bile parent panel koyu, bu yüzden metin beyaz kalmalı.         */
.cumle-res-section {
  background: rgba(0,0,0,.25) !important;
  border-radius: 10px;
  padding: 10px 13px;
  margin-top: 2px;
  color: #fff !important;
}
.cumle-res-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: rgba(255,255,255,.65) !important;
  margin-bottom: 6px;
}

/* ── Pitfalls + Rules — tek panel ─────────────────────────── */
.cumle-res-tips {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cumle-res-tip-line {
  font-size: 13.5px;
  color: #fff !important;
  font-weight: 700;
  line-height: 1.5;
}
.cumle-res-pitfall-line {
  color: #fca5a5 !important;
}
.cumle-res-pitfall-line strong {
  color: #fca5a5 !important;
}
.cumle-res-rule-line {
  color: #e2e8f0 !important;
}

/* ── Word Structure — yatay layout ────────────────────────── */
.cumle-ws-horiz {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  justify-content: center;
  align-items: flex-start;
}
.cumle-ws-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
  flex-shrink: 0;
  padding: 4px 2px;
}
/* Token — hardal/altın, daha opak, büyük punto */
.cumle-ws-token {
  background: rgba(212,160,23,.30) !important;
  color: #fcd34d !important;
  font-size: 15px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 7px;
  border: 1px solid rgba(212,160,23,.45) !important;
  white-space: nowrap;
  margin-bottom: 3px;
}
/* Role — token altında, BEYAZ */
.cumle-ws-role {
  font-size: 10.5px;
  color: #fff !important;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}
/* Field — role altında, açık mavi */
.cumle-ws-field {
  font-size: 9.5px;
  color: #93c5fd !important;
  font-weight: 600;
  font-style: italic;
  margin-top: 1px;
  white-space: nowrap;
}

/* ── Chunks — kalıplar ────────────────────────────────────── */
.cumle-chunk-item {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 3px 0;
}
.cumle-chunk-de {
  background: rgba(16,185,129,.15) !important;
  color: #6ee7b7 !important;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}
.cumle-chunk-note {
  font-size: 12.5px;
  color: #e2e8f0 !important;
  font-weight: 600;
}

/* ── Native Voice ─────────────────────────────────────────── */
.cumle-nv-de {
  font-size: 15px;
  font-weight: 700;
  color: #fbbf24 !important;
  margin-bottom: 4px;
}
.cumle-nv-register {
  display: inline-block;
  font-size: 10px;
  color: rgba(255,255,255,.55) !important;
  font-weight: 600;
  background: rgba(255,255,255,.08) !important;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
}
.cumle-nv-note {
  font-size: 12.5px;
  color: #e2e8f0 !important;
  font-weight: 600;
  margin-top: 4px;
}

/* ── Formal variant ───────────────────────────────────────── */
.cumle-formal-de {
  font-size: 14px;
  font-weight: 700;
  color: #93c5fd !important;
  margin-bottom: 4px;
}
.cumle-formal-note {
  font-size: 12.5px;
  color: #e2e8f0 !important;
  font-weight: 600;
}

/* ── Animasyonlar ─────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Cümle soru metni ─────────────────────────────────────── */
.cumle-fc-q-sentence {
  font-size: clamp(16px, 4.5vw, 22px) !important;
  font-weight: 700;
  line-height: 1.4;
}
.cumle-fc-q-label {
  margin-top: 4px;
}

/* ── Timer cumle ──────────────────────────────────────────── */
#cumle-fc-timer {
  position: relative;
  z-index: 1;
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* ── Light mode — SADECE soru kartı bileşenleri ───────────── */
/* Sonuç paneli bölümleri (cumle-res-section) HER ZAMAN koyu  *
 * gradient içinde, light mode'da bile beyaz metin kalmalı.    *
 * Bu yüzden sonuç paneli elementleri için override YOK.       */
body.light .cumle-hint-trigger { color: #7c3aed; background: rgba(139,92,246,.1); border-color: rgba(139,92,246,.25); }
body.light .cumle-hint-bubble { background: rgba(139,92,246,.08); border-color: rgba(139,92,246,.2); color: #1e293b; }
body.light .cumle-hint-bubble-tail { border-top-color: rgba(139,92,246,.2); }
body.light .cumle-hint-bubble-tail::after { border-top-color: rgba(139,92,246,.08); }
body.light .cumle-hint-line { color: #334155; }
body.light .cumle-hint-num { color: #7c3aed; }

/* ---------- Masaüstü CSS Logo Gizleme (Mobil İçin) ---------- */
@media (max-width: 899px) {
  .hp-desktop-logo { display: none; }
}

@keyframes breatheGlow {
  0% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(96,165,250,0.25)); opacity: 0.8; }
  100% { transform: scale(1.05); filter: drop-shadow(0 0 20px rgba(96,165,250,0.6)); opacity: 1; }
}

@keyframes breatheGlowLight {
  0% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(249,115,22,0.3)); opacity: 0.85; }
  100% { transform: scale(1.05); filter: drop-shadow(0 0 22px rgba(249,115,22,0.7)); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════
   Masaüstü Responsive (Grid 2-1-2) Yerleşimi
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 900px) {
  .header-logo-center { display: none !important; }

  #home-panel.visible {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: min-content;
    align-items: start;
    align-content: start;
    gap: 16px;
  }
  
  .home-main-grid,
  .home-right-col {
    display: contents;
  }
  
  /* MASAÜSTÜ LOGO - ORTA SÜTUN */
  .hp-desktop-logo {
    grid-column: 3 / span 1;
    grid-row: 1 / span 5; /* Kilit Çözüm: Logo Row 1'i dikeyde esnetmesin diye tüm satırlara uzatıyoruz */
    width: 100%;
    max-width: 85%;
    margin: 40px auto 0 auto; /* Üstten biraz boşluk bırakarak sarkıttık */
    object-fit: contain;
    align-self: start;
    animation: breatheGlow 3s infinite alternate ease-in-out;
  }
  body.light .hp-desktop-logo {
    animation: breatheGlowLight 3s infinite alternate ease-in-out;
  }
  
  /* ---------- SOL SÜTUN (Col 1-2)  ---------- */
  .hp-profile-row { grid-column: 1 / span 2; grid-row: 1; margin-bottom: 0 !important; align-self: stretch; }
  .welcome-card { grid-column: 1 / span 2; grid-row: 2 / span 5; margin-top: 0 !important; } 

  /* ---------- SAĞ SÜTUN (Col 4-5 İstiflenmiş Bloklar) ---------- */
  .streak-banner { 
    grid-column: 4 / span 2; 
    grid-row: 1; 
    padding: 10px 14px; 
    margin-bottom: 0 !important;
    align-self: stretch;
  }

  /* Daraltılan Özel Paneller - SAGA DAYALI (justify-self: end) */
  #hp-goal-badges-row,
  #hp-hazine-mini-panel,
  #hp-artikel-sor-panel {
    width: 75%;
    justify-self: end; /* SAĞA HİZALANDI */
  }

  #hp-goal-badges-row { 
    grid-column: 4 / span 2; 
    grid-row: 2; 
    gap: 12px;
  }
  
  .goal-badges-row .goal-card {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  #hp-hazine-mini-panel { 
    grid-column: 4 / span 2; 
    grid-row: 3; 
    padding: 10px 16px; 
  }
  
  #hp-artikel-sor-panel { 
    grid-column: 4 / span 2; 
    grid-row: 4; 
    margin-top: 0 !important; 
    padding: 10px 16px; 
  }
  
  /* İstatistikler Paneli (%25 daraltılmadı, 100% genişlik) */
  .stats-box { 
    grid-column: 4 / span 2; 
    grid-row: 5; 
  }
  .stat-boxes-grid {
    gap: 10px; 
  }
  .stat-big-box {
    padding: 10px 14px; 
  }
}

/* ── Legal & Compliance ─────────────────────────────────────────── */
.ai-disclaimer {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  padding: 8px 14px 4px;
  opacity: 0.8;
  font-family: 'Nunito', sans-serif;
  border-top: 1px dashed var(--border2);
  margin-top: 5px;
}

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface-solid);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.1);
  z-index: 1000;
  padding: 14px 20px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
}

.cookie-banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 900px;
  width: 100%;
  justify-content: space-between;
}

.cookie-banner-content p {
  margin: 0;
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
  font-weight: 500;
  flex: 1;
}

.cookie-banner-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.cookie-btn:hover {
  opacity: 0.9;
}

@media (max-width: 600px) {
  .cookie-banner-content {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 12px;
  }
}

.app-global-footer {
  text-align: center;
  padding: 20px 10px 80px; /* Extra bottom padding for mobile nav */
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  background: transparent;
}

.app-global-footer a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.app-global-footer a:hover {
  color: var(--accent);
}

.app-global-footer span {
  opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════════
   Cookie Consent Banner — GDPR / TTDSG §25 uyumlu
   Accept / Reject butonları eşit görsel ağırlıkta (dark pattern yasağı)
   ═══════════════════════════════════════════════════════════════ */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 999;
  background: var(--surface-solid);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  box-shadow: 0 -4px 20px rgba(0,0,0,.2);
}
.cookie-banner-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.cookie-banner-content p {
  flex: 1;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  min-width: 200px;
  margin: 0;
}
.cookie-banner-content p a {
  color: var(--accent);
  text-decoration: underline;
}
.cookie-btn {
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}
.cookie-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(96,165,250,.3);
}
/* Reject button (eşit görsel ağırlık — dark pattern yasağına uyum) */
.cookie-btn-reject {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  color: var(--text2);
}
.cookie-btn-reject:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface2);
  box-shadow: none;
}
@media (max-width: 600px) {
  .cookie-banner-content {
    flex-direction: column;
    text-align: center;
  }
}
