@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,800&family=Nunito+Sans:opsz,wght@6..12,400;6..12,600;6..12,800&display=swap");

:root {
  --paper: #fbfaf6;
  --card: #ffffff;
  --ink: #1d1b26;
  --muted: #6b6879;
  --line: #ebe7dd;
  --primary: #5444d8;
  --primary-ink: #ffffff;
  --primary-soft: #eeebff;
  --hl: #ffe45c;
  --hl-soft: #fff6c2;
  --ok: #1f9d6b;
  --ok-soft: #e3f6ec;
  --bad: #e0533d;
  --bad-soft: #fdeceb;
  --st-new: #cdc9d6;
  --st-learning: #4f8df7;
  --st-review: #f39c38;
  --st-learned: #2fb27a;
  --st-mock_pass: #0e9f9a;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(29, 27, 38, .05), 0 8px 24px rgba(29, 27, 38, .06);
  --font: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", var(--font);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 800; }
h3 { font-size: 1.08rem; font-weight: 600; }
p { margin: 0 0 .8em; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 8px; }

.wrap { max-width: 760px; margin: 0 auto; padding: 16px 16px 96px; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(251, 250, 246, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .in { max-width: 760px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.15rem; text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 26px; height: 26px; border-radius: 8px; background: var(--hl); display: grid; place-items: center; font-size: 15px; transform: rotate(-6deg); }
.topbar .sp { flex: 1; }
.iconbtn { border: 0; background: transparent; padding: 8px 10px; border-radius: 10px; cursor: pointer; color: var(--muted); }
.iconbtn:hover { background: var(--line); color: var(--ink); }

.muted { color: var(--muted); }
.small { font-size: .88rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.stack > * + * { margin-top: 12px; }
.center { text-align: center; }
.hidden { display: none !important; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; }
.section { margin-top: 26px; }
.section > h2 { display: flex; align-items: center; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 11px 16px; border-radius: 14px; cursor: pointer; font-weight: 700; text-decoration: none;
  min-height: 46px; transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { background: #f5f3ee; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 6px 16px rgba(84, 68, 216, .25); }
.btn.primary:hover { background: #4636c9; }
.btn.big { font-size: 1.05rem; padding: 14px 20px; min-height: 54px; width: 100%; letter-spacing: .02em; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.study { background: var(--ink); color: #fff; border-color: var(--ink); font-family: var(--display); letter-spacing: .04em; }
.btn.study:hover { background: #33303f; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--line); color: var(--ink); white-space: nowrap; }
.chip.days { background: var(--hl); }
.chip.days.urgent { background: var(--bad); color: #fff; }
.chip.demo { background: var(--primary-soft); color: var(--primary); }
.st { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.st-new { background: var(--st-new); } .st-learning { background: var(--st-learning); } .st-review { background: var(--st-review); }
.st-learned { background: var(--st-learned); } .st-mock_pass { background: var(--st-mock_pass); }

/* highlighter */
.hl, mark {
  background: linear-gradient(104deg, rgba(255, 228, 92, 0) .9%, var(--hl) 2.4%, rgba(255, 228, 92, .75) 5.8%, rgba(255, 228, 92, .3) 93%, rgba(255, 228, 92, .85) 96%, rgba(255, 228, 92, 0) 98%), linear-gradient(183deg, rgba(255, 228, 92, 0) 0%, rgba(255, 228, 92, .3) 7.9%, rgba(255, 228, 92, 0) 15%);
  padding: .1em .35em; border-radius: 6px; -webkit-box-decoration-break: clone; box-decoration-break: clone; color: inherit;
}
.hl-anim { background-size: 0% 100%; background-repeat: no-repeat; animation: hl .9s .2s ease forwards; }
@keyframes hl { to { background-size: 100% 100%; } }

/* dashboard */
.hello { display: flex; align-items: center; gap: 14px; margin: 8px 0 4px; }
.ring { width: 64px; height: 64px; flex: none; }
.ring circle { fill: none; stroke-width: 7; }
.ring .bg { stroke: var(--line); }
.ring .fg { stroke: var(--ok); stroke-linecap: round; transition: stroke-dashoffset .8s ease; transform: rotate(-90deg); transform-origin: 50% 50%; }
.ring text { font-family: var(--display); font-weight: 800; font-size: 15px; fill: var(--ink); }

.task { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.task .tick { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; color: #fff; }
.task.done .tick { background: var(--ok); border-color: var(--ok); }
.task.done .ttl { text-decoration: line-through; color: var(--muted); }
.task .ttl { font-weight: 700; }

.course { position: relative; overflow: hidden; }
.course::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--c, var(--primary)); }
.course h3 { font-size: 1.15rem; margin: 0; }
.bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--line); margin: 12px 0 6px; }
.bar span { height: 100%; transition: width .6s ease; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }

.grid2 { display: grid; gap: 12px; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }

/* topic list */
.tlist { list-style: none; padding: 0; margin: 0; }
.tlist li { display: flex; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.tlist li:last-child { border-bottom: 0; }
.tlist a { color: var(--ink); text-decoration: none; font-weight: 700; flex: 1; }

/* upload */
.drop { border: 2px dashed #d6d1c4; border-radius: var(--radius); padding: 22px; text-align: center; background: #fffdf7; cursor: pointer; transition: border-color .2s, background .2s; }
.drop.over { border-color: var(--primary); background: var(--primary-soft); }
.src { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.src:last-child { border-bottom: 0; }
.src .nm { font-weight: 700; word-break: break-word; }
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); width: 0; transition: width .2s; }
.spin { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* study flow */
.flowhead { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.steps-dots { display: flex; gap: 6px; flex: 1; }
.steps-dots i { height: 6px; flex: 1; border-radius: 99px; background: var(--line); transition: background .3s; }
.steps-dots i.on { background: var(--primary); }
.steps-dots i.done { background: #b7b0f3; }
.lesson-card { min-height: 46vh; display: flex; flex-direction: column; animation: rise .35s ease both; }
.lesson-card .kicker { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin-bottom: 6px; }
.lesson-card .body { flex: 1; }
.lesson-card .actions { margin-top: 18px; display: flex; gap: 10px; }
.lesson-card .actions .btn { flex: 1; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.term { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; background: #fffef9; }
.term b { font-family: var(--display); }
.term .acad { margin-top: 6px; font-size: .92rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 6px; }
.hl-list { list-style: none; padding: 0; margin: 0; }
.hl-list li { margin: 0 0 12px; font-weight: 600; }
.steplist { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steplist li { position: relative; padding: 0 0 14px 44px; animation: rise .4s ease both; }
.steplist li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 800; display: grid; place-items: center; }
.steplist li::after { content: ""; position: absolute; left: 14px; top: 30px; bottom: 2px; width: 2px; background: var(--primary-soft); }
.steplist li:last-child::after { display: none; }
.example { border-left: 4px solid var(--hl); background: #fffdf3; padding: 10px 14px; border-radius: 0 12px 12px 0; margin-bottom: 10px; }
table.cmp { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
table.cmp th, table.cmp td { padding: 9px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
table.cmp th { background: #f6f4ee; font-family: var(--display); }
table.cmp tr:last-child td { border-bottom: 0; }
.tablewrap { overflow-x: auto; }
.source-ref { font-size: .8rem; color: var(--muted); margin-top: 10px; }
.notice { background: var(--hl-soft); border: 1px solid #f3e08c; border-radius: 14px; padding: 12px 14px; font-size: .92rem; }
.notice.info { background: var(--primary-soft); border-color: #d9d4ff; }
.notice.bad { background: var(--bad-soft); border-color: #f6c9c2; }

/* diagram */
.diagram svg { width: 100%; height: auto; display: block; }
.diagram .node rect { fill: #fff; stroke: var(--primary); stroke-width: 2; }
.diagram .node text.l { font-family: var(--display); font-weight: 700; font-size: 15px; fill: var(--ink); }
.diagram .node text.d { font-size: 12px; fill: var(--muted); }
.diagram .edge path { fill: none; stroke: #9a93c9; stroke-width: 2; }
.diagram .edge text { font-size: 12px; font-weight: 700; fill: var(--primary); }
.diagram .edge rect { fill: var(--paper); }
.diagram.anim .node { opacity: 0; transform-box: fill-box; transform-origin: center; animation: pop .45s ease forwards; }
.diagram.anim .edge path { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw .7s ease forwards; }
.diagram.anim .edge g.lbl { opacity: 0; animation: fade .3s ease forwards; }
@keyframes pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }

/* questions */
.qtype { font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.qprompt { font-size: 1.12rem; font-weight: 700; margin: 6px 0 14px; }
.scenario { background: #f6f4ee; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; font-size: .95rem; }
.opt { display: block; width: 100%; text-align: left; border: 2px solid var(--line); background: #fff; padding: 13px 14px; border-radius: 14px; margin-bottom: 10px; cursor: pointer; font-weight: 600; transition: border-color .15s, background .15s; }
.opt:hover { border-color: #c9c3f5; }
.opt.sel { border-color: var(--primary); background: var(--primary-soft); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt .why { display: block; font-weight: 400; font-size: .88rem; color: var(--muted); margin-top: 4px; }
.tf { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tf .opt { text-align: center; margin: 0; }
input.text, textarea.text, select.text { width: 100%; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fff; }
input.text:focus, textarea.text:focus, select.text:focus { border-color: var(--primary); outline: none; }
.match-row { display: grid; grid-template-columns: 1fr; gap: 6px; margin-bottom: 12px; }
@media (min-width: 520px) { .match-row { grid-template-columns: 1fr 1fr; align-items: center; } }
.match-row .l { font-weight: 700; }
.match-row.wrong select { border-color: var(--bad); }
.match-row.right select { border-color: var(--ok); }
.order-item { display: flex; align-items: center; gap: 8px; border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; font-weight: 600; transition: transform .2s; }
.order-item .n { width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; flex: none; font-size: .85rem; }
.order-item .t { flex: 1; }
.order-item button { border: 1px solid var(--line); background: #fff; border-radius: 10px; width: 38px; height: 38px; cursor: pointer; font-size: 1rem; }
.feedback { margin-top: 14px; border-radius: 16px; padding: 14px 16px; animation: rise .3s ease both; }
.feedback.ok { background: var(--ok-soft); }
.feedback.bad { background: var(--bad-soft); }
.feedback h3 { display: flex; align-items: center; gap: 8px; }
.feedback .remedial { background: #fff; border-radius: 12px; padding: 12px; margin-top: 10px; }
.check { width: 30px; height: 30px; }
.check circle { fill: var(--ok); }
.check path { fill: none; stroke: #fff; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .4s .15s ease forwards; }
.burst { position: fixed; pointer-events: none; inset: 0; z-index: 50; }
.burst i { position: absolute; width: 8px; height: 8px; border-radius: 2px; animation: fly .9s ease-out forwards; }
@keyframes fly { to { transform: translate(var(--dx), var(--dy)) rotate(260deg); opacity: 0; } }

.summary-big { font-family: var(--display); font-size: 2.6rem; font-weight: 800; }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-list span { background: var(--line); border-radius: 99px; padding: 4px 10px; font-size: .86rem; font-weight: 600; }
.pill-list.ok span { background: var(--ok-soft); }
.pill-list.bad span { background: #fff1dc; }

.video { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.video:last-child { border-bottom: 0; }
.video .yt { width: 42px; height: 30px; border-radius: 8px; background: #ff3b30; flex: none; display: grid; place-items: center; color: #fff; font-size: 14px; }

/* modal & toast */
.modal { position: fixed; inset: 0; background: rgba(29, 27, 38, .45); display: grid; place-items: end center; z-index: 40; padding: 0; animation: fade .2s ease both; opacity: 1; }
@media (min-width: 640px) { .modal { place-items: center; padding: 16px; } }
.modal .sheet { background: var(--card); width: 100%; max-width: 520px; border-radius: 22px 22px 0 0; padding: 20px 18px 24px; max-height: 92vh; overflow: auto; animation: rise .25s ease both; }
@media (min-width: 640px) { .modal .sheet { border-radius: 22px; } }
label.fl { display: block; font-weight: 700; font-size: .9rem; margin: 12px 0 6px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px; z-index: 60; max-width: calc(100% - 32px); box-shadow: var(--shadow); animation: rise .25s ease both; }
.toast.bad { background: var(--bad); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: 100%; max-width: 380px; }
.empty { text-align: center; padding: 28px 16px; }
.empty .big { font-size: 2.2rem; }
.skeleton { height: 90px; border-radius: var(--radius); background: linear-gradient(90deg, #f1eee6, #f8f6f0, #f1eee6); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin-bottom: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.pagetext { white-space: pre-wrap; font-size: .92rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }

/* ------------------------------------------------------------ telefon */
html, body { overscroll-behavior-y: none; }
button, .btn, .opt, a, .task { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.topbar .in { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); padding-top: max(10px, env(safe-area-inset-top)); }
.wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.modal .sheet { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.toast { bottom: calc(20px + env(safe-area-inset-bottom)); }
.btn.small, .btn.ghost.small { min-height: 40px !important; }
.iconbtn { min-height: 44px; min-width: 44px; }
input.text, textarea.text, select.text { font-size: 16px; min-height: 48px; } /* iOS yakınlaştırmasını önler */
.titlerow { display: flex; gap: 8px; align-items: flex-start; }
.titlerow h1, .titlerow h3 { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.titlerow .chip { margin-top: 4px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair .btn { white-space: nowrap; padding-left: 8px; padding-right: 8px; }
/* başparmak bölgesi: ders kartı ve soru butonları ekranın altında sabit */
.card .sticky-actions { position: sticky; bottom: 0; z-index: 5; margin: 18px -18px -18px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(255,255,255,0), #fff 22%); border-radius: 0 0 var(--radius) var(--radius); }
@media (hover: none) {
  .btn:hover { background: var(--card); }
  .btn.primary:hover { background: var(--primary); }
  .btn.study:hover { background: var(--ink); }
  .opt:hover { border-color: var(--line); }
  .opt.sel:hover { border-color: var(--primary); }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  h1 { font-size: 1.42rem; }
  h2 { font-size: 1.15rem; }
  .wrap { padding-top: 12px; }
  .card { padding: 15px; border-radius: 16px; }
  .card .sticky-actions { margin: 16px -15px -15px; padding-left: 15px; padding-right: 15px; }
  .section { margin-top: 22px; }
  .hello { gap: 12px; }
  .ring { width: 54px; height: 54px; }
  .task { padding: 12px; }
  .task .go { display: none; }
  .lesson-card { min-height: calc(100vh - 150px); min-height: calc(100dvh - 150px); }
  .qprompt { font-size: 1.05rem; }
  .summary-big { font-size: 2.2rem; }
  /* karşılaştırma tablosu → kartlar */
  .tablewrap table.cmp, .tablewrap table.cmp tbody, .tablewrap table.cmp tr, .tablewrap table.cmp th, .tablewrap table.cmp td { display: block; width: 100%; }
  .tablewrap table.cmp { border: 0; }
  .tablewrap table.cmp thead { display: none; }
  .tablewrap table.cmp tr { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; background: #fff; }
  .tablewrap table.cmp tbody th { background: #f6f4ee; border-bottom: 1px solid var(--line); }
  .tablewrap table.cmp td { border-bottom: 1px dashed var(--line); }
  .tablewrap table.cmp td:last-child { border-bottom: 0; }
  .tablewrap table.cmp td::before { content: attr(data-label); display: block; font-size: .75rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  .diagram.anim .node { opacity: 1; }
  .diagram.anim .edge path { stroke-dashoffset: 0; }
  .hl-anim { background-size: 100% 100%; }
}
.feedback { scroll-margin-top: 72px; }
.term .en { display: inline-block; margin-left: 8px; font-size: .78rem; font-weight: 800; color: var(--primary); background: var(--primary-soft); border-radius: 99px; padding: 1px 8px; vertical-align: 2px; }
.en-chip { background: var(--primary-soft); color: var(--primary); margin-right: 6px; font-size: .7rem; }
.video .yt.doc { background: var(--line); color: var(--ink); }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .9em; background: #f1eef9; color: #3b2fb0; border-radius: 6px; padding: .08em .35em; overflow-wrap: anywhere; }
mark code { background: transparent; }
.toast { top: calc(68px + env(safe-area-inset-top)); bottom: auto; }
.titlerow { flex-wrap: wrap; }
.titlerow h1, .titlerow h3 { flex: 1 1 13rem; }
