/* ===== AOS temaları ===== */
:root, [data-theme="modern"] {
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Inter', system-ui, sans-serif;
  --head-weight: 700; --head-spacing: -0.02em;
  --bg: #f5f6f8; --surface: #fff; --surface-2: #f0f2f5; --text: #1b1f27; --muted: #667085; --line: #e4e7ec;
  --accent: #2f5bea; --accent-ink: #fff; --accent-soft: #eaf0ff; --accent-2: #0e9384;
  --top-bg: rgba(255,255,255,.88); --top-ink: #1b1f27; --top-line: #e4e7ec;
  --sb-bg: #fff; --sb-ink: #344054; --sb-active: #eaf0ff; --sb-active-ink: #2f5bea; --sb-num: #f0f2f5;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --hero-bg: linear-gradient(135deg, #1e3a8a 0%, #2f5bea 60%, #3ba7f0 100%); --hero-ink: #fff;
  --ok: #12b76a; --bad: #f04438; --warn: #f79009;
}
[data-theme="auzef"] {
  --font: 'Source Sans 3', 'Source Sans Pro', system-ui, sans-serif;
  --font-head: 'Bree Serif', Georgia, serif;
  --head-weight: 400; --head-spacing: 0;
  --bg: #f6f5ee; --surface: #fff; --surface-2: #f1f3ea; --text: #23301a; --muted: #6b745e; --line: #e2e5d6;
  --accent: #536f35; --accent-ink: #fff; --accent-soft: #eef3e4; --accent-2: #fad806;
  --top-bg: #536f35; --top-ink: #fff; --top-line: #fad806;
  --sb-bg: #3f5628; --sb-ink: #e8eedb; --sb-active: #fad806; --sb-active-ink: #2c3b1b; --sb-num: rgba(255,255,255,.12);
  --radius: 10px; --shadow: 0 1px 2px rgba(40,55,20,.06), 0 2px 6px rgba(40,55,20,.06);
  --hero-bg: linear-gradient(120deg, #3c5226 0%, #536f35 55%, #6b8a45 100%); --hero-ink: #fff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.6 var(--font); color: var(--text); background: var(--bg); min-height: 100vh; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: var(--head-weight); letter-spacing: var(--head-spacing); line-height: 1.25; margin: 0 0 .5em; }
a { color: var(--accent); }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.big { width: 30px; height: 30px; }
.muted { color: var(--muted); }
code { font-size: .8em; color: var(--muted); word-break: break-all; }

/* ===== üst çubuk ===== */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 20px; padding-left: max(20px, env(safe-area-inset-left));
  background: var(--top-bg); color: var(--top-ink); border-bottom: 1px solid var(--top-line); backdrop-filter: saturate(1.6) blur(10px); }
[data-theme="auzef"] .topbar { border-bottom-width: 4px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; min-width: 0; flex: 1; }
.brand-logo { width: 44px; height: 44px; display: none; }
[data-theme="auzef"] .brand-logo { display: block; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--accent); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .04em; flex: none; }
[data-theme="auzef"] .brand-mark { display: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-text strong { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { font-size: 12px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.theme-switch { display: flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
[data-theme="auzef"] .theme-switch { background: rgba(0,0,0,.18); border-color: rgba(255,255,255,.2); }
.theme-switch button { border: 0; background: none; color: inherit; font: 600 13px var(--font); padding: 6px 14px; border-radius: 999px; cursor: pointer; opacity: .75; }
.theme-switch button[aria-checked="true"] { background: var(--accent); color: #fff; opacity: 1; }
[data-theme="auzef"] .theme-switch button[aria-checked="true"] { background: var(--accent-2); color: #2c3b1b; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; color: inherit; cursor: pointer; }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.menu-btn { display: none; }

/* ===== düğmeler ===== */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: 600 14px var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; transition: .15s; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: transparent; }
.topbar .btn.ghost { color: inherit; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ===== yerleşim ===== */
.layout { display: flex; min-height: calc(100vh - 64px); }
.sidebar { width: 280px; flex: none; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; background: var(--sb-bg); color: var(--sb-ink); border-right: 1px solid var(--line); padding: 18px 12px 24px; }
[data-theme="auzef"] .sidebar { top: 68px; height: calc(100vh - 68px); border-right: 0; }
.sidebar[hidden] { display: none; }
.sb-course { padding: 4px 12px 16px; display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
[data-theme="auzef"] .sb-course { border-color: rgba(255,255,255,.14); }
.sb-course small { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; opacity: .6; }
.sb-course strong { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 19px; }
.sb-course span { font-size: 13px; opacity: .75; }
.sb-label { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 700; opacity: .55; padding: 14px 12px 6px; }
.sb-group a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; text-decoration: none; color: inherit; font-size: 14.5px; line-height: 1.3; }
.sb-group a:hover { background: var(--sb-num); }
.sb-group a.active { background: var(--sb-active); color: var(--sb-active-ink); font-weight: 600; }
.sb-group .num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--sb-num); font-size: 13px; flex: none; }
.sb-group a.active .num { background: var(--accent); color: #fff; }
[data-theme="auzef"] .sb-group a.active .num { background: #536f35; }
.sb-foot { font-size: 12px; opacity: .5; padding: 20px 12px 0; }
.scrim { display: none; }
main { flex: 1; min-width: 0; }
.page { max-width: 1180px; margin: 0 auto; padding: 28px 32px 60px; display: flex; flex-direction: column; gap: 24px; }
.page-head h1 { font-size: 30px; margin-bottom: 4px; }
.page-head p { margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card h2 { font-size: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.section-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 14px; }
.section-head h2 { font-size: 24px; margin: 0; }
.alert { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; padding: 12px 16px; border-radius: 10px; }
.alert.small { padding: 4px 8px; font-size: 13px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.16); font-size: 13.5px; font-weight: 600; }
.chip .ico { width: 15px; height: 15px; }
.chip.muted { opacity: .85; font-weight: 500; }
.hero .chip.muted { color: inherit; background: rgba(0,0,0,.14); }
.card .chip { background: var(--surface-2); color: var(--muted); }

/* ===== açılış ===== */
.landing { max-width: 760px; margin: 0 auto; padding: 48px 24px 60px; display: flex; flex-direction: column; gap: 24px; text-align: center; }
.landing-logo { width: 96px; height: 96px; margin: 0 auto 8px; display: none; }
[data-theme="auzef"] .landing-logo { display: block; }
.landing h1 { font-size: 44px; margin: 0; color: var(--accent); }
.landing h1 span { color: var(--text); font-size: .55em; }
.lead { font-size: 18px; color: var(--muted); max-width: 620px; margin: 10px auto 0; }
.dropzone { border: 2px dashed var(--line); border-radius: 20px; background: var(--surface); padding: 44px 24px; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: .2s; }
.dropzone .ico.big { width: 46px; height: 46px; color: var(--accent); }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.01); }
.dropzone h2 { font-size: 22px; margin: 8px 0 0; }
.dropzone p { margin: 0 0 14px; color: var(--muted); }
.drop-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.landing-notes { list-style: none; padding: 0; margin: 0; text-align: left; display: grid; gap: 10px; color: var(--muted); font-size: 14.5px; }
.landing-notes li { display: flex; gap: 10px; align-items: flex-start; }
.landing-notes .ico { color: var(--accent); margin-top: 3px; }
.loading { display: grid; place-items: center; gap: 12px; padding: 120px 20px; color: var(--muted); }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== ana sayfa ===== */
.hero { position: relative; overflow: hidden; background: var(--hero-bg); color: var(--hero-ink); border-radius: calc(var(--radius) + 6px); padding: 40px 40px 36px; display: flex; align-items: center; gap: 24px; }
[data-theme="auzef"] .hero { border-bottom: 6px solid #fad806; }
.hero h1 { font-size: 46px; margin: 6px 0 16px; }
.hero .eyebrow { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; opacity: .8; font-weight: 600; }
.hero-text { flex: 1; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-logo { width: 150px; height: 150px; flex: none; display: none; filter: drop-shadow(0 6px 18px rgba(0,0,0,.25)); }
[data-theme="auzef"] .hero-logo { display: block; }
[data-theme="modern"] .hero::after { content: ''; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: rgba(255,255,255,.08); }
.prose p { margin: 0 0 .8em; }
.prose > div > p:last-child { margin-bottom: 0; }
.note { margin-top: 18px; padding: 16px 18px; border-radius: 10px; background: var(--accent-soft); }
.note h3 { font-size: 16px; margin-bottom: 6px; }
.people { display: grid; gap: 12px; }
.person { display: flex; align-items: center; gap: 14px; }
.person small { display: block; color: var(--muted); }
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--surface-2); border: 2px solid var(--line); }
[data-theme="auzef"] .avatar { border-color: #fad806; }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.unit-card { display: flex; gap: 16px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: .15s; }
.unit-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.unit-num { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font: 700 20px var(--font-head); flex: none; }
[data-theme="auzef"] .unit-num { background: #536f35; color: #fad806; border-radius: 50%; font-weight: 400; }
.unit-num.lg { width: 56px; height: 56px; font-size: 26px; }
.unit-body { min-width: 0; flex: 1; }
.unit-body h3 { font-size: 18px; margin: 2px 0 8px; }
.topics { list-style: none; padding: 0; margin: 0 0 10px; font-size: 13.5px; color: var(--muted); }
.topics li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unit-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.unit-meta span { display: inline-flex; align-items: center; gap: 5px; }
.unit-meta .ico { width: 15px; height: 15px; color: var(--accent); }
.link-card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; transition: .15s; }
.link-card:hover { border-color: var(--accent); }
.link-card .ico.big { color: var(--accent); margin-bottom: 6px; }
.link-card h3 { font-size: 18px; margin: 0; }
.link-card p { margin: 0; color: var(--muted); font-size: 14px; }

/* ===== ünite ===== */
.unit-head { display: flex; flex-direction: column; gap: 14px; }
.crumbs { font-size: 13px; color: var(--muted); }
.crumbs a { color: inherit; }
.unit-title { display: flex; gap: 16px; align-items: center; }
.unit-title h1 { font-size: 32px; margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: flex; align-items: center; gap: 8px; padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14.5px; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
[data-theme="auzef"] .tabs a.active { border-bottom-color: #fad806; color: #3f5628; }
.tabs em { font-style: normal; font-size: 12px; background: var(--surface-2); color: var(--muted); padding: 1px 8px; border-radius: 999px; }
.pager { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 20px; }

/* ders notu */
.notes-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 32px; align-items: start; }
.toc-side { position: sticky; top: 16px; max-height: calc(100vh - 110px); overflow-y: auto; }
.toc-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 5px 12px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: 13.5px; line-height: 1.35; }
.toc li.h3 a { padding-left: 26px; font-size: 13px; }
.toc li a:hover { color: var(--text); }
.toc li a.on { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px 44px; box-shadow: var(--shadow); font-size: 17px; line-height: 1.75; overflow-wrap: break-word; }
.doc, .doc * { font-family: var(--font) !important; }
.doc h1, .doc h2, .doc h3, .doc h4, .doc h5 { font-family: var(--font-head) !important; scroll-margin-top: 16px; }
.doc h2 { font-size: 25px; margin: 1.6em 0 .6em; color: var(--accent); }
[data-theme="auzef"] .doc h2 { color: #3f5628; padding-bottom: 6px; border-bottom: 3px solid #fad806; display: inline-block; }
.doc h3 { font-size: 20px; margin: 1.4em 0 .5em; }
.doc h4 { font-size: 17.5px; margin: 1.2em 0 .4em; }
.doc h5 { font-size: 16px; }
.doc p { margin: 0 0 .9em !important; }
.doc ul, .doc ol { padding-left: 1.4em !important; margin: .4em 0 1em !important; }
.doc li { margin: .2em 0; }
.doc img { max-width: 100%; height: auto !important; display: block; margin: 18px auto; border-radius: 8px; cursor: zoom-in; }
.doc .table-wrap { overflow-x: auto; margin: 20px 0; -webkit-overflow-scrolling: touch; }
.doc table { border-collapse: collapse; min-width: 100%; margin: 0 !important; font-size: 15px; }
.doc td, .doc th { border: 1px solid var(--line); padding: 8px 12px; vertical-align: top; }
.doc td p { margin: 0 0 .3em !important; }
.doc .missing { padding: 14px; border: 1px dashed var(--bad); color: var(--bad); border-radius: 8px; font-size: 14px; }
.doc > :first-child, .doc-sec > h2:first-child { margin-top: 0; }
.doc-sec { margin-bottom: 8px; }
.doc-sec.callout { padding: 18px 22px 8px; border-radius: 12px; margin: 18px 0; background: var(--surface-2); border-left: 5px solid var(--accent); }
.doc-sec.callout h2 { font-size: 19px; margin: 0 0 .5em; border: 0 !important; padding: 0; display: block; }
[data-theme="auzef"] .doc-sec.callout { border-left-color: #fad806; background: #f6f8ef; }
.doc-sec.c-quote { font-size: 18px; font-style: italic; background: transparent !important; border-left-width: 4px; }
.doc-sec.c-goals { background: var(--accent-soft); }
.doc-sec.c-think { background: #fff8e6; border-left-color: #f5b400; }
.doc-sec.c-summary { background: var(--accent-soft); }
.doc-sec.c-refs { font-size: 14.5px; background: transparent !important; border-left-color: var(--line); }

/* sunum */
.slides { display: flex; flex-direction: column; }
.stage { position: relative; background: #111; height: min(58vh, 600px); touch-action: pan-y; }
.stage:fullscreen { height: 100vh; }
.slide-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.nav-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; cursor: pointer; display: grid; place-items: center; }
.nav-btn:hover { background: var(--accent); }
.nav-btn.prev { left: 14px; } .nav-btn.next { right: 14px; }
.nav-btn .ico { width: 24px; height: 24px; }
.slide-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.slide-count { font-weight: 700; }
.spacer { flex: 1; }
.thumbs { display: flex; gap: 10px; overflow-x: auto; padding: 14px 16px; scroll-snap-type: x proximity; }
.thumb { position: relative; flex: none; width: 120px; aspect-ratio: 4 / 3; border: 2px solid transparent; border-radius: 8px; padding: 0; background: var(--surface-2); cursor: pointer; overflow: hidden; scroll-snap-align: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb span { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; padding: 0 6px; border-radius: 4px; }
.thumb.on { border-color: var(--accent); }
[data-theme="auzef"] .thumb.on { border-color: #fad806; }

/* sorular */
.quiz-tools { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; position: sticky; top: 0; z-index: 5; padding: 14px 20px; }
.quiz-score strong { font-size: 22px; color: var(--accent); }
.quiz-score .progress { height: 6px; border-radius: 99px; background: var(--surface-2); margin-top: 6px; width: 220px; overflow: hidden; }
.quiz-score .progress i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
[data-theme="auzef"] .quiz-score .progress i { background: #fad806; }
.quiz-btns { display: flex; gap: 8px; }
.quiz { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.q-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.q-no { font: 700 13px var(--font); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.q-text { font-size: 17px; font-weight: 600; }
.q-text img, .opt img { max-width: 100%; height: auto; }
.opts { display: grid; gap: 8px; margin-top: 10px; }
.opt { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); font: 15.5px var(--font); color: var(--text); cursor: pointer; transition: .12s; }
.opt:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.opt.picked { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.opt.picked b { background: var(--accent); color: var(--accent-ink, #fff); }
[data-theme="auzef"] .opt.picked { border-color: #3f5628; background: #eef4e6; box-shadow: inset 0 0 0 1px #3f5628; }
[data-theme="auzef"] .opt.picked b { background: #536f35; color: #fad806; }

.opt b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); flex: none; font-size: 14px; }
.opt .prose p { margin: 0; }
.opt:disabled { cursor: default; color: var(--text); opacity: 1; }
.opt.right { border-color: var(--ok); background: #ecfdf3; }
.opt.right b { background: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--bad); background: #fef3f2; }
.opt.wrong b { background: var(--bad); color: #fff; }
.q-fb { margin-top: 10px; font-weight: 600; min-height: 1.4em; }
.q-fb .ok { color: var(--ok); display: inline-flex; gap: 6px; align-items: center; }
.q-fb .no { color: var(--bad); }

/* medya */
.media { display: flex; flex-direction: column; gap: 14px; }
.media-head { display: flex; gap: 12px; align-items: center; }
.media-head .ico { color: var(--accent); }
.media-head h3 { margin: 0; font-size: 18px; }
.media video { width: 100%; border-radius: 10px; background: #000; aspect-ratio: 16/9; }
.media audio { width: 100%; }
.media-foot { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* dosyalar */
.file-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.file-row:last-child { border-bottom: 0; }
.file-ext { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 12px; flex: none; }
[data-theme="auzef"] .file-ext { background: #fad806; color: #3f5628; }
.file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-info small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* denetim */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; }
.stat b { font: 700 28px var(--font-head); }
.stat span { color: var(--muted); font-size: 13px; }
.stat.err b { color: var(--bad); } .stat.warn b { color: var(--warn); }
.audit-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.audit-row { display: grid; grid-template-columns: 70px 110px 1fr; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 14px; align-items: baseline; }
.audit-row .lvl { font-size: 11px; font-weight: 800; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; text-align: center; }
.audit-row.err .lvl { background: #fef3f2; color: var(--bad); }
.audit-row.warn .lvl { background: #fffaeb; color: #b54708; }
.audit-row.info .lvl { background: var(--surface-2); color: var(--muted); }
.audit-row span:last-child { word-break: break-word; }
.pad { padding: 18px; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.88); display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; background: #fff; }
.lb-close { position: absolute; top: 12px; right: 12px; color: #fff; }

/* ===== duyarlı tasarım ===== */
@media (max-width: 1100px) {
  .notes-layout { grid-template-columns: 1fr; }
  .toc-side { display: none; }
}
@media (max-width: 900px) {
  .menu-btn { display: grid; }
  .menu-btn[hidden] { display: none; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; height: 100vh !important; z-index: 60; transform: translateX(-105%); transition: transform .25s ease; box-shadow: 0 0 40px rgba(0,0,0,.25); padding-top: 24px; }
  [data-theme="auzef"] .sidebar { top: 0; }
  .drawer-open .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: .25s; }
  .drawer-open .scrim { opacity: 1; pointer-events: auto; }
  .page { padding: 20px 16px 48px; gap: 18px; }
  .hero { padding: 28px 22px; }
  .hero h1 { font-size: 34px; }
  .hero-logo { width: 90px; height: 90px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .topbar { padding: 0 10px; gap: 6px; height: 58px; }
  [data-theme="auzef"] .topbar { height: 60px; }
  .layout { min-height: calc(100vh - 58px); }
  .brand { gap: 8px; }
  .brand-logo { width: 36px; height: 36px; }
  .brand-mark { width: 34px; height: 34px; font-size: 11px; }
  .brand-text strong { font-size: 16px; }
  .brand-text small { display: none; }
  .theme-switch button { padding: 5px 9px; font-size: 12px; }
  #changePkg span { display: none; }
  #changePkg { padding: 8px; }
  .hero { flex-direction: column-reverse; align-items: flex-start; padding: 22px 18px; gap: 12px; }
  .hero h1 { font-size: 30px; margin-bottom: 12px; }
  .hero-logo { width: 64px; height: 64px; }
  .hero .eyebrow { font-size: 11px; }
  .chip { font-size: 12.5px; padding: 4px 10px; }
  .grid-2, .grid-3, .unit-grid { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .unit-card { padding: 14px; gap: 12px; }
  .unit-title h1 { font-size: 23px; }
  .unit-num.lg { width: 44px; height: 44px; font-size: 21px; }
  .tabs a { padding: 9px 10px; font-size: 14px; }
  .tabs a .ico { display: none; }
  .doc { padding: 20px 16px; font-size: 16px; line-height: 1.7; border-radius: 10px; }
  .doc h2 { font-size: 21px; }
  .doc h3 { font-size: 18px; }
  .doc-sec.callout { padding: 14px 14px 4px; }
  .quiz-tools { position: static; }
  .stage { height: auto; aspect-ratio: 4 / 3; }
  .doc td, .doc th { padding: 8px 10px !important; }
  .doc table { font-size: 14px; }
  .nav-btn { width: 38px; height: 38px; }
  .nav-btn.prev { left: 6px; } .nav-btn.next { right: 6px; }
  .thumb { width: 84px; }
  .slide-bar .btn span { display: none; }
  .quiz-tools { padding: 12px 14px; }
  .quiz-score .progress { width: 140px; }
  .quiz-btns .btn { padding: 8px 10px; font-size: 13px; }
  .audit-row { grid-template-columns: 60px 1fr; padding: 10px 14px; }
  .audit-row span:last-child { grid-column: 1 / -1; }
  .landing { padding: 28px 16px 40px; }
  .landing h1 { font-size: 34px; }
  .lead { font-size: 16px; }
  .dropzone { padding: 30px 16px; }
  .file-row { flex-wrap: wrap; }
  .file-row .btn { margin-left: 60px; }
  .page-head h1 { font-size: 25px; }
}

/* ===== v2: materyal menüsü düzeni ===== */
main { display: block; min-height: calc(100vh - 68px); }
.back-btn { margin-left: -6px; }
.brand-text strong { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.brand-org { font-weight: 700; letter-spacing: .02em; }
[data-theme="auzef"] .brand-org { color: #fad806; }
[data-theme="modern"] .brand-org { color: var(--accent); }
.brand-sep { opacity: .5; font-weight: 400; }
#brandTitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { gap: 2px; }
.top-actions .icon-btn:hover { background: rgba(127,127,127,.15); }
.top-actions .icon-btn svg { stroke-linejoin: round; }

.home { gap: 30px; }
.home-head { display: flex; align-items: center; gap: 22px; padding: 34px 36px; border-radius: calc(var(--radius) + 6px); background: var(--hero-bg); color: var(--hero-ink); position: relative; overflow: hidden; }
[data-theme="auzef"] .home-head { border-bottom: 6px solid #fad806; }
[data-theme="modern"] .home-head::after { content: ''; position: absolute; right: -90px; top: -90px; width: 320px; height: 320px; border-radius: 50%; background: rgba(255,255,255,.08); }
.home-logo { width: 104px; height: 104px; flex: none; display: none; filter: drop-shadow(0 6px 16px rgba(0,0,0,.25)); }
[data-theme="auzef"] .home-logo { display: block; }
.home-title { min-width: 0; }
.home-title h1 { font-size: 40px; margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.home-title h1 .org { font-weight: 700; }
[data-theme="auzef"] .home-title h1 .org { color: #fad806; }
.home-title h1 .sep { opacity: .45; font-weight: 300; }
.home-sub { margin: 6px 0 0; font-size: 19px; opacity: .92; font-weight: 600; }
.home-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: 14px; opacity: .85; }
.home-meta span { display: inline-flex; align-items: center; gap: 6px; }
.home-meta .ico { width: 15px; height: 15px; }
.sec-title { font-size: 22px; margin: 0 0 14px; }
.sec-title.small { font-size: 15px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-family: var(--font); font-weight: 700; }
.mat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.mat-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 24px; min-height: 190px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: inherit; transition: .18s; position: relative; }
.mat-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 28px rgba(0,0,0,.09); }
[data-theme="auzef"] .mat-card { border-top: 4px solid #536f35; }
[data-theme="auzef"] .mat-card:hover { border-top-color: #fad806; }
.mat-card h3 { font-size: 21px; margin: 8px 0 0; }
.mat-card p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.45; flex: 1; }
.mat-meta { font-size: 13px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; margin-top: 6px; }
.mat-card.off { opacity: .5; pointer-events: none; box-shadow: none; }
.mat-ico { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); flex: none; }
.mat-ico .ico { width: 28px; height: 28px; }
[data-theme="auzef"] .mat-ico { background: #536f35; color: #fad806; border-radius: 50%; }
.mat-ico.lg { width: 52px; height: 52px; }
.mini-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mini-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; transition: .15s; }
.mini-card:hover { border-color: var(--accent); }
.mini-card > .ico:first-child { color: var(--accent); width: 22px; height: 22px; }
.mini-card div { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.mini-card b { font-size: 14.5px; }
.mini-card small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ico.chev { width: 16px; height: 16px; color: var(--muted); }

.mat-head { display: flex; flex-direction: column; gap: 12px; }
.mat-title { display: flex; align-items: center; gap: 16px; }
.mat-title h1 { font-size: 30px; margin: 0; }
.unit-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.unit-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: .15s; }
.unit-row:hover { border-color: var(--accent); transform: translateX(2px); }
.unit-row.off { opacity: .5; pointer-events: none; }
.unit-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.unit-row-body b { font-size: 16px; }
.unit-row-body small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 4px; }
.unit-chips::-webkit-scrollbar { display: none; }
.unit-chips a { flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.unit-chips a:hover { border-color: var(--accent); }
.unit-chips a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme="auzef"] .unit-chips a.on { background: #fad806; border-color: #fad806; color: #2c3b1b; }
.doc .flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { background: #fff3b0; } 100% { background: transparent; } }

/* ayarlar */
.sheet-wrap { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.4); display: flex; justify-content: flex-end; }
.sheet { width: min(400px, 100%); height: 100%; background: var(--surface); color: var(--text); padding: 18px 22px; overflow-y: auto; box-shadow: -10px 0 40px rgba(0,0,0,.2); animation: slidein .2s ease; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sheet-head h2 { margin: 0; font-size: 22px; }
.sheet-sec { padding: 14px 0; border-top: 1px solid var(--line); }
.sheet-sec h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-family: var(--font); font-weight: 700; margin-bottom: 10px; }
.theme-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); cursor: pointer; text-align: left; font: 14px var(--font); }
.theme-card small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.theme-card[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.sw { width: 100%; height: 58px; border-radius: 8px; display: grid; place-items: center; margin-bottom: 6px; }
.sw-auzef { background: linear-gradient(120deg, #3c5226, #536f35); border-bottom: 5px solid #fad806; }
.sw-auzef img { width: 40px; height: 40px; }
.sw-modern { background: linear-gradient(135deg, #1e3a8a, #2f5bea 60%, #3ba7f0); color: #fff; font-weight: 800; font-family: Inter, sans-serif; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 14px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.card .kv { font-size: 15px; }

/* medya, kitap, bilgi, arama */
.online-note { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--text); font-size: 14px; margin-bottom: 14px; }
.online-note .ico { color: var(--accent); }
.unit-content > .card.media + .card.media { margin-top: 16px; }
.embed { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #111; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.book-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.book-btns { display: flex; gap: 8px; }
.pdf-wrap { height: 78vh; }
.pdf-frame { width: 100%; height: 100%; border: 0; display: block; background: #525659; }
.note-card { background: var(--accent-soft); }
.info-units { margin: 0; padding-left: 1.2em; display: grid; gap: 10px; }
.info-units ul { margin: 4px 0 0; padding-left: 1.1em; color: var(--muted); font-size: 14.5px; }
.search-box { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 2px solid var(--line); border-radius: 14px; padding: 4px 16px; }
.search-box:focus-within { border-color: var(--accent); }
.search-box .ico { color: var(--muted); }
.search-input { flex: 1; border: 0; outline: 0; background: none; font: 18px var(--font); padding: 12px 0; color: var(--text); min-width: 0; }
.search-results { display: grid; gap: 10px; }
.search-hit { display: block; text-decoration: none; color: inherit; padding: 14px 18px; }
.search-hit:hover { border-color: var(--accent); }
.hit-meta { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 4px; flex-wrap: wrap; }
.search-hit p { margin: 0; font-size: 15px; }
.search-hit mark { background: #fff1a6; color: inherit; padding: 0 2px; border-radius: 3px; }

@media (max-width: 1000px) {
  .mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .page { padding: 20px 16px 48px; }
  .unit-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  main { min-height: calc(100vh - 60px); }
  .brand-text small { display: block; font-size: 11px; }
  .brand-text strong { font-size: 15px; gap: 6px; }
  .top-actions .icon-btn { width: 38px; height: 38px; }
  .home { gap: 22px; }
  .home-head { padding: 22px 18px; gap: 14px; flex-direction: column; align-items: flex-start; }
  .home-logo { width: 62px; height: 62px; }
  .home-title h1 { font-size: 27px; gap: 2px 10px; }
  .home-sub { font-size: 16px; }
  .home-meta { font-size: 13px; }
  .mat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .mat-card { padding: 16px 14px; min-height: 0; gap: 4px; }
  .mat-card h3 { font-size: 17px; margin-top: 6px; }
  .mat-card p { font-size: 12.5px; }
  .mat-meta { font-size: 11.5px; padding: 2px 8px; }
  .mat-ico { width: 44px; height: 44px; }
  .mat-ico .ico { width: 23px; height: 23px; }
  .mini-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .mat-title h1 { font-size: 22px; }
  .mat-ico.lg { width: 44px; height: 44px; }
  .pdf-wrap { display: none; }
  .book-btns { width: 100%; }
  .book-btns .btn { flex: 1; justify-content: center; }
  .sheet { width: 100%; height: auto; max-height: 85vh; position: absolute; bottom: 0; border-radius: 18px 18px 0 0; animation: slideup .2s ease; }
  .sheet-wrap { align-items: flex-end; }
  @keyframes slideup { from { transform: translateY(30px); opacity: 0; } }
  .search-input { font-size: 16px; }
}
.audio-box { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: center; padding: 8px 0; }
.audio-box > div { display: flex; flex-direction: column; }
.audio-box b { font-size: 18px; font-family: var(--font-head); font-weight: var(--head-weight); }
.audio-box audio { grid-column: 1 / -1; width: 100%; margin-top: 8px; }

/* ===== v3: uygulama kabuğu, kaydırmasız ekranlar, mobil tab bar, tüm kitap ===== */
html, body {
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.topbar {
  position: relative;
  top: auto;
  flex: none;
  z-index: 50;
  padding-top: env(safe-area-inset-top);
  padding-right: max(12px, env(safe-area-inset-right));
  padding-left: max(12px, env(safe-area-inset-left));
  height: calc(56px + env(safe-area-inset-top));
  min-height: calc(56px + env(safe-area-inset-top));
}
[data-theme="auzef"] .topbar { height: calc(58px + env(safe-area-inset-top)); min-height: calc(58px + env(safe-area-inset-top)); }
#main {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
#main.scroll {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
#main .page { animation: fadein .18s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* alt sekme çubuğu — masaüstünde gizli */
.tabbar {
  display: none;
  flex: none;
  z-index: 50;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 4px 6px calc(6px + env(safe-area-inset-bottom));
  padding-left: max(6px, env(safe-area-inset-left));
  padding-right: max(6px, env(safe-area-inset-right));
}
.tabbar a, .tabbar button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  border: 0;
  background: none;
  color: var(--muted);
  text-decoration: none;
  font: 600 10.5px/1.2 var(--font);
  letter-spacing: .01em;
  cursor: pointer;
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabbar .on { color: var(--accent); }
[data-theme="auzef"] .tabbar .on { color: #3f5628; }
[data-theme="auzef"] .tabbar { border-top: 2px solid #fad806; background: #fbfaf3; }

@media (max-width: 900px) {
  body.has-pkg .tabbar { display: flex; }
  body.has-pkg .top-actions #settingsBtn { display: none; }
  .crumbs { display: none; }
  .mat-head { gap: 8px; }
}

/* kaydırmasız sayfalar: ana alanın tamamını doldur */
.page.fit {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 12px;
  padding: 16px 24px 18px;
}
.page.fit > .mat-head { flex: none; }
.page.home.fit { gap: 10px; }
.page.home.fit > .home-head { flex: none; }
.page.home.fit > section {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.page.home.fit > section:has(.mat-grid) { flex: 1 1 auto; }
.page.home.fit > section:has(.mini-grid) { flex: none; }
.page.fit .sec-title { margin: 0 0 8px; }
.mat-grid {
  flex: 1 1 auto;
  min-height: 0;
  align-content: stretch;
  grid-auto-rows: 1fr;
}
.page.fit .mat-card {
  min-height: 0;
  height: 100%;
  padding: 16px 18px;
  gap: 4px;
}
.unit-list-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: 4px;
}
.page.fit .unit-list { align-content: start; }
.page.picker .mat-head { flex: none; }
.page.picker .allbook-card { flex: none; }
.page.picker .sec-title { flex: none; }
.scroll-inner {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  min-height: 0;
  flex: 1 1 auto;
}
.grow { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.page.fit .card.grow, .page.fit .pdf-wrap { flex: 1 1 auto; min-height: 0; }
.page.fit .pdf-wrap { height: auto; }
.bilgi-body { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.fit-center { height: 100%; display: flex; flex-direction: column; justify-content: center; }

/* daha kısa ekranlar */
@media (max-height: 860px) {
  .home-head { padding: 18px 22px; }
  .home-title h1 { font-size: 32px; }
  .home-logo { width: 72px; height: 72px; }
  .home-sub { font-size: 16px; margin-top: 2px; }
  .home-meta { margin-top: 8px; }
  .page.fit .mat-card h3 { font-size: 18px; }
  .page.fit .mat-card p { font-size: 13px; }
  .page.fit .mat-ico { width: 42px; height: 42px; }
  .page.fit .mat-ico .ico { width: 22px; height: 22px; }
  .mini-card { padding: 10px 12px; }
}
@media (max-height: 760px) {
  .home-head { padding: 12px 16px; }
  .home-title h1 { font-size: 26px; }
  .home-logo { width: 56px; height: 56px; }
  .home-sub { font-size: 14px; }
  .page.fit { padding: 10px 16px 12px; gap: 8px; }
  .page.fit .mat-card { padding: 10px 12px; }
  .page.fit .mat-card p { display: none; }
  .sec-title { font-size: 18px; margin-bottom: 6px; }
}

/* Tüm Kitap kartı ve görünümü */
.allbook-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; background: var(--hero-bg); color: var(--hero-ink);
  border-radius: var(--radius); text-decoration: none;
  box-shadow: var(--shadow);
}
[data-theme="auzef"] .allbook-card { border-bottom: 4px solid #fad806; }
.allbook-card .mat-ico { background: rgba(255,255,255,.18); color: #fff; }
[data-theme="auzef"] .allbook-card .mat-ico { background: #fad806; color: #3f5628; }
.allbook-card b { display: block; font-size: 18px; font-family: var(--font-head); font-weight: var(--head-weight); }
.allbook-card small { opacity: .9; font-size: 13px; }
.allbook-card .chev { color: inherit; }
.book-unit { margin-bottom: 36px; scroll-margin-top: 16px; }
.book-unit-head { display: flex; align-items: center; gap: 14px; margin: 8px 0 16px; padding-bottom: 12px; border-bottom: 3px solid var(--accent-2, var(--accent)); }
.book-unit-head h1 { margin: 0; font-size: 28px; }
.book-unit .doc { box-shadow: none; }
.toc.book-toc ol.book-toc-ol { border-left: 0; }
.toc-unit { margin: 0 0 8px; }
.toc-unit > a { display: flex; align-items: baseline; gap: 6px; font-weight: 700; color: var(--text); padding: 4px 0; text-decoration: none; font-size: 13.5px; }
.toc-unit > a b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 11px; flex: none; }
.toc-unit > ol { border-left: 2px solid var(--line); margin: 2px 0 0 10px; padding: 0; list-style: none; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.ghost.sm { color: var(--accent); }

/* ünite çipleri: 14 üniteye kadar yatay kayar, sayfa kaymaz */
.unit-chips { flex: none; max-width: 100%; }

/* arama satırı */
.search-hit { padding: 0; }
.search-hit > a:first-child { display: block; text-decoration: none; color: inherit; padding: 14px 18px 8px; }
.search-hit .hit-book { display: inline-flex; align-items: center; gap: 6px; padding: 0 18px 12px; font-size: 13px; font-weight: 600; text-decoration: none; }
.search-box { flex: none; }

/* deneme üretici */
.exam-gen { flex: none; }
.card.link-card.off { opacity: .45; pointer-events: none; }

/* PDF sığdır */
.page.fit .book-bar { flex: none; }
.page.unit.fit { overflow: hidden; height: 100%; display: flex; flex-direction: column; }
.page.unit.fit .unit-content { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.page.unit.fit .slides { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.page.unit.fit .stage { flex: 1 1 auto; height: auto; max-height: none; min-height: 0; }
.page.unit.fit .pager { flex: none; }
.page.unit.fit .unit-chips, .page.unit.fit .mat-head { flex: none; }

/* landing sığsın */
.landing { height: 100%; max-height: 100%; overflow: hidden; padding: 24px 20px; justify-content: center; }

/* ayarlar paneli: ekrana sığsın */
.sheet-wrap { overflow: hidden; }
.sheet { display: flex; flex-direction: column; max-height: 100dvh; }
.sheet-head { flex: none; }
.sheet-sec { overflow: auto; }

/* ---- mobil uygulama görünümü ---- */
@media (max-width: 900px) {
  .topbar { padding-inline: 8px; gap: 4px; }
  .page, .page.fit { padding: 12px 14px 16px; }
  .page.home.fit { padding: 10px 12px 12px; }
  .home-head { border-radius: 18px; }
  .mat-card, .mini-card, .unit-row, .card, .allbook-card { border-radius: 16px; }
  .icon-btn, .tabbar a, .tabbar button, .unit-row, .mat-card, .mini-card { min-height: 44px; }
  .unit-list { gap: 8px; }
  .unit-row { padding: 10px 12px; }
  .allbook-card { padding: 12px 14px; }
  .allbook-card b { font-size: 16px; }
}
@media (max-width: 600px) {
  .page.fit .mat-card p { display: none; } /* 2 sütunda yer aç */
  .mat-meta { font-size: 11px; }
  .home-title h1 { font-size: 22px; }
  .home-logo { width: 52px; height: 52px; }
  .mini-card small { display: none; }
  .mini-card { padding: 12px 14px; min-height: 48px; }
  .landing { padding: 16px 14px; }
  .landing h1 { font-size: 28px; }
  .lead { font-size: 14px; }
  .dropzone { padding: 20px 12px; }
  .landing-notes { display: none; }
  .pdf-wrap { display: none; }
  .book-unit-head h1 { font-size: 22px; }
}

/* standalone / ana ekrana eklenmiş */
@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top); }
}

/* kısa + dar */
@media (max-width: 600px) and (max-height: 740px) {
  .home-head { padding: 10px 12px; gap: 8px; }
  .home-meta { display: none; }
  .home-sub { display: none; }
  .sec-title { font-size: 15px; margin-bottom: 6px; }
  .page.fit .mat-ico { width: 36px; height: 36px; }
  .page.fit .mat-card { padding: 10px; }
  .page.fit .mat-card h3 { font-size: 15px; margin-top: 2px; }
}

#main, main { min-height: 0 !important; }
.layout { min-height: 0; }

/* v3 layout fixes: hero always row; diğer 2-col on phone; no overlap */
.page.home .home-head {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start;
  text-align: left;
}
.page.home .home-title { flex: 1; min-width: 0; }
.page.home .home-title h1 { flex-wrap: wrap; }
.page.home.fit > section:has(.mat-grid) { overflow: hidden; }
@media (max-width: 900px) {
  .mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .page.fit .mat-card p { display: none; }
  .page.home.fit .home-head { padding: 12px 14px; gap: 12px; }
  .page.home.fit .home-logo { width: 52px; height: 52px; }
  .page.home.fit .home-title h1 { font-size: 22px; }
}
@media (max-width: 600px) {
  .page.home.fit .home-sub { font-size: 13px; }
  .mini-card { padding: 10px 12px; min-height: 44px; }
  .mini-card small { display: none; }
}
.page.home.fit > section { overflow: hidden; }
@media (max-width: 600px) and (max-height: 760px) {
  .page.home.fit .mat-grid { gap: 8px; }
  .page.fit .mat-card { padding: 8px 10px; }
  .page.fit .mat-card h3 { font-size: 14.5px; }
  .page.fit .mat-ico { width: 32px; height: 32px; }
  .page.fit .mat-ico .ico { width: 18px; height: 18px; }
  .mat-meta { padding: 1px 7px; font-size: 10.5px; }
  .page.home.fit .sec-title { margin-bottom: 4px; }
  .mini-card { padding: 8px 10px; min-height: 42px; }
  .mini-card b { font-size: 13px; }
}
.tabbar .on { background: var(--accent-soft); }
[data-theme="auzef"] .tabbar .on { color: #2c3b1b; background: #fad806; }
#main.scroll, .page.allbook, .all-book, .book-unit, .doc { max-width: 100%; }
.doc, .all-book { overflow-x: hidden; }
.page.fit .grid-2, .page.fit .exam-gen { flex: 0 0 auto; align-content: start; }
.page.fit .link-card { height: auto; min-height: 0; }

/* PDF kitap kartı ve üretim */
.pdf-engine {
  position: fixed;
  left: 0;
  top: 0;
  width: 1200px;
  height: 2000px;
  border: 0;
  opacity: 0;
  z-index: -1;
  pointer-events: none;
}
.mat-card.pdf-card { position: relative; }
.pdf-bar {
  display: block;
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
  margin-top: 4px;
}
.pdf-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s; }
[data-theme="auzef"] .pdf-bar i { background: #fad806; }
.pdf-bar.lg { height: 10px; margin: 12px 0; }
.pdf-card.st-running .mat-meta { color: var(--accent); }
.pdf-card.st-error .mat-meta { color: var(--bad); }
.pdf-progress { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.pdf-progress .spinner { margin-bottom: 6px; }
.pdf-warn { font-size: 13px; color: var(--muted); }
.pdf-warn ul { margin: 6px 0 0; padding-left: 1.1em; }
.sheet-note { font-size: 13px; margin: 0 0 10px; }
.opt-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; cursor: pointer; }
.opt-row input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.opt-row b { display: block; font-size: 14.5px; }
.opt-row small { display: block; color: var(--muted); font-size: 12.5px; }
.opt-block { margin: 8px 0 12px; }
.opt-block > b { display: block; font-size: 13px; margin-bottom: 6px; }
.seg { display: flex; gap: 6px; }
.seg-btn { flex: 1; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 10px; padding: 8px 10px; font: 600 13px var(--font); cursor: pointer; }
.seg-btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
[data-theme="auzef"] .seg-btn.on { background: #fad806; color: #2c3b1b; border-color: #fad806; }
.pdf-kitap-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }

/* Mobil içindekiler: kenar sekmesi + kayan çekmece (kaydırarak da açılır) */
.toc-drawer-root { display: none; }
@media (max-width: 1100px) {
  .toc-drawer-root {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 80;
    pointer-events: none;
    --toc-p: 0;
  }
  .toc-tab {
    pointer-events: auto;
    position: fixed;
    right: 0;
    top: 42%;
    z-index: 81;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 34px;
    padding: 12px 4px 12px 6px;
    margin: 0;
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: 12px 0 0 12px;
    background: var(--surface);
    color: var(--accent);
    box-shadow: -2px 2px 12px rgba(0,0,0,.12);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    opacity: calc(1 - var(--toc-p, 0));
    transform: translateX(calc(var(--toc-p, 0) * 8px));
    transition: opacity .2s ease;
  }
  .toc-drawer-root.dragging .toc-tab { transition: none; }
  .toc-drawer-root.open .toc-tab { pointer-events: none; }
  .toc-tab svg { width: 20px; height: 20px; flex: none; }
  .toc-tab-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font: 700 11px/1.1 var(--font);
    letter-spacing: .04em;
  }
  [data-theme="auzef"] .toc-tab {
    background: #536f35;
    color: #fad806;
    border-color: #3d5428;
  }
  .toc-scrim {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: #000;
    opacity: calc(var(--toc-p, 0) * 0.42);
    pointer-events: none;
    cursor: pointer;
  }
  .toc-drawer-root.open .toc-scrim,
  .toc-drawer-root.dragging .toc-scrim { pointer-events: auto; }
  .toc-panel {
    pointer-events: auto;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, 86vw);
    background: var(--surface);
    color: var(--text);
    box-shadow: -8px 0 32px rgba(0,0,0,.22);
    display: flex;
    flex-direction: column;
    transform: translateX(calc((1 - var(--toc-p, 0)) * 100%));
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-right: env(safe-area-inset-right);
  }
  .toc-drawer-root:not(.dragging) .toc-panel { transition: transform .28s cubic-bezier(.32, .72, 0, 1); }
  .toc-drawer-root:not(.dragging) .toc-scrim { transition: opacity .28s ease; }
  .toc-panel-head {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 12px 10px 16px;
    border-bottom: 1px solid var(--line);
  }
  .toc-panel-head strong { font-size: 15px; }
  .toc-panel .toc {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 16px 24px;
    touch-action: pan-y;
  }
  .toc-panel .toc-title { display: none; }
  [data-theme="auzef"] .toc-panel-head { border-bottom: 2px solid #fad806; }
}
@media (max-width: 900px) {
  .toc-tab { top: auto; bottom: calc(72px + env(safe-area-inset-bottom)); }
}

/* Deneme sınavı (tek soru, süre, gezgin) */
.exam-page { display: flex; flex-direction: column; gap: 12px; }
.exam-page.fit { overflow: hidden; gap: 6px; padding: 8px 16px 10px; }
.exam-chrome { flex: none; position: relative; z-index: 4; }
.exam-chrome-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; min-height: 40px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.exam-title-sm { font-size: 14px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.exam-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; padding: 10px 16px; }
.exam-time-wrap { display: flex; flex-direction: column; gap: 2px; }
.exam-timer { font: 700 18px/1 var(--font-head, var(--font)); letter-spacing: .04em; font-variant-numeric: tabular-nums; flex: none; }
.exam-timer.low { color: #b45309; }
.exam-timer.critical { color: var(--bad, #b91c1c); }
.exam-answered { font-size: 12px; margin-left: auto; white-space: nowrap; flex: none; }
.exam-dots-btn {
  flex: none; min-width: 52px; min-height: 28px; height: 28px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2);
  color: var(--text); font: 700 12px var(--font); cursor: pointer;
}
.exam-chrome.open-dots .exam-dots-btn,
.exam-dots-btn[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-soft); }
.exam-dots { display: flex; flex-wrap: nowrap; gap: 4px; flex: none; overflow-x: auto; overflow-y: hidden; padding: 4px 2px 0; scrollbar-width: thin; }
.exam-dot { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 700 11px var(--font); cursor: pointer; flex: none; padding: 0; }
.exam-dot.marked { border-color: var(--accent); }
.exam-dot.on { background: var(--accent); color: var(--accent-ink, #fff); border-color: var(--accent); }
[data-theme="auzef"] .exam-dot.on { background: #fad806; color: #2c3b1b; border-color: #fad806; }
.exam-stage { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.exam-stage.can-scroll { overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.exam-stage .exam-q {
  flex: 1 1 auto; min-height: 0; margin: 0; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px; overflow: hidden;
}
.exam-stage.can-scroll .exam-q { overflow: visible; flex: none; }
.exam-q .q-head { gap: 6px; margin-bottom: 0; }
.exam-q .q-no { font-size: 11px; }
.exam-q .q-text { flex: none; margin: 0; }
.exam-q .q-text p { margin: 0 0 .35em; }
.exam-q .q-text img { max-height: 16vh; width: auto; max-width: 100%; object-fit: contain; }
.exam-q .opts { flex: 1 1 auto; gap: 6px; min-height: 0; align-content: start; }
.exam-q .opt { padding: 7px 10px; gap: 10px; font-size: 1em; line-height: 1.35; }
.exam-q .opt b { width: 26px; height: 26px; font-size: 13px; }
.exam-nav { display: flex; gap: 6px; flex: none; flex-wrap: nowrap; align-items: center; }
.exam-nav .btn { padding: 7px 12px; min-height: 36px; font-size: 13.5px; }
.exam-nav .btn[disabled] { opacity: .4; }
@media (min-width: 901px) {
  .exam-dots-btn { display: none; }
  .exam-dots { padding-top: 6px; }
}
@media (max-width: 900px) {
  .exam-dots {
    display: none;
    position: absolute; left: 0; right: 0; top: calc(100% + 4px);
    flex-wrap: wrap; overflow: auto; max-height: min(40vh, 220px);
    padding: 8px; gap: 6px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow), 0 8px 24px rgba(0,0,0,.12);
  }
  .exam-chrome.open-dots .exam-dots { display: flex; }
  .exam-dot { width: 32px; height: 32px; font-size: 12px; }
  .exam-title-sm { display: none; }
  .page.exam-page.fit { padding: 6px 10px 8px; gap: 6px; }
}
@media (max-width: 600px) {
  .exam-nav .btn { flex: 1; justify-content: center; padding: 7px 8px; min-height: 40px; }
  .exam-chrome-row { padding: 3px 8px; min-height: 36px; }
  .exam-timer { font-size: 16px; }
}
.exam-score-num { font-size: 22px; margin: 0 0 8px; }
.exam-review { display: flex; flex-direction: column; gap: 12px; }
.opts.readonly .opt { cursor: default; }
.unit-qs .unit-q { margin: 0 0 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.q-plain, .q-plain * { cursor: default; }
.q-plain-stem { display: flex; gap: 8px; align-items: flex-start; }
.q-plain-stem .q-plain-no { flex: none; font-weight: 700; min-width: 1.6em; }
.q-plain-stem .prose, .q-plain-opt .prose { flex: 1; min-width: 0; }
.q-plain-stem .prose > p:first-child, .q-plain-opt .prose > p:first-child { margin-top: 0; }
.q-plain-stem .prose > p:last-child, .q-plain-opt .prose > p:last-child { margin-bottom: 0; }
.q-plain-opts { margin: 8px 0 0 1.6em; display: flex; flex-direction: column; gap: 4px; }
.q-plain-opt { display: flex; gap: 8px; align-items: flex-start; }
.q-plain-ltr { flex: none; font-weight: 700; min-width: 1.6em; }
.unit-qs .opt, .unit-qs button.opt { display: none; } /* safety: notes never show interactive options */

.cevap-key ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cevap-key li { display: flex; align-items: center; gap: 8px; min-width: 72px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2, #f4f4f0); }
.cevap-key .ck-no { color: var(--muted); font-size: 12px; }
.cevap-key b { font-size: 16px; color: var(--accent); }
[data-theme="auzef"] .cevap-key b { color: #3f5628; }
.book-toc-top { margin: 0 0 28px; padding: 28px 32px; }
.book-toc-top h1 { margin: 0 0 16px; }
.book-front { margin: 0 0 36px; padding: 28px 32px; }
.book-front-head .eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.book-front-head h1 { margin: 0 0 16px; }
.pdf-fallback { margin: 8px 0 0; font-size: 12.5px; }
@media (max-width: 600px) {
  .exam-timer { font-size: 16px; }
  .exam-toolbar { padding: 6px 10px; }
  .book-toc-top, .book-front { padding: 18px 16px; }
}


/* ---------- cevap anahtarı (düz satır) + yazdır ---------- */
.unit-key-line {
  margin: 1.25em 0 0;
  padding: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--muted, #5b6454);
  scroll-margin-top: 16px;
}
.print-btn { margin-left: auto; flex: none; }
.print-btn svg { width: 16px; height: 16px; }

@media print {
  @page { size: A4; margin: 14mm; }
  html, body {
    background: #fff !important;
    color: #111 !important;
    height: auto !important;
    overflow: visible !important;
    font-size: 11pt;
  }
  body { display: block !important; }
  .topbar,
  .tabbar,
  .sidebar,
  .toc-side,
  .toc-tab,
  .toc-panel,
  .toc-scrim,
  .pager,
  .unit-chips,
  .crumbs,
  .print-btn,
  .sheet-wrap,
  #settings,
  .lightbox,
  .toc-drawer,
  #tabbar { display: none !important; }
  #main, #main.scroll {
    display: block !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    position: static !important;
    flex: none !important;
  }
  .page, .page.unit, .page.allbook, .page.fit,
  .notes-layout, .all-book, .unit-content {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    animation: none !important;
    box-shadow: none !important;
  }
  .notes-layout { grid-template-columns: 1fr !important; gap: 0 !important; }
  .mat-head { border: 0 !important; margin: 0 0 12px !important; padding: 0 !important; }
  .mat-title { gap: 10px; }
  .mat-title h1 { font-size: 20pt; }
  .doc img, .prose img, article.doc img {
    max-width: 100% !important;
    height: auto !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .doc-sec, .unit-q, .q-plain, .book-unit, table, figure {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .book-unit { break-before: page; }
  .book-unit:first-of-type { break-before: auto; }
  .all-book > .book-toc-top { break-after: page; }
  a[href]::after { content: none !important; }
  .doc-sec.callout { break-inside: avoid; }
  .unit-key-line { color: #333 !important; }
}
