/* ===== Tasarım belirteçleri (docs/STANDARDS.md "Tasarım sistemi") ===== */
:root {
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 40px;
  --r-sm: 12px; --r: 16px; --r-lg: 20px; --r-pill: 999px;
  --bg: #f4f6fb; --surface: #ffffff; --surface-2: #eef1f8; --line: #e1e6f0; --line-strong: #cdd4e3;
  --text: #17203a; --muted: #5f6984;
  --primary: #FF7A1A; --primary-d: #C2540A; --primary-soft: #FFEBDA; --primary-text: #B34700; --on-primary: #2B1400;
  --ok: #1fa356; --ok-d: #15803f; --ok-soft: #dcf7e6; --ok-text: #11743a;
  --bad: #e5484d; --bad-d: #b8343a; --bad-soft: #ffe5e5; --bad-text: #b4232a;
  --warn: #f59e0b; --warn-d: #c27c06; --warn-soft: #fff3d6; --warn-text: #92570a;
  --xp: #FFD43B; --xp-d: #D4A500; --xp-soft: #FFF6CC; --xp-text: #7A5C00;
  --streak: #ff8a00; --streak-soft: #ffeedb; --streak-text: #b35c00;
  --mine: #fff1c2;
  --hl-y: rgba(255, 214, 10, .45); --hl-g: rgba(52, 199, 89, .38); --hl-p: rgba(255, 105, 180, .34);
  --bar-bg: rgba(255, 255, 255, .8);
  --scrim: rgba(10, 14, 30, .45);
  --shadow: 0 10px 30px rgba(23, 32, 58, .12);
  --tab-h: 64px; --side-w: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1220; --surface: #171c2e; --surface-2: #20263b; --line: #2a3149; --line-strong: #3a4260;
    --text: #e9ecf6; --muted: #a0a9c2;
    --primary: #FF7A1A; --primary-d: #C2540A; --primary-soft: #43260F; --primary-text: #FFAB6B; --on-primary: #2B1400;
    --ok: #2bb865; --ok-d: #1c8a49; --ok-soft: #15331f; --ok-text: #62e094;
    --bad: #ff5a5f; --bad-d: #c1373c; --bad-soft: #3b1b1f; --bad-text: #ff9295;
    --warn-soft: #3a2c0f; --warn-text: #ffc457; --xp-soft: #3a3110; --xp-text: #FFD43B;
    --streak-soft: #3d2610; --streak-text: #ffad52; --mine: #3d3417;
    --bar-bg: rgba(23, 28, 46, .8); --scrim: rgba(0, 0, 0, .6); --shadow: 0 10px 30px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1220; --surface: #171c2e; --surface-2: #20263b; --line: #2a3149; --line-strong: #3a4260;
  --text: #e9ecf6; --muted: #a0a9c2;
  --primary: #FF7A1A; --primary-d: #C2540A; --primary-soft: #43260F; --primary-text: #FFAB6B; --on-primary: #2B1400;
  --ok: #2bb865; --ok-d: #1c8a49; --ok-soft: #15331f; --ok-text: #62e094;
  --bad: #ff5a5f; --bad-d: #c1373c; --bad-soft: #3b1b1f; --bad-text: #ff9295;
  --warn-soft: #3a2c0f; --warn-text: #ffc457; --xp-soft: #3a3110; --xp-text: #FFD43B;
  --streak-soft: #3d2610; --streak-text: #ffad52; --mine: #3d3417;
  --bar-bg: rgba(23, 28, 46, .8); --scrim: rgba(0, 0, 0, .6); --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* ===== Temel ===== */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--primary-text); text-decoration: none; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; margin: 0 0 4px; font-weight: 800; }
h3 { font-size: 1.05rem; margin: 0 0 8px; font-weight: 800; }
.ico { flex: none; display: block; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
[hidden] { display: none !important; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hint { color: var(--muted); font-size: .92rem; margin: 4px 0; }
.meta { color: var(--muted); font-size: .85rem; margin: 4px 0 0; }
.good { color: var(--ok-text); font-weight: 700; } .wrong { color: var(--bad-text); font-weight: 700; }
.eyebrow { display: block; color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.section-title { margin: var(--s3) 0 var(--s1); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s1); }
.row-between .pbar { flex: 1; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== Kabuk: üst çubuk, içerik, sekme çubuğu ===== */
#appbar {
  position: sticky; top: 0; z-index: 20; background: var(--bar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}
.appbar-in { display: flex; align-items: center; gap: var(--s1); max-width: 1100px; margin: 0 auto; min-height: 56px; padding: 0 var(--s2); }
.brand-sm, .brand { display: flex; align-items: center; gap: var(--s1); color: var(--text); font-size: 1.15rem; }
.brand-logo { width: 34px; height: auto; flex: none; display: block; }
.brand-name { font-weight: 800; letter-spacing: -.01em; color: var(--text); } .brand-name span { color: #FF7A1A; }
.chip-stat { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 10px; border-radius: var(--r-pill); font-weight: 800; color: var(--muted); }
.chip-stat.streak { color: var(--muted); } .chip-stat.streak.lit { color: var(--streak); }
.chip-stat.xp { color: var(--xp-d); } .chip-stat b { color: var(--text); font-variant-numeric: tabular-nums; }
.chip-stat.bump { animation: bump .5s cubic-bezier(.3, 1.6, .5, 1); }
main {
  max-width: 760px; margin: 0 auto;
  padding: var(--s2) calc(env(safe-area-inset-right) + var(--s2)) calc(var(--tab-h) + var(--foot-h, 0px) + env(safe-area-inset-bottom) + var(--s3)) calc(env(safe-area-inset-left) + var(--s2));
}
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex;
  background: var(--bar-bg); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
#tabbar .brand { display: none; }
#tabbar a { flex: 1; min-height: var(--tab-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .68rem; font-weight: 700; color: var(--muted); position: relative; }
#tabbar a .tab-ic { display: grid; place-items: center; width: 52px; height: 32px; border-radius: var(--r-pill); transition: background .2s, transform .2s; }
#tabbar a.on { color: var(--primary-text); }
#tabbar a.on .tab-ic { background: var(--primary-soft); color: var(--primary); }
#tabbar a:active .tab-ic { transform: scale(.92); }
.top { display: flex; align-items: center; gap: var(--s1); min-height: 52px; margin-bottom: var(--s2); }
.back { min-width: 44px; min-height: 44px; display: grid; place-items: center; border-radius: var(--r-pill); color: var(--text); margin-left: -10px; }
.back:active { background: var(--surface-2); }
.page { animation: rise .3s ease-out; }
.loading { display: flex; gap: 8px; justify-content: center; padding: var(--s5) 0; }
.loading i { width: 12px; height: 12px; border-radius: 50%; background: var(--primary); animation: dot 1s infinite ease-in-out; }
.loading i:nth-child(2) { animation-delay: .15s; } .loading i:nth-child(3) { animation-delay: .3s; }

/* iPad / geniş ekran: sol kenar çubuğu + iki sütun */
@media (min-width: 900px) {
  :root { --tab-h: 0px; }
  body { padding-left: var(--side-w); }
  #tabbar {
    top: 0; right: auto; width: var(--side-w); flex-direction: column; gap: 4px; border-top: 0; border-right: 1px solid var(--line);
    padding: calc(env(safe-area-inset-top) + var(--s2)) var(--s2) calc(env(safe-area-inset-bottom) + var(--s2)) calc(env(safe-area-inset-left) + var(--s2));
  }
  #tabbar .brand { display: flex; padding: 0 var(--s1) var(--s3); font-size: 1.4rem; }
  #tabbar a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 52px; padding: 0 8px; font-size: 1rem; border-radius: var(--r); border: 2px solid transparent; }
  #tabbar a .tab-ic { width: 36px; height: 36px; }
  #tabbar a.on { background: var(--primary-soft); border-color: var(--primary); }
  #tabbar a.on .tab-ic { background: transparent; }
  #tabbar a:hover:not(.on) { background: var(--surface-2); }
  .brand-sm { visibility: hidden; }
  main { max-width: 1100px; padding-left: var(--s4); padding-right: var(--s4); }
  .cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--s3); align-items: start; }
  .book-layout { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: var(--s4); align-items: start; }
  .book-layout > div:first-child { position: sticky; top: 88px; }
  .book-grid { grid-template-columns: 1fr 1fr; }
  body.lesson { padding-left: 0; }
}

/* ===== Açılış ekranı (splash) ===== */
#splash { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2); background: var(--bg); opacity: 1; transition: opacity .4s ease; }
#splash.out { opacity: 0; pointer-events: none; }
#splash .sp-logo { position: relative; width: 112px; }
#splash .sp-logo img { width: 100%; display: block; animation: pop .5s cubic-bezier(.3, 1.4, .5, 1); }
#splash .sp-name { font-size: 2rem; font-weight: 800; letter-spacing: -.01em; color: var(--text); } #splash .sp-name span { color: #FF7A1A; }
#splash .sp-spark { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #FFD43B; opacity: 0; animation: spark 1.6s ease-out infinite; }
#splash .sp-spark:nth-child(2) { left: 6%; top: 8%; animation-delay: .1s; } #splash .sp-spark:nth-child(3) { right: 4%; top: 2%; animation-delay: .6s; width: 6px; height: 6px; }
#splash .sp-spark:nth-child(4) { right: 14%; bottom: 6%; animation-delay: 1.1s; background: #FF7A1A; }
@keyframes spark { 0% { transform: scale(0) translateY(0); opacity: 0; } 25% { opacity: 1; } 100% { transform: scale(1.4) translateY(-16px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #splash, #splash .sp-spark, #splash .sp-logo img { animation: none !important; transition: none !important; } #splash .sp-spark { display: none; } }

/* ===== Bileşen: düğme (3B, basınca çöker) ===== */
.btn {
  --b: var(--surface); --bd: var(--line-strong); --fg: var(--text);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--s1);
  min-height: 52px; padding: 0 20px; margin: 0 0 4px; border-radius: var(--r); border: 2px solid var(--bd);
  background: var(--b); color: var(--fg); font: inherit; font-size: 1rem; font-weight: 800; letter-spacing: .02em;
  box-shadow: 0 4px 0 var(--bd); cursor: pointer; user-select: none; -webkit-user-select: none; text-align: center;
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
}
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 var(--bd); }
.btn:hover:not(:disabled) { filter: brightness(1.04); }
.btn.primary { --b: var(--primary); --bd: var(--primary-d); --fg: var(--on-primary); }
.btn.success { --b: var(--ok); --bd: var(--ok-d); --fg: #fff; }
.btn.danger { --fg: var(--bad-text); }
.footbar .btn.danger, .row .btn.danger, .fb-row .btn.danger { --fg: var(--bad-text); }
.fb.bad .fb-row .btn.danger { --b: var(--bad); --bd: var(--bad-d); --fg: #fff; }
.btn.ghost { --b: transparent; --bd: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:active:not(:disabled) { transform: none; background: var(--surface-2); }
.btn.small { min-height: 44px; min-width: 44px; padding: 0 14px; font-size: .92rem; border-radius: var(--r-sm); box-shadow: 0 3px 0 var(--bd); }
.btn.small:active:not(:disabled) { transform: translateY(3px); }
.btn.ghost.small { box-shadow: none; }
.btn.icon { padding: 0; width: 52px; flex: none; }
.btn.small.icon { width: 44px; }
.btn.block { display: flex; width: 100%; }
.btn:disabled { --b: var(--surface-2); --bd: var(--line); --fg: var(--muted); cursor: default; filter: none; }
.btn.ghost:disabled { --b: transparent; --bd: transparent; opacity: .4; }
.row { display: flex; gap: 12px; margin: var(--s2) 0; flex-wrap: wrap; align-items: center; } .row > .btn { flex: 1; }
.row > .btn.icon { flex: none; }
.row > .btn { white-space: nowrap; padding: 0 12px; }
.seg2 { display: flex; flex-direction: column; line-height: 1.1; } .seg2 small { font-size: .72rem; opacity: .8; }

/* ===== Bileşen: kart ===== */
.card, .qcard, .note, .passage, .wcard {
  display: block; background: var(--surface); color: var(--text); border: 2px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s2); margin: 0 0 var(--s2);
}
a.card { transition: transform .12s, border-color .12s; }
a.card:active { transform: scale(.985); }
a.card:hover { border-color: var(--line-strong); }
.card p { margin: 2px 0; }
.tile { width: 48px; height: 48px; flex: none; border-radius: 14px; display: grid; place-items: center; }
.tone-primary.tile { background: var(--primary-soft); color: var(--primary); }
.tone-ok.tile { background: var(--ok-soft); color: var(--ok); }
.tone-bad.tile { background: var(--bad-soft); color: var(--bad); }
.tone-warn.tile { background: var(--warn-soft); color: var(--warn-d); }

/* ===== Bileşen: ilerleme çubuğu / halka ===== */
.pbar { height: 14px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; min-width: 40px; }
.pbar i { display: block; height: 100%; border-radius: inherit; background: var(--primary); position: relative; transition: width .5s cubic-bezier(.3, 1.2, .5, 1); min-width: 0; }
.pbar i::after { content: ""; position: absolute; left: 8px; right: 8px; top: 3px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .3); }
.pbar.tone-ok i { background: var(--ok); } .pbar.tone-bad i { background: var(--bad); } .pbar.tone-xp i { background: var(--xp); }
.ring { position: relative; flex: none; display: grid; place-items: center; }
.ring > svg { position: absolute; inset: 0; }
.ring .ring-bg { stroke: var(--surface-2); }
.ring .ring-fg { stroke: var(--primary); transition: stroke-dashoffset .8s cubic-bezier(.3, 1, .5, 1); }
.ring.tone-ok .ring-fg { stroke: var(--ok); } .ring.tone-bad .ring-fg { stroke: var(--bad); } .ring.tone-xp .ring-fg { stroke: var(--xp); }
.ring-c { position: relative; display: grid; place-items: center; font-weight: 800; color: var(--text); text-align: center; line-height: 1.1; }
.ring.tone-ok .ring-c { color: var(--ok); }
.ring-num b { display: block; font-size: 1.6rem; } .ring-num small { color: var(--muted); font-weight: 700; }
.ring-sm { font-size: 1.05rem; } .ring-big { font-size: 1.8rem; }

/* ===== Bileşen: hap etiketi, istatistik, rozet ===== */
.pill { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 2px 10px; border-radius: var(--r-pill); font-size: .8rem; font-weight: 800; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.tone-primary { background: var(--primary-soft); color: var(--primary-text); }
.pill.tone-ok { background: var(--ok-soft); color: var(--ok-text); }
.pill.tone-bad { background: var(--bad-soft); color: var(--bad-text); }
.pill.tone-warn { background: var(--warn-soft); color: var(--warn-text); }
.pill.tone-xp { background: var(--xp-soft); color: var(--xp-text); }
.pill.tone-streak { background: var(--streak-soft); color: var(--streak-text); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--s1) 0; }
.tag { display: inline-block; font-size: .75rem; font-weight: 800; padding: 2px 8px; border-radius: var(--r-pill); background: var(--warn-soft); color: var(--warn-text); margin: 4px 6px 0 0; }
.stats { display: flex; gap: 12px; margin: 0 0 var(--s2); }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 var(--s2); }
.stat { flex: 1; min-width: 0; background: var(--surface); border: 2px solid var(--line); border-radius: var(--r); padding: 12px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat b { display: block; font-size: 1.45rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { font-size: .78rem; font-weight: 700; color: var(--muted); }
.stat-ic { display: grid; place-items: center; }
.stat.tone-ok .stat-ic, .stat.tone-ok b { color: var(--ok-text); }
.stat.tone-bad .stat-ic, .stat.tone-bad b { color: var(--bad-text); }
.stat.tone-primary .stat-ic { color: var(--primary); }
.stat.tone-xp .stat-ic { color: var(--xp); }
.stat.tone-streak .stat-ic { color: var(--streak); }
.stat.tone-warn .stat-ic { color: var(--warn); }
.stat.tone-muted .stat-ic { color: var(--muted); }
.medal { --m: 64px; width: var(--m); height: calc(var(--m) * 1.05); flex: none; display: grid; place-items: center; }
.medal-c { width: var(--m); height: var(--m); border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); border: 3px solid var(--line); box-shadow: 0 4px 0 var(--line); }
.medal.on .medal-c { background: radial-gradient(circle at 35% 30%, #ffe680, var(--xp) 60%); color: #7a4c00; border-color: var(--xp-d); box-shadow: 0 4px 0 var(--xp-d); }
.medals { display: flex; gap: 10px; flex-wrap: wrap; margin-top: var(--s1); }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.badge-cell { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 12px 8px; border-radius: var(--r); background: var(--surface-2); }
.badge-cell b { font-size: .9rem; line-height: 1.2; } .badge-cell small { line-height: 1.25; }
.badge-cell:not(.on) b { color: var(--muted); }
.badge-prog { width: 100%; display: flex; flex-direction: column; gap: 2px; }
.badge-prog .pbar { height: 8px; } .badge-prog .pbar i::after { display: none; }

/* ===== Bileşen: boş durum, bölümlü kontrol, anahtar ===== */
.empty { text-align: center; padding: var(--s4) var(--s2); display: flex; flex-direction: column; align-items: center; gap: var(--s1); }
.empty-ic { width: 88px; height: 88px; border-radius: 28px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); transform: rotate(-6deg); margin-bottom: var(--s1); }
.empty h3 { margin: 0; font-size: 1.15rem; } .empty p { margin: 0; color: var(--muted); max-width: 36ch; }
.empty .btn { margin-top: var(--s1); }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: var(--r); background: var(--surface-2); margin: 0 0 var(--s2); }
.seg > * { flex: 1; min-height: 44px; display: grid; place-items: center; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font: inherit; font-weight: 800; font-size: .92rem; cursor: pointer; padding: 0 6px; text-align: center; line-height: 1.15; }
.seg > .on { background: var(--surface); color: var(--primary-text); box-shadow: 0 2px 0 var(--line-strong); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 52px; border-bottom: 1px solid var(--line); font-weight: 600; }
.switch-row:last-of-type { border-bottom: 0; }
.switch-row input[type=number] { width: 96px; flex: none; text-align: center; margin: 0; }
.switch { -webkit-appearance: none; appearance: none; flex: none; width: 52px; height: 32px; min-height: 32px; margin: 0; padding: 0; border-radius: var(--r-pill); border: 0; background: var(--line-strong); position: relative; cursor: pointer; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch:checked { background: var(--ok); } .switch:checked::after { transform: translateX(20px); }
input, select, textarea {
  font: inherit; font-size: 16px; width: 100%; min-height: 48px; padding: 10px 14px; margin: 6px 0;
  border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--text);
}
input:focus, textarea:focus { outline: none; border-color: var(--primary); }
input.ok { border-color: var(--ok); background: var(--ok-soft); } input.bad { border-color: var(--bad); background: var(--bad-soft); }
input[type=range] { padding: 0; border: 0; accent-color: var(--primary); min-height: 44px; background: transparent; }
input[type=checkbox]:not(.switch) { width: 22px; min-height: 22px; margin: 0 8px 0 0; vertical-align: middle; accent-color: var(--primary); }
.field { display: block; margin: 12px 0; } .field > span { display: block; color: var(--muted); font-size: .9rem; font-weight: 700; margin-bottom: 6px; }
.field .seg { margin: 0; }
details { margin: var(--s1) 0; }
summary { min-height: 44px; display: flex; align-items: center; color: var(--primary-text); font-weight: 800; cursor: pointer; }

/* ===== Bileşen: alt sayfa ===== */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-back { position: absolute; inset: 0; background: var(--scrim); animation: fade .2s ease-out; }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; background: var(--surface); color: var(--text);
  border-radius: 28px 28px 0 0; padding: 8px var(--s3) calc(env(safe-area-inset-bottom) + var(--s3));
  box-shadow: var(--shadow); animation: up .32s cubic-bezier(.2, .9, .3, 1.1);
}
.sheet-wrap.out .sheet { transform: translateY(100%); transition: transform .2s ease-in; }
.sheet-wrap.out .sheet-back { opacity: 0; transition: opacity .2s; }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto var(--s2); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s1); }
.sheet-head h2 { font-size: 1.4rem; margin: 0; }
.sheet-sub { font-size: 1.05rem; font-weight: 700; margin: 0 0 var(--s2) !important; }
.sheet-actions { display: flex; gap: 12px; margin-top: var(--s3); } .sheet-actions .btn { flex: 1; } .sheet-actions .btn.icon { flex: none; }
.step-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s2); }
.step-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 10px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); font-size: .85rem; font-weight: 700; }
.step-chip.past { background: var(--ok-soft); color: var(--ok-text); } .step-chip.on { background: var(--primary); color: var(--on-primary); }
.step-rows { display: flex; flex-direction: column; gap: 8px; }
.step-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 6px 12px 6px 6px; border-radius: var(--r); border: 2px solid var(--line); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.step-row b { flex: 1; } .step-row.on { border-color: var(--primary); background: var(--primary-soft); } .step-row .ico:last-child { color: var(--muted); }
@media (min-width: 900px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 28px; } }

/* ===== Bileşen: toast ===== */
.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 68px); transform: translateX(-50%); z-index: 70;
  background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: var(--r-pill); font-weight: 800; box-shadow: var(--shadow);
  animation: drop .3s cubic-bezier(.2, .9, .3, 1.2); max-width: calc(100vw - 32px); text-align: center;
}

/* ===== Bileşen: alt çubuk + doğru/yanlış paneli ===== */
.footbar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); z-index: 15;
  background: var(--bar-bg); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: 2px solid var(--line); padding: 12px calc(env(safe-area-inset-right) + var(--s2)) 12px calc(env(safe-area-inset-left) + var(--s2));
}
body.lesson .footbar { bottom: 0; padding-bottom: calc(env(safe-area-inset-bottom) + 12px); }
@media (min-width: 900px) { body:not(.lesson) .footbar { left: var(--side-w); } }
.fb-inner { max-width: 720px; margin: 0 auto; }
.fb-row { display: flex; gap: 12px; } .fb-row .btn { flex: 1; margin-bottom: 4px; } .fb-row .btn.icon { flex: none; }
.footbar.fb { border-top: 0; animation: up .3s cubic-bezier(.2, .9, .3, 1.15); }
.footbar.fb.ok { background: var(--ok-soft); color: var(--ok-text); }
.footbar.fb.bad { background: var(--bad-soft); color: var(--bad-text); }
.footbar.fb.info { background: var(--primary-soft); color: var(--primary-text); }
.fb-head { display: flex; align-items: center; gap: 12px; margin-bottom: var(--s1); }
.fb-head b { font-size: 1.3rem; flex: 1; }
.fb-head .btn.ghost { color: inherit; }
.fb-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); flex: none; animation: pop .4s cubic-bezier(.3, 1.6, .5, 1); }
.fb-line { margin: 0 0 6px; font-weight: 700; color: var(--text); }
.fb-expl { margin: 0 0 var(--s1); color: var(--text); font-size: .95rem; max-height: 30vh; overflow: auto; }

/* ===== Ana Sayfa ===== */
.hero { display: flex; align-items: center; gap: var(--s2); }
.hero h2 { font-size: 1.3rem; }
.continue { display: flex; align-items: center; gap: 12px; }
.cont-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cont-t b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.continue .btn { flex: none; pointer-events: none; }
.qgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.qtile { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 14px 12px; color: var(--text); }
.qtile b { line-height: 1.2; } .qtile .hint { font-size: .8rem; margin: 0; line-height: 1.25; }
.level { display: flex; align-items: center; gap: var(--s2); }
.level-badge { width: 60px; height: 60px; flex: none; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--xp); color: #6b4300; box-shadow: 0 4px 0 var(--xp-d); line-height: 1; }
.level-badge b { font-size: 1.2rem; }
.level .grow { display: flex; flex-direction: column; gap: 8px; }
.week { display: flex; justify-content: space-between; gap: 4px; margin-top: var(--s1); }
.wday { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-weight: 700; }
.wd-dot { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 2px solid var(--line); }
.wday.on .wd-dot { background: var(--streak-soft); color: var(--streak); border-color: var(--streak); }
.wday.today small { color: var(--primary-text); }
.wday.today .wd-dot { box-shadow: 0 0 0 3px var(--primary-soft); }
@media (max-width: 420px) { .qgrid { grid-template-columns: 1fr; } .qtile { flex-direction: row; align-items: center; flex-wrap: wrap; column-gap: 12px; } .qtile .tile { width: 44px; height: 44px; } .qtile b { flex: 1; } .qtile .hint { width: 100%; padding-left: 56px; margin-top: -18px; } }

/* ===== Kitaplar ===== */
.book-grid { display: grid; gap: var(--s2); }
.book { display: flex; gap: var(--s2); margin: 0; align-items: flex-start; }
.book-t { flex: 1; min-width: 0; }
.book h2 { color: var(--text); }
.cover { width: 64px; height: 84px; flex: none; border-radius: 12px; display: grid; place-items: center; color: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .18); }
.hue-0 { background: linear-gradient(160deg, #6b7bff, #3443c7); } .hue-1 { background: linear-gradient(160deg, #3fd081, #15803f); }
.hue-2 { background: linear-gradient(160deg, #ffb340, #e2700b); } .hue-3 { background: linear-gradient(160deg, #ff7aa8, #c9306c); }
.pct { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ===== Kitap içi: ünite yolu ===== */
.book-info { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.book-info .btn { width: 100%; }
.path { display: flex; flex-direction: column; align-items: center; gap: 28px; padding: var(--s2) 0 var(--s5); }
.node-wrap { display: flex; flex-direction: column; align-items: center; transform: translateX(var(--x, 0)); position: relative; }
.node {
  width: 76px; height: 70px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--surface-2); color: var(--primary); box-shadow: 0 7px 0 var(--line-strong), inset 0 -3px 0 rgba(0, 0, 0, .04);
  transition: transform .1s, box-shadow .1s;
}
.node:active { transform: translateY(6px); box-shadow: 0 1px 0 var(--line-strong); }
.node.done { background: var(--xp); color: #6b4300; box-shadow: 0 7px 0 var(--xp-d); }
.node.done:active { box-shadow: 0 1px 0 var(--xp-d); }
.node.current { background: var(--primary); color: var(--on-primary); box-shadow: 0 7px 0 var(--primary-d); }
.node.current:active { box-shadow: 0 1px 0 var(--primary-d); }
.node-ring { position: relative; width: 100px; height: 100px; display: grid; place-items: center; }
.node-ring .ring { position: absolute; inset: 0; }
.node-ring .node { position: relative; margin-top: -6px; }
.node-tip {
  position: relative; margin-bottom: 8px; padding: 6px 14px; border-radius: 12px; background: var(--surface); color: var(--primary-text);
  border: 2px solid var(--line); font-weight: 800; font-size: .85rem; letter-spacing: .06em; animation: bob 1.6s ease-in-out infinite;
}
.node-tip::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 12px; height: 12px; background: var(--surface); border: 2px solid var(--line); border-top: 0; border-left: 0; transform: translateX(-50%) rotate(45deg); }
.node-l { margin-top: 10px; text-align: center; max-width: 170px; display: flex; flex-direction: column; line-height: 1.25; }
.node-l b { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.node-l span { font-weight: 700; font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== Ders (ünite adımları) ===== */
body.lesson #appbar, body.lesson #tabbar { display: none; }
body.lesson { --tab-h: 0px; }
body.lesson main { max-width: 1000px; padding-top: 0; padding-bottom: calc(var(--foot-h, 90px) + env(safe-area-inset-bottom) + var(--s3)); }
.lesson-top {
  position: sticky; top: 0; z-index: 12; display: flex; align-items: center; gap: 6px; margin: 0 calc(-1 * var(--s2));
  padding: calc(env(safe-area-inset-top) + 6px) var(--s1) 6px; background: var(--bar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.lesson-top .btn { margin: 0; color: var(--muted); }
.lesson-bar { flex: 1; } .lesson-bar .pbar { height: 16px; }
.lesson-title { margin: var(--s1) 0 var(--s2); }
.lesson-head { display: flex; align-items: center; gap: 12px; }
.lesson-head h1 { font-size: 1.5rem; }
.lesson-title > .hint { margin: 6px 0 0; }
.qnav { display: flex; align-items: center; justify-content: space-between; gap: var(--s1); margin-bottom: var(--s1); }
.counter { color: var(--muted); font-size: .9rem; font-weight: 800; white-space: nowrap; }
.counter-row { display: flex; align-items: center; gap: 12px; margin: 0 0 var(--s2); }
.counter-row .pbar { flex: 1; }
.review-card { max-width: 520px; margin: 0 auto; } .review-card .wcard { min-height: 260px; }
.split { display: block; } .qs { min-width: 0; }
@media (min-width: 800px) and (orientation: landscape) {
  .split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); align-items: start; }
  .split .passage { position: sticky; top: calc(env(safe-area-inset-top) + 72px); max-height: calc(100vh - 100px - var(--foot-h, 90px)); overflow: auto; }
}

/* Metin, not, soru */
.passage { line-height: 1.7; font-size: 1.04rem; }
.passage p { white-space: pre-wrap; margin: 6px 0; }
.passage-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s1); }
.passage-head h3 { margin: 0; }
.blank { display: inline-block; min-width: 3.5em; border-bottom: 2px solid var(--text); }
.w { border-radius: 4px; cursor: pointer; } .w:active, .w.sel { background: var(--mine); }
.note h3 { color: var(--primary-text); }
.md p, .md ul { margin: 6px 0; } .md h4 { margin: 12px 0 4px; } .md code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.stem { font-weight: 600; font-size: 1.05rem; margin-bottom: 12px; line-height: 1.55; }
.qnum { color: var(--primary-text); }
.opt {
  display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; min-height: 56px; margin: 0 0 12px; padding: 10px 14px;
  border-radius: var(--r); border: 2px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit;
  box-shadow: 0 4px 0 var(--line-strong); cursor: pointer; transition: transform .08s, box-shadow .08s, background .15s, border-color .15s;
}
.opt:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 var(--line-strong); }
.opt-k { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; border: 2px solid var(--line-strong); color: var(--muted); font-size: .9rem; }
.opt:disabled { cursor: default; }
.opt.sel { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 4px 0 var(--primary); }
.opt.sel .opt-k { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.opt.ok { border-color: var(--ok); background: var(--ok-soft); box-shadow: 0 4px 0 var(--ok); }
.opt.ok .opt-k { border-color: var(--ok); background: var(--ok); color: #fff; }
.opt.bad { border-color: var(--bad); background: var(--bad-soft); box-shadow: 0 4px 0 var(--bad); animation: shake .4s; }
.opt.bad .opt-k { border-color: var(--bad); background: var(--bad); color: #fff; }
.opt.mine { border-color: var(--warn); background: var(--mine); box-shadow: 0 4px 0 var(--warn); }
.expl { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; margin: 8px 0 0; }

/* Kelime kartları */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; } .grid .wcard { margin: 0; }
.wcard {
  min-height: 130px; display: flex; align-items: center; justify-content: center; text-align: center; cursor: pointer;
  user-select: none; -webkit-user-select: none; box-shadow: 0 4px 0 var(--line); border-color: var(--line);
}
.wcard.back { background: var(--primary-soft); border-color: var(--primary); box-shadow: 0 4px 0 var(--primary); }
.wcard.flip { animation: flip .35s ease-out; }
.wcard .btn { margin: 6px auto 0; }
.big-card { min-height: 240px; touch-action: pan-y; margin: var(--s1) 0 0; }
.big { font-size: 1.5rem; font-weight: 800; line-height: 1.25; } .sub { color: var(--muted); font-size: .92rem; margin-top: 4px; } .it { font-style: italic; }
.wcard .pill { margin-top: 8px; }
.study .row { margin-top: var(--s3); }
.wlist h3 { margin-bottom: 4px; }
.wrow { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); min-height: 52px; } .wrow > div { flex: 1; min-width: 0; }
.wrow:last-child { border-bottom: 0; }
.boxes { display: flex; align-items: flex-end; gap: 4px; height: 56px; padding: 4px 0; }
.boxes span { width: 10px; height: 100%; display: flex; align-items: flex-end; }
.boxes i { display: block; width: 100%; height: var(--h); border-radius: 4px; background: var(--primary); }

/* Profil */
.profile-hero { display: flex; align-items: center; gap: var(--s2); }
.profile-hero .grow { display: flex; flex-direction: column; gap: 6px; }
.avatar { position: relative; width: 76px; height: 76px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); border: 3px solid var(--primary); }
.avatar-lv { position: absolute; right: -6px; bottom: -6px; min-width: 30px; height: 30px; padding: 0 6px; border-radius: var(--r-pill); display: grid; place-items: center; background: var(--xp); color: #6b4300; font-weight: 800; border: 3px solid var(--surface); }
.xpchart { position: relative; display: flex; align-items: flex-end; gap: 8px; height: 150px; margin-top: var(--s2); padding-top: 18px; }
.xcol { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; font-weight: 700; }
.xcol i { width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px; background: var(--line-strong); }
.xcol.on i { background: var(--xp); }
.xcol small { font-size: .72rem; color: var(--muted); min-height: 1em; }
.xcol span { font-size: .75rem; color: var(--muted); }
.goal-line { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--primary); opacity: .5; margin-bottom: 22px; pointer-events: none; }
.result { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s1); padding: var(--s3) var(--s2); }
.result .stats { width: 100%; margin: var(--s1) 0 0; }

/* Boşluk doldurma: kelime kutusu */
.bank { position: sticky; top: calc(env(safe-area-inset-top) + 58px); z-index: 5; background: var(--bar-bg); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 2px solid var(--line); border-radius: var(--r-lg); padding: 10px; margin: 0 0 var(--s2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 0 14px; border-radius: var(--r-sm); border: 2px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 700; box-shadow: 0 3px 0 var(--line-strong); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: pointer;
}
.chip.used { opacity: .35; box-shadow: none; }
.chip.sel { background: var(--primary); border-color: var(--primary-d); color: var(--on-primary); box-shadow: 0 3px 0 var(--primary-d); }
.chip.ghost { position: fixed; z-index: 100; pointer-events: none; transform: translate(-50%, -120%); display: flex; align-items: center; box-shadow: var(--shadow); }
.bslot { display: inline-block; vertical-align: baseline; min-width: 6em; min-height: 40px; padding: 4px 10px; margin: 2px; border-radius: var(--r-sm); border: 2px dashed var(--line-strong); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 700; text-align: center; cursor: pointer; }
.bslot.filled { border-style: solid; border-color: var(--primary); background: var(--primary-soft); }
.bslot.ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok-text); } .bslot.bad { background: var(--bad-soft); border-color: var(--bad); color: var(--bad-text); }

/* Seçmeli metin */
.czp { line-height: 2.2; }
.cw { white-space: nowrap; }
.cwo { display: inline; min-height: 32px; padding: 3px 8px; margin: 0; border: 0; border-radius: 8px; background: var(--primary-soft); color: var(--primary-text); font: inherit; font-weight: 700; touch-action: manipulation; cursor: pointer; }
.cwo.sel { background: var(--primary); color: var(--on-primary); }
.cwo.dim { opacity: .45; font-weight: 500; background: transparent; }
.cwo.ok { background: var(--ok); color: #fff; opacity: 1; }
.cwo.bad { background: var(--bad-soft); color: var(--bad-text); text-decoration: line-through; opacity: 1; }
.clock { font-variant-numeric: tabular-nums; }

/* Eşleştirme (sürükle-bırak, Pointer Events) */
.md-board { display: flex; gap: 12px; align-items: flex-start; margin-top: 8px; }
.md-pool { flex: 0 0 38%; display: flex; flex-direction: column; gap: 8px; min-height: 48px; }
.md-targets { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.md-card {
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: grab;
  padding: 10px 12px; border: 2px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); font-weight: 700; box-shadow: 0 3px 0 var(--line-strong);
}
.md-card.sel { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 3px 0 var(--primary); }
.md-card.dragging { opacity: .35; }
.md-card.good { background: var(--ok-soft); border-color: var(--ok); color: var(--ok-text); box-shadow: 0 3px 0 var(--ok); }
.md-card.wrong { background: var(--bad-soft); border-color: var(--bad); color: var(--bad-text); box-shadow: 0 3px 0 var(--bad); }
.md-ghost { position: fixed; z-index: 1000; pointer-events: none; box-shadow: var(--shadow); opacity: .95; margin: 0; }
.md-target { border: 2px dashed var(--line-strong); border-radius: var(--r-sm); padding: 8px 10px; min-height: 52px; }
.md-target.filled { border-style: solid; border-color: var(--line); }
.md-target.over { border-color: var(--primary); background: var(--primary-soft); }
.md-label { font-size: .95rem; margin-bottom: 4px; }
.md-slot:empty { display: none; }
.md-foot { margin-bottom: 0; } .md-foot .btn { flex: none; }
@media (max-width: 599px) {
  .md-board { flex-direction: column; align-items: stretch; min-width: 0; }
  .md-targets { order: 1; }
  .md-pool {
    order: 2; flex: none; width: 100%; box-sizing: border-box; flex-direction: row; flex-wrap: wrap; align-items: flex-start;
    position: sticky; bottom: var(--foot-h, 0px); z-index: 5; max-height: 35vh; max-height: 35dvh; overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain; min-height: 0;
    padding: 8px; background: var(--bar-bg); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 2px solid var(--line);
    border-radius: var(--r) var(--r) 0 0;
  }
  .md-pool:empty { display: none; }
  .md-card { touch-action: pan-y; font-size: 15px; min-height: 44px; box-sizing: border-box; display: flex; align-items: center; max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
  .md-pool .md-card { flex: 0 1 auto; width: fit-content; }
  .md-label { font-size: 15px; overflow-wrap: anywhere; }
}

/* Orijinal sayfalar */
.overlay { position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow: auto; padding: calc(env(safe-area-inset-top) + 8px) 12px calc(env(safe-area-inset-bottom) + 20px); }
.overlay img { width: 100%; max-width: 900px; display: block; margin: 8px auto; border-radius: var(--r-sm); background: #fff; }
.overlay .top { max-width: 900px; margin: 0 auto; }

/* ===== Kutlamalar ===== */
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 90; pointer-events: none; }
.celebrate { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: var(--s3); background: var(--scrim); animation: fade .2s; }
.celebrate.out { opacity: 0; transition: opacity .2s; }
.cel-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: 28px; padding: var(--s4) var(--s3) var(--s3); text-align: center; box-shadow: var(--shadow); animation: pop .45s cubic-bezier(.3, 1.5, .5, 1); }
.cel-card h2 { font-size: 1.5rem; margin: var(--s2) 0 4px; } .cel-card p { color: var(--muted); margin: 0 0 var(--s3); }
.cel-art { display: grid; place-items: center; animation: pop .6s .1s both cubic-bezier(.3, 1.8, .5, 1); }
.cel-level, .cel-streak { width: 120px; height: 120px; border-radius: 36px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.cel-level { background: var(--xp); color: #6b4300; box-shadow: 0 6px 0 var(--xp-d); }
.cel-level b, .cel-streak b { font-size: 2.4rem; }
.cel-streak { background: var(--streak-soft); color: var(--streak); }
.cel-streak b { color: var(--streak-text); }
.endscreen { position: fixed; inset: 0; z-index: 75; background: var(--bg); overflow: auto; display: grid; place-items: center; padding: calc(env(safe-area-inset-top) + var(--s3)) var(--s3) calc(env(safe-area-inset-bottom) + var(--s3)); animation: fade .25s; }
.end-in { width: 100%; max-width: 460px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--s1); }
.end-art { width: 140px; height: 140px; border-radius: 44px; display: grid; place-items: center; background: var(--xp); color: #6b4300; box-shadow: 0 8px 0 var(--xp-d); margin-bottom: var(--s2); animation: pop .6s cubic-bezier(.3, 1.8, .5, 1); }
.end-in h1 { font-size: 1.9rem; color: var(--xp-text); }
.end-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: 100%; margin: var(--s3) 0; }
.end-tile { border-radius: var(--r); border: 2px solid; overflow: hidden; animation: rise .4s both; }
.end-tile:nth-child(2) { animation-delay: .1s; } .end-tile:nth-child(3) { animation-delay: .2s; }
.end-tl { color: #fff; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 4px; }
.end-tv { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 12px 4px; background: var(--surface); font-size: 1.05rem; }
.end-tile.tone-xp { border-color: var(--xp); } .end-tile.tone-xp .end-tl { background: var(--xp); color: #6b4300; } .end-tile.tone-xp .ico { color: var(--xp); }
.end-tile.tone-ok { border-color: var(--ok); } .end-tile.tone-ok .end-tl { background: var(--ok); } .end-tile.tone-ok .ico { color: var(--ok); }
.end-tile.tone-primary { border-color: var(--primary); } .end-tile.tone-primary .end-tl { background: var(--primary); } .end-tile.tone-primary .ico { color: var(--primary); }
.xp-pop { position: fixed; z-index: 85; transform: translateX(-50%); pointer-events: none; font-weight: 800; color: var(--xp-text); background: var(--xp-soft); padding: 4px 10px; border-radius: var(--r-pill); animation: floatUp 1s ease-out forwards; }

/* ===== Animasyonlar ===== */
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }
@keyframes drop { from { transform: translate(-50%, -20px); opacity: 0; } }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
@keyframes pop { 0% { transform: scale(.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes bump { 50% { transform: scale(1.25); } }
@keyframes bob { 50% { transform: translateY(-5px); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes flip { 0% { transform: perspective(600px) rotateY(90deg); } 100% { transform: perspective(600px) rotateY(0); } }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 36px); } }
@keyframes dot { 0%, 80%, 100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .node-tip { animation: none; }
}

/* ---- Ana Sayfa bandı, ısı haritası, grafikler, istatistik ---- */
.band { display: flex; align-items: center; gap: 12px; margin: 0 0 var(--s2); padding: 10px 12px; border-radius: var(--r); border: 2px solid var(--xp); background: var(--xp-soft); color: var(--xp-text); }
.band > a { color: inherit; text-decoration: none; display: flex; flex-direction: column; min-width: 0; } .band .hint { color: inherit; opacity: .8; margin: 0; }
.chart { margin-top: var(--s1); } .chart svg { display: block; width: 100%; height: auto; max-width: 560px; overflow: visible; }
.ch-t { fill: var(--muted); font: 700 10px var(--font); } .ch-axis, .ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-bar { fill: var(--primary); } .ch-line { stroke: var(--ok); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; } .ch-dot { fill: var(--ok); stroke: var(--surface); stroke-width: 2; }
.ch-hm { fill: var(--line); } .ch-hm.l1 { fill: var(--ok); fill-opacity: .3; } .ch-hm.l2 { fill: var(--ok); fill-opacity: .55; } .ch-hm.l3 { fill: var(--ok); fill-opacity: .8; } .ch-hm.l4 { fill: var(--ok); }
.acc-row { display: grid; grid-template-columns: minmax(88px, 1.1fr) 2fr auto auto; align-items: center; gap: 8px; min-height: 44px; }
.acc-row b { min-width: 3.2ch; text-align: right; font-variant-numeric: tabular-nums; } .acc-row small { margin: 0; min-width: 4ch; }
.weak-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 2px solid var(--line); } .weak-row:first-of-type { border-top: 0; } .weak-row .btn { flex: none; }
.book-prog { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }

/* ---- Bugünkü çalışmam (Ana Sayfa kartı) + günlük oturum ---- */
.today { display: flex; flex-direction: column; gap: var(--s2); border-color: var(--primary); background: var(--primary-soft); }
.today h2 { font-size: 1.4rem; margin: 2px 0; color: var(--primary-text); }
.today .eyebrow { color: var(--primary-text); }
.today-t { display: flex; flex-direction: column; gap: 6px; }
.today .pills { margin: 0; }
.today .btn { min-height: 64px; font-size: 1.15rem; text-decoration: none; }
.btn.on { --b: var(--warn-soft); --bd: var(--warn); --fg: var(--warn-text); }
.end-tiles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 600px) { .end-tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.end-tile:nth-child(4) { animation-delay: .3s; }
.end-tile.tone-streak { border-color: var(--streak); } .end-tile.tone-streak .end-tl { background: var(--streak); } .end-tile.tone-streak .ico { color: var(--streak); }
.lesson-top .clock { flex: none; font-variant-numeric: tabular-nums; }

/* ---- Deneme sınavı (modules/exam.js) ---- */
.mix { display: flex; flex-direction: column; gap: 4px; }
.mix-row { display: grid; grid-template-columns: minmax(110px, 1.2fr) 2fr 2.4ch minmax(7ch, auto); align-items: center; gap: 8px; min-height: 36px; }
.mix-row b { text-align: right; font-variant-numeric: tabular-nums; } .mix-row small { margin: 0; text-align: right; }
.mix-row.none { opacity: .6; }
.note-warn { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: var(--s1) 0; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--warn-text); }
.note-warn p { margin: 0; } .note-warn .ico { flex: none; }
.ex-row { display: flex; align-items: center; gap: 8px; min-height: 56px; text-decoration: none; color: inherit; margin-bottom: var(--s1); }
.ex-q { display: flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; color: inherit; }
.ex-body.paused { filter: blur(14px); pointer-events: none; user-select: none; }
.ex .lesson-top .counter { overflow: hidden; text-overflow: ellipsis; }
.omr { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 var(--s2); }
.omr-b { min-width: 44px; min-height: 44px; border-radius: 50%; display: inline-grid; place-items: center; font: inherit; font-weight: 800; font-size: .9rem; text-decoration: none; cursor: pointer;
  border: 2px solid var(--line-strong); background: var(--surface); color: var(--muted); }
.omr-b.ans { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.omr-b.mark { border-color: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.omr-b.cur { outline: 3px solid var(--text); outline-offset: 2px; }
.omr-b.v-ok { background: var(--ok-soft); color: var(--ok-text); } .omr-b.v-bad { background: var(--bad-soft); color: var(--bad-text); }

/* ---- Okuma: sözlük balonu + sesli okuma çubuğu (modules/reader.js) ---- */
.sn { border-radius: 6px; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background .2s; scroll-margin: 96px 0 calc(var(--foot-h, 90px) + 96px); }
.sn.speaking { background: var(--primary-soft); }
.rdbar { position: sticky; bottom: calc(var(--foot-h, 0px) + var(--s1)); z-index: 6; display: flex; flex-direction: column; gap: 8px; margin-top: var(--s2); padding: 8px 12px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--r); box-shadow: 0 4px 0 var(--line); }
.tts { display: flex; align-items: center; gap: 8px; }
.tts[hidden] { display: none; } .tts .tts-pos { margin-left: auto; color: var(--muted); font-weight: 700; white-space: nowrap; }
.gloss-pop { position: fixed; z-index: 60; width: min(320px, calc(100vw - 16px)); padding: var(--s2); background: var(--surface); color: var(--text); border: 2px solid var(--line-strong); border-radius: var(--r); box-shadow: 0 4px 0 var(--line-strong), 0 12px 32px rgba(0, 0, 0, .25); animation: fade .15s ease-out; }
.gp-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; } .gp-word { font-size: 1.25rem; font-weight: 800; }
.gp-tr { font-size: 1.15rem; font-weight: 700; margin: 6px 0 var(--s1); } .gp-tr small { color: var(--muted); font-weight: 600; font-size: .9rem; } .gp-tr.none { color: var(--muted); font-weight: 600; }
.gp-act { display: flex; gap: 8px; margin: var(--s1) 0; } .gp-act .btn { flex: 1; }
.field .row { margin: 0; flex-wrap: nowrap; } .field .row > select { flex: 1; min-width: 0; margin: 0; } .field .row > .btn { flex: none; }
.ch-band { fill: var(--ok); fill-opacity: .16; }

/* ---- Okuma hızı, odak modu, okuma görünümü, vurgu/not (reader.js, readSpeed.js, annots.js) ---- */
.rd { font-size: calc(1.04rem * var(--rd-size, 1)); line-height: var(--rd-lh, 1.7); }
.rt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 44px; }
.rt .rt-hint { flex: 1; min-width: 0; color: var(--muted); font-size: .85rem; font-weight: 700; }
.rt-res { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; } .rt-res b { font-size: 1.25rem; } .rt-res small { color: var(--muted); font-weight: 700; }
.rt-band { flex-basis: 100%; margin: 0; color: var(--muted); font-size: .85rem; font-weight: 700; }
.lesson-tools { display: flex; flex: none; gap: 2px; } .lesson-tools:empty { display: none; }
.lesson-tools .btn.on { --b: var(--primary-soft); --bd: var(--primary); --fg: var(--primary-text); }
.rd.focus .para { opacity: .28; cursor: pointer; transition: opacity .25s; scroll-margin: 96px 0 calc(var(--foot-h, 90px) + 96px); }
.rd.focus .para.cur { opacity: 1; cursor: auto; }
.hl { border-radius: 3px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hl-y { background: var(--hl-y); } .hl-g { background: var(--hl-g); } .hl-p { background: var(--hl-p); }
.hl-flash { outline: 3px solid var(--primary); outline-offset: 1px; }
.nmark { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin: 0 2px; padding: 0; vertical-align: text-bottom; border: 0; border-radius: 7px; background: var(--primary); color: var(--on-primary); cursor: pointer; }
.nmark::after { content: ''; position: absolute; inset: -11px; } /* dokunma hedefi 44px */
.annbar { position: fixed; z-index: 50; display: flex; align-items: center; padding: 0 4px; background: var(--surface); border: 2px solid var(--line-strong); border-radius: var(--r-pill); box-shadow: 0 4px 0 var(--line-strong), 0 12px 32px rgba(0, 0, 0, .25); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; animation: fade .15s ease-out; }
.annbar .btn { margin: 0; }
.ann-dot { position: relative; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: var(--text); cursor: pointer; }
.ann-dot::before { content: ''; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--hl-y); }
.ann-dot.g::before { background: var(--hl-g); } .ann-dot.p::before { background: var(--hl-p); }
.ann-dot.on::before { border-color: var(--text); }
.ann-dot .ico { position: absolute; }
.ann-colors { display: flex; gap: 4px; margin: 0 0 var(--s1); }
.ann-quote { margin: 0 0 var(--s1); padding: 8px 12px; border-left: 4px solid var(--primary); border-radius: var(--r-sm); background: var(--surface-2); max-height: 8em; overflow: auto; }
.ann-filters { display: flex; gap: var(--s1); } .ann-filters select { flex: 1; min-width: 0; margin: 0; }
.ann-card { display: flex; align-items: flex-start; gap: var(--s1); margin-bottom: var(--s1); }
.ann-main { flex: 1; min-width: 0; display: block; color: inherit; text-decoration: none; }
.ann-meta { display: flex; align-items: center; gap: 8px; } .ann-meta .eyebrow { margin: 0; }
.ann-chip { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--hl-y); }
.ann-chip.g { background: var(--hl-g); } .ann-chip.p { background: var(--hl-p); }
.ann-text { margin: 6px 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ann-note { display: flex; align-items: flex-start; gap: 6px; margin: 6px 0 0; color: var(--muted); font-weight: 600; white-space: pre-wrap; } .ann-note .ico { margin-top: 3px; }

/* ===== Genel arama (#/search, modules/search.js) ===== */
.srch-box { position: relative; margin: var(--s1) 0 var(--s2); } .srch-box > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.srch-box input { margin: 0; padding-left: 46px; font-weight: 700; }
.srch-group { margin-bottom: var(--s3); } .srch-group h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 var(--s1); }
.srch-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--s1); min-height: 44px; color: inherit; text-decoration: none; }
.srch-row .eyebrow { margin: 0; } .srch-t { font-size: 1.1rem; } .srch-s { overflow-wrap: anywhere; } .srch-q { color: var(--muted); }
.srch-s svg { vertical-align: -2px; color: var(--muted); }
mark.srch-hit { background: var(--hl-y); color: inherit; border-radius: 4px; padding: 0 1px; font-weight: 800; }
.srch-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.srch-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 2px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.srch-chip svg { color: var(--muted); }

/* ===== Yerel uygulama hissi (STANDARDS: "Yerel his") ===== */
html, body { overscroll-behavior: none; touch-action: manipulation; } /* aşağı çekip yenileme/kenar sekmesi yok; çift dokunma yakınlaştırması yok (ayarlardaki yazı boyutu çalışır) */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
:where(.rd, .passage) { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; } /* seçim + büyüteç yalnızca okuma metninde (.cw gibi kendi none'ları korunur) */
input, textarea, select { -webkit-user-select: text; user-select: text; } /* iOS'ta user-select:none yazmayı engeller */
.nav-fwd { animation: slideFwd .22s ease-out; } .nav-back { animation: slideBack .22s ease-out; }
@keyframes slideFwd { from { transform: translateX(28px); opacity: 0; } }
@keyframes slideBack { from { transform: translateX(-28px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .nav-fwd, .nav-back { animation: none; } }
@media (display-mode: window-controls-overlay) { /* masaüstü pencere denetimleri üst çubuğa binmesin */
  #appbar { padding-right: calc(100vw - env(titlebar-area-x, 0px) - env(titlebar-area-width, 100vw)); -webkit-app-region: drag; app-region: drag; }
  #appbar a, #appbar button { -webkit-app-region: no-drag; app-region: no-drag; }
}

/* Okuma + soru iki sütun: 16:10 Samsung tabletlerde (yatay ~1280×800) kısa yükseklikte de sığar */
@media (min-width: 800px) and (orientation: landscape) { .split .passage { max-height: max(260px, calc(100vh - 100px - var(--foot-h, 90px))); } }

/* Uygulamayı yükle: iOS/Android adımları */
.ios-steps { list-style: none; margin: var(--s2) 0; padding: 0; display: grid; gap: var(--s1); counter-reset: st; }
.ios-steps li { display: flex; align-items: center; gap: var(--s2); padding: 12px; border: 2px solid var(--line); border-radius: var(--r); background: var(--surface-2); counter-increment: st; font-weight: 700; }
.ios-steps li::before { content: counter(st); flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); font-size: .9rem; font-weight: 800; }
.ios-ic { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: var(--r-sm); background: var(--primary-soft); color: var(--primary-text); }

/* Giriş yokken tanıtım (modules/landing.js) */
.landing-hero { text-align: center; padding: 8px 0 4px; }
.landing-hero h1 { margin: 6px 0 4px; font-size: 1.8rem; }
.landing-hero .brand-accent { color: #FF7A1A; }
.landing-logo { display: block; margin: 0 auto; }
.landing > * + * { margin-top: 12px; }
@media (min-width: 900px) { .landing { max-width: 520px; margin: 0 auto; } }
