﻿/* ================= Dilkapı ================= */
:root {
  --accent: #e8590c;
  --accent-dark: #c94a06;
  --accent-soft: #fdf0e7;
  --blue: #1c64d1;
  --blue-soft: #eaf1fd;
  --green: #17914b;
  --green-soft: #e8f6ed;
  --red: #c92a2a;
  --red-soft: #fdecec;
  --amber: #b8860b;
  --amber-soft: #fdf5e2;

  --ink: #1f2733;
  --ink-2: #5b6472;
  --ink-3: #8b939f;
  --bg: #f6f6f4;
  --card: #fff;
  --line: #e6e4df;
  --line-2: #d9d6d0;

  --hover: #f2efe9;
  --track: #e9e6e0;
  --card-2: #fffdf9;
  --topbar: rgba(246,246,244,.85);

  --r: 14px;
  --shadow: 0 1px 2px rgba(31,39,51,.05), 0 4px 14px rgba(31,39,51,.045);
  --shadow-lg: 0 3px 6px rgba(31,39,51,.06), 0 12px 28px rgba(31,39,51,.08);
  --font: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

/* Karanlık mod — tema, açılışta JS ile data-theme olarak yazılır */
:root[data-theme="dark"] {
  --accent: #ff8038;
  --accent-dark: #ffa066;
  --accent-soft: #38241a;
  --blue: #74a9f7;
  --blue-soft: #1b2a3d;
  --green: #52c785;
  --green-soft: #16301f;
  --red: #f27272;
  --red-soft: #331a1c;
  --amber: #e3b955;
  --amber-soft: #322810;

  --ink: #e9ebee;
  --ink-2: #a9b1bd;
  --ink-3: #7a8390;
  --bg: #15181d;
  --card: #1d2128;
  --line: #2b303a;
  --line-2: #3c434f;

  --hover: #262b34;
  --track: #2b303a;
  --card-2: #222730;
  --topbar: rgba(21,24,29,.85);

  --shadow: 0 1px 2px rgba(0,0,0,.34), 0 4px 14px rgba(0,0,0,.28);
  --shadow-lg: 0 3px 6px rgba(0,0,0,.4), 0 12px 28px rgba(0,0,0,.34);
  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 15.5px; line-height: 1.55; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
input { font: inherit; }
.ic { flex-shrink: 0; display: block; }
.hidden { display: none !important; }

#app { display: flex; min-height: 100vh; }

/* ---------- Kenar çubuğu ---------- */
#sidebar {
  width: 272px; flex-shrink: 0; background: var(--card);
  border-right: 1px solid var(--line);
  padding: 18px 12px; display: flex; flex-direction: column; gap: 3px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 50;
}
.logo { display: flex; align-items: center; gap: 11px; padding: 4px 10px 18px; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--accent);
  color: #fff; font-weight: 800; font-size: 13.5px; letter-spacing: .5px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.logo-txt { display: flex; flex-direction: column; line-height: 1.25; }
.logo-title { font-weight: 700; font-size: 15px; }
.logo-sub { font-size: 11.5px; color: var(--ink-3); }

.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 9px;
  font-weight: 500; font-size: 14.5px; color: var(--ink-2);
  transition: background .13s, color .13s;
}
.nav-link:hover { background: var(--hover); color: var(--ink); }
.nav-link.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.badge {
  margin-left: auto; background: var(--accent); color: #fff;
  border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; min-width: 19px; text-align: center;
}
.nav-sec { font-size: 11px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color: var(--ink-3); padding: 16px 11px 7px; }
#nav-lessons { display: flex; flex-direction: column; gap: 1px; }
.nav-lesson {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 11px; border-radius: 9px; font-size: 13.5px; color: var(--ink-2);
  transition: background .13s;
}
.nav-lesson:hover { background: var(--hover); }
.nav-lesson.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.nl-num {
  width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  background: hsl(var(--hue) 62% 95%); color: hsl(var(--hue) 55% 34%);
}
.nav-lesson.done .nl-num { background: var(--green-soft); color: var(--green); }
.nav-lesson .nl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nl-state { margin-left: auto; color: var(--green); display: flex; }
.nl-state.small { font-size: 11px; font-weight: 600; color: var(--ink-3); }
.sidebar-foot { margin-top: auto; padding-top: 14px; }
.ghost-btn {
  display: flex; align-items: center; gap: 7px; width: 100%;
  padding: 7px 11px; border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--ink-3);
}
.ghost-btn:hover { background: var(--hover); color: var(--ink); }
.ghost-btn.danger:hover { background: var(--red-soft); color: var(--red); }
.sidebar-foot { display: flex; flex-direction: column; gap: 2px; }

/* ---------- Üst çubuk ---------- */
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#topbar {
  display: flex; align-items: center; gap: 12px; padding: 13px 26px;
  background: var(--topbar); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 40; border-bottom: 1px solid transparent;
}
#topbar.scrolled { border-bottom-color: var(--line); }
#menu-toggle { display: none; }
#topbar-title { font-weight: 700; font-size: 15.5px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips { display: flex; gap: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--card); border: 1px solid var(--line); padding: 4px 11px;
  border-radius: 99px; font-size: 13px; color: var(--ink-2); white-space: nowrap;
}
.chip b { font-weight: 700; color: var(--ink); }
.chip-u { color: var(--ink-3); font-size: 12px; }
#xp-ic { color: var(--amber); display: flex; }
#streak-ic { color: var(--accent); display: flex; }

#view { padding: 6px 26px 60px; max-width: 1040px; width: 100%; margin: 0 auto; }
body.in-flow #view { padding: 0; max-width: 100%; }
body.in-flow #topbar { display: none; }

/* ---------- Ortak ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--accent); color: #fff; padding: 10px 20px; border-radius: 11px;
  font-weight: 600; font-size: 14.5px; transition: background .13s, transform .08s;
}
.btn:hover { filter: brightness(1.09); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.lg { padding: 13px 26px; font-size: 15.5px; border-radius: 12px; }
.btn.sm { padding: 6px 13px; font-size: 13px; border-radius: 9px; }
.btn.green { background: var(--green); }
.btn.red { background: var(--red); }
.btn.ghost { background: var(--card); color: var(--ink-2); border: 1px solid var(--line-2); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }

.tts {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--blue-soft); color: var(--blue); border-radius: 9px;
  width: 32px; height: 32px; flex-shrink: 0; vertical-align: middle;
  transition: background .13s, transform .08s;
}
.tts:hover { filter: brightness(.95); }
.tts:active { transform: scale(.93); }
.tts.speaking { background: var(--blue); color: #fff; }
.tts.lg { width: 42px; height: 42px; border-radius: 12px; }
.tts.xl { width: 74px; height: 74px; border-radius: 22px; }

.sec { font-size: 17px; font-weight: 700; margin: 28px 0 13px; display: flex; align-items: baseline; gap: 9px; }
.sec.first { margin-top: 16px; }
.sec-sub { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.back {
  display: inline-flex; align-items: center; gap: 6px; margin: 14px 0 6px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-3);
}
.back:hover { color: var(--ink); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty-state-ic { width: 62px; height: 62px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.empty-state-ic.ok { background: var(--green-soft); color: var(--green); }
.empty-state .sub { font-size: 13.5px; color: var(--ink-3); }
.spinner { width: 26px; height: 26px; border: 2.5px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.bar { height: 7px; background: var(--track); border-radius: 99px; overflow: hidden; flex: 1; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s ease; }
.bar-lbl { font-size: 12px; font-weight: 500; color: var(--ink-3); white-space: nowrap; }

/* ---------- Ana sayfa ---------- */
.hero {
  background: linear-gradient(135deg, #f2690f, var(--accent) 55%, #c94a06);
  color: #fff; border-radius: 18px; padding: 30px 32px; margin: 14px 0 20px;
  position: relative; overflow: hidden;
}
/* Filigran aktif kursun koduyla değişir (JS --kurs-kod'u yazar).
   Sabit 'NL' idi; Almanca kursunda da dev bir NL duruyordu. */
.hero::after {
  content: var(--kurs-kod, ''); position: absolute; right: 24px; top: 50%; transform: translateY(-50%);
  font-size: 120px; font-weight: 800; opacity: .1; letter-spacing: -4px;
}
.hero-txt { position: relative; max-width: 620px; }
.hero h1 { font-size: 24px; font-weight: 700; margin-bottom: 7px; letter-spacing: -.3px; }
.hero p { opacity: .93; font-size: 14.5px; margin-bottom: 18px; }
/* Hero her iki temada da turuncu kalır, bu yüzden butonu sabit beyaz tutuyoruz */
.hero .btn { background: #fff; color: #c94a06; }
.hero .btn:hover { filter: brightness(.97); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { display: flex; align-items: center; gap: 12px; padding: 15px 17px; }
.stat-ic { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-ic.amber { background: var(--amber-soft); color: var(--amber); }
.stat-ic.orange { background: var(--accent-soft); color: var(--accent); }
.stat-ic.green { background: var(--green-soft); color: var(--green); }
.stat-ic.blue { background: var(--blue-soft); color: var(--blue); }
.stat-val { font-size: 19px; font-weight: 700; line-height: 1.15; }
.stat-lbl { font-size: 12.5px; color: var(--ink-3); }

.week { padding: 17px 19px; margin-bottom: 20px; }
.week-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 13px; font-size: 14px; }
.week-head span { font-size: 12.5px; color: var(--ink-3); }
.week-bars { display: flex; gap: 7px; align-items: flex-end; height: 86px; }
.wb-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.wb-val { font-size: 10.5px; font-weight: 600; color: var(--accent-dark); height: 13px; }
.wb-bar { width: 100%; max-width: 40px; border-radius: 6px 6px 2px 2px; background: var(--accent); min-height: 4px; transition: height .4s ease; }
.wb-bar.zero { background: var(--track); }
.wb-bar.today { background: var(--blue); }
.wb-bar.today.zero { background: var(--blue-soft); }
.wb-lbl { font-size: 11px; font-weight: 500; color: var(--ink-3); }
.wb-lbl.today { color: var(--blue); font-weight: 700; }

.banner { display: flex; align-items: center; gap: 13px; padding: 15px 18px; margin-bottom: 8px; transition: border-color .13s; }
.banner:hover { border-color: var(--line-2); }
.banner-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.banner > div { flex: 1; font-size: 14.5px; }
.banner .sub { font-size: 12.5px; color: var(--ink-3); font-weight: 400; }
.banner > .ic { color: var(--ink-3); }

.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.lesson { padding: 16px 17px; display: flex; flex-direction: column; gap: 9px; transition: transform .13s, box-shadow .13s, border-color .13s; }
.lesson:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 3px 6px rgba(31,39,51,.06), 0 10px 22px rgba(31,39,51,.07); }
.lesson-top { display: flex; align-items: flex-start; gap: 12px; }
.lesson-num {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
  background: hsl(var(--hue) 62% 94%); color: hsl(var(--hue) 55% 33%);
}
.lesson-num.big { width: 52px; height: 52px; border-radius: 15px; font-size: 21px; }
/* Ders numarasının çevresinde ilerleme halkası */
.lesson-ring {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--track) 0);
  transition: background .4s ease;
}
.lesson-ring.full { background: conic-gradient(var(--green) 100%, var(--green) 0); }
.lesson-ring .lesson-num { width: 38px; height: 38px; border-radius: 50%; font-size: 14px; }
.lesson-name { flex: 1; min-width: 0; }
.lesson-name h3 { font-size: 15px; font-weight: 650; line-height: 1.3; }
.nl-sub { font-size: 12.5px; color: var(--ink-3); font-style: italic; }
.done-badge { width: 24px; height: 24px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lesson-desc { font-size: 13.5px; color: var(--ink-2); flex: 1; }
.lesson-foot { display: flex; align-items: center; gap: 10px; }

/* ---------- Ders sayfası ---------- */
.lesson-head { display: flex; align-items: center; gap: 15px; margin: 10px 0 16px; }
.lesson-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.3px; line-height: 1.25; }
.lesson-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }

/* Ünite yolu: sol tarafta kesintisiz bir patika çizgisi */
.unit-path { display: flex; flex-direction: column; gap: 9px; position: relative; }
.unit-path::before {
  content: ''; position: absolute; left: 38px; top: 26px; bottom: 26px;
  width: 2px; background: var(--line); border-radius: 2px; z-index: 0;
}
.unit-path.all-done::before { background: color-mix(in srgb, var(--green) 45%, transparent); }
.unit {
  display: flex; align-items: center; gap: 13px; padding: 15px 17px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); transition: transform .15s, border-color .15s, box-shadow .15s;
  position: relative; z-index: 1;
}
.unit:hover { transform: translateX(3px); border-color: var(--line-2); box-shadow: var(--shadow-lg); }
.unit-ic {
  width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--track); color: var(--ink-3);
  border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--line);
  transition: background .15s, color .15s, box-shadow .15s;
}
.unit.done .unit-ic { background: var(--green-soft); color: var(--green); box-shadow: 0 0 0 1px color-mix(in srgb, var(--green) 40%, transparent); }
.unit.next { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.unit.next .unit-ic { background: var(--accent); color: #fff; box-shadow: 0 0 0 1px var(--accent); }
.unit-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.unit-txt b { font-size: 14.5px; font-weight: 650; }
.unit-txt span { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit-meta { font-size: 12.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.unit.next .unit-meta { color: var(--accent); }
.unit > .ic { color: var(--ink-3); }
.note-card { display: flex; gap: 11px; padding: 15px 17px; margin-top: 18px; font-size: 14px; color: var(--ink-2); align-items: flex-start; }
.note-card .ic { color: var(--green); margin-top: 1px; }
.note-card a { color: var(--blue); font-weight: 600; }

/* ---------- Ünite akışı ---------- */
.flow { min-height: 100vh; display: flex; flex-direction: column; }
.flow-top {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 26px; max-width: 720px; width: 100%; margin: 0 auto;
}
.flow-exit { color: var(--ink-3); display: flex; padding: 4px; border-radius: 8px; }
.flow-exit:hover { background: var(--hover); color: var(--ink); }
.flow-bar { flex: 1; height: 11px; background: var(--track); border-radius: 99px; overflow: hidden; }
.flow-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .35s ease; }
.flow-count { font-size: 12.5px; font-weight: 600; color: var(--ink-3); min-width: 42px; text-align: right; }

.flow-body {
  flex: 1; max-width: 720px; width: 100%; margin: 0 auto; padding: 14px 26px 150px;
  animation: step-in .26s cubic-bezier(.22,.7,.3,1);
}
.flow-body.center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
@keyframes step-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .flow-body, .toast, .finish-ic { animation: none !important; }
  * { transition-duration: .01ms !important; }
}
.step-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--accent-dark); margin-bottom: 10px; }
.step-title { font-size: 21px; font-weight: 700; line-height: 1.35; margin-bottom: 18px; letter-spacing: -.2px; }
.blank { display: inline-block; width: 74px; border-bottom: 3px solid var(--accent); vertical-align: -2px; }

.prompt-box {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 13px;
  padding: 18px 22px; font-size: 20px; font-weight: 650; margin-bottom: 20px; text-align: center;
}
.prompt-box.sub { font-size: 15px; font-weight: 400; color: var(--ink-2); font-style: italic; padding: 12px 18px; }
.prompt-box.sentence { font-size: 17px; font-weight: 500; line-height: 1.45; text-align: center; }
.type-in.wide { font-size: 16px; }
.listen-box { display: flex; flex-direction: column; align-items: center; gap: 11px; margin: 12px 0 26px; }
.listen-box span { font-size: 13px; color: var(--ink-3); }

.opts { display: flex; flex-direction: column; gap: 9px; }
.opt {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--card); border: 1.5px solid var(--line-2); border-radius: 12px;
  padding: 14px 16px; font-size: 15.5px; font-weight: 500;
  transition: border-color .12s, background .12s;
}
.opt:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.opt:disabled { cursor: default; }
.opt-key {
  width: 24px; height: 24px; border-radius: 7px; background: var(--track); color: var(--ink-3);
  display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; flex-shrink: 0;
}
.opt.correct { border-color: var(--green); background: var(--green-soft); }
.opt.correct .opt-key { background: var(--green); color: #fff; }
.opt.wrong { border-color: var(--red); background: var(--red-soft); }
.opt.wrong .opt-key { background: var(--red); color: #fff; }

.type-in {
  width: 100%; border: 1.5px solid var(--line-2); border-radius: 12px;
  background: var(--card); color: var(--ink);
  padding: 14px 17px; font-size: 17px; font-weight: 500; outline: none;
  transition: border-color .12s, background .12s;
}
.type-in::placeholder { color: var(--ink-3); }
.type-in:focus { border-color: var(--accent); }
.type-in.correct { border-color: var(--green); background: var(--green-soft); }
.type-in.wrong { border-color: var(--red); background: var(--red-soft); }
.hint { font-size: 13px; color: var(--ink-3); margin-top: 11px; }
.hint-btn {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px;
  font-size: 13px; font-weight: 500; color: var(--ink-3);
  padding: 6px 12px; border-radius: 9px; border: 1px dashed var(--line-2);
}
.hint-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.hint.mask:not(:empty) {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 18px; letter-spacing: 2px; color: var(--accent-dark);
  margin-top: 12px; padding: 9px 14px; background: var(--accent-soft);
  border-radius: 9px; display: inline-block;
}

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.match-col { display: flex; flex-direction: column; gap: 9px; }
.m-btn {
  background: var(--card); border: 1.5px solid var(--line-2); border-radius: 12px;
  padding: 13px 11px; font-size: 14.5px; font-weight: 500; transition: all .12s;
}
.m-btn:hover:not(.matched) { border-color: var(--accent); }
.m-btn.sel { border-color: var(--blue); background: var(--blue-soft); }
.m-btn.matched { border-color: var(--green); background: var(--green-soft); color: var(--green); opacity: .65; cursor: default; }
.m-btn.shake { border-color: var(--red); background: var(--red-soft); animation: shake .35s; }
@keyframes shake { 0%,100% { transform: translateX(0) } 25% { transform: translateX(-5px) } 75% { transform: translateX(5px) } }

.order-line {
  min-height: 62px; border-bottom: 2px dashed var(--line-2); padding: 10px 4px 14px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 20px;
}
.order-ph { color: var(--ink-3); font-size: 14px; }
.order-pool { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--card); border: 1.5px solid var(--line-2); border-bottom-width: 3px;
  border-radius: 11px; padding: 9px 15px; font-size: 15.5px; font-weight: 500; transition: transform .08s;
}
.chip:hover:not(:disabled) { border-color: var(--accent); }
.chip:active { transform: scale(.96); }

/* Kelime tanıtımı */
.teach { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.teach-word { display: flex; align-items: center; gap: 13px; font-size: 34px; font-weight: 700; color: var(--accent-dark); letter-spacing: -.5px; }
.teach-tr { font-size: 20px; font-weight: 600; margin-bottom: 14px; }
.teach-ex {
  background: var(--card); border: 1px solid var(--line); border-radius: 13px;
  padding: 15px 19px; max-width: 460px;
}
.ex-nl { display: flex; align-items: center; gap: 10px; justify-content: center; font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.ex-tr { font-size: 14px; color: var(--ink-2); }

/* Dilbilgisi kartı */
.grammar { padding: 20px 22px; overflow-x: auto; }
.grammar p { margin-bottom: 11px; }
.grammar p:last-child { margin-bottom: 0; }
.grammar ul { padding-left: 20px; margin: 9px 0; }
.grammar li { margin-bottom: 5px; }
.grammar p.note, .grammar p.warn, .grammar p.key {
  border-left: 3px solid; border-radius: 0 8px 8px 0; padding: 10px 14px; margin: 13px 0; font-size: 14.5px;
}
.grammar p.note { border-color: var(--blue); background: var(--blue-soft); }
.grammar p.warn { border-color: var(--accent); background: var(--accent-soft); }
.grammar p.key { border-color: var(--green); background: var(--green-soft); }
.gtable { border-collapse: collapse; width: 100%; margin: 13px 0; font-size: 14.5px; }
.gtable th { background: var(--track); text-align: left; padding: 8px 12px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.gtable td { border-bottom: 1px solid var(--line); padding: 8px 12px; }
.gtable tr:last-child td { border-bottom: none; }

/* Diyalog */
.dialog { margin-top: 16px; }
.d-line { display: flex; gap: 10px; margin-bottom: 13px; align-items: flex-start; }
.d-av { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #fff; }
.d-line.a .d-av { background: var(--accent); }
.d-line.b .d-av { background: var(--blue); }
.d-bubble { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 3px 13px 13px 13px; padding: 10px 14px; }
.d-who { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .5px; }
.d-nl { font-weight: 600; font-size: 15px; margin-top: 1px; }
.d-tr { font-size: 13.5px; color: var(--ink-2); margin-top: 2px; }

/* Alt geri bildirim çubuğu */
.flow-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  border-top: 1px solid transparent; transform: translateY(100%);
  transition: transform .22s ease, background .18s;
}
.flow-foot.show { transform: translateY(0); background: var(--card); border-top-color: var(--line); }
.flow-foot.ok { background: var(--green-soft); border-top-color: color-mix(in srgb, var(--green) 35%, transparent); }
.flow-foot.no { background: var(--red-soft); border-top-color: color-mix(in srgb, var(--red) 35%, transparent); }
.fb { max-width: 720px; margin: 0 auto; padding: 15px 26px; display: flex; align-items: center; gap: 13px; }
.fb-ic { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; }
.flow-foot.ok .fb-ic { background: var(--green); }
.flow-foot.no .fb-ic { background: var(--red); }
.fb-txt { flex: 1; min-width: 0; font-size: 14.5px; line-height: 1.4; }
.fb-txt b { display: block; font-weight: 700; }
.flow-foot.ok .fb-txt b { color: var(--green); }
.flow-foot.no .fb-txt b { color: var(--red); }
.fb-txt span { display: block; font-size: 13.5px; color: var(--ink-2); }
.fb .btn { flex-shrink: 0; }
@media (max-width: 560px) {
  .fb { flex-wrap: wrap; padding: 13px 16px; }
  .fb-txt { order: 2; width: 100%; }
  .fb .btn { order: 3; width: 100%; }
}

/* Ünite sonu */
.finish { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.finish.standalone { max-width: 480px; margin: 30px auto; }
.finish-ic {
  width: 76px; height: 76px; border-radius: 24px; background: var(--green-soft); color: var(--green);
  display: flex; align-items: center; justify-content: center;
  animation: pop .42s cubic-bezier(.2,1.3,.4,1);
}
@keyframes pop { 0% { transform: scale(.5); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
.finish-ic.warn { background: var(--accent-soft); color: var(--accent); }
.finish h2 { font-size: 23px; font-weight: 700; letter-spacing: -.3px; }
.finish-stats { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.finish-stats > div {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 22px; min-width: 96px; display: flex; flex-direction: column;
}
.finish-stats b { font-size: 21px; font-weight: 700; color: var(--accent-dark); }
.finish-stats span { font-size: 12px; color: var(--ink-3); }
.finish-note { font-size: 14px; color: var(--ink-2); max-width: 420px; }

/* ---------- Ders testi ---------- */
/* Ders sonu ölçme ünitesi mavi ile ayrışır; turuncu "sıradaki ünite" vurgusuyla
   çakışmasın diye kendi rengini taşır. */
.unit.test .unit-ic {
  background: var(--blue-soft); color: var(--blue);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--blue) 35%, transparent);
}
.unit.test .unit-meta { color: var(--blue); }
.unit.test.next { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft), var(--shadow); }
.unit.test.next .unit-ic { background: var(--blue); color: #fff; box-shadow: 0 0 0 1px var(--blue); }
.unit.test.next .unit-meta { color: var(--blue); }
.unit.test.done .unit-ic {
  background: var(--green-soft); color: var(--green);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--green) 40%, transparent);
}
.unit.test.done .unit-meta { color: var(--ink-3); }

.test-intro { display: flex; flex-direction: column; align-items: center; gap: 13px; max-width: 400px; }
.test-intro-ic {
  width: 68px; height: 68px; border-radius: 22px;
  background: var(--blue-soft); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
}
.test-intro h2 { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.test-intro-sub { font-size: 14px; color: var(--ink-2); }
.test-rules {
  list-style: none; display: flex; flex-direction: column; gap: 9px;
  width: 100%; text-align: left; margin-top: 4px;
}
.test-rules li {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  font-size: 13.5px; color: var(--ink-2);
}
.test-rules li .ic { color: var(--blue); }
.test-rules b { color: var(--ink); font-weight: 650; }

.hint.muted { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.hint.muted .ic { color: var(--blue); }

.finish.fail .finish-ic { background: var(--red-soft); color: var(--red); }
.finish.fail .finish-stats b { color: var(--red); }

/* Sertifika */
.cert {
  border: 2px solid var(--accent); border-radius: 18px; padding: 36px 28px; text-align: center;
  background: linear-gradient(160deg, var(--card), var(--accent-soft)); max-width: 520px; margin: 30px auto;
}
.cert-tag { font-size: 11.5px; letter-spacing: 2.5px; text-transform: uppercase; font-weight: 700; color: var(--accent-dark); }
.cert h1 { font-size: 27px; font-weight: 800; margin: 7px 0; letter-spacing: -.4px; }
.cert p { color: var(--ink-2); font-size: 14.5px; }
.cert-score { font-size: 44px; font-weight: 800; color: var(--accent-dark); margin: 12px 0; letter-spacing: -1px; }
.cert-note { margin-top: 14px; font-weight: 600; color: var(--ink) !important; }

/* Sınav girişi */
.exam-intro { text-align: center; padding: 40px 30px; max-width: 560px; margin: 24px auto; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.exam-ic { width: 68px; height: 68px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.exam-intro h1 { font-size: 23px; font-weight: 700; }
.exam-intro p { color: var(--ink-2); font-size: 14.5px; }
.warn-line { color: var(--accent-dark) !important; font-weight: 600; }
.exam-intro .btn { margin-top: 14px; }

/* ---------- Kelime kartları ---------- */
.flash-wrap { max-width: 520px; margin: 26px auto; text-align: center; }
/* Tekrar modu seçici */
.mode-bar {
  display: inline-flex; gap: 3px; padding: 3px; margin-bottom: 18px;
  background: var(--track); border-radius: 11px;
}
.mode {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 15px; border-radius: 9px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  transition: background .13s, color .13s;
}
.mode:hover { color: var(--ink); }
.mode.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }

/* Yazarak tekrar kartı */
.write-card { padding: 28px 24px; display: flex; flex-direction: column; gap: 16px; }
.w-tr { font-size: 25px; font-weight: 700; }
.btn.full { width: 100%; }
.w-fb { display: none; }
.w-fb.show { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.w-fb-txt { display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 15px; }
.w-fb.ok .w-fb-txt { color: var(--green); }
.w-fb.no .w-fb-txt { color: var(--red); }
.w-fb-txt b { font-size: 19px; color: var(--ink); }
.w-ex { font-size: 14px; color: var(--ink); background: var(--track); border-radius: 10px; padding: 11px 14px; }
.w-ex span { color: var(--ink-2); font-size: 13px; }
.flash-info { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-bottom: 14px; }
.flash { perspective: 1200px; cursor: pointer; height: 280px; }
.flash-in { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform .5s; }
.flash.flipped .flash-in { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 26px;
}
.flash-face.back { transform: rotateY(180deg); background: var(--card-2); }
.f-word { font-size: 30px; font-weight: 700; color: var(--accent-dark); letter-spacing: -.4px; }
.f-tr { font-size: 24px; font-weight: 700; }
.f-ex { font-size: 14px; color: var(--ink-2); }
.f-tap { font-size: 12px; color: var(--ink-3); position: absolute; bottom: 15px; }
.boxes { display: flex; gap: 4px; }
.box { width: 8px; height: 8px; border-radius: 50%; background: var(--track); }
.box.on { background: var(--accent); }
.flash-btns { display: flex; gap: 11px; justify-content: center; margin-top: 20px; }
.flash-btns .btn { min-width: 150px; }

/* ---------- Sözlük ---------- */
.search { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1.5px solid var(--line-2); border-radius: 12px; padding: 0 15px; margin-bottom: 16px; }
.search .ic { color: var(--ink-3); }
.search input { flex: 1; border: none; outline: none; padding: 12px 0; font-size: 15px; background: none; color: var(--ink); }
.search input::placeholder { color: var(--ink-3); }
.table-wrap { overflow-x: auto; padding: 4px 8px; }
.dict { width: 100%; border-collapse: collapse; }
.dict th { text-align: left; font-size: 11px; letter-spacing: .7px; text-transform: uppercase; color: var(--ink-3); padding: 9px 12px; border-bottom: 1.5px solid var(--line); font-weight: 700; }
.dict td { padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 14.5px; vertical-align: middle; }
.dict tr:last-child td { border-bottom: none; }
.c-nl { color: var(--accent-dark); font-weight: 650; white-space: nowrap; }
.c-ex { color: var(--ink-2); font-style: italic; font-size: 13.5px; }
.c-les { white-space: nowrap; }
.c-les a { color: var(--blue); font-size: 13px; font-weight: 500; }
.c-none { text-align: center; padding: 34px !important; color: var(--ink-3); }

/* ---------- Bildirim ---------- */
#toast-wrap { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 9px; z-index: 200; }
.toast {
  display: flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--bg); border-radius: 11px; padding: 11px 16px;
  font-weight: 600; font-size: 14px; box-shadow: 0 8px 22px rgba(0,0,0,.22);
  animation: toast-in .25s ease; transition: opacity .4s;
}
.toast .ic { color: var(--amber); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: translateY(0) } }

/* ---------- Mobil ---------- */
#backdrop { display: none; }
@media (max-width: 900px) {
  #sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.18); }
  #sidebar.open { transform: translateX(0); }
  #backdrop.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.32); z-index: 45; }
  #menu-toggle { display: flex; color: var(--ink-2); padding: 3px; }
  #topbar { padding: 12px 16px; }
  #view { padding: 4px 16px 50px; }
  .flow-top, .flow-body { padding-left: 16px; padding-right: 16px; }
  .hero { padding: 24px 20px; }
  .hero::after { font-size: 84px; right: 12px; }
  .hero h1 { font-size: 21px; }
  .step-title { font-size: 19px; }
  .teach-word { font-size: 28px; }
  .prompt-box { font-size: 18px; }
}

/* ================= Hesap: giriş ve kayıt ================= */
#auth { display: none; }
body.auth-mode #app { display: none; }
body.auth-mode #auth {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px; background: var(--bg);
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--card);
  border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-lg); padding: 32px 30px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; margin-bottom: 22px; }
.auth-card h1 { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.auth-sub { font-size: 14px; color: var(--ink-2); margin: 6px 0 22px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field input {
  width: 100%; border: 1.5px solid var(--line-2); border-radius: 11px;
  background: var(--card); color: var(--ink);
  padding: 11px 14px; font-size: 15px; outline: none; transition: border-color .12s;
}
.field input:focus { border-color: var(--accent); }
.field-hint { font-size: 12.5px; color: var(--ink-3); margin: -6px 0 14px; }
.auth-error { color: var(--red); font-size: 13.5px; font-weight: 500; min-height: 20px; margin-bottom: 6px; }
.btn.full { width: 100%; }
.auth-switch { text-align: center; font-size: 13.5px; color: var(--ink-2); margin-top: 18px; }
.linkish { color: var(--accent); font-weight: 600; font-size: inherit; padding: 0; }
.linkish:hover { text-decoration: underline; }

/* Kenar çubuğundaki hesap kutusu */
.acct {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 10px; background: var(--track); margin-bottom: 6px;
}
.acct-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.acct-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-out { color: var(--ink-3); display: flex; padding: 3px; border-radius: 7px; }
.acct-out:hover { background: var(--red-soft); color: var(--red); }
.badge.off { background: var(--track); color: var(--ink-3); font-weight: 600; }

/* ================= Yapay zekâ koçu ================= */
.sec-desc { font-size: 14px; color: var(--ink-2); margin: -6px 0 16px; max-width: 640px; }
.coach-card { padding: 20px 22px; margin-bottom: 8px; }
.coach-empty { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 20px 22px; }
.coach-empty > div { flex: 1; min-width: 200px; }
.coach-empty b { font-size: 15px; }
.coach-empty p { font-size: 13.5px; color: var(--ink-2); margin-top: 2px; }
.coach-ic {
  width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.coach-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.coach-head b { font-size: 15px; display: block; }
.coach-date { font-size: 12.5px; color: var(--ink-3); }
.coach-summary { font-size: 14.5px; line-height: 1.6; margin-bottom: 16px; }

.weak { border-left: 3px solid var(--line-2); padding: 2px 0 2px 13px; margin-bottom: 14px; }
.weak-top { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; flex-wrap: wrap; }
.weak-top b { font-size: 14.5px; }
.sev { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 2px 8px; border-radius: 99px; }
.sev-high { background: var(--red-soft); color: var(--red); }
.sev-mid { background: var(--accent-soft); color: var(--accent-dark); }
.sev-low { background: var(--track); color: var(--ink-2); }
.weak-why { font-size: 13.5px; color: var(--ink-2); margin-bottom: 6px; }
.weak-advice { font-size: 13.5px; display: flex; align-items: flex-start; gap: 7px; color: var(--ink); }
.weak-advice .ic { color: var(--accent); margin-top: 2px; flex-shrink: 0; }
.strong-point {
  display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px;
  background: var(--green-soft); color: var(--ink); border-radius: 10px; padding: 10px 13px; margin: 14px 0;
}
.strong-point .ic { color: var(--green); margin-top: 2px; flex-shrink: 0; }

/* Sohbet */
.chat { padding: 0; overflow: hidden; }
.chat-log { max-height: 460px; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.chat-empty { color: var(--ink-2); font-size: 14px; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip-q {
  background: var(--track); border-radius: 99px; padding: 7px 14px;
  font-size: 13px; font-weight: 500; color: var(--ink-2); text-align: left;
}
.chip-q:hover { background: var(--accent-soft); color: var(--accent-dark); }
.msg { max-width: 88%; }
.msg.me { align-self: flex-end; }
.msg.me .msg-body {
  background: var(--accent); color: #fff; border-radius: 14px 14px 4px 14px;
  padding: 10px 14px; font-size: 14.5px;
}
.msg.coach .msg-body {
  background: var(--track); border-radius: 14px 14px 14px 4px;
  padding: 12px 15px; font-size: 14.5px; line-height: 1.6;
}
.msg-who { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--ink-3); margin-bottom: 4px; }
.msg-who .ic { color: var(--accent); }
.msg-body p { margin-bottom: 8px; }
.msg-body p:last-child { margin-bottom: 0; }
.msg-body ul { padding-left: 20px; margin: 6px 0; }
.msg-body li { margin-bottom: 4px; }
.chat-form { display: flex; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--line); }
.chat-form input {
  flex: 1; border: 1.5px solid var(--line-2); border-radius: 11px;
  background: var(--card); color: var(--ink);
  padding: 11px 15px; font-size: 14.5px; outline: none;
}
.chat-form input:focus { border-color: var(--accent); }
.chat-form input::placeholder { color: var(--ink-3); }
.chat-form .btn { padding: 10px 16px; }
.chat-tools { padding: 0 20px 14px; }

/* Hata listesi */
.mistakes td { font-size: 13.5px; }
.m-kind { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.m-wrong { color: var(--red); }
.m-exp-row td { padding: 0 12px !important; border-bottom: 1px solid var(--line); }

/* Neden yanlış yaptım açıklama kutusu */
.why-box { display: none; }
.why-box.show {
  display: block; max-width: 720px; margin: 0 auto;
  padding: 14px 18px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; font-size: 14px; line-height: 1.6;
  animation: step-in .2s ease;
}
.flow-foot .why-box.show { margin-bottom: 0; border-radius: 12px 12px 0 0; border-bottom: none; }
.why-head { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--accent-dark); margin-bottom: 7px; }
.why-box p { margin-bottom: 8px; }
.why-box p:last-child { margin-bottom: 0; }
.why-box ul { padding-left: 20px; margin: 6px 0; }
.why-err { color: var(--red); font-size: 13.5px; }
.btn.ghost.why-btn { padding: 9px 14px; font-size: 13.5px; }
.spinner.sm { width: 15px; height: 15px; border-width: 2px; display: inline-block; vertical-align: -2px; margin-right: 5px; }

/* Yapay zekâ testi */
.quiz-intro { padding: 20px 22px; }
.quiz-focus { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--ink-2); margin-bottom: 12px; }
.quiz-focus .ic { color: var(--accent); margin-top: 2px; flex-shrink: 0; }
.quiz-score { font-size: 13.5px; color: var(--ink-2); margin-bottom: 14px; }
.quiz-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.quiz-note { font-size: 13px; color: var(--ink-3); margin-top: 12px; }
.stale-tag { font-size: 11.5px; font-weight: 700; background: var(--accent-soft); color: var(--accent-dark); padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.target-tag {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px;
  font-size: 12px; font-weight: 600; color: var(--ink-3);
  background: var(--track); padding: 4px 11px; border-radius: 99px;
}
.target-tag .ic { color: var(--accent); }

.toast.err { background: var(--red); color: #fff; }
.toast.err .ic { color: #fff; }

@media (max-width: 900px) {
  .auth-card { padding: 26px 22px; }
  .chat-log { max-height: 380px; }
  .msg { max-width: 95%; }
}

/* Veri klasörü yazılamadığında ana sayfada gösterilen uyarı */
.storage-warn {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 15px 18px; margin-bottom: 20px;
  border-left: 4px solid var(--red);
  background: var(--red-soft);
}
.storage-warn b { font-size: 14.5px; display: block; margin-bottom: 3px; }
.storage-warn p { font-size: 13.5px; color: var(--ink-2); margin: 0; }
.sw-ic { color: var(--red); flex-shrink: 0; margin-top: 1px; }

/* ---------- Kurs seçimi ---------- */
/* Kurslar kendi renk tonlarını --hue ile taşır; turuncu vurgu tek kursa ait
   olmaktan çıkıp aktif kursun rengine dönüşür. */
#kurs-secici { padding: 0 12px 10px; }
.kurs-secici {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card-2);
  transition: border-color .15s, background .15s;
}
.kurs-secici:hover { border-color: var(--line-2); background: var(--hover); }
.kurs-ic {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: hsl(var(--hue, 24) 70% 50% / .14); color: hsl(var(--hue, 24) 70% 42%);
}
:root[data-theme="dark"] .kurs-ic { color: hsl(var(--hue, 24) 75% 68%); }
.kurs-ic.lg { width: 44px; height: 44px; border-radius: 14px; }
.kurs-ad { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.kurs-ad b { font-size: 13.5px; font-weight: 650; }
.kurs-ad span { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kurs-secici > .ic { color: var(--ink-3); }

.kurs-liste { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.kurs-kart {
  display: flex; flex-direction: column; gap: 11px; padding: 18px;
  text-align: left; width: 100%; cursor: pointer;
  border: 1px solid var(--line); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.kurs-kart:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.kurs-kart.aktif { border-color: hsl(var(--hue, 24) 70% 50%); box-shadow: 0 0 0 3px hsl(var(--hue, 24) 70% 50% / .13), var(--shadow); }
.kurs-kart-ust { display: flex; align-items: center; gap: 12px; }
.kurs-kart-ad { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kurs-kart-ad b { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.kurs-kart-ad span { font-size: 12.5px; color: var(--ink-3); }
.kurs-aktif {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  color: var(--green); background: var(--green-soft); padding: 4px 9px; border-radius: 99px;
}
.kurs-aciklama { font-size: 13.5px; color: var(--ink-2); }
.kurs-etiketler { display: flex; flex-wrap: wrap; gap: 6px; }
.kurs-etiketler span {
  font-size: 11.5px; font-weight: 600; color: var(--ink-3);
  background: var(--track); padding: 4px 9px; border-radius: 7px;
}
.kurs-etiketler .vurgu { color: hsl(var(--hue, 24) 70% 40%); background: hsl(var(--hue, 24) 70% 50% / .13); }
:root[data-theme="dark"] .kurs-etiketler .vurgu { color: hsl(var(--hue, 24) 75% 70%); }
.lesson-progress.sade { margin: 0; }

/* ---------- Seviye belirleme ---------- */
.secim-liste { display: flex; flex-direction: column; gap: 12px; margin: 4px 0 20px; }
.secim {
  display: flex; align-items: center; gap: 14px; padding: 17px; width: 100%;
  text-align: left; cursor: pointer; border: 1px solid var(--line);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.secim:hover { transform: translateX(3px); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.secim > div { flex: 1; min-width: 0; }
.secim b { display: block; font-size: 15.5px; font-weight: 650; margin-bottom: 3px; }
.secim p { font-size: 13px; color: var(--ink-2); }
.secim > .ic { color: var(--ink-3); }
.secim-ic {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue-soft); color: var(--blue);
}
.secim-ic.alt { background: var(--green-soft); color: var(--green); }

.seviye-tablo { display: flex; flex-direction: column; gap: 9px; padding: 17px; }
.seviye-tablo > b { font-size: 14px; margin-bottom: 3px; }
.seviye-satir { display: flex; align-items: center; gap: 12px; }
.seviye-satir > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.seviye-satir b { font-size: 13.5px; font-weight: 650; }
.seviye-satir span { font-size: 12px; color: var(--ink-3); }
.seviye-kod {
  width: 38px; text-align: center; font-size: 12px; font-weight: 700;
  color: var(--blue); background: var(--blue-soft); padding: 5px 0; border-radius: 8px; flex-shrink: 0;
}
.seviye-ders { font-size: 12px; color: var(--ink-3); white-space: nowrap; }

.seviye-dagilim { display: flex; flex-direction: column; gap: 7px; width: 100%; max-width: 340px; margin-top: 6px; }
.sd-satir { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-3); }
.sd-satir > span:first-child { width: 26px; font-weight: 700; color: var(--ink-2); }
.sd-satir .bar { flex: 1; height: 7px; background: var(--track); border-radius: 99px; overflow: hidden; }
.sd-satir .bar span { display: block; height: 100%; background: var(--ink-3); border-radius: 99px; }
.sd-satir.gecti .bar span { background: var(--green); }
.sd-satir.gecti > span:first-child { color: var(--green); }

/* ---------- Çalışma modu ---------- */
.mod-liste { display: flex; flex-direction: column; gap: 13px; margin-top: 4px; }
.mod-kart {
  display: flex; flex-direction: column; gap: 10px; padding: 18px; width: 100%;
  text-align: left; cursor: pointer; border: 1px solid var(--line);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.mod-kart:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.mod-kart.secili { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.mod-ust { display: flex; align-items: center; gap: 12px; }
.mod-ic {
  width: 40px; height: 40px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--track); color: var(--ink-3);
}
.mod-ic.gevsek { background: var(--green-soft); color: var(--green); }
.mod-ic.orta { background: var(--accent-soft); color: var(--accent); }
.mod-ic.siki { background: var(--red-soft); color: var(--red); }
.mod-ad { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mod-ad b { font-size: 16.5px; font-weight: 700; letter-spacing: -.2px; }
.mod-ad span { font-size: 12.5px; color: var(--ink-3); }
.mod-aciklama { font-size: 13.5px; color: var(--ink-2); }
.mod-satirlar { display: flex; flex-wrap: wrap; gap: 6px; }
.mod-satirlar span {
  font-size: 11.5px; color: var(--ink-3); background: var(--track);
  padding: 4px 9px; border-radius: 7px;
}
.mod-satirlar b { color: var(--ink); font-weight: 650; }
.mod-kime { font-size: 12px; color: var(--ink-3); font-style: italic; }

/* ---------- Zorlandığın kelimeler ---------- */
.zk-liste { padding: 8px 0; margin-bottom: 14px; }
.zk-baslik {
  display: flex; align-items: center; gap: 8px; padding: 8px 17px 12px;
  font-size: 13px; font-weight: 650; color: var(--ink-2);
}
.zk-baslik .ic { color: var(--accent); }
.zk-satir {
  display: flex; align-items: center; gap: 12px; padding: 10px 17px;
  border-top: 1px solid var(--line);
}
.zk-kelime { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.zk-kelime b { font-size: 14.5px; font-weight: 650; }
.zk-kelime span { font-size: 12.5px; color: var(--ink-3); }
.zk-satir.zor .zk-kelime b { color: var(--red); }
.zk-sayi {
  font-size: 11.5px; font-weight: 650; color: var(--ink-3);
  background: var(--track); padding: 4px 9px; border-radius: 7px; white-space: nowrap;
}
.zk-satir.zor .zk-sayi { background: var(--red-soft); color: var(--red); }
.zk-ders { font-size: 12px; color: var(--blue); font-weight: 600; white-space: nowrap; }
.btn.full { width: 100%; justify-content: center; }

/* ---------- Ünitede oturmayan kelimeler ---------- */
.oturmayan { padding: 15px 17px; margin-top: 6px; text-align: left; max-width: 420px; display: flex; flex-direction: column; gap: 9px; }
.oturmayan-bas { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 650; }
.oturmayan-bas .ic { color: var(--accent); }
.oturmayan p { font-size: 12.5px; color: var(--ink-3); }
.oturmayan-liste { display: flex; flex-wrap: wrap; gap: 6px; }
.oturmayan-liste span {
  font-size: 12px; background: var(--track); padding: 4px 9px; border-radius: 7px; color: var(--ink-2);
}
.oturmayan-liste b { color: var(--red); font-weight: 650; }
.btn.ghost.sm { align-self: flex-start; font-size: 12.5px; padding: 6px 12px; }

/* ---------- Seviye grupları (ana sayfa) ---------- */
.seviye-grup { padding: 17px; margin-bottom: 14px; }
.seviye-grup.aktif { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.seviye-grup.kilitli { background: var(--card-2); }

.sg-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sg-kod {
  width: 44px; text-align: center; font-size: 13px; font-weight: 800; letter-spacing: .3px;
  color: var(--blue); background: var(--blue-soft); padding: 7px 0; border-radius: 9px; flex-shrink: 0;
}
.seviye-grup.aktif .sg-kod { color: var(--accent); background: var(--accent-soft); }
.seviye-grup.kilitli .sg-kod { color: var(--ink-3); background: var(--track); }
.sg-ad { flex: 1; min-width: 140px; display: flex; flex-direction: column; }
.sg-ad b { font-size: 15.5px; font-weight: 700; letter-spacing: -.2px; }
.sg-ad span { font-size: 12.5px; color: var(--ink-3); }
.sg-ilerleme { display: flex; align-items: center; gap: 10px; flex-basis: 100%; }
.sg-rozet {
  font-size: 11.5px; font-weight: 650; padding: 5px 10px; border-radius: 99px;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  background: var(--track); color: var(--ink-3);
}
.sg-rozet.aktif { background: var(--accent-soft); color: var(--accent-dark); }
.sg-rozet.gecti { background: var(--green-soft); color: var(--green); }
.sg-rozet.kilitli { background: var(--track); color: var(--ink-3); }
.sg-not {
  display: flex; align-items: center; gap: 8px; margin-top: 13px;
  font-size: 13px; color: var(--ink-3);
}
.sg-not .ic { flex-shrink: 0; }
.sg-not.gecti { color: var(--green); }
.seviye-grup .sg-sinav { margin: 14px 0 0; }
.seviye-grup.kilitli .sg-not { margin-top: 0; }

/* ---------- Kenar çubuğunda seviye başlıkları ---------- */
.nav-seviye {
  display: flex; align-items: center; gap: 8px; padding: 14px 11px 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  color: var(--ink-3);
}
.nav-seviye.aktif { color: var(--accent-dark); }
.nav-seviye.kilitli { opacity: .65; }
.ns-kod {
  background: var(--track); color: var(--ink-2); border-radius: 6px;
  padding: 2px 6px; font-size: 10.5px; letter-spacing: .4px;
}
.nav-seviye.aktif .ns-kod { background: var(--accent-soft); color: var(--accent-dark); }
.ns-ad { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 11.5px; }
.ns-say { font-size: 10.5px; font-weight: 600; letter-spacing: 0; }
.ns-kilit { display: flex; color: var(--ink-3); }

/* ---------- Seviye bitirme sınavı ---------- */
.sinav-durum { display: flex; gap: 14px; padding: 18px; align-items: flex-start; margin-bottom: 16px; }
.sinav-durum.acik { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.sinav-ic {
  width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--track); color: var(--ink-3);
}
.sinav-durum.acik .sinav-ic { background: var(--accent-soft); color: var(--accent); }
.sinav-govde { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.sinav-govde > b { font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.sinav-govde p { font-size: 13.5px; color: var(--ink-2); }
.sinav-kurallar { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 3px; }
.sinav-kurallar li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.sinav-kurallar .ic { color: var(--green); flex-shrink: 0; }
.sinav-uyari { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--accent-dark); }
.sinav-uyari .ic { flex-shrink: 0; }
.sinav-durum .secim-liste { margin: 0; }

/* ---------- Telefona kurulum ve çevrimdışı (PWA) ---------- */
.kurulum {
  border: 1px solid var(--line); border-radius: 11px; background: var(--card-2);
  padding: 11px 12px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 7px;
}
.kurulum-ust { display: flex; align-items: center; gap: 8px; }
.kurulum-ust b { flex: 1; font-size: 13px; font-weight: 650; }
.kurulum-ic {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.kurulum-kapat {
  display: flex; color: var(--ink-3); padding: 3px; border-radius: 6px; flex-shrink: 0;
}
.kurulum-kapat:hover { background: var(--hover); color: var(--ink-2); }
.kurulum p { font-size: 12px; color: var(--ink-3); line-height: 1.45; }
.kurulum b { color: var(--ink-2); }
.btn.sm { font-size: 13px; padding: 7px 13px; }

#cevrimdisi {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 80;
  display: flex; align-items: center; gap: 8px; max-width: min(440px, calc(100vw - 28px));
  padding: 10px 15px; border-radius: 11px;
  background: var(--red-soft); color: var(--red);
  border: 1px solid var(--red); box-shadow: var(--shadow-lg);
  font-size: 12.5px; font-weight: 550; line-height: 1.4;
}
#cevrimdisi .ic { flex-shrink: 0; }

/* ---------- Çentikli ekranlar (tam ekran kurulu uygulama) ---------- */
@media (max-width: 900px) {
  #topbar { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  #sidebar { padding-top: env(safe-area-inset-top, 0px); }
  #view { padding-bottom: calc(50px + env(safe-area-inset-bottom, 0px)); }
  .flow-foot { padding-bottom: calc(env(safe-area-inset-bottom, 0px)); }
  body.auth-mode #auth { padding-top: calc(24px + env(safe-area-inset-top, 0px)); }
}

/* ---------- Yazım düzeltme adımı ---------- */
.yazim-kutu {
  display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 460px;
  margin: 4px 0 14px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--card-2);
}
.yazim-satir { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.yazim-satir > span {
  font-size: 11.5px; font-weight: 650; letter-spacing: .3px; text-transform: uppercase;
  color: var(--ink-3); width: 68px; flex-shrink: 0;
}
.yazim-satir b { font-weight: 700; }
.yazim-satir.yanlis b { color: var(--red); text-decoration: line-through; text-decoration-thickness: 2px; }
.yazim-satir.dogru b { color: var(--green); }
.yazim-kutu p { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.fb-txt .yanlis-yazim { color: var(--red); text-decoration: line-through; }

/* ---------- Yeni sürüm bildirimi ---------- */
.surum-kutu {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 85;
  display: flex; align-items: center; gap: 10px;
  max-width: min(420px, calc(100vw - 28px));
  padding: 10px 12px 10px 15px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--accent);
  box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 550;
}
.surum-kutu > span { flex: 1; }
.surum-kutu > .ic { color: var(--accent); flex-shrink: 0; }
.surum-kapat { display: flex; color: var(--ink-3); padding: 4px; border-radius: 6px; flex-shrink: 0; }
.surum-kapat:hover { background: var(--hover); color: var(--ink-2); }

/* ---------- Kelime bankası ---------- */
.paket-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.paket-kart { display: flex; flex-direction: column; gap: 5px; padding: 13px 14px; transition: border-color .13s, transform .13s; }
.paket-kart:hover { border-color: var(--line-2); transform: translateY(-1px); }
.paket-kart.tamam { background: var(--card-2); }
.pk-ust { display: flex; align-items: center; gap: 8px; }
.pk-ust b { flex: 1; font-size: 14px; font-weight: 650; }
.pk-sayi { font-size: 11.5px; font-weight: 650; color: var(--ink-3); background: var(--track); padding: 2px 8px; border-radius: 99px; }
.pk-aciklama { font-size: 12.5px; color: var(--ink-2); }
.pk-ornek { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-paket { color: var(--blue); }
.sg-paket:hover span { text-decoration: underline; }
.sg-paket b { font-weight: 700; }

/* ---------- Okuma sorusu metni ---------- */
.okuma-metni {
  width: 100%; max-width: 560px; margin: 2px 0 12px; padding: 13px 15px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px;
  background: var(--card-2); font-size: 15px; line-height: 1.6; white-space: pre-line;
}
