/* KKÜ BM Çalışma — tek dosya stil sistemi */

/* ---------------------------------------------------------------------------
   Tema: "Teknik Rapor" — nötr arduvaz zemin, tek sinyal mavisi, numaralı bölümler.
   Gövde de başlık da IBM Plex Sans; kod ve etiketler IBM Plex Mono. Süs yok:
   ayrımı gölge değil ince çizgi yapar, bu yüzden köşe yarıçapı 2px'te kalır.

   app.js `applyTheme()` her zaman çözülmüş bir değer damgalar ("auto" ise işletim
   sisteminin tercihine bakar), bu yüzden burada `prefers-color-scheme` sorgusu YOK:
   her palet tek yerde tanımlı, ikizlenmiyor.
   --------------------------------------------------------------------------- */
:root {
  color-scheme: light;
  --bg: #f2f4f6;
  --bg-2: #e9edf1;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --line: #d3dae0;
  --line-soft: #e3e8ec;
  --txt: #16202a;            /* kâğıt üzerinde ≈15:1 */
  --txt-2: #41505d;          /* ≈8.6:1 */
  --txt-3: #66727d;          /* ≈5.2:1 */
  --acc: #2f5d8a;            /* tek sinyal mavisi — tıklanabilir olan her şey */
  --acc-2: #1f6f78;          /* ikincil: ilerleme, kod şeridi */
  --ok: #1b6b4c;
  --bad: #a8322a;
  --warn: #8a5a0b;
  --c: var(--acc);
  --c-lift: 0%;
  --r: 2px;
  --r-lg: 4px;
  --sh: 0 1px 2px rgba(22,32,42,.06);
  --nav-h: 62px;
  --top-h: 56px;
  /* tipografi — tek aile, iki rol */
  --ff: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ff-head: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fm: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --body-size: 14.5px;
  --prose-size: 16.5px;
  --prose-lh: 1.68;
  --measure: 70ch;
  --h1-size: clamp(23px, 5.6vw, 27px);
  --h2-size: 19px;
  --h3-size: 16.5px;
  --letter-head: -.01em;
  /* kod */
  --code-bg: #eef1f4;
  --code-txt: #16202a;
  --tk-kw: #2f5d8a;
  --tk-str: #1b6b4c;
  --tk-com: #66727d;
  --tk-num: #8a5a0b;
  --tk-fn: #1f6f78;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f151b;
  --bg-2: #0b1116;
  --surface: #151d26;
  --surface-2: #1b2531;
  --line: #2a3642;
  --line-soft: #1f2a35;
  --txt: #e6ecf2;            /* ≈13.7:1 */
  --txt-2: #a9b6c2;          /* ≈7.9:1 */
  --txt-3: #7d8b97;          /* ≈4.7:1 */
  --acc: #74a9dd;
  --acc-2: #58b3ab;
  --ok: #4bbf8a;
  --bad: #f0798a;
  --warn: #e0a63c;
  --c-lift: 26%;
  --sh: 0 1px 2px rgba(0,0,0,.5);
  --code-bg: #0b1117;
  --code-txt: #e6ecf2;
  --tk-kw: #8fb8ff;
  --tk-str: #7fd1a8;
  --tk-com: #7d8b97;
  --tk-num: #e3b341;
  --tk-fn: #58b3ab;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--ff);
  font-size: var(--body-size);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 6px; }

/* ---------- açılış ---------- */
.splash {
  position: fixed; inset: 0; display: grid; place-content: center; gap: 14px;
  justify-items: center; background: var(--bg); z-index: 100;
}
.splash-logo {
  width: 64px; height: 64px; border-radius: var(--r-lg); display: grid; place-content: center;
  background: var(--acc); color: var(--surface); font-family: var(--ff-head);
  font-weight: 700; letter-spacing: .5px; animation: pulse 1.4s ease-in-out infinite;
}
.splash-txt { color: var(--txt-3); font-size: 13px; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: .9 } 50% { transform: scale(1.06); opacity: 1 } }

/* ---------- iskelet ---------- */
.shell { min-height: 100%; }

.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--top-h);
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.brand-mark {
  width: 32px; height: 32px; flex: none; border-radius: var(--r); display: grid; place-content: center;
  background: var(--acc); color: var(--surface); font-family: var(--ff-head); font-size: 11px; font-weight: 700;
}
.brand-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-txt b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-txt small { font-size: 11px; color: var(--txt-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.streak {
  display: flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 700;
}
.icon-btn {
  width: 36px; height: 36px; flex: none; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-size: 17px; line-height: 1;
  display: grid; place-content: center; transition: background .15s;
}
.icon-btn:hover { background: var(--surface-2); }

.view { padding: 16px 14px calc(var(--nav-h) + 26px + env(safe-area-inset-bottom)); max-width: 880px; margin: 0 auto; }
.view:focus { outline: none; }

/* alt sekme çubuğu (mobil) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  border-top: 1px solid var(--line-soft);
}
.tabbar a, .tabbar button {
  display: grid; place-content: center; justify-items: center; gap: 2px; position: relative;
  color: var(--txt-3); font-size: 19px; transition: color .15s;
  background: none; border: 0; padding: 0; cursor: pointer; font-family: var(--ff-head);
}
.tabbar a small, .tabbar button small { font-size: 10px; font-weight: 600; }
.tabbar a.on, .tabbar button.on { color: var(--acc); }

/* ---------- mobil "Menü" paneli ----------
   Alt çubuğa en fazla 5 sekme sığıyor; geri kalan bölümler (Derslerim, Program, Notlar,
   Ara, Yanlışlarım, Notlarım, İstatistik, Ayarlar) bu panelden açılır. Masaüstünde kenar
   menü hepsini zaten gösterdiği için panel yalnızca dar ekranda anlamlı. */
/* z-index alt çubuğun (40) bir altında: çubuk görünür kalır, "Menü"ye tekrar basınca panel kapanır. */
.more { position: fixed; inset: 0; z-index: 39; }
.more-backdrop { position: absolute; inset: 0; background: rgba(15, 21, 27, .38); animation: fade .18s ease; }
.more-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--surface); border-top: 1px solid var(--line);
  border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: 0 -8px 30px rgba(15, 21, 27, .16);
  padding: 10px 14px calc(var(--nav-h) + 14px + env(safe-area-inset-bottom));
  animation: sheet-up .22s ease;
}
.more-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 10px; }
.more-head b { font-family: var(--fm); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--txt-3); font-weight: 500; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.more-grid a {
  display: grid; justify-items: center; gap: 6px; padding: 13px 4px 11px; text-align: center;
  border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--surface-2);
  color: var(--txt-2); font-family: var(--ff-head); font-size: 12.5px; font-weight: 600; line-height: 1.2;
}
.more-grid a .ni { width: 22px; height: 22px; }
.more-grid a.on { color: var(--acc); border-color: color-mix(in srgb, var(--acc) 45%, var(--line)); background: color-mix(in srgb, var(--acc) 8%, var(--surface)); }
.more-grid a:active { transform: scale(.98); }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@media (min-width: 900px) { .more { display: none !important; } }
.sidenav { display: none; }

.badge {
  position: absolute; top: 6px; right: 50%; transform: translateX(20px);
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: var(--r);
  background: var(--bad); color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-content: center;
}

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 232px 1fr; grid-template-rows: auto 1fr; }
  .topbar { grid-column: 1 / -1; }
  .tabbar, .only-mobile { display: none !important; }
  .sidenav {
    display: flex; flex-direction: column; gap: 2px; padding: 16px 12px;
    border-right: 1px solid var(--line-soft); position: sticky; top: var(--top-h);
    height: calc(100vh - var(--top-h));
  }
  .sidenav a {
    display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--r);
    color: var(--txt-2); font-weight: 600; font-size: 14px; position: relative; transition: background .15s, color .15s;
  }
  .sidenav a:hover { background: var(--surface); color: var(--txt); }
  .sidenav a.on { background: color-mix(in srgb, var(--acc) 16%, var(--surface)); color: var(--txt); }
  .sidenav .ni { width: 19px; height: 19px; }
  .sidenav .badge { position: static; transform: none; margin-left: auto; }
  .sidenav-foot { margin-top: auto; display: grid; place-items: center; padding: 12px 0; }
  .view { padding: 24px 28px 60px; }
}

/* ---------- simgeler ----------
   Emoji yerine tek bir cizgi-ikon seti: semboller index.html icindeki <svg class="sprite">
   blogunda, hepsi 24x24 izgarada ve currentColor ile ciziliyor. Boylece simgeler metinle
   ayni rengi alir, kagit/ozalit modlarinda kendiliginden doner ve punto ile olceklenir. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico, .ni {
  width: 1.15em; height: 1.15em; flex: none; vertical-align: -.22em;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.ico-md { width: 26px; height: 26px; stroke-width: 1.4; }
.ico-lg { width: 46px; height: 46px; stroke-width: 1.1; }
.btn .ico, .chip .ico { opacity: .85; }
.empty .e-ico .ico { width: 42px; height: 42px; stroke-width: 1.1; color: var(--txt-3); }

/* ---------- ortak parçalar ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r);
  padding: 15px; box-shadow: var(--sh); min-width: 0;
}
.card + .card { margin-top: 12px; }
.stack { display: grid; gap: 12px; min-width: 0; }
.stack > * { min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.muted { color: var(--txt-3); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }

/* Başlıklar ve arayüz iskeleti Plex Sans; yalnızca akan metin serif kalır.
   "Teknik dil" başlıkta, etikette ve rakamda; kitap sakinliği gövdede. */
h1, h2, h3, h4 { font-family: var(--ff-head); letter-spacing: var(--letter-head); text-wrap: balance; overflow-wrap: break-word; }
/* "Denetlenebilirlik/Gözlenebilirlik" gibi bölünemeyen birleşikler dar ekranda taşmasın */
h1 { font-size: var(--h1-size); margin: 0 0 4px; line-height: 1.18; }
h2 { font-size: var(--h2-size); margin: 22px 0 10px; }
h3 { font-size: var(--h3-size); margin: 18px 0 8px; }
.btn, .chip, .seg button, .tabbar a, .sidenav a, .brand-txt, .field label,
.week-num, .grade, .stat b, .day-block h3,
input, select, textarea, .ans-input { font-family: var(--ff-head); }
/* Girilen sayılar hizalı dursun (hedef, kart sayısı, süre). */
input[type="number"], input[type="date"] { font-variant-numeric: tabular-nums; }
.sec-title { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 0 10px; }
.sec-title h2 { margin: 0; }
.sec-title a { font-size: 13px; color: var(--acc); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 15px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface-2); font-weight: 650; font-size: 14px; cursor: pointer;
  transition: transform .08s, background .15s, border-color .15s;
}
.btn:active { transform: scale(.975); }
.btn:hover { background: var(--surface); }
.btn.primary {
  background: var(--acc); border-color: transparent; color: var(--surface);
}
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); color: var(--bad); background: transparent; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--line-soft); color: var(--txt-2);
  font-family: var(--fm); font-size: 10.5px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase;
}
.chip.on { background: color-mix(in srgb, color-mix(in oklab, var(--c), var(--txt) var(--c-lift)) 22%, var(--surface)); border-color: color-mix(in srgb, color-mix(in oklab, var(--c), var(--txt) var(--c-lift)) 45%, transparent); color: var(--txt); }
.chip.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.chip.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }

.bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: color-mix(in oklab, var(--c), var(--txt) var(--c-lift)); transition: width .4s ease; }

/* ---------- ders kartları ---------- */
.course-grid { display: grid; gap: 11px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .course-grid { grid-template-columns: 1fr 1fr; } }

.course-card {
  display: block; background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 14px; position: relative; overflow: hidden;
  box-shadow: var(--sh); transition: transform .12s, border-color .15s;
}
.course-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, color-mix(in oklab, var(--c), var(--txt) var(--c-lift)) 45%, var(--line)); }
.course-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: color-mix(in oklab, var(--c), var(--txt) var(--c-lift)); }
.course-card .cc-top { display: flex; align-items: center; gap: 10px; }
.course-card .cc-ico {
  width: 38px; height: 38px; flex: none; border-radius: var(--r); display: grid; place-content: center; font-size: 19px;
  background: color-mix(in srgb, color-mix(in oklab, var(--c), var(--txt) var(--c-lift)) 18%, var(--surface));
}
.course-card h3 { margin: 0; font-size: 15px; line-height: 1.3; }
.course-card .cc-meta { font-size: 11.5px; color: var(--txt-3); }
.course-card .bar { margin-top: 11px; }
.course-card .cc-foot { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11.5px; color: var(--txt-3); }
.course-card.soon { opacity: .58; }

/* ---------- hafta listesi ---------- */
.week-list { display: grid; gap: 8px; }
.week-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 13px;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r);
  transition: border-color .15s, transform .1s;
}
.week-item:hover { border-color: color-mix(in srgb, color-mix(in oklab, var(--c), var(--txt) var(--c-lift)) 45%, var(--line)); }
.week-item:active { transform: scale(.995); }
.week-num {
  width: 34px; height: 34px; flex: none; border-radius: var(--r); display: grid; place-content: center;
  background: var(--surface-2); font-weight: 750; font-size: 13px; color: var(--txt-2);
}
.week-item.done .week-num { background: color-mix(in srgb, var(--ok) 20%, var(--surface)); color: var(--ok); }
.week-item .wi-body { flex: 1; min-width: 0; overflow: hidden; }
.week-item .wi-body b { display: block; font-size: 14px; font-weight: 620; }
.week-item .wi-body small { color: var(--txt-3); font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-item .wi-score { font-size: 12px; font-weight: 700; }

/* ---------- konu / prose ---------- */
/* Tüm .prose'lar (konu, çözüm açıklaması, not) aynı okuma tipografisini paylaşır. */
.prose {
  font-size: var(--prose-size);
  line-height: var(--prose-lh);
  text-wrap: pretty;
  min-width: 0; overflow-wrap: anywhere;
}
/* Konu anlatımı zeminin üstünde ayrı bir kutu değil: teknik rapor dilinde metin
   doğrudan sayfada durur, ölçüyü yalnızca genişlik sınırlar.
   width:100% şart: .stack bir grid ve auto kenar boşluğu verilen grid öğesi esnemek
   yerine içeriğine göre büyür; geniş tablo/kod telefonda sayfayı taşırır. */
article.prose {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  counter-reset: sec;
}
.prose > * { min-width: 0; max-width: 100%; }
.prose p, .prose li { overflow-wrap: anywhere; }
.prose ul, .prose ol { overflow-wrap: anywhere; }
/* md.js başlık seviyesini bir kaydırır: ders metnindeki "##" h3 olarak çıkar (sayfanın
   h1'i konu başlığıdır). Bu yüzden BÖLÜM başlığı h3'tür — içeriğin 2016 konusunun
   tamamı bu seviyeyi kullanıyor. h2 ("#", 122 konuda) daha büyük bir üst başlıktır.
   Bölümler rapor gibi numaralanır (1.0, 2.0 …); numara yalnızca konu anlatımında,
   çünkü quiz çözümleri ve notlar da .prose kullanıyor ve orada sayı anlamsız olur. */
.prose h2 { font-size: calc(var(--h2-size) + 3px); margin: 32px 0 10px; }
.prose h3 { font-size: var(--h2-size); margin: 28px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--txt); }
article.prose h3::before {
  counter-increment: sec; content: counter(sec) ".0 ";
  font-family: var(--fm); font-size: .82em; color: var(--acc); font-weight: 500;
}
.prose h4 { font-size: var(--h3-size); margin: 20px 0 6px; color: var(--txt); }
.prose h5 { font-size: 15px; margin: 16px 0 4px; color: var(--txt-2); }
.prose p { margin: 10px 0; }
.prose ul, .prose ol { margin: 10px 0; padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose li > p { margin: 4px 0; }
.prose strong { color: var(--txt); font-weight: 680; }
.prose mark { background: color-mix(in srgb, var(--warn) 35%, var(--surface)); color: inherit; padding: 0 3px; border-radius: 4px; }
.prose a { color: var(--acc); text-decoration: underline; text-underline-offset: 2px; }
.prose hr { border: none; border-top: 1px solid var(--line-soft); margin: 22px 0; }
.prose code {
  font-family: var(--fm); font-size: .88em; padding: 2px 5px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--line-soft);
}
.prose blockquote { margin: 12px 0; padding: 8px 14px; border-left: 2px solid var(--acc); background: var(--surface-2); color: var(--txt-2); }

.table-wrap { overflow-x: auto; margin: 14px 0; border: 1px solid var(--line-soft); border-radius: var(--r); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); }
th { background: var(--surface-2); font-weight: 680; font-size: 13px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }

/* Kod bloğu artık temayla birlikte dönüyor: kâğıt modunda açık zeminli listing,
   ozalit modunda koyu. Sol kenardaki mavi şerit teknik çizimdeki kesit işareti. */
figure.code {
  margin: 14px 0; border: 1px solid var(--line); border-left: 3px solid var(--acc-2);
  border-radius: var(--r); overflow: hidden; background: var(--code-bg);
}
figure.code figcaption {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 12px; background: color-mix(in srgb, var(--txt) 5%, transparent);
  border-bottom: 1px solid var(--line);
  font-size: 11px; color: var(--txt-3); font-family: var(--fm); text-transform: uppercase; letter-spacing: .04em;
}
figure.code pre { margin: 0; padding: 13px 14px; overflow-x: auto; }
figure.code code {
  font-family: var(--fm); font-size: 13px; line-height: 1.65; background: none; border: none; padding: 0;
  color: var(--code-txt); white-space: pre; font-variant-ligatures: none;
}
.copy-btn {
  background: none; border: 1px solid var(--line); border-radius: var(--r); padding: 2px 8px;
  font-size: 10px; color: var(--txt-3); cursor: pointer; text-transform: none; letter-spacing: 0;
}
.copy-btn:hover { color: var(--txt); border-color: var(--txt-3); }
.tk-kw { color: var(--tk-kw); }
.tk-str { color: var(--tk-str); }
.tk-com { color: var(--tk-com); font-style: italic; }
.tk-num { color: var(--tk-num); }
.tk-fn { color: var(--tk-fn); }

.math-block { overflow-x: auto; overflow-y: hidden; padding: 6px 0; margin: 14px 0; }
.math-raw { color: var(--warn); }
.katex { font-size: 1.03em; }
/* Satır içi formüller sarılamaz. KaTeX'in `.katex` kutusu `display: inline` olduğu için
   max-width/overflow ona işlemez; bu yüzden md.js uzun formülleri .math-long ile
   sarmalar ve yalnız onları kaydırılabilir yaparız. Kısa formüller düz satır içi kalır,
   böylece metin hizası bozulmaz. */
.math-long {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  vertical-align: middle;
}
.katex-display > .katex { max-width: none; }

/* KaTeX her formülü iki kez üretir: görünen HTML + ekran okuyucular için gizli MathML.
   Gizli MathML mutlak konumlu; kaydırma kutusu `position: relative` değilse kutunun
   dışına taşıp SAYFAYI yatay kaydırıyor. Kutuları konumlandırıp içeride tutuyoruz. */
.table-wrap, .math-block, .math-long, figure.code, figure.code pre { position: relative; }
.katex .katex-mathml {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.qtext, .fq, .fa, .verdict, .callout { min-width: 0; overflow-wrap: anywhere; }
.callout > *, .verdict > * { max-width: 100%; }
.table-wrap, .math-block, figure.code { min-width: 0; max-width: 100%; }
.choice .grow { overflow-wrap: anywhere; }
.katex-display { margin: 0; }

.callout { margin: 14px 0; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2); }
/* Kutu başlıkları teknik çizim etiketi gibi: mono, seyrek, büyük harf.
   (Büyük harf dönüşümü doğru olsun diye index.html'de lang="tr" şart.) */
.callout-h { font-family: var(--fm); font-weight: 500; font-size: 11.5px; letter-spacing: .11em; text-transform: uppercase; margin-bottom: 6px; }
.callout p:first-of-type { margin-top: 2px; }
.callout p:last-child { margin-bottom: 0; }
.callout.c-tip { border-color: color-mix(in srgb, var(--acc) 45%, transparent); background: color-mix(in srgb, var(--acc) 10%, var(--surface)); }
.callout.c-warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 9%, var(--surface)); }
.callout.c-exam { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: color-mix(in srgb, var(--bad) 9%, var(--surface)); }
.callout.c-def { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 8%, var(--surface)); }

/* ---------- quiz ---------- */
.quiz-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.quiz-head .bar { flex: 1; }
.qbox { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--sh); min-width: 0; }
.qtext { font-size: 16.5px; line-height: 1.65; margin-bottom: 16px; }
.qtext p:first-child { margin-top: 0; }
.choices { display: grid; gap: 9px; }
.choice {
  display: flex; align-items: flex-start; gap: 11px; padding: 12px 14px; width: 100%; text-align: left;
  border-radius: var(--r); border: 1.5px solid var(--line); background: var(--surface-2); cursor: pointer;
  transition: border-color .15s, background .15s, transform .08s; font-size: 14.5px; line-height: 1.5;
}
.choice:hover:not([disabled]) { border-color: var(--acc); }
.choice:active:not([disabled]) { transform: scale(.99); }
.choice .ck {
  width: 24px; height: 24px; flex: none; border-radius: var(--r); display: grid; place-content: center;
  background: var(--surface); border: 1px solid var(--line); font-size: 12px; font-weight: 750; margin-top: 1px;
}
.choice.sel { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 14%, var(--surface)); }
.choice.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 16%, var(--surface)); }
.choice.right .ck { background: var(--ok); color: #04240f; border-color: transparent; }
.choice.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, var(--surface)); }
.choice.wrong .ck { background: var(--bad); color: #2b0710; border-color: transparent; }
.choice[disabled] { cursor: default; }

.ans-input {
  width: 100%; padding: 12px 14px; border-radius: var(--r); border: 1.5px solid var(--line);
  background: var(--surface-2); font-size: 15px;
}
.ans-input:focus { border-color: var(--acc); outline: none; }
textarea.ans-input { min-height: 110px; resize: vertical; font-family: inherit; line-height: 1.6; }
textarea.ans-input.code { font-family: var(--fm); font-size: 13.5px; }

.verdict { margin-top: 16px; padding: 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2); }
.verdict.ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 9%, var(--surface)); }
.verdict.bad { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: color-mix(in srgb, var(--bad) 9%, var(--surface)); }
.verdict-h { font-weight: 750; margin-bottom: 6px; display: flex; align-items: center; gap: 7px; }
.verdict .prose { font-size: 14.5px; }
.verdict .prose p:first-child { margin-top: 0; }

.rubric { margin: 8px 0 0; padding-left: 20px; font-size: 14px; color: var(--txt-2); }

/* Soru/sinav eylem cubugu — alt sekme cubugunun ustune sabitlenir */
.quiz-actions {
  position: sticky;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px);
  z-index: 25;
  margin: 18px -6px 0;
  padding: 8px 6px;
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(1.6) blur(10px);
}
@media (min-width: 900px) { .quiz-actions { bottom: 14px; } }

/* ---------- kartlar (SRS) ---------- */
.flash {
  min-height: 240px; display: grid; place-content: center; text-align: center; gap: 14px;
  padding: 28px 20px; border-radius: var(--r-lg); border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--sh); cursor: pointer;
}
.flash .fq { font-size: 20px; font-weight: 650; line-height: 1.45; }
.flash .fa { font-size: 16px; color: var(--txt-2); line-height: 1.6; border-top: 1px dashed var(--line); padding-top: 14px; }
.grade-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 12px; }
.grade {
  display: grid; gap: 1px; padding: 11px 4px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface-2); cursor: pointer; text-align: center; font-size: 13px; font-weight: 680;
}
.grade small { font-size: 10px; color: var(--txt-3); font-weight: 500; }
.grade.g-again { border-color: color-mix(in srgb, var(--bad) 50%, transparent); color: var(--bad); }
.grade.g-hard { border-color: color-mix(in srgb, var(--warn) 50%, transparent); color: var(--warn); }
.grade.g-good { border-color: color-mix(in srgb, var(--ok) 50%, transparent); color: var(--ok); }
.grade.g-easy { border-color: color-mix(in srgb, var(--acc) 50%, transparent); color: var(--acc); }

/* ---------- istatistik ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 620px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 13px; }
.stat b { display: block; font-size: 24px; font-weight: 750; letter-spacing: -.02em; line-height: 1.2; }
.stat small { color: var(--txt-3); font-size: 11.5px; }

.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; overflow-x: auto; padding: 4px 0; }
.heat i { width: 12px; height: 12px; border-radius: 3px; background: var(--surface-2); }
.heat i[data-l="1"] { background: color-mix(in srgb, var(--acc) 30%, var(--surface-2)); }
.heat i[data-l="2"] { background: color-mix(in srgb, var(--acc) 55%, var(--surface-2)); }
.heat i[data-l="3"] { background: color-mix(in srgb, var(--acc) 78%, var(--surface-2)); }
.heat i[data-l="4"] { background: var(--acc); }

.spark { display: flex; align-items: flex-end; gap: 3px; height: 60px; }
.spark i { flex: 1; background: color-mix(in oklab, var(--c), var(--txt) var(--c-lift)); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }

/* ---------- program ---------- */
.day-block { margin-bottom: 16px; }
.day-block h3 { margin: 0 0 8px; font-size: 14px; color: var(--txt-2); text-transform: uppercase; letter-spacing: .06em; }
.slot {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line-soft); margin-bottom: 7px; position: relative; overflow: hidden;
}
.slot::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: color-mix(in oklab, var(--c), var(--txt) var(--c-lift)); }
.slot .time { font-family: var(--fm); font-size: 12.5px; color: var(--txt-2); flex: none; width: 46px; }
.slot .sl-body b { display: block; font-size: 14px; }
.slot .sl-body small { color: var(--txt-3); font-size: 11.5px; }
.slot.now { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc) inset; }

/* ---------- çeşitli ---------- */
.goal-ring { width: 54px; height: 54px; border-radius: 50%; display: grid; place-content: center; font-size: 11px; font-weight: 700; }
.empty { text-align: center; padding: 46px 20px; color: var(--txt-3); }
.empty .e-ico { margin-bottom: 10px; line-height: 0; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom));
  z-index: 90; padding: 10px 18px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line); box-shadow: var(--sh); font-size: 13.5px; font-weight: 600;
  animation: rise .25s ease; max-width: 90vw;
}
@media (min-width: 900px) { .toast { bottom: 24px; } }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } }

.seg { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r); }
.seg button {
  flex: 1; padding: 7px 10px; border-radius: var(--r); border: none; background: none; cursor: pointer;
  font-size: 13px; font-weight: 650; color: var(--txt-3);
}
.seg button.on { background: var(--surface); color: var(--txt); box-shadow: var(--sh); }

.field { display: grid; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 650; color: var(--txt-2); }
.field input[type="text"], .field input[type="number"], .field select, .field textarea {
  padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2);
}
.field .hint { font-size: 11.5px; color: var(--txt-3); }

.timer { font-family: var(--fm); font-size: 15px; font-weight: 700; padding: 5px 11px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.timer.warn { color: var(--bad); border-color: var(--bad); }

.update-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom));
  z-index: 95; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 16px; border-radius: var(--r-lg); background: var(--surface-2);
  border: 1px solid var(--acc); box-shadow: var(--sh); font-size: 14px; font-weight: 600;
  animation: rise .25s ease;
}
@media (min-width: 900px) { .update-bar { left: auto; right: 24px; bottom: 24px; max-width: 340px; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- teknik künye: mono etiketler, hizalı rakamlar ----------
   "Mühendislik Defteri" temasının dili başlıkta, etikette ve rakamda yaşar;
   akan metin serif ve sakin kalır. Rakamların tabular olması, ilerleme
   yüzdeleri ve izleme tablolarında sütunların kaymamasını sağlar. */
.cc-meta, .cc-foot, .stat small, .sec-title a, .day-block h3, .wi-body small {
  font-family: var(--fm); font-size: 10.5px; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase;
}
.stat b, .cc-foot, .wi-score, .timer, .streak, .slot .time, .badge, table td, .goal-ring {
  font-variant-numeric: tabular-nums;
}
.week-num { font-family: var(--fm); font-weight: 500; }
.prose table { font-variant-numeric: tabular-nums lining-nums; }
.prose hr { border-top-style: dashed; }
.math-block { padding: 8px 0; border-block: 1px dashed var(--line-soft); }

/* ---------- okuma ayarı (Ayarlar › Görünüm) ---------- */
.field input[type="range"] {
  width: 100%; accent-color: var(--acc); background: none; padding: 0; border: none;
}
.read-demo {
  margin-top: 4px; padding: 14px 16px; border: 1px dashed var(--line);
  border-radius: var(--r); background: var(--surface-2);
}

/* ---------- derslerim: ders seçimi ve saat girişi ---------- */
.pick-row {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; cursor: pointer;
  padding: 10px 12px; margin-bottom: 7px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line-soft); position: relative; overflow: hidden;
}
.pick-row::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--c-ink); opacity: .45; }
.pick-row:hover { border-color: color-mix(in srgb, var(--c-ink) 45%, var(--line)); }
.pick-row.on { background: color-mix(in srgb, var(--acc) 10%, var(--surface)); border-color: color-mix(in srgb, var(--acc) 45%, var(--line)); }
.pick-row.on::before { opacity: 1; }
.pick-row b { display: block; font-size: 14px; font-weight: 620; }
.pick-row small {
  display: block; color: var(--txt-3); font-family: var(--fm); font-size: 10.5px;
  font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
}
.pick-row .pk-box {
  flex: none; width: 22px; height: 22px; border-radius: 5px; display: grid; place-content: center;
  border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; font-weight: 800; color: var(--acc);
}
.pick-row.on .pk-box { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 18%, var(--surface)); }
.seg.dim button.on { background: none; color: var(--txt-3); box-shadow: none; }

.mine-card .cc-ico {
  width: 34px; height: 34px; border-radius: var(--r); display: grid; place-content: center;
  background: color-mix(in srgb, var(--c-ink) 15%, var(--surface-2)); font-size: 17px; flex: none;
}
.slot-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.slot-edit select, .slot-edit input {
  padding: 7px 8px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface-2); font-size: 13px; min-width: 0;
}
.slot-edit select[data-f="day"] { flex: 1 1 108px; }
.slot-edit select[data-f="kind"] { flex: 1 1 96px; }
.slot-edit input[type="time"] { flex: 0 1 104px; font-variant-numeric: tabular-nums; }
.slot-edit input[data-f="room"] { flex: 1 1 96px; }
.slot-edit .icon-btn { flex: none; width: 32px; height: 32px; font-size: 18px; }

/* ---------- notlar ---------- */
.grade-card .cc-ico {
  width: 34px; height: 34px; border-radius: var(--r); display: grid; place-content: center;
  background: color-mix(in srgb, var(--c-ink) 15%, var(--surface-2)); font-size: 17px; flex: none;
}
.g-letter-sel {
  padding: 7px 9px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface-2); font-size: 13px; font-weight: 650; flex: none; width: 122px;
}
.grade-card .row.spread > .row > .grow b { font-size: 14.5px; line-height: 1.3; }
.grade-items { margin-top: 10px; display: grid; gap: 6px; }
.grade-item { display: flex; align-items: center; gap: 6px; }
.grade-item input {
  padding: 7px 9px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface-2); font-size: 13px; min-width: 0; font-variant-numeric: tabular-nums;
}
.grade-item input[data-f="name"] { flex: 1 1 90px; }
.grade-item input[data-f="score"] { flex: 0 0 78px; text-align: center; font-weight: 700; }
.grade-item input[readonly] { opacity: .72; }
.gi-w { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--txt-3); flex: 0 0 66px; }
.gi-w input { width: 46px; text-align: center; padding: 7px 4px; }
.grade-item .icon-btn { flex: none; width: 30px; height: 30px; font-size: 17px; }
.g-letter {
  font-family: var(--fm); font-weight: 600; letter-spacing: .04em;
  padding: 1px 7px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line);
}

.past-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.past-add select, .past-add input {
  padding: 8px 10px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface-2); font-size: 13px; min-width: 0;
}
.past-add #pastPick { flex: 1 1 100%; }
.past-add #pastName { flex: 2 1 140px; }
.past-add #pastAkts, .past-add #priorGpa, .past-add #priorAkts { flex: 1 1 92px; text-align: center; font-variant-numeric: tabular-nums; }
.past-add #pastLetter { flex: 1 1 116px; }

.past-head, .past-row { display: grid; grid-template-columns: 1fr 56px 108px 40px 30px; gap: 6px; align-items: center; }
.past-head {
  font-family: var(--fm); font-size: 10px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--txt-3); padding: 0 2px 6px;
}
.past-row { margin-bottom: 6px; }
.past-row input, .past-row select {
  padding: 7px 8px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface-2); font-size: 13px; min-width: 0;
}
.past-row input[data-f="akts"] { text-align: center; font-variant-numeric: tabular-nums; }
.past-coef { font-family: var(--fm); font-size: 12px; color: var(--txt-3); text-align: right; font-variant-numeric: tabular-nums; }
.past-row .icon-btn { width: 28px; height: 28px; font-size: 16px; }
@media (max-width: 420px) {
  .past-head { display: none; }
  .past-row { grid-template-columns: 1fr 52px 96px 30px; }
  .past-coef { display: none; }
}

/* ---------- hesap ve giriş ---------- */
.auth-card { max-width: 460px; margin-inline: auto; width: 100%; }
.g-btn { background: var(--surface); border-color: var(--line); color: var(--txt); font-weight: 600; gap: 10px; padding: 11px 15px; }
.g-btn:hover { background: var(--surface-2); }
.g-logo { width: 18px; height: 18px; flex: none; }
.or { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; color: var(--txt-3); }
.or::before, .or::after { content: ''; flex: 1; border-top: 1px solid var(--line-soft); }
.or span { font-family: var(--fm); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }
.linkish { background: none; border: 0; padding: 4px 0; color: var(--acc); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--ff-head); }
.auth-err { margin: 0 0 12px; padding: 9px 12px; border: 1px solid color-mix(in srgb, var(--bad) 45%, var(--line)); border-radius: var(--r);
  background: color-mix(in srgb, var(--bad) 8%, var(--surface)); color: var(--bad); font-size: 13.5px; }
.field input[type="email"], .field input[type="password"] { padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2); }
.avatar { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-content: center;
  background: var(--acc); color: var(--surface); font-family: var(--ff-head); font-weight: 700; font-size: 16px; }
.sync-line { display: flex; align-items: center; gap: 7px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft);
  font-size: 13px; color: var(--txt-2); }
.sync-line.ok { color: var(--ok); }
.sync-line.warn { color: var(--warn); }
.sync-line.bad { color: var(--bad); }
.sync-line.busy .ico { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- yönetici: AKTS düzeltmeleri ---------- */
.akts-group h3 { margin: 8px 0 6px; font-family: var(--fm); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--txt-3); }
.akts-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-bottom: 6px;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); }
.akts-row b { display: block; font-size: 14px; font-weight: 600; font-family: var(--ff-head); }
.akts-row input { width: 74px; flex: none; padding: 8px 10px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2);
  font-family: var(--fm); font-variant-numeric: tabular-nums; text-align: right; }
.akts-row.fixed { border-color: color-mix(in srgb, var(--acc) 50%, var(--line)); box-shadow: inset 3px 0 0 var(--acc); }
.akts-row.fixed input { border-color: var(--acc); color: var(--acc); font-weight: 600; }
.akts-row .icon-btn { width: 30px; height: 30px; font-size: 13px; }
