/* =========================================================
   LGS Quiz – tasarım sistemi
   ========================================================= */

:root {
  /* Sweet tema: krem zemin, turuncu, yeşil, çikolata kahvesi yazı */
  --bg: #fdf3e7;
  --surface: #fffaf4;
  --surface-2: #fbe8d3;
  --surface-3: #f4d8b9;
  --border: #f1dcc4;
  --text: #4a230c;
  --muted: #9a6a48;

  --primary: #ef8a43;
  --primary-2: #f7a965;
  --primary-soft: #fde6cf;
  --primary-ink: #c0601d;
  --primary-shade: #d2702c;

  --correct: #2b9a68;
  --correct-shade: #1f7a51;
  --correct-soft: #e2f3e9;
  --correct-ink: #1b6b46;
  --wrong: #e2574a;
  --wrong-shade: #b8402f;
  --wrong-soft: #fde4de;
  --wrong-ink: #a3352a;
  --empty: #b89b84;
  --mid: #d8860f;
  --mid-soft: #fff0d6;

  --streak: #f27a2e;
  --streak-soft: #ffe9d6;
  --streak-ink: #bd5212;
  --gold: #f5b301;

  --note: #fff6df;
  --note-border: #f2dfa8;

  --opt-a: #ef8a43;
  --opt-b: #2b9a68;
  --opt-c: #e0a21b;
  --opt-d: #e2574a;

  --radius: 22px;
  --radius-sm: 14px;
  --shadow-sm: 0 1px 2px rgba(74, 35, 12, .05);
  --shadow: 0 1px 2px rgba(74, 35, 12, .04), 0 10px 28px rgba(140, 72, 24, .08);
  --shadow-lg: 0 14px 40px rgba(140, 72, 24, .16);
  --font: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Baloo 2", "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}

/* Tema her zaman açık renk: cihaz karanlık modda olsa da krem/turuncu tasarım kullanılır */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 800; letter-spacing: -.005em; font-family: var(--font-display); }
p { margin: 0; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }

.ic { width: 20px; height: 20px; flex: 0 0 auto; }

/* =========================================================
   Üst bar ve alt sekme çubuğu
   ========================================================= */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.logo { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; }
.logo b { font-weight: 900; color: var(--primary); }
.logo-mark {
  width: 34px; height: 34px; border-radius: 11px; display: inline-grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-weight: 900; font-size: 18px; box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 40%, transparent);
}
.logo-mark.lg { width: 64px; height: 64px; border-radius: 20px; font-size: 32px; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 11px; border: none; background: none;
  color: var(--muted); font-weight: 700; font-size: 15px; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--primary-soft); color: var(--primary-ink); }
.nav .ic { width: 18px; height: 18px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px; margin-left: 8px;
  padding: 4px 4px 4px 4px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border);
}
.user-chip .name { font-weight: 700; font-size: 14px; padding-right: 4px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff;
  font-weight: 800; font-size: 13px; flex: 0 0 auto;
}
.icon-btn {
  width: 32px; height: 32px; border-radius: 50%; border: none; background: transparent;
  display: grid; place-items: center; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn .ic { width: 18px; height: 18px; }

.tabbar { display: none; }

@media (max-width: 720px) {
  .nav .nav-links, .user-chip .name { display: none; }
  .user-chip { margin-left: 0; }
  .tabbar:not([hidden]) {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px;
    font-size: 11px; white-space: nowrap; font-weight: 700; color: var(--muted); border-radius: 12px;
  }
  .tabbar a .ic { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--primary); background: var(--primary-soft); }
  body.has-tabbar .container { padding-bottom: 96px; }
}

/* =========================================================
   Genel yerleşim ve bileşenler
   ========================================================= */

.container { max-width: 1080px; margin: 0 auto; padding: 28px 16px 72px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 30px; font-weight: 900; }
.page-head p { color: var(--muted); margin-top: 6px; font-size: 16px; }
.crumbs { color: var(--muted); font-size: 14px; font-weight: 600; margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a:hover { color: var(--primary); }
.crumbs .sep { opacity: .5; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.section-title { font-size: 20px; font-weight: 800; margin: 34px 0 14px; display: flex; align-items: center; gap: 10px; }
.section-title .link { margin-left: auto; font-size: 14px; color: var(--primary); font-weight: 700; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 13px; border: 1px solid transparent;
  font-weight: 800; font-size: 15px; letter-spacing: .01em;
  background: var(--primary); color: #fff;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--primary) 60%, #000), 0 6px 16px color-mix(in srgb, var(--primary) 25%, transparent);
  transition: transform .08s, box-shadow .08s, filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--primary) 60%, #000); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn .ic { width: 18px; height: 18px; }
.btn.secondary {
  background: var(--surface); color: var(--text); border-color: var(--border);
  box-shadow: 0 2px 0 var(--surface-3);
}
.btn.secondary:hover { background: var(--surface-2); filter: none; }
.btn.secondary:active { box-shadow: none; }
.btn.danger { background: var(--surface); color: var(--wrong); border-color: color-mix(in srgb, var(--wrong) 30%, var(--border)); box-shadow: none; }
.btn.danger:hover { background: var(--wrong-soft); filter: none; }
.btn.light { background: #fff; color: var(--primary-ink); box-shadow: 0 3px 0 rgba(0, 0, 0, .15); }
.btn.success { background: var(--correct); box-shadow: 0 3px 0 color-mix(in srgb, var(--correct) 60%, #000); }
.btn.sm { padding: 7px 13px; font-size: 14px; border-radius: 10px; box-shadow: none; }
.btn.lg { padding: 14px 26px; font-size: 17px; border-radius: 15px; }
.btn.block { width: 100%; }

input[type=text], input[type=password], textarea, select {
  width: 100%; padding: 12px 14px; border: 2px solid var(--border); border-radius: 12px;
  font: inherit; font-weight: 600; background: var(--surface); color: var(--text); transition: border-color .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); font-weight: 500; opacity: .8; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
textarea { resize: vertical; min-height: 84px; }
label { font-weight: 800; font-size: 14px; display: block; margin-bottom: 6px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px;
  font-size: 13px; font-weight: 800; background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.badge.good { background: var(--correct-soft); color: var(--correct-ink); }
.badge.mid { background: var(--mid-soft); color: var(--mid); }
.badge.bad { background: var(--wrong-soft); color: var(--wrong-ink); }
.subject-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 800; white-space: nowrap;
  color: var(--c, var(--primary));
  background: color-mix(in srgb, var(--c, var(--primary)) 14%, transparent);
}
.points-cell { font-weight: 800; color: var(--primary-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .big {
  width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center;
  font-size: 40px; background: var(--surface-2);
}
.empty-state h3 { color: var(--text); font-size: 19px; margin-bottom: 6px; }
.empty-state .btn { margin-top: 18px; }

/* İskelet yükleme */
.skeleton { display: grid; gap: 16px; }
.sk { border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* =========================================================
   Giriş
   ========================================================= */

.login, .login-wrap { max-width: 460px; margin: 40px auto; }
.login-card { text-align: center; padding: 34px 28px; }
.login-card h1 { font-size: 28px; font-weight: 900; margin: 16px 0 8px; }
.login-card form { text-align: left; margin-top: 24px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.feature { background: var(--surface-2); border-radius: 14px; padding: 12px 8px; }
.feature .e { font-size: 24px; display: block; }
.feature b { display: block; font-size: 13px; margin-top: 4px; }
.feature span { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; }
.login-wrap h1 { font-size: 26px; font-weight: 900; margin-bottom: 6px; }
.login-foot { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }
.login-foot a { color: var(--primary); font-weight: 800; }

/* =========================================================
   Ana sayfa
   ========================================================= */

.eyebrow { font-size: 14px; font-weight: 800; opacity: .85; text-transform: uppercase; letter-spacing: .06em; }
.sc-icon {
  width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 28px;
  background: color-mix(in srgb, var(--c) 15%, transparent);
}
.progress { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 16px; }
.progress > span { display: block; height: 100%; background: var(--c, var(--primary)); border-radius: 99px; transition: width .6s ease; }

/* Deneme listesi */
.attempt-list { display: flex; flex-direction: column; gap: 10px; }
.attempt {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm);
  transition: border-color .15s, transform .15s;
}
.attempt:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); transform: translateX(2px); }
.att-score {
  width: 54px; height: 54px; border-radius: 15px; flex: 0 0 auto; display: grid; place-items: center;
  font-weight: 900; font-size: 15px; background: var(--surface-2); color: var(--muted);
}
.att-score.good { background: var(--correct-soft); color: var(--correct-ink); }
.att-score.mid { background: var(--mid-soft); color: var(--mid); }
.att-score.bad { background: var(--wrong-soft); color: var(--wrong-ink); }
.att-main { flex: 1; min-width: 0; }
.att-title { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-sub { font-size: 13px; color: var(--muted); font-weight: 600; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.att-dyb { display: flex; gap: 6px; font-size: 13px; font-weight: 800; }
.att-dyb span { padding: 3px 8px; border-radius: 8px; }
.att-dyb .d { background: var(--correct-soft); color: var(--correct-ink); }
.att-dyb .y { background: var(--wrong-soft); color: var(--wrong-ink); }
.att-dyb .b { background: var(--surface-2); color: var(--muted); }
.att-points { font-weight: 900; color: var(--primary-ink); min-width: 74px; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .att-dyb { display: none; }
  .attempt { gap: 12px; padding: 12px; }
  .att-score { width: 46px; height: 46px; font-size: 14px; }
}

/* =========================================================
   Ders sayfası
   ========================================================= */

.subject-hero {
  --c: var(--primary);
  border-radius: 22px; padding: 24px; margin-bottom: 22px; display: flex; gap: 18px; align-items: center;
  background: color-mix(in srgb, var(--c) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c) 25%, var(--border));
}
.subject-hero .sc-icon { width: 72px; height: 72px; font-size: 38px; border-radius: 20px; background: color-mix(in srgb, var(--c) 18%, transparent); }
.subject-hero h1 { font-size: 30px; font-weight: 900; }
.subject-hero .progress { max-width: 340px; margin-top: 12px; }
.subject-hero .info { flex: 1; min-width: 0; }

.topic { padding: 0; overflow: hidden; }
.topic-head { padding: 16px 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); }
.topic-num {
  width: 34px; height: 34px; border-radius: 11px; flex: 0 0 auto; display: grid; place-items: center;
  font-weight: 900; background: color-mix(in srgb, var(--c, var(--primary)) 15%, transparent); color: var(--c, var(--primary));
}
.topic-head h3 { font-size: 17px; }
.test-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); transition: background .15s; }
.test-row:last-child { border-bottom: none; }
.test-row:hover { background: var(--surface-2); }
.test-status {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.test-status.done { background: var(--correct-soft); color: var(--correct); }
.test-status .ic { width: 18px; height: 18px; }
.test-row .name { font-weight: 800; }
.test-row .meta { font-size: 13px; color: var(--muted); font-weight: 600; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.test-row .info { flex: 1; min-width: 0; }
@media (max-width: 560px) { .test-row { flex-wrap: wrap; } .test-row .btn { margin-left: 52px; } }

/* =========================================================
   Test çözme
   ========================================================= */

body.quiz-mode .nav { display: none; }
.quiz { max-width: 820px; margin: 0 auto; }
.quiz-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.quiz-top .icon-btn { width: 40px; height: 40px; background: var(--surface); border: 1px solid var(--border); }
.quiz-title { flex: 1; min-width: 0; }
.quiz-title b { display: block; font-size: 17px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quiz-title .muted { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.chips { display: flex; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--border); font-weight: 800; font-size: 15px;
  font-variant-numeric: tabular-nums; white-space: nowrap; position: relative;
}
.chip.points { background: var(--primary-soft); border-color: transparent; color: var(--primary-ink); }
.chip.streak { color: var(--muted); }
.chip.streak.hot { background: var(--streak-soft); border-color: transparent; color: var(--streak-ink); }
.chip.streak.hot .fl { display: inline-block; animation: flicker 1.2s infinite; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.15) rotate(3deg); } }
@media (max-width: 560px) {
  .quiz-top { flex-wrap: wrap; }
  .chips { width: 100%; order: 3; }
  .chip { flex: 1; justify-content: center; }
}

.segments { display: flex; gap: 5px; margin-bottom: 16px; }
.seg {
  flex: 1; height: 10px; border-radius: 99px; border: none; padding: 0; background: var(--surface-3);
  transition: background .2s, transform .15s; position: relative;
}
.seg:hover { transform: scaleY(1.4); }
.seg.right { background: var(--correct); }
.seg.bad { background: var(--wrong); }
.seg.current { outline: 2px solid var(--primary); outline-offset: 2px; }

.q-card { padding: 26px; }
.q-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.q-num { font-weight: 900; font-size: 15px; color: var(--primary-ink); background: var(--primary-soft); padding: 4px 12px; border-radius: 99px; }
.q-num span { opacity: .6; }
.hint-chip { font-size: 13px; font-weight: 700; color: var(--muted); }
.hint-chip.hot { color: var(--streak-ink); }
.question-text { font-size: 20px; font-weight: 700; white-space: pre-line; margin-bottom: 22px; line-height: 1.5; }
.question-img { max-width: 100%; border-radius: 14px; margin: -8px 0 20px; border: 1px solid var(--border); display: block; }

.options { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .options.two { grid-template-columns: 1fr 1fr; } }
.option {
  --o: var(--opt-a);
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px 16px; border-radius: 16px; background: var(--surface);
  border: 2px solid var(--border); box-shadow: 0 3px 0 var(--surface-3);
  font-weight: 700; font-size: 16px; color: var(--text);
  transition: border-color .12s, background .12s, transform .08s, box-shadow .08s, opacity .2s;
}
.option[data-letter="B"] { --o: var(--opt-b); }
.option[data-letter="C"] { --o: var(--opt-c); }
.option[data-letter="D"] { --o: var(--opt-d); }
.option:not(:disabled):not(.static):hover { border-color: var(--o); background: color-mix(in srgb, var(--o) 7%, var(--surface)); }
.option:not(:disabled):not(.static):active { transform: translateY(2px); box-shadow: 0 1px 0 var(--surface-3); }
.option .letter {
  flex: 0 0 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 900; color: #fff; background: var(--o); font-size: 16px;
}
.option .opt-text { flex: 1; }
.option .mark { width: 26px; height: 26px; border-radius: 50%; display: none; place-items: center; color: #fff; flex: 0 0 auto; }
.option .mark .ic { width: 16px; height: 16px; stroke-width: 3; }
.option.selected { border-color: var(--o); background: color-mix(in srgb, var(--o) 10%, var(--surface)); }
.option.is-correct { border-color: var(--correct); background: var(--correct-soft); box-shadow: 0 3px 0 color-mix(in srgb, var(--correct) 35%, transparent); }
.option.is-correct .letter { background: var(--correct); }
.option.is-correct .mark { display: grid; background: var(--correct); }
.option.is-wrong { border-color: var(--wrong); background: var(--wrong-soft); box-shadow: 0 3px 0 color-mix(in srgb, var(--wrong) 30%, transparent); }
.option.is-wrong .letter { background: var(--wrong); }
.option.is-wrong .mark { display: grid; background: var(--wrong); }
.option.dim { opacity: .45; }
.option.static, .option:disabled { cursor: default; }
.option.shake { animation: shake .45s; }
.option.bounce { animation: bounce .5s; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes bounce { 0% { transform: scale(1); } 40% { transform: scale(1.03); } 100% { transform: scale(1); } }
.your-answer { font-size: 12px; font-weight: 800; color: var(--muted); white-space: nowrap; }

.feedback { margin-top: 20px; border-radius: 18px; padding: 16px 18px; border: 2px solid; }
.feedback.ok { background: var(--correct-soft); border-color: color-mix(in srgb, var(--correct) 45%, transparent); }
.feedback.no { background: var(--wrong-soft); border-color: color-mix(in srgb, var(--wrong) 40%, transparent); }
.fb-head { display: flex; align-items: center; gap: 12px; }
.fb-icon { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: 0 0 auto; }
.fb-icon .ic { width: 24px; height: 24px; stroke-width: 3; }
.feedback.ok .fb-icon { background: var(--correct); }
.feedback.no .fb-icon { background: var(--wrong); }
.fb-title { font-size: 19px; font-weight: 900; }
.feedback.ok .fb-title { color: var(--correct-ink); }
.feedback.no .fb-title { color: var(--wrong-ink); }
.fb-sub { font-size: 14px; font-weight: 700; color: var(--muted); }
.gain { margin-left: auto; font-size: 26px; font-weight: 900; color: var(--correct-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.feedback.no .gain { color: var(--wrong-ink); opacity: .7; }
.point-lines { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pl {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px;
  background: var(--surface); font-size: 14px; font-weight: 700; color: var(--text);
}
.pl.streak { background: var(--streak-soft); color: var(--streak-ink); }
.explain {
  margin-top: 14px; padding: 12px 14px; border-radius: 13px; font-size: 15px; font-weight: 600;
  background: var(--note); border: 1px solid var(--note-border); color: var(--text);
}
.feedback.pop { animation: pop .35s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes pop { 0% { transform: translateY(10px) scale(.97); opacity: 0; } 100% { transform: none; opacity: 1; } }
.streak-flash {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 6px 14px; border-radius: 99px;
  background: linear-gradient(90deg, #f97316, #f43f5e); color: #fff; font-weight: 900; font-size: 15px;
  animation: zoomIn .45s cubic-bezier(.2, .9, .3, 1.4);
}
@keyframes zoomIn { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.float-points {
  position: absolute; right: 8px; top: -6px; font-weight: 900; font-size: 16px; color: var(--correct);
  pointer-events: none; animation: floatUp 1.1s ease-out forwards; white-space: nowrap;
}
@keyframes floatUp { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-34px); opacity: 0; } }

.quiz-nav { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
@media (max-width: 720px) {
  .quiz-nav {
    position: sticky; bottom: 0; z-index: 5; margin: 14px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
  }
  .quiz-nav .btn { padding: 11px 14px; }
  .q-card { padding: 20px; }
  .question-text { font-size: 18px; }
}
.kbd-hint { text-align: center; margin-top: 14px; font-size: 13px; color: var(--muted); font-weight: 600; }
.kbd { display: inline-block; min-width: 22px; padding: 1px 6px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); border-bottom-width: 2px; font-size: 12px; font-weight: 800; }
@media (hover: none) { .kbd-hint { display: none; } }

/* =========================================================
   Sonuç
   ========================================================= */

.result-hero {
  position: relative; overflow: hidden; border-radius: 26px; padding: 30px; color: #fff;
  display: flex; gap: 28px; align-items: center; flex-wrap: wrap;
  background: linear-gradient(130deg, var(--primary), var(--primary-2));
  box-shadow: 0 14px 40px color-mix(in srgb, var(--primary) 30%, transparent);
}
.result-hero.good { background: linear-gradient(130deg, #059669, #10b981 55%, #34d399); box-shadow: 0 14px 40px rgba(16, 185, 129, .3); }
.result-hero.mid { background: linear-gradient(130deg, #ea580c, #f59e0b); box-shadow: 0 14px 40px rgba(245, 158, 11, .3); }
.result-hero::after { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; right: -80px; top: -120px; background: rgba(255, 255, 255, .1); }
.result-hero > * { position: relative; z-index: 1; }
.score-ring {
  --p: 0; width: 132px; height: 132px; border-radius: 50%; flex: 0 0 auto;
  background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, .25) 0);
  display: grid; place-items: center;
}
.score-ring > div {
  width: 106px; height: 106px; border-radius: 50%; display: grid; place-items: center; text-align: center;
  background: rgba(0, 0, 0, .12); backdrop-filter: blur(4px); font-size: 30px; font-weight: 900; line-height: 1;
}
.score-ring small { display: block; font-size: 12px; font-weight: 700; opacity: .85; margin-top: 4px; }
.rh-main { flex: 1; min-width: 240px; }
.rh-main h1 { font-size: 28px; font-weight: 900; margin: 4px 0 12px; }
.big-points { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.big-points b { font-size: 44px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.big-points span { font-weight: 700; opacity: .85; }
.rh-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.rh-chips span { padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, .18); font-weight: 800; font-size: 14px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { padding: 16px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); text-align: center; box-shadow: var(--shadow-sm); }
.card .stat { background: var(--surface-2); border: none; box-shadow: none; }
.stat .e { font-size: 20px; display: block; margin-bottom: 2px; }
.stat b { display: block; font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat span { font-size: 13px; color: var(--muted); font-weight: 700; }
.stat.c b { color: var(--correct); }
.stat.w b { color: var(--wrong); }
.stat.p b { color: var(--primary-ink); }
.stat.s b { color: var(--streak); }
.result-stats { margin: 16px 0; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }

.review-q { border-left: 6px solid var(--empty); }
.review-q.correct { border-left-color: var(--correct); }
.review-q.wrong { border-left-color: var(--wrong); }
.review-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.review-q .question-text { font-size: 17px; margin-bottom: 16px; }
.review-q .option { padding: 11px 14px; font-size: 15px; box-shadow: none; }
.review-q .option .letter { flex-basis: 32px; height: 32px; border-radius: 10px; font-size: 14px; }
.status-pill { padding: 3px 11px; border-radius: 99px; font-size: 13px; font-weight: 900; }
.status-pill.correct { background: var(--correct-soft); color: var(--correct-ink); }
.status-pill.wrong { background: var(--wrong-soft); color: var(--wrong-ink); }
.status-pill.empty { background: var(--surface-2); color: var(--muted); }
.meta-pill { font-size: 13px; font-weight: 800; color: var(--muted); }
.meta-pill.streak { color: var(--streak-ink); }
.meta-pill.points { color: var(--primary-ink); }

.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button {
  padding: 7px 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface);
  font-weight: 800; font-size: 14px; color: var(--muted); transition: all .15s;
}
.filters button:hover { color: var(--text); }
.filters button.on { background: var(--text); color: var(--surface); border-color: var(--text); }

/* Konfeti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i {
  position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; opacity: .95;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
@media (prefers-reduced-motion: reduce) {
  .confetti { display: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =========================================================
   Tablo (öğretmen paneli)
   ========================================================= */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); }
tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }

/* =========================================================
   Öğretmen paneli
   ========================================================= */

.tabs { display: flex; gap: 4px; margin-bottom: 20px; padding: 4px; background: var(--surface-2); border-radius: 14px; width: fit-content; max-width: 100%; }
.tabs button { padding: 9px 18px; border: none; background: none; font-weight: 800; color: var(--muted); border-radius: 11px; }
.tabs button.on { background: var(--surface); color: var(--primary-ink); box-shadow: var(--shadow-sm); }
.admin-cols { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
@media (max-width: 820px) { .admin-cols { grid-template-columns: 1fr; } }
.tree { padding: 10px; position: sticky; top: 76px; }
@media (max-width: 820px) { .tree { position: static; } }
.tree-subject { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
.tree-subject:last-of-type { border-bottom: none; }
.tree-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; font-size: 15px;
  width: 100%; border: none; background: none; text-align: left; color: var(--text); font-weight: 600;
}
.tree-item:hover { background: var(--surface-2); }
.tree-item.on { background: var(--primary-soft); color: var(--primary-ink); font-weight: 800; }
.tree-item.subject { font-weight: 900; }
.tree-item.topic-i { padding-left: 22px; font-weight: 700; }
.tree-item.test-i { padding-left: 40px; font-size: 14px; }
.tree-add { padding: 4px 10px 4px 40px; font-size: 13px; font-weight: 800; color: var(--primary); border: none; background: none; }
.tree-add:hover { text-decoration: underline; }
.tree-add.topic-add { padding-left: 22px; }
.q-admin { display: flex; gap: 14px; align-items: flex-start; }
.q-admin .num {
  flex: 0 0 32px; height: 32px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-ink);
  display: grid; place-items: center; font-weight: 900;
}
.q-admin .body { flex: 1; min-width: 0; font-weight: 600; }
.q-admin .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; font-size: 14px; margin-top: 10px; color: var(--muted); }
@media (max-width: 560px) { .q-admin { flex-wrap: wrap; } .q-admin .opts { grid-template-columns: 1fr; } }
.q-admin .opts .ok { color: var(--correct); font-weight: 900; }
.opt-input { display: flex; gap: 8px; align-items: center; }
.opt-input .radio {
  flex: 0 0 42px; height: 42px; border-radius: 12px; border: 2px solid var(--border); background: var(--surface);
  font-weight: 900; color: var(--muted); transition: all .15s;
}
.opt-input .radio:hover { border-color: var(--correct); }
.opt-input .radio.on { background: var(--correct); border-color: var(--correct); color: #fff; }

/* =========================================================
   Bildirim ve pencere
   ========================================================= */

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--surface); padding: 12px 20px; border-radius: 14px; font-weight: 800;
  box-shadow: var(--shadow-lg); z-index: 100; max-width: calc(100% - 32px); animation: toastIn .25s ease-out;
}
.toast.error { background: var(--wrong); color: #fff; }
body.has-tabbar .toast { bottom: 96px; }
@keyframes toastIn { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

.modal-bg {
  position: fixed; inset: 0; background: rgba(12, 15, 30, .5); display: grid; place-items: center;
  z-index: 50; padding: 16px; animation: fadeIn .15s;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.modal {
  background: var(--surface); border-radius: 22px; padding: 26px; width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg); animation: pop .25s cubic-bezier(.2, .9, .3, 1.3); border: 1px solid var(--border);
}
.modal .m-icon { font-size: 36px; margin-bottom: 6px; }
.modal h3 { margin-bottom: 8px; font-size: 21px; }
.modal p { color: var(--muted); margin: 0 0 20px; font-weight: 600; }
.modal .row { justify-content: flex-end; }
@keyframes fadeIn { from { opacity: 0; } }

/* =========================================================
   v3: deneme, gelişim, sıralama, kendi kayıtlar
   ========================================================= */

/* Orta genişlikte menü sadece ikon */
@media (min-width: 721px) and (max-width: 1000px) {
  .nav .nav-links a span { display: none; }
  .nav .nav-links a { padding: 9px 11px; }
}

input[type=number], input[type=date] {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
}
input[type=number]:focus, input[type=date]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }

.tabs a { padding: 9px 18px; font-weight: 800; color: var(--muted); border-radius: 11px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.on { background: var(--surface); color: var(--primary-ink); box-shadow: var(--shadow-sm); }
.tabs { overflow-x: auto; }
@media (max-width: 560px) { .tabs a { padding: 9px 12px; font-size: 14px; } }

.page-head.with-action { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head.with-action > div { flex: 1; min-width: 240px; }

.mode-tag { display: inline-block; font-size: 11px; font-weight: 900; padding: 2px 8px; border-radius: 99px; vertical-align: 2px; margin-left: 4px; }
.mode-tag.exam { background: var(--primary-soft); color: var(--primary-ink); }
.mode-tag.practice { background: var(--wrong-soft); color: var(--wrong-ink); }

.icon-btn.danger:hover { background: var(--wrong-soft); color: var(--wrong); }

/* Ana sayfa kısayolları */
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
@media (max-width: 900px) { .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.quick-tile {
  display: flex; align-items: center; gap: 12px; padding: 14px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm);
  color: var(--text); font: inherit; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.quick-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--c) 40%, var(--border)); }
.qt-icon {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; flex: 0 0 auto;
  background: color-mix(in srgb, var(--c) 14%, transparent);
}
.quick-tile b { display: block; font-weight: 900; font-size: 15px; line-height: 1.2; }
.quick-tile span:not(.qt-icon) { display: block; font-size: 13px; color: var(--muted); font-weight: 700; margin-top: 2px; }
@media (max-width: 420px) { .quick-tile { padding: 12px 10px; gap: 9px; } .qt-icon { width: 38px; height: 38px; font-size: 19px; } .quick-tile b { font-size: 14px; } }

/* Soru üstündeki ders / konu etiketi (karışık testlerde) */
.q-context { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 12px; font-size: 13px; font-weight: 700; color: var(--muted); }

/* Deneme sınavı ekranı */
.seg.answered { background: var(--primary); }
.seg.gap { margin-left: 8px; }
.chip.countdown { font-variant-numeric: tabular-nums; }
.chip.countdown.warn { background: var(--mid-soft); color: var(--mid); border-color: transparent; }
.chip.countdown.low { background: var(--wrong); color: #fff; border-color: transparent; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .65; } }
.section-start {
  margin: -2px 0 14px; padding: 9px 14px; border-radius: 12px; font-size: 14px; font-weight: 700;
  background: var(--primary-soft); color: var(--primary-ink);
}
.exam-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

/* Deneme kurulumu */
.exam-setup { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 820px) { .exam-setup { grid-template-columns: 1fr; } }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.pick {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; text-align: left;
  border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.pick .pk-icon { font-size: 22px; }
.pick .pk-main { flex: 1; min-width: 0; }
.pick b { display: block; font-weight: 800; font-size: 15px; }
.pick small { color: var(--muted); font-weight: 700; }
.pick .pk-check {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  border: 2px solid var(--border); color: transparent;
}
.pick .pk-check .ic { width: 14px; height: 14px; }
.pick.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, var(--surface)); }
.pick.on .pk-check { background: var(--c); border-color: var(--c); color: #fff; }
.choice { display: flex; gap: 6px; flex-wrap: wrap; }
.choice button {
  padding: 10px 18px; border-radius: 12px; border: 2px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 800; cursor: pointer; min-width: 64px;
}
.choice button.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.exam-summary { display: flex; flex-direction: column; gap: 14px; }
.es-big { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.es-big div { text-align: center; padding: 16px 8px; border-radius: 14px; background: var(--surface-2); }
.es-big b { display: block; font-size: 34px; font-weight: 900; line-height: 1.1; color: var(--primary-ink); }
.es-big span { font-weight: 800; color: var(--muted); font-size: 13px; }
.rules { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; font-size: 14px; font-weight: 600; }
.rules li { padding-left: 24px; position: relative; }
.rules li::before { content: '✓'; position: absolute; left: 4px; color: var(--correct); font-weight: 900; }

/* Sonuç: ders ders tablo */
.break-table td.d { color: var(--correct-ink); font-weight: 800; }
.break-table td.y { color: var(--wrong-ink); font-weight: 800; }
.break-table td.b { color: var(--muted); font-weight: 800; }
.break-table tr:last-child td { border-bottom: none; }
.card.table-wrap { overflow: hidden; overflow-x: auto; }
.meta-pill.minus { color: var(--wrong-ink); }

/* Konu analizi */
.insights { display: grid; gap: 10px; }
.ins { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 15px; font-weight: 600; }
.ins > span { font-size: 20px; line-height: 1.2; }
.ins.good { background: var(--correct-soft); color: var(--correct-ink); }
.ins.bad { background: var(--wrong-soft); color: var(--wrong-ink); }
.an-subject .an-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.an-subject .an-head h3 { font-size: 18px; font-weight: 900; }
.an-subject .sc-icon { width: 40px; height: 40px; font-size: 20px; }
.an-list { display: grid; }
.an-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--border); }
.card.an-list > .an-row:first-child, .an-head + .an-list > .an-row:first-child { border-top: none; }
.an-name { font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.an-bar { height: 9px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 8px 0 6px; }
.an-bar span { display: block; height: 100%; border-radius: 99px; background: var(--empty); transition: width .6s ease; }
.an-bar.good span { background: var(--correct); }
.an-bar.mid span { background: var(--mid); }
.an-bar.bad span { background: var(--wrong); }
.an-meta { font-size: 13px; color: var(--muted); font-weight: 700; }
.an-pct { font-size: 20px; font-weight: 900; min-width: 56px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.an-pct.good { color: var(--correct-ink); }
.an-pct.mid { color: var(--mid); }
.an-pct.bad { color: var(--wrong-ink); }
.an-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 640px) {
  .an-row { grid-template-columns: minmax(0, 1fr) auto; }
  .an-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .an-actions:empty { display: none; }
}

/* Kendi çözdüklerim */
.manual-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 820px) { .manual-cols { grid-template-columns: 1fr; } }
.man-form h3, .man-summary h3 { font-size: 18px; font-weight: 900; }
.form-grid { display: grid; gap: 12px; margin-bottom: 12px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 560px) { .form-grid.two { grid-template-columns: 1fr; } .form-grid.four { grid-template-columns: 1fr 1fr; } }
label.lc { color: var(--correct-ink); }
label.lw { color: var(--wrong-ink); }
.calc {
  display: grid; place-items: center; height: 47px; border-radius: var(--radius-sm); font-weight: 900; font-size: 18px;
  background: var(--surface-2); color: var(--muted); border: 1.5px dashed var(--border);
}
.calc.err { color: var(--wrong); border-color: var(--wrong); }
.man-preview { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; min-height: 8px; font-size: 14px; font-weight: 700; }
.man-preview span { padding: 4px 10px; border-radius: 99px; background: var(--surface-2); }
.man-preview .d { background: var(--correct-soft); color: var(--correct-ink); }
.man-preview .y { background: var(--wrong-soft); color: var(--wrong-ink); }
.man-preview .err { background: var(--wrong-soft); color: var(--wrong-ink); }
.ms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.ms-grid div { padding: 12px 8px; border-radius: 12px; text-align: center; background: var(--surface-2); }
.ms-grid b { display: block; font-size: 24px; font-weight: 900; }
.ms-grid span { font-size: 13px; font-weight: 700; color: var(--muted); }
.ms-grid .d b { color: var(--correct-ink); }
.ms-grid .y b { color: var(--wrong-ink); }
.ms-net { margin-top: 12px; text-align: center; font-weight: 700; color: var(--muted); }
.ms-net b { color: var(--text); }
.man-item .att-points { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* Sıralama */
.lb-me { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border: none; }
.lb-me-rank { font-size: 36px; font-weight: 900; line-height: 1; }
.lb-me b { display: block; font-size: 17px; font-weight: 900; }
.lb-me span { font-size: 14px; font-weight: 700; opacity: .9; }
.lb-list { padding: 6px; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; }
.lb-row + .lb-row { margin-top: 2px; }
.lb-row.me { background: var(--primary-soft); }
.lb-rank { width: 34px; text-align: center; font-weight: 900; font-size: 17px; color: var(--muted); flex: 0 0 auto; }
.lb-row.top .lb-rank { font-size: 26px; }
.lb-main { flex: 1; min-width: 0; }
.lb-main b { display: block; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-main span { font-size: 13px; color: var(--muted); font-weight: 700; }
.lb-points { font-weight: 900; font-size: 18px; color: var(--primary-ink); font-variant-numeric: tabular-nums; }
.me-tag { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--primary); color: #fff; vertical-align: 2px; margin-left: 4px; }
.lb-gap { text-align: center; color: var(--muted); font-weight: 900; padding: 2px; }

/* Öğretmen: öğrenciler */
.dyb-cell { display: inline-flex; gap: 4px; font-weight: 800; font-size: 13px; }
.dyb-cell span { padding: 2px 7px; border-radius: 7px; min-width: 26px; text-align: center; }
.dyb-cell .d { background: var(--correct-soft); color: var(--correct-ink); }
.dyb-cell .y { background: var(--wrong-soft); color: var(--wrong-ink); }
.dyb-cell .b { background: var(--surface-2); color: var(--muted); }
.student-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.student-head h2 { font-size: 22px; font-weight: 900; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.split-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.split-stats > div { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 4px; }
.split-stats b { font-size: 18px; font-weight: 900; }
@media (max-width: 640px) { .split-stats { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .tabs:has(> a) { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
  .tabs a { padding: 8px 6px; font-size: 13px; text-align: center; white-space: normal; line-height: 1.25; display: grid; place-items: center; }
}

/* ---------- Evren (yapay zekâ ile test oluşturma) ---------- */
.evren-hero {
  display: flex; gap: 16px; align-items: center; margin-bottom: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, var(--surface, #fff)), color-mix(in srgb, var(--primary-2) 16%, var(--surface, #fff)));
  border-color: color-mix(in srgb, var(--primary) 25%, var(--border));
}
.evren-hero h2 { font-size: 20px; font-weight: 900; }
.evren-hero p { color: var(--muted); margin-top: 4px; font-weight: 600; }
.evren-avatar {
  flex: none; width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 28px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 40%, transparent);
}
.evren-avatar.spin { animation: evren-pulse 1.4s ease-in-out infinite; }
@keyframes evren-pulse { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.08) rotate(12deg); } }
@media (prefers-reduced-motion: reduce) { .evren-avatar.spin { animation: none; } }
.evren-provider {
  display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 800;
  background: var(--primary-soft); color: var(--primary-ink);
}

.evren-setup { margin-bottom: 16px; border: 2px dashed color-mix(in srgb, var(--primary) 40%, var(--border)); }
.evren-setup h3 { font-size: 17px; font-weight: 900; margin-bottom: 6px; }
.evren-setup p { color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.evren-setup ol { margin: 0 0 14px 20px; display: grid; gap: 8px; font-weight: 600; }
.evren-setup code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.evren-setup pre {
  margin: 6px 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1px solid var(--border); font-size: 13px; overflow-x: auto; white-space: pre;
}

.evren-form { margin-bottom: 20px; }
.evren-form textarea { width: 100%; }
.evren-source { margin-top: 4px; }
.evren-source summary { cursor: pointer; font-weight: 800; padding: 6px 0; list-style-position: inside; }
.evren-source textarea { margin-top: 8px; }

.evren-wait { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.evren-wait b { display: block; font-size: 16px; }

.evren-q { transition: opacity .15s; }
.evren-q.off { opacity: .55; }
.evren-q textarea { width: 100%; }
.evren-q .opt-input input { flex: 1; }
.evren-check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; margin: 0; }
.evren-check input { width: 18px; height: 18px; accent-color: var(--primary); }

.evren-save { margin-top: 16px; position: sticky; bottom: 12px; box-shadow: 0 10px 30px rgba(20, 24, 60, .14); }
.evren-radio { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-weight: 700; margin: 0; }
.evren-radio input { accent-color: var(--primary); }
@media (max-width: 560px) {
  .evren-hero { flex-direction: column; align-items: flex-start; }
  .evren-save { position: static; }
}

/* =========================================================
   Sweet tema – krem, turuncu, yeşil (son katman: üstteki kuralları yumuşatır)
   ========================================================= */

body {
  background:
    radial-gradient(900px 500px at 110% -10%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 60%),
    radial-gradient(700px 500px at -20% 110%, color-mix(in srgb, var(--primary-2) 12%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
.topbar { background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom-color: transparent; box-shadow: 0 1px 0 var(--border); }
.logo { font-family: var(--font-display); font-size: 21px; }
.logo-mark { border-radius: 12px; font-family: var(--font-display); box-shadow: 0 3px 0 var(--primary-shade); }
.card { border-color: transparent; }
.btn { font-family: var(--font-display); font-size: 16px; border-radius: 16px; box-shadow: 0 4px 0 var(--primary-shade); }
.btn:active { box-shadow: 0 1px 0 var(--primary-shade); }
.btn.success { box-shadow: 0 4px 0 var(--correct-shade); }
.btn.secondary { background: var(--surface); box-shadow: 0 3px 0 var(--surface-3); border-color: var(--border); }
.btn.danger, .btn.sm { box-shadow: none; }
.page-head h1, .section-title, .mini-title { font-family: var(--font-display); }
.section-title { font-weight: 800; }

/* ----- Ana sayfa ----- */
.home { max-width: 760px; margin: 0 auto; }
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 6px 0 20px; }
.welcome h1 { font-size: 34px; font-weight: 800; }
.welcome h1 .wave { display: inline-block; transform-origin: 70% 80%; animation: wave 2.4s ease-in-out 1; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(16deg); } 20%, 40% { transform: rotate(-8deg); } }
.welcome p { font-size: 18px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.welcome-avatar {
  flex: 0 0 auto; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 28px; font-weight: 800; color: #fff;
  background: radial-gradient(circle at 35% 30%, var(--primary-2), var(--primary));
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 18%, transparent), 0 8px 20px color-mix(in srgb, var(--primary) 30%, transparent);
  transition: transform .2s;
}
.welcome-avatar:hover { transform: rotate(-6deg) scale(1.04); }

.stat-banner {
  display: grid; grid-template-columns: repeat(3, 1fr); border-radius: 26px; padding: 18px 8px;
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 80%, var(--primary-2)));
  color: #fff; box-shadow: 0 6px 0 var(--primary-shade), 0 16px 34px color-mix(in srgb, var(--primary) 28%, transparent);
}
.sb-item { display: flex; align-items: center; gap: 12px; padding: 4px 16px; min-width: 0; }
.sb-item + .sb-item { border-left: 2px solid rgba(255, 255, 255, .22); }
.sb-ic {
  width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; flex: 0 0 auto;
  background: rgba(255, 255, 255, .9); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .08);
}
.sb-item b { display: block; font-family: var(--font-display); font-size: 26px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sb-item small { display: block; font-size: 13px; font-weight: 700; opacity: .9; white-space: nowrap; }
a.sb-item:hover .sb-ic { transform: scale(1.06); }
.sb-ic { transition: transform .15s; }

.mini-title { font-size: 18px; font-weight: 700; margin: 28px 0 12px; display: flex; align-items: center; gap: 8px; }
.mini-title .link { margin-left: auto; font-family: var(--font); font-size: 14px; color: var(--primary-ink); font-weight: 800; }

.daily-card {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 18px; padding: 20px 22px;
  border-radius: 26px; color: #fff;
  background: linear-gradient(135deg, var(--correct), color-mix(in srgb, var(--correct) 82%, #000));
  box-shadow: 0 6px 0 var(--correct-shade), 0 16px 34px color-mix(in srgb, var(--correct) 26%, transparent);
  transition: transform .15s;
}
.daily-card:hover { transform: translateY(-2px); }
.dc-ring {
  flex: 0 0 auto; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 26px;
  background: rgba(255, 255, 255, .14); border: 4px solid rgba(255, 255, 255, .25); border-left-color: var(--note-border);
}
.dc-main { flex: 1; min-width: 0; position: relative; z-index: 1; }
.dc-main b { display: block; font-family: var(--font-display); font-size: 24px; font-weight: 800; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-main > span:not(.dc-tag) { display: block; font-size: 15px; font-weight: 600; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-tag { display: inline-block; font-size: 12px; font-weight: 800; padding: 2px 10px; border-radius: 99px; background: rgba(255, 255, 255, .2); margin-bottom: 4px; }
.dc-arrow { position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .18); }
.dc-deco { position: absolute; right: 70px; bottom: -6px; font-size: 34px; letter-spacing: -8px; opacity: .12; pointer-events: none; }

.home .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.quick-tile { border-radius: 20px; border-color: transparent; background: var(--surface-2); box-shadow: none; }
.quick-tile:hover { box-shadow: var(--shadow); border-color: transparent; }
.qt-icon { background: var(--surface); border-radius: 14px; }
.quick-tile b { font-family: var(--font-display); font-weight: 700; font-size: 16px; }

.subject-list { display: flex; flex-direction: column; gap: 12px; }
.subject-row {
  --c: var(--primary);
  display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 22px;
  background: var(--surface-2); transition: transform .15s, box-shadow .15s;
}
.subject-row:hover { transform: translateX(3px); box-shadow: var(--shadow); }
.sr-badge {
  flex: 0 0 auto; width: 62px; height: 62px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--surface); box-shadow: 0 2px 0 var(--surface-3);
}
.sr-badge .e { font-size: 26px; line-height: 1; }
.sr-badge small { font-size: 12px; font-weight: 800; color: var(--c); margin-top: 3px; }
.sr-main { flex: 1; min-width: 0; }
.sr-main b { display: block; font-family: var(--font-display); font-size: 21px; font-weight: 700; line-height: 1.2; }
.sr-main > span { display: block; font-size: 15px; font-weight: 600; color: var(--muted); }
.sr-main .progress { height: 6px; margin-top: 8px; background: color-mix(in srgb, var(--c) 14%, var(--surface)); max-width: 260px; }
.sr-arrow { color: var(--text); flex: 0 0 auto; }
.sr-arrow .ic { width: 22px; height: 22px; stroke-width: 2.6; }

.attempt { border-color: transparent; border-radius: 20px; }

/* ----- Günlük plan ----- */
.stat-banner + .daily-card, .stat-banner + .plan-card, .daily-card + .plan-card { margin-top: 20px; }
.sb-item.cold .sb-ic { filter: grayscale(1); opacity: .7; }
.plan-card {
  border-radius: 26px; padding: 20px; background: var(--surface);
  border: 2px solid var(--surface-2); box-shadow: 0 5px 0 var(--surface-3);
}
.plan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.plan-head h2 { font-size: 21px; font-weight: 800; }
.plan-head p { color: var(--muted); font-weight: 700; font-size: 14.5px; margin-top: 2px; }
.plan-count {
  flex: 0 0 auto; font-family: var(--font-display); font-weight: 800; font-size: 18px; padding: 4px 14px; border-radius: 99px;
  background: var(--primary-soft); color: var(--primary-ink);
}
.plan-count.all { background: var(--correct-soft); color: var(--correct-ink); }
.plan-tasks { display: flex; flex-direction: column; gap: 10px; }
.plan-task {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 18px; text-align: left;
  background: var(--surface-2); border: none; color: inherit; font: inherit; cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.plan-task:hover { transform: translateX(3px); box-shadow: var(--shadow); }
.pt-check {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 2.5px solid var(--surface-3); background: var(--surface); color: #fff;
}
.pt-check .ic { width: 15px; height: 15px; stroke-width: 3.2; }
.plan-task.done .pt-check { background: var(--correct); border-color: var(--correct); animation: check-pop .35s ease; }
.plan-task.done .pt-main b { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--muted); }
.pt-icon {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px;
  background: color-mix(in srgb, var(--c) 14%, var(--surface));
}
.pt-main { flex: 1; min-width: 0; }
.pt-main b { display: block; font-family: var(--font-display); font-size: 17px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-main > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-main .pt-reason { color: var(--primary-ink); font-weight: 800; font-size: 12.5px; white-space: normal; }
.plan-task.done .pt-reason { color: var(--correct-ink); }
.pt-arrow { flex: 0 0 auto; color: var(--muted); }
.pt-arrow .ic { width: 20px; height: 20px; }
.plan-done { margin-top: 12px; text-align: center; font-weight: 800; color: var(--correct-ink); }
.plan-streak { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 2px dashed var(--surface-3); }
.week-dots { display: flex; gap: 6px; }
.week-dots span {
  width: 34px; height: 40px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  background: var(--surface-2); font-size: 15px; line-height: 1; padding-bottom: 4px; gap: 2px;
}
.week-dots span small { font-size: 10.5px; font-weight: 800; color: var(--muted); }
.week-dots span.on { background: color-mix(in srgb, var(--primary) 18%, var(--surface)); }
.week-dots span.today { box-shadow: inset 0 0 0 2px var(--primary); }
@keyframes check-pop { 0% { transform: scale(.6); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* ----- Rozetler ----- */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.badge {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px 12px; border-radius: 20px;
  background: var(--surface-2); border: none; font: inherit; color: var(--muted); cursor: pointer; text-align: center;
  transition: transform .15s;
}
.badge:hover { transform: translateY(-2px); }
.bd-emoji { font-size: 32px; line-height: 1; filter: grayscale(1); opacity: .45; }
.badge b { font-family: var(--font-display); font-size: 14px; font-weight: 700; line-height: 1.15; }
.badge small { font-size: 11.5px; font-weight: 800; color: var(--correct-ink); }
.badge.earned { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--text); box-shadow: 0 4px 0 color-mix(in srgb, var(--primary) 22%, var(--surface-3)); }
.badge.earned .bd-emoji { filter: none; opacity: 1; }
.bd-bar { width: 70%; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 2px; }
.bd-bar span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
@media (max-width: 560px) {
  .plan-card { padding: 16px; }
  .week-dots span { width: 30px; }
  .badge-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .welcome h1 { font-size: 27px; }
  .welcome p { font-size: 16px; }
  .welcome-avatar { width: 62px; height: 62px; font-size: 23px; }
  .stat-banner { padding: 14px 2px; border-radius: 22px; }
  .sb-item { flex-direction: column; text-align: center; gap: 6px; padding: 2px 6px; }
  .sb-ic { width: 40px; height: 40px; font-size: 21px; }
  .sb-item b { font-size: 21px; }
  .sb-item small { font-size: 11.5px; }
  .daily-card { padding: 16px; gap: 14px; }
  .dc-ring { width: 52px; height: 52px; font-size: 22px; }
  .dc-main b { font-size: 20px; }
  .home .quick { grid-template-columns: 1fr; gap: 10px; }
  .subject-row { padding: 14px; gap: 14px; }
  .sr-badge { width: 54px; height: 54px; }
  .sr-main b { font-size: 19px; }
}

/* ----- Test ekranı ----- */
body.quiz-mode { background: var(--bg); }
body.quiz-mode::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(420px 300px at 95% 20%, color-mix(in srgb, var(--primary) 13%, transparent), transparent 70%),
    radial-gradient(520px 360px at 0% 85%, color-mix(in srgb, var(--primary-2) 15%, transparent), transparent 70%);
}
.quiz { max-width: 640px; }
.quiz-top .icon-btn { background: transparent; border: none; color: var(--text); }
.quiz-top .icon-btn .ic { width: 22px; height: 22px; stroke-width: 2.6; }
.quiz-title { text-align: center; }
.quiz-title b { font-family: var(--font-display); font-size: 21px; font-weight: 800; }
.chip { background: var(--surface); border-color: transparent; box-shadow: var(--shadow-sm); }

.segments { gap: 4px; margin-bottom: 8px; }
.seg { height: 9px; background: var(--surface-3); }
.seg.right { background: var(--correct); }
.seg.bad { background: var(--wrong); }
.seg.current { outline: none; background: var(--primary); }

.q-card { background: transparent; border: none; box-shadow: none; padding: 8px 2px 4px; }
.q-num { background: none; padding: 0; color: var(--correct); font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.q-num span { opacity: 1; color: var(--correct); font-size: 16px; }
.question-text { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.3; margin-bottom: 26px; }
.question-text, .question-img { position: relative; }

.options { gap: 14px; }
@media (min-width: 640px) { .options.two { grid-template-columns: 1fr; } }
.option {
  position: relative; gap: 14px; padding: 18px 20px; border-radius: 22px; border: none;
  background: var(--primary); color: #fff; font-family: var(--font-display); font-size: 20px; font-weight: 700;
  box-shadow: 0 5px 0 var(--primary-shade);
}
.option .letter { flex: 0 0 34px; height: 34px; border-radius: 50%; font-size: 15px; background: rgba(255, 255, 255, .22); color: #fff; }
.option:not(:disabled):not(.static):hover { background: color-mix(in srgb, var(--primary) 92%, #fff); border-color: transparent; transform: translateY(-2px); box-shadow: 0 7px 0 var(--primary-shade); }
.option:not(:disabled):not(.static):active { transform: translateY(3px); box-shadow: 0 2px 0 var(--primary-shade); }
.option:not(:disabled):not(.static):not(.selected)::after {
  content: ""; width: 12px; height: 12px; flex: 0 0 auto; margin-right: 4px;
  border-right: 3px solid currentColor; border-top: 3px solid currentColor; border-radius: 2px; transform: rotate(45deg);
}
.option .mark { width: 30px; height: 30px; background: transparent !important; }
.option .mark .ic { width: 24px; height: 24px; stroke-width: 3.4; }
.option.is-correct { background: var(--correct); border: none; box-shadow: 0 5px 0 var(--correct-shade); }
.option.is-correct .letter, .option.is-wrong .letter { background: rgba(255, 255, 255, .22); }
.option.is-wrong { background: var(--wrong); border: none; box-shadow: 0 5px 0 var(--wrong-shade); }
.option.is-correct.bounce::before {
  content: ""; position: absolute; left: -16px; top: -16px; width: 26px; height: 26px; pointer-events: none;
  background:
    linear-gradient(var(--correct), var(--correct)) 0 60% / 12px 3px no-repeat,
    linear-gradient(var(--correct), var(--correct)) 60% 0 / 3px 12px no-repeat;
  transform: rotate(-20deg); animation: pop .35s;
}
.option.dim { opacity: .5; }
.option .your-answer { color: #fff; opacity: .9; }
.option.selected { background: var(--text); box-shadow: 0 5px 0 #000; }
.option.selected .letter { background: var(--primary); }

/* Sonuç / inceleme kartlarındaki şıklar sade kalsın */
.option.static {
  background: var(--surface-2); color: var(--text); box-shadow: none; font-family: var(--font); font-size: 16px; padding: 12px 14px; border-radius: 16px;
}
.option.static .letter { background: var(--surface); color: var(--muted); }
.option.static.is-correct { background: var(--correct-soft); color: var(--correct-ink); }
.option.static.is-correct .letter { background: var(--correct); color: #fff; }
.option.static.is-correct .mark { color: var(--correct); }
.option.static.is-wrong { background: var(--wrong-soft); color: var(--wrong-ink); }
.option.static.is-wrong .letter { background: var(--wrong); color: #fff; }
.option.static.is-wrong .mark { color: var(--wrong); }
.option.static .your-answer { color: var(--muted); }

.feedback { border-radius: 22px; border-width: 0; box-shadow: var(--shadow); }
.fb-title { font-family: var(--font-display); font-weight: 800; }
.gain { font-family: var(--font-display); }
.quiz-nav .btn { border-radius: 16px; }
@media (max-width: 720px) {
  .quiz-nav { background: color-mix(in srgb, var(--bg) 92%, transparent); border-top-color: transparent; }
  .question-text { font-size: 23px; }
  .option { font-size: 18px; padding: 16px 16px; }
}

/* Alt sekme çubuğu ve sonuç başlığı */
@media (max-width: 720px) {
  .tabbar:not([hidden]) { background: color-mix(in srgb, var(--surface) 94%, transparent); border-top-color: transparent; box-shadow: 0 -6px 20px rgba(140, 72, 24, .08); }
  .tabbar a.active { background: transparent; color: var(--primary-ink); }
  .tabbar a.active .ic { transform: translateY(-1px) scale(1.12); }
}
.result-hero { border-radius: 28px; }
.result-hero.good { background: linear-gradient(135deg, var(--correct), color-mix(in srgb, var(--correct) 80%, #000)); }
.result-hero.mid { background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.question-text.long { font-family: var(--font); font-size: 19px; font-weight: 700; line-height: 1.55; }
@media (max-width: 720px) { .question-text.long { font-size: 17px; } }
.review-head .q-num { font-size: 15px; background: var(--primary-soft); color: var(--primary-ink); padding: 3px 12px; border-radius: 99px; font-family: var(--font); }
.review-head .q-num span { color: inherit; font-size: inherit; }
.review-head ~ .question-text { font-family: var(--font); font-size: 17px; font-weight: 700; line-height: 1.5; margin-bottom: 14px; }
.quiz-nav .btn { white-space: nowrap; }
@media (max-width: 400px) { .quiz-nav { gap: 8px; } .quiz-nav .btn { padding: 11px 12px; font-size: 15px; } }
@media (max-width: 560px) {
  .home .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .home .quick-tile { flex-direction: column; text-align: center; gap: 6px; padding: 12px 6px; }
  .home .quick-tile b { font-size: 14px; }
  .home .quick-tile span:not(.qt-icon) { font-size: 11.5px; }
}

/* Evren: kaynak resim alanı ve "AI ile" düğmeleri */
.evren-drop {
  border: 2px dashed var(--surface-3); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px;
  background: var(--surface-2); transition: border-color .15s, background .15s; outline: none;
}
.evren-drop:focus-visible, .evren-drop.over { border-color: var(--primary); background: var(--primary-soft); }
.evren-drop-hint { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 6px 0; }
.evren-drop-hint .e { font-size: 30px; line-height: 1; }
.evren-drop-hint .btn { margin-top: 6px; }
.evren-drop.has .evren-drop-hint { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 4px 0 0; }
.evren-drop.has .evren-drop-hint .e { display: none; }
.evren-drop.has .evren-drop-hint .btn { margin-top: 0; }
.evren-imgs { display: flex; gap: 10px; flex-wrap: wrap; }
.evren-drop.has .evren-imgs { margin-bottom: 10px; }
.evren-img { position: relative; margin: 0; width: 132px; height: 132px; border-radius: 14px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.evren-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.evren-img-x {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: none;
  background: rgba(74, 35, 12, .75); color: #fff; font-size: 13px; font-weight: 900; display: grid; place-items: center;
}
.evren-img-x:hover { background: var(--wrong); }
.tree-adds { gap: 0; }
.tree-add.ai { padding-left: 10px; color: var(--correct-ink); }
.btn.ai-btn { background: var(--correct); box-shadow: 0 4px 0 var(--correct-shade); }
.btn.ai-btn:active { box-shadow: 0 1px 0 var(--correct-shade); }
.review-q.new { border-left-color: var(--primary); }
.status-pill.new { background: var(--primary-soft); color: var(--primary-ink); }
.mode-tag.manual { background: var(--correct-soft); color: var(--correct-ink); }
a.man-item:hover { border-color: transparent; }
.evren-wait .muted.small { display: block; }
.evren-retry-note { opacity: .8; }

/* Soruyu AI ile düzenle penceresi */
.modal.ai-edit { max-width: 860px; max-height: 90vh; overflow-y: auto; }
.ai-q { background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 15px; }
.ai-q-text { white-space: pre-line; font-weight: 700; margin-bottom: 8px; }
.ai-q .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; color: var(--muted); font-weight: 600; }
.ai-q .opts .ok { color: var(--correct-ink); font-weight: 800; }
.ai-q.new { background: var(--correct-soft); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--correct) 35%, transparent); }
.ai-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ai-label { font-size: 13px; font-weight: 800; color: var(--muted); margin-bottom: 6px; }
.ai-label.new { color: var(--correct-ink); }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ai-chips button {
  border: 1px solid var(--border); background: var(--surface); border-radius: 99px; padding: 5px 12px;
  font-size: 13px; font-weight: 700; color: var(--text);
}
.ai-chips button:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.ai-edit .row { flex-wrap: wrap; }
@media (max-width: 720px) { .ai-compare, .ai-q .opts { grid-template-columns: 1fr; } }

/* ----- Uygulamayı yükle (PWA) ----- */
.install-bar {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 16px; border-radius: 20px;
  background: color-mix(in srgb, var(--correct) 12%, var(--surface)); border: 2px solid color-mix(in srgb, var(--correct) 25%, transparent);
}
.ib-icon { font-size: 26px; }
.install-bar > div { flex: 1; min-width: 0; }
.install-bar b { display: block; font-family: var(--font-display); font-size: 16px; }
.install-bar span:not(.ib-icon) { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
.ib-close { border: none; background: none; color: var(--muted); font-size: 16px; padding: 6px; cursor: pointer; }

/* ----- Üniteler ve LGS istatistiği ----- */
.unit-block { margin-top: 26px; }
.unit-block:first-of-type { margin-top: 8px; }
.unit-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 4px 12px; }
.unit-head h2 { font-size: 21px; font-weight: 800; }
.topic-title { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.topic-num { min-width: 34px; width: auto; padding: 0 6px; }
.lgs-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; white-space: nowrap;
  font-size: 12.5px; font-weight: 700; background: var(--surface-2); color: var(--muted);
}
.lgs-chip b { font-weight: 900; color: var(--text); }
.lgs-chip.hot { background: color-mix(in srgb, var(--primary) 16%, var(--surface)); color: var(--primary-ink); }
.lgs-chip.hot b { color: var(--primary-ink); }
.lgs-chip.mid { background: var(--correct-soft); color: var(--correct-ink); }
.lgs-chip.mid b { color: var(--correct-ink); }
.lgs-chip.out { background: var(--wrong-soft, #fde3df); color: var(--wrong); }
.lgs-chip.unit { font-size: 13.5px; padding: 4px 12px; background: var(--primary-soft); color: var(--primary-ink); }
.lgs-chip.unit b { color: var(--primary-ink); }
.an-unit { display: block; font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: none; }
.an-name .lgs-chip { margin-left: 4px; vertical-align: 1px; }

/* ----- Öğretmen ağacı: üniteler ----- */
.tree-item.unit-i { padding-left: 16px; font-weight: 800; color: var(--primary-ink); }
.tree-item.topic-i { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tree-item.topic-i.deep { padding-left: 34px; }
.tree-item.test-i.deep { padding-left: 52px; }
.tree-adds.deep .tree-add:first-child { padding-left: 52px; }
.tree-add.topic-add.deep { padding-left: 34px; }
.ti-name { flex: 1; min-width: 0; text-align: left; line-height: 1.25; }
.ti-lgs { flex: 0 0 auto; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: var(--primary-soft); color: var(--primary-ink); }
.ti-lgs.out { background: #fde3df; color: var(--wrong); }
.tree-unit { margin: 4px 0 6px; padding-top: 4px; border-top: 1px dashed var(--surface-3); }

/* Konu düzenleme penceresi */
.modal.topic-edit { max-width: 520px; }
.lgs-years { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.lgs-years label { display: flex; flex-direction: column; gap: 3px; margin: 0; font-size: 12px; font-weight: 800; color: var(--muted); }
.lgs-years input { text-align: center; padding: 8px 4px; }

/* ----- Evren: PDF kaynağı ----- */
.evren-pdf {
  margin-top: 12px; padding: 14px 16px; border-radius: 18px; background: var(--surface);
  border: 2px solid color-mix(in srgb, var(--correct) 25%, var(--surface-2)); display: flex; flex-direction: column; gap: 10px;
}
.ep-head { display: flex; align-items: center; gap: 12px; }
.ep-icon { font-size: 26px; }
.ep-title { flex: 1; min-width: 0; }
.ep-title b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-title span { display: block; font-weight: 700; }
.ep-start { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ep-start label { margin: 0; }
.ep-start input { width: 140px; }
.ep-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.ep-bar span { display: block; height: 100%; background: var(--correct); border-radius: 99px; transition: width .4s ease; }
.ep-pages { display: flex; flex-wrap: wrap; gap: 6px; }
.ep-page {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 10px; border: none; cursor: default;
  font: inherit; font-size: 13px; font-weight: 800; background: var(--surface-2); color: var(--muted);
}
.ep-page.run { background: var(--primary-soft); color: var(--primary-ink); animation: ep-pulse 1s ease-in-out infinite alternate; }
.ep-page.ok { background: var(--correct-soft); color: var(--correct-ink); cursor: pointer; }
.ep-page.err { background: #fde3df; color: var(--wrong); cursor: pointer; }
@keyframes ep-pulse { from { opacity: .55; } to { opacity: 1; } }
.ep-warn { font-size: 13px; font-weight: 700; color: var(--wrong); }
.ep-text textarea { margin-top: 6px; font-size: 14px; }

/* Evren: teste kayıtlı kaynaklar */
.evren-saved { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--primary-soft); display: flex; flex-direction: column; gap: 8px; }
.evren-saved .es-item { position: relative; background: var(--surface); border-radius: 12px; padding: 8px 40px 8px 12px; box-shadow: var(--shadow); }
.evren-saved summary { cursor: pointer; font-weight: 700; }
.evren-saved pre { white-space: pre-wrap; margin: 8px 0 0; max-height: 220px; overflow: auto; font: inherit; font-size: 13px; }
.evren-saved .es-x { top: 8px; right: 8px; }
.evren-img.saved { outline: 3px solid var(--primary); outline-offset: -3px; }
.evren-img-tag { position: absolute; left: 6px; bottom: 6px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }

/* Kaynaklarım */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.lib-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; }
.lib-view { height: 130px; border-radius: 12px; background: var(--primary-soft); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.lib-view img { width: 100%; height: 100%; object-fit: cover; }
.lib-view .e { font-size: 34px; }
.lib-text { align-self: stretch; padding: 10px 12px; font-size: 12.5px; line-height: 1.45; overflow: hidden; white-space: pre-wrap; text-align: left; }
.lib-name { word-break: break-word; }
.lib-pre { white-space: pre-wrap; max-height: 60vh; overflow: auto; font: inherit; font-size: 14px; background: var(--primary-soft); padding: 12px; border-radius: 12px; }
.lib-view-modal { max-width: 720px; width: 92vw; }
.lib-pick { max-width: 560px; width: 92vw; }
.lib-pick-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; }
.lib-pick-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--primary-soft); cursor: pointer; font-weight: 400; }
.lib-pick-item img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; }
.lib-pick-item .e { font-size: 28px; width: 52px; text-align: center; }
.lib-pick-item input { width: auto; flex: none; }

/* Kaynaklarım: yükleme alanı ve işler */
.lib-jobs { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.lib-job { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; padding: 6px 12px; border-radius: 10px; background: var(--primary-soft); font-size: 14px; }
.lib-job.err { background: #fde8e6; }
.lib-job.ok { background: #e4f6ee; }
.ev-tag { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--primary-soft); }
.ev-tag.guess { background: #fff1d6; }

/* Evren sihirbazı */
.wiz-bar{display:flex;gap:8px;list-style:none;margin:0 0 18px;padding:0;flex-wrap:wrap}
.wiz-bar li{flex:1;min-width:110px}
.wiz-bar button{width:100%;display:flex;align-items:center;gap:8px;padding:9px 12px;border-radius:14px;border:2px solid var(--line,#eadfce);background:#fff;font:inherit;font-weight:800;cursor:pointer;color:inherit}
.wiz-bar button.on{border-color:#e8742a;background:#fdebd9;color:#b4510f}
.wiz-bar button.done{border-color:#bfe3c6;background:#eefaf0}
.wiz-n{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:50%;background:#f1e6d6;font-size:13px}
.wiz-bar .on .wiz-n{background:#e8742a;color:#fff}
.wiz-bar .done .wiz-n{background:#4caf6a;color:#fff}
.wiz-h{margin:0 0 14px;font-size:18px}
.wiz-pane[hidden],.wiz-nav [hidden],#evrenOut[hidden]{display:none}
.wiz-nav{display:flex;gap:10px;margin-top:20px;padding-top:14px;border-top:1px dashed #eadfce}
.wiz-sum{display:flex;flex-direction:column;gap:8px}
.wiz-row{display:flex;align-items:center;gap:12px;padding:10px 14px;border-radius:14px;background:#fff7ee}
.wiz-k{flex:0 0 150px;font-weight:800;color:#8a6a4a;font-size:14px}
.wiz-v{flex:1;font-weight:700;word-break:break-word}
.wiz-chips{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:10px}
.wiz-chip{padding:6px 12px;border-radius:999px;border:2px solid #eadfce;background:#fff;font:inherit;font-size:13px;font-weight:700;cursor:pointer;text-align:left;color:inherit}
.wiz-chip.on{border-color:#e8742a;background:#fdebd9;color:#b4510f}
