/* Part66Edu — tasarım sistemi (docs/10-ui-tasarim-sistemi.md)
   Belirteçler :root üzerinde; koyu tema aynı belirteçlerle (sistem tercihi + elle seçim). */

:root {
  color-scheme: light;
  --page: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --surface-3: #e3e8ef;
  --border: #d5dbe4;
  --border-strong: #b8c1ce;
  --ink: #111827;
  --ink-2: #414b5a;
  --muted: #667085;
  --brand: #1f5fbf;
  --brand-hover: #174c99;
  --brand-ink: #ffffff;
  --brand-soft: #e4edfb;
  --header-bg: #0b2545;
  --header-ink: #f2f5fa;
  --header-muted: #a9b8cf;
  --focus: #f59e0b;
  --good: #067647;
  --good-soft: #e3f5ea;
  --warn: #93650b;
  --warn-soft: #fdf1d6;
  --bad: #b42318;
  --bad-soft: #fde8e6;
  --info: #1f5fbf;
  --info-soft: #e4edfb;
  --violet: #5b3fc4;
  --violet-soft: #eeeafb;
  --teal: #0e6a73;
  --teal-soft: #e0f2f3;
  /* grafikler (dataviz referans paleti; doğrulandı: docs/10 §Grafik) */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --grid: #e7e9ee;
  --axis: #c3c9d3;
  --seq-0: #eef1f5;
  --seq-1: #cde2fb; --seq-2: #9ec5f4; --seq-3: #6da7ec; --seq-4: #3987e5; --seq-5: #256abf; --seq-6: #184f95; --seq-7: #104281;
  --status-good: #0ca30c; --status-warning: #fab219; --status-serious: #ec835a; --status-critical: #d03b3b;
  --fig-accent: #1f5fbf;
  --fig-accent-fill: #5f8fd6; /* üzerine koyu metin yazılabilen ton: metin 5,4:1, zemin 3,3:1 */
  --fig-warn: #f3c350;
  --fig-fill: #eef3fb;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.18);
  --radius: 10px;
  --radius-sm: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d1117; --surface: #161b22; --surface-2: #1f2630; --surface-3: #283140; --border: #2f3947; --border-strong: #445062;
    --ink: #e8eaed; --ink-2: #b9c0cb; --muted: #8d96a3; --brand: #6ea8fe; --brand-hover: #8fbcff; --brand-ink: #0b1220; --brand-soft: #1a2a42;
    --header-bg: #0a1a30; --header-ink: #eef2f8; --header-muted: #95a6bf; --focus: #fbbf24;
    --good: #4ade80; --good-soft: #10301f; --warn: #fbbf24; --warn-soft: #3a2c08; --bad: #f87171; --bad-soft: #3b1515; --info: #6ea8fe; --info-soft: #1a2a42;
    --violet: #a996ff; --violet-soft: #2a2247; --teal: #5fd0d9; --teal-soft: #0f3134;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --grid: #262e39; --axis: #3a4452;
    --seq-0: #1f2630; --seq-1: #173152; --seq-2: #1c4a80; --seq-3: #2262ad; --seq-4: #2f7ad6; --seq-5: #5598e7; --seq-6: #86b6ef; --seq-7: #b7d3f6;
    --fig-accent: #6ea8fe; --fig-accent-fill: #3869a8; --fig-warn: #846515; --fig-fill: #1c2635;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d1117; --surface: #161b22; --surface-2: #1f2630; --surface-3: #283140; --border: #2f3947; --border-strong: #445062;
  --ink: #e8eaed; --ink-2: #b9c0cb; --muted: #8d96a3; --brand: #6ea8fe; --brand-hover: #8fbcff; --brand-ink: #0b1220; --brand-soft: #1a2a42;
  --header-bg: #0a1a30; --header-ink: #eef2f8; --header-muted: #95a6bf; --focus: #fbbf24;
  --good: #4ade80; --good-soft: #10301f; --warn: #fbbf24; --warn-soft: #3a2c08; --bad: #f87171; --bad-soft: #3b1515; --info: #6ea8fe; --info-soft: #1a2a42;
  --violet: #a996ff; --violet-soft: #2a2247; --teal: #5fd0d9; --teal-soft: #0f3134;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --grid: #262e39; --axis: #3a4452;
  --seq-0: #1f2630; --seq-1: #173152; --seq-2: #1c4a80; --seq-3: #2262ad; --seq-4: #2f7ad6; --seq-5: #5598e7; --seq-6: #86b6ef; --seq-7: #b7d3f6;
  --fig-accent: #6ea8fe; --fig-accent-fill: #3869a8; --fig-warn: #846515; --fig-fill: #1c2635;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
}

/* ---------- Temel ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.55 var(--font); min-height: 100vh; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .9em; }
img, svg { max-width: 100%; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); color: var(--ink); padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip-link:focus { left: 8px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Yerleşim ---------- */
.app-header { background: var(--header-bg); color: var(--header-ink); position: sticky; top: 0; z-index: 30; }
.app-header .bar { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--header-ink); text-decoration: none; font-weight: 700; letter-spacing: .2px; white-space: nowrap; min-width: 0; flex: 0 1 auto; }
.brand > span { overflow: hidden; text-overflow: ellipsis; }
.brand:hover { color: #fff; }
.brand svg { width: 28px; height: 28px; flex: none; }
.brand small { display: block; font-weight: 400; color: var(--header-muted); font-size: .72rem; letter-spacing: 0; }
.nav { display: flex; gap: 2px; margin-left: 8px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--header-muted); text-decoration: none; padding: 8px 12px; border-radius: 8px; white-space: nowrap; font-size: .95rem; min-height: 40px; display: inline-flex; align-items: center; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, .14); }
.header-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: none; }
.icon-btn { background: transparent; border: 1px solid transparent; color: var(--header-ink); border-radius: 8px; min-width: 40px; min-height: 40px; cursor: pointer; font-size: 1.05rem; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: rgba(255, 255, 255, .1); }
.user-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--header-ink); text-decoration: none; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .08); font-size: .88rem; max-width: 220px; }
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-toggle { display: none; }
@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; top: 56px; left: 0; right: 0; flex-direction: column; background: var(--header-bg); padding: 8px; margin: 0; box-shadow: var(--shadow-lg); }
  .nav.open { display: flex; }
  .user-chip span { display: none; }
  .user-chip { padding: 0; width: 40px; height: 40px; justify-content: center; }
}
@media (max-width: 480px) {
  .brand small { display: none; }
  .brand { font-size: .95rem; }
  .app-header .bar { gap: 6px; padding: 0 10px; }
  .icon-btn { min-width: 36px; }
}
main { max-width: 1280px; margin: 0 auto; padding: 20px 16px 64px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin: 4px 0 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb { font-size: .88rem; color: var(--muted); margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb a { color: var(--muted); }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid.split { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }
@media (max-width: 900px) { .grid.split { grid-template-columns: minmax(0, 1fr); } }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.app-footer { max-width: 1280px; margin: 0 auto; padding: 24px 16px 40px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--border); }

/* ---------- Kartlar ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.05rem; }
.card-head .spacer + * { margin-left: auto; }
.card.flat { box-shadow: none; }
.card.link-card { text-decoration: none; color: inherit; display: block; transition: border-color .15s, transform .15s; }
.card.link-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.card.disabled { opacity: .72; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .label { color: var(--muted); font-size: .85rem; }
.stat .value { font-size: 1.7rem; font-weight: 650; line-height: 1.15; }
.stat .hint { color: var(--muted); font-size: .82rem; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat-row .stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }

/* ---------- Düğmeler ve formlar ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 550; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); color: var(--ink); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--brand-ink); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { min-height: 34px; padding: 0 10px; font-size: .9rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-group { display: inline-flex; flex-wrap: wrap; gap: 8px; }
label { font-weight: 550; font-size: .93rem; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field .help { color: var(--muted); font-size: .84rem; font-weight: 400; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 0 14px; }
input[type="text"], input[type="password"], input[type="number"], input[type="search"], input[type="datetime-local"], input[type="email"], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; padding: 10px 12px; min-height: 44px; width: 100%;
}
/* Açılır liste (native popup) şeffaf görünmesin: seçenekler kendi arka planını ve rengini taşır */
select option, select optgroup { background-color: var(--surface); color: var(--ink); }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
textarea.code { font-family: var(--mono); font-size: .88rem; min-height: 380px; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--brand); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--brand); }
.form-error { color: var(--bad); background: var(--bad-soft); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.form-error ul { margin: 6px 0 0; padding-left: 20px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filters .field { margin: 0; min-width: 140px; flex: 0 1 180px; }
.filters .field.grow { flex: 1 1 240px; }
.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.segmented button { border: 0; background: var(--surface); color: var(--ink); padding: 0 14px; min-height: 40px; font: inherit; cursor: pointer; border-right: 1px solid var(--border); }
.segmented button:last-child { border-right: 0; }
.segmented button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }

/* ---------- Rozetler ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border); white-space: nowrap; line-height: 1.6; }
.badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.violet { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.badge.level { font-variant-numeric: tabular-nums; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- Tablolar ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; font-size: .85rem; color: var(--ink-2); position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--brand-soft) 45%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.compact th, table.compact td { padding: 6px 10px; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.empty .big { font-size: 2rem; display: block; margin-bottom: 6px; }

/* ---------- İlerleme ---------- */
.meter { height: 8px; background: var(--seq-1); border-radius: 999px; overflow: hidden; min-width: 60px; }
.meter > span { display: block; height: 100%; background: var(--series-1); border-radius: 999px; }
.meter.good > span { background: var(--status-good); }
.meter.warn > span { background: var(--status-warning); }
.meter.bad > span { background: var(--status-critical); }
.meter-label { display: flex; justify-content: space-between; font-size: .84rem; color: var(--muted); margin-bottom: 4px; gap: 8px; }
.mod-progress { margin-bottom: 16px; }
.mod-progress .meter { margin: 4px 0; }

/* ---------- Bildirim ve iletişim kutuları ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--surface); padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.good { background: var(--good); color: #fff; }
:root[data-theme="dark"] .toast.good, :root[data-theme="dark"] .toast.bad { color: #0b1220; }
.toast button { margin-left: auto; background: transparent; border: 0; color: inherit; cursor: pointer; font-size: 1.1rem; }
dialog { border: 1px solid var(--border); border-radius: 14px; padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 40px); }
dialog.wide { width: min(980px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(9, 14, 24, .55); }
dialog .dlg-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
dialog .dlg-head h2 { margin: 0; font-size: 1.1rem; }
dialog .dlg-body { padding: 18px; overflow: auto; max-height: calc(100vh - 200px); }
dialog .dlg-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.notice { border-radius: var(--radius); padding: 12px 14px; border: 1px solid var(--border); background: var(--surface-2); }
.notice.info { background: var(--info-soft); border-color: transparent; }
.notice.warn { background: var(--warn-soft); border-color: transparent; }
.notice.bad { background: var(--bad-soft); border-color: transparent; }
.notice.good { background: var(--good-soft); border-color: transparent; }
.loading { color: var(--muted); padding: 32px 0; display: flex; gap: 10px; align-items: center; }
.loading::before { content: ""; width: 18px; height: 18px; border: 3px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a, .tabs button { padding: 10px 14px; text-decoration: none; color: var(--ink-2); border: 0; border-bottom: 3px solid transparent; background: none; font: inherit; cursor: pointer; white-space: nowrap; min-height: 44px; }
.tabs [aria-selected="true"], .tabs [aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ---------- Giriş ---------- */
.auth-wrap { min-height: calc(100vh - 120px); display: grid; place-items: center; padding: 24px 0; }
.auth-card { width: min(440px, 100%); }
.auth-card .brand-big { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.auth-card .brand-big svg { width: 44px; height: 44px; color: var(--brand); }
.privacy-text { max-height: 50vh; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; background: var(--surface-2); margin-bottom: 14px; }

/* ---------- Modül ve ders listeleri ---------- */
.module-card { display: flex; flex-direction: column; gap: 10px; height: 100%; }
.module-card .code { font-weight: 700; color: var(--brand); font-size: .85rem; letter-spacing: .5px; }
.module-card h3 { margin: 0; }
.module-card .meta { color: var(--muted); font-size: .86rem; display: flex; flex-wrap: wrap; gap: 6px 12px; }
.module-card .foot { margin-top: auto; }
.leaf-list { list-style: none; margin: 0; padding: 0; }
.leaf-list li { border-bottom: 1px solid var(--border); }
.leaf-list li:last-child { border-bottom: 0; }
.leaf-item { display: grid; grid-template-columns: 70px 1fr auto; gap: 12px; align-items: center; padding: 12px 4px; }
.leaf-item .ref { font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.leaf-item .title a { font-weight: 600; text-decoration: none; }
.leaf-item .title .sub { color: var(--muted); font-size: .84rem; display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; }
.leaf-item .side { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.leaf-item.out { opacity: .6; }
.section-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 14px 4px 4px; font-weight: 700; }
@media (max-width: 640px) { .leaf-item { grid-template-columns: 52px 1fr; } .leaf-item .side { grid-column: 2; justify-content: flex-start; } }
.level-grid { display: inline-grid; grid-template-columns: repeat(5, auto); gap: 2px; font-size: .75rem; }
.level-grid span { padding: 1px 5px; border-radius: 4px; background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; }
.level-grid span.mine { background: var(--brand); color: var(--brand-ink); font-weight: 700; }
.level-grid span.regime-level { grid-column: 1 / -1; text-align: center; background: transparent; border: 1px dashed var(--border, currentColor); }

/* ---------- Ders sayfası ---------- */
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; align-items: start; }
@media (max-width: 1024px) { .lesson-layout { grid-template-columns: minmax(0, 1fr); } }
.toc-mobile { display: none; }
@media (max-width: 1024px) { .toc-mobile { display: block; margin-bottom: 16px; } .lesson-aside .toc { display: none; } }
.lesson-aside { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 90px); overflow: auto; }
@media (max-width: 1024px) { .lesson-aside { position: static; max-height: none; } }
.toc { font-size: .9rem; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li a { display: block; padding: 5px 8px; border-left: 3px solid transparent; color: var(--ink-2); text-decoration: none; border-radius: 0 6px 6px 0; }
.toc li a:hover { background: var(--surface-2); }
.toc li a.active { border-left-color: var(--brand); color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.toc li.d3 a { padding-left: 22px; font-size: .86rem; }
@media (max-width: 1024px) { .toc details:not([open]) ol { display: none; } }
.objectives { background: var(--brand-soft); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px; }
.objectives h2 { font-size: 1rem; margin-bottom: 6px; }
.objectives ul { margin: 0; padding-left: 20px; }
.lesson { font-size: 1.07rem; line-height: 1.7; max-width: 72ch; }
.lesson h2 { font-size: 1.35rem; margin: 2em 0 .6em; padding-top: .3em; scroll-margin-top: 76px; }
.lesson h3 { font-size: 1.12rem; margin: 1.6em 0 .5em; scroll-margin-top: 76px; }
.lesson h2 .anchor, .lesson h3 .anchor { opacity: 0; margin-left: -1em; padding-right: .3em; text-decoration: none; color: var(--muted); font-weight: 400; }
.lesson h2:hover .anchor, .lesson h3:hover .anchor, .lesson .anchor:focus { opacity: 1; }
.lesson ul, .lesson ol { padding-left: 1.4em; margin: 0 0 1em; }
.lesson li { margin: .25em 0; }
.lesson blockquote { margin: 1em 0; padding: .5em 1em; border-left: 4px solid var(--border-strong); color: var(--ink-2); }
.lesson .table-wrap { margin: 1em 0; }
/* Uzun bağlantı adresleri (mevzuat kaynakları) dar ekranda satır kırabilsin; aksi halde sayfa yatay taşar. */
.lesson a { overflow-wrap: anywhere; }
.lesson details { background: var(--surface-2); border-radius: 8px; padding: 8px 14px; margin: .5em 0 1.2em; }
.lesson details summary { cursor: pointer; font-weight: 600; color: var(--brand); min-height: 32px; }
.lesson .math-block { overflow-x: auto; overflow-y: hidden; padding: .3em 0; margin: .6em 0; }
.lesson .katex { font-size: 1.05em; }
.math-error { color: var(--bad); }
.lesson-flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--warn-soft); } to { background: transparent; } }

.callout { border-radius: var(--radius); padding: 12px 16px 4px; margin: 1.2em 0; border-left: 5px solid; background: var(--surface-2); }
.callout .callout-title { font-weight: 800; font-size: .82rem; letter-spacing: .7px; margin: 0 0 6px; display: flex; gap: 8px; align-items: center; }
.callout .callout-title::before { font-size: 1rem; }
.callout-uyari { border-color: var(--bad); background: var(--bad-soft); }
.callout-uyari .callout-title { color: var(--bad); }
.callout-uyari .callout-title::before { content: "⚠"; }
.callout-dikkat { border-color: var(--warn); background: var(--warn-soft); }
.callout-dikkat .callout-title { color: var(--warn); }
.callout-dikkat .callout-title::before { content: "◆"; }
.callout-not { border-color: var(--info); background: var(--info-soft); }
.callout-not .callout-title { color: var(--info); }
.callout-not .callout-title::before { content: "ℹ"; }
.callout-ipucu { border-color: var(--good); background: var(--good-soft); }
.callout-ipucu .callout-title { color: var(--good); }
.callout-ipucu .callout-title::before { content: "✦"; }
.callout-ornek { border-color: var(--violet); background: var(--violet-soft); }
.callout-ornek .callout-title { color: var(--violet); }
.callout-ornek .callout-title::before { content: "✎"; }
.callout-hangar { border-color: var(--teal); background: var(--teal-soft); }
.callout-hangar .callout-title { color: var(--teal); }
.callout-hangar .callout-title::before { content: "✈"; }

figure { margin: 1.4em 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; color: var(--ink); }
figure svg { display: block; margin: 0 auto; width: 100%; max-width: 560px; height: auto; }
figcaption { font-size: .88rem; color: var(--muted); margin-top: 8px; text-align: center; }
figure .f-line { stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
figure .f-thin { stroke: currentColor; stroke-width: 1; fill: none; }
figure .f-thick { stroke-width: 4; }
figure .f-dash { stroke-dasharray: 6 4; }
/* f-thick ve f-dash tek başına kullanıldığında da görünür olsun (çizgi rengi ve dolgusuz) */
figure .f-thick:not(.f-line):not(.f-accent):not(.f-thin) { stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round; }
figure .f-dash:not(.f-line):not(.f-accent):not(.f-thin) { stroke: currentColor; stroke-width: 2; fill: none; }
figure .f-accent { stroke: var(--fig-accent); stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
figure .f-fill { fill: var(--fig-fill); stroke: currentColor; stroke-width: 1; }
figure .f-accent-fill { fill: var(--fig-accent-fill); stroke: none; }
figure .f-warn-fill { fill: var(--fig-warn); stroke: none; }
figure .f-dot { fill: currentColor; stroke: none; }
figure .f-text { fill: currentColor; font: 14px var(--font); }
figure .f-text-sm { fill: currentColor; font: 12px var(--font); }
figure .f-sub { font-size: 10px; }
figure text { fill: currentColor; }

.lesson-end { max-width: 72ch; margin-top: 32px; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.pager a { flex: 1 1 240px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; background: var(--surface); }
.pager a:hover { border-color: var(--brand); }
.pager a .dir { display: block; font-size: .8rem; color: var(--muted); }
.pager a.next { text-align: right; }
.gloss dt { font-weight: 700; margin-top: 10px; }
.gloss dt .en { font-weight: 400; color: var(--muted); font-style: italic; margin-left: 6px; }
.gloss dd { margin: 2px 0 0; color: var(--ink-2); }

/* ---------- Soru / sınav ---------- */
.question { font-size: 1.05rem; }
.question .stem { margin-bottom: 14px; line-height: 1.6; }
.question .stem p:last-child { margin-bottom: 0; }
.options { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.option { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: start; width: 100%; text-align: left; background: var(--surface); border: 2px solid var(--border); border-radius: 10px; padding: 12px 14px; cursor: pointer; font: inherit; color: var(--ink); min-height: 52px; }
.option:hover { border-color: var(--brand); }
.option .key { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; font-weight: 700; font-size: .9rem; color: var(--ink-2); }
.option[aria-pressed="true"], .option[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); }
.option[aria-pressed="true"] .key, .option[aria-checked="true"] .key { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.option.correct { border-color: var(--good); background: var(--good-soft); }
.option.correct .key { background: var(--good); border-color: var(--good); color: #fff; }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); }
.option.wrong .key { background: var(--bad); border-color: var(--bad); color: #fff; }
.option[disabled] { cursor: default; }
.option .body p { margin: 0; }
.option .note { grid-column: 2; font-size: .9rem; color: var(--ink-2); margin-top: 6px; }
.feedback { margin-top: 14px; border-radius: 10px; padding: 14px 16px; }
.feedback.good { background: var(--good-soft); }
.feedback.bad { background: var(--bad-soft); }
.feedback h3 { margin: 0 0 6px; font-size: 1rem; }
.feedback.good h3 { color: var(--good); }
.feedback.bad h3 { color: var(--bad); }
.progress-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.progress-dots span { width: 22px; height: 6px; border-radius: 3px; background: var(--surface-3); }
.progress-dots span.good { background: var(--status-good); }
.progress-dots span.bad { background: var(--status-critical); }
.progress-dots span.current { background: var(--brand); }

.exam-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .exam-layout { grid-template-columns: minmax(0, 1fr); } }
.exam-side { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 900px) { .exam-side { position: static; order: -1; } }
.timer { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.timer.low { color: var(--bad); }
.qnav { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
.qnav button { min-height: 38px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); border-radius: 6px; cursor: pointer; font: inherit; font-size: .88rem; font-variant-numeric: tabular-nums; position: relative; }
.qnav button.answered { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 700; }
.qnav button.flagged::after { content: ""; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--status-warning); }
.qnav button[aria-current="true"] { outline: 3px solid var(--focus); outline-offset: 1px; }
.qnav button.correct { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.qnav button.wrong { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.legend-inline { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .82rem; color: var(--muted); }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.legend-inline i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--border-strong); display: inline-block; }
.result-hero { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.result-hero .score { font-size: 3rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.essay-box textarea { min-height: 260px; }
.word-count { font-size: .84rem; color: var(--muted); text-align: right; }

/* ---------- Grafikler ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis-line { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .tick { fill: var(--muted); font: 11px var(--font); font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--series-1); }
.chart .bar:hover, .chart .bar:focus { opacity: .8; outline: none; }
.chart .bar.ref-under { fill: var(--series-1); }
.chart .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--series-1); opacity: .1; }
.chart .marker { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart .ref-line { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 4 3; }
.chart .ref-label { fill: var(--ink-2); font: 11px var(--font); }
.chart .val-label { fill: var(--ink-2); font: 11px var(--font); font-variant-numeric: tabular-nums; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:focus { outline: none; }
.chart .hit:focus + .bar, .chart .hit:hover + .bar { opacity: .8; }
.chart .crosshair { stroke: var(--axis); stroke-width: 1; }
.chart-tip { position: absolute; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: 8px; padding: 8px 10px; font-size: .84rem; z-index: 5; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.chart-tip strong { font-size: 1rem; display: block; font-variant-numeric: tabular-nums; }
.chart-tip .k { color: var(--muted); }
.chart-foot { display: flex; justify-content: flex-end; margin-top: 4px; }
.chart-foot button { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; font-size: .84rem; padding: 4px; }
.chart-table { margin-top: 8px; }
.heatmap { overflow-x: auto; }
.heatmap table { border-collapse: separate; border-spacing: 2px; width: auto; font-size: .82rem; }
.heatmap th, .heatmap td { border: 0; padding: 0; background: none; position: static; }
.heatmap th { font-weight: 600; color: var(--ink-2); padding: 2px 6px; white-space: nowrap; text-align: left; }
.heatmap th.col { writing-mode: vertical-rl; transform: rotate(180deg); text-align: left; height: 70px; padding: 4px 0; font-weight: 500; }
.heatmap td .cell { width: 30px; height: 26px; border-radius: 4px; display: grid; place-items: center; font-size: .7rem; font-variant-numeric: tabular-nums; cursor: default; }
.heatmap td .cell.none { background: var(--seq-0); background-image: repeating-linear-gradient(45deg, transparent 0 4px, var(--border) 4px 5px); }
.heatmap td .cell.na { background: transparent; border: 1px dashed var(--border); }
.heat-legend { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; margin-top: 8px; }
.heat-legend .ramp { display: inline-flex; }
.heat-legend .ramp i { width: 22px; height: 12px; display: inline-block; }
.heat-legend .ramp i:first-child { border-radius: 3px 0 0 3px; }
.heat-legend .ramp i:last-child { border-radius: 0 3px 3px 0; }

/* ---------- Madde analizi ---------- */
.flag-list { display: flex; flex-wrap: wrap; gap: 4px; }
.mini-bar { display: inline-block; height: 8px; background: var(--series-1); border-radius: 0 4px 4px 0; vertical-align: middle; }
.opt-table td, .opt-table th { padding: 4px 8px; font-size: .84rem; }
.item-preview { font-size: .93rem; }
.item-preview .stem { margin-bottom: 6px; }
.item-preview ol { margin: 0; padding-left: 22px; }
.item-preview li.key { font-weight: 700; color: var(--good); }

@media print {
  .app-header, .app-footer, .lesson-aside, .lesson-end, .no-print, .toasts { display: none !important; }
  body { background: #fff; color: #000; }
  main { padding: 0; }
  .card { box-shadow: none; }
  .lesson { max-width: none; }
  .lesson details { display: block; }
  a { color: inherit; text-decoration: none; }
}
@media (forced-colors: active) {
  .chart .bar, .meter > span { fill: CanvasText; background: CanvasText; }
}
