/* Kelime Atölyesi — stil. Harici kaynak yok, çevrimdışı çalışır. */
:root {
  --bg: #f2f4f3; --surface: #ffffff; --surface-2: #f6f8f7; --ink: #16211f; --ink-2: #45544f; --muted: #63726d;
  --line: #dfe5e2; --line-2: #ccd6d2;
  --primary: #0d6e63; --primary-2: #0a564e; --primary-soft: #dcefeb; --on-primary: #fff;
  --accent: #b4571a; --accent-soft: #fbeade;
  --ok: #1b7f45; --ok-soft: #e2f3e8; --bad: #bf3b3b; --bad-soft: #fbe8e8;
  --warn: #8d6100; --warn-soft: #fbf0d6; --tip: #0d6e63; --tip-soft: #dcefeb;
  --word: #6b43a8; --word-soft: #f0eafb;
  --b0: #c6cfcb; --b1: #e0a46a; --b2: #d8c05a; --b3: #8dc272; --b4: #4faa7c; --b5: #0d8f6f;
  --radius: 14px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20, 35, 32, .05), 0 6px 18px rgba(20, 35, 32, .06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: Consolas, "Cascadia Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111614; --surface: #19201e; --surface-2: #1f2825; --ink: #e8eeeb; --ink-2: #b6c2be; --muted: #869490;
    --line: #2a3531; --line-2: #384540;
    --primary: #4fd1bb; --primary-2: #79e0ce; --primary-soft: #16302c; --on-primary: #06201c;
    --accent: #eda468; --accent-soft: #33241a;
    --ok: #5ac98a; --ok-soft: #14301f; --bad: #ff8b8b; --bad-soft: #351a1a;
    --warn: #eac36a; --warn-soft: #2e2715; --tip: #4fd1bb; --tip-soft: #16302c;
    --word: #c4a6ff; --word-soft: #251f36;
    --b0: #3a4541; --b1: #a3703f; --b2: #a89440; --b3: #5f9a58; --b4: #3d8c67; --b5: #2fc0a0;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 18px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111614; --surface: #19201e; --surface-2: #1f2825; --ink: #e8eeeb; --ink-2: #b6c2be; --muted: #869490;
  --line: #2a3531; --line-2: #384540;
  --primary: #4fd1bb; --primary-2: #79e0ce; --primary-soft: #16302c; --on-primary: #06201c;
  --accent: #eda468; --accent-soft: #33241a;
  --ok: #5ac98a; --ok-soft: #14301f; --bad: #ff8b8b; --bad-soft: #351a1a;
  --warn: #eac36a; --warn-soft: #2e2715; --tip: #4fd1bb; --tip-soft: #16302c;
  --word: #c4a6ff; --word-soft: #251f36;
  --b0: #3a4541; --b1: #a3703f; --b2: #a89440; --b3: #5f9a58; --b4: #3d8c67; --b5: #2fc0a0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 18px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* .btn/.grades kendi display'ini ezmesin */
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.55; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .92em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; }
h1 { font-size: 1.85rem; letter-spacing: -.01em; }
h2 { font-size: 1.22rem; margin-top: 1.9rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- üst çubuk ---------- */
.topbar {
  /* top: 0 değil — telefon uygulamasında durum çubuğunun altında kalsın */
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; display: flex; align-items: center; gap: 1rem;
  padding: .55rem 1.2rem; background: var(--surface); border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px;
  background: var(--primary); color: var(--on-primary); font-weight: 700; font-family: var(--serif); font-size: 1.05rem;
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-t { font-weight: 650; }
.brand-s { font-size: .72rem; color: var(--muted); letter-spacing: .02em; }
.nav { display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: thin; }
.nav a {
  display: flex; align-items: center; gap: .35rem; padding: .42rem .7rem; border-radius: 9px;
  color: var(--ink-2); font-size: .93rem; white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.on { background: var(--primary-soft); color: var(--primary-2); font-weight: 600; }
.nav .ni { font-size: .95em; }
.tools { margin-left: auto; display: flex; align-items: center; gap: .4rem; }
.searchbox { position: relative; }
.searchbox input {
  width: 210px; padding: .42rem .7rem; border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--surface-2); color: var(--ink); font: inherit; font-size: .92rem;
}
.searchbox input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.qres {
  position: absolute; top: calc(100% + 4px); right: 0; width: 330px; max-height: 60vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 11px; box-shadow: var(--shadow); padding: .3rem;
}
.qrow { display: flex; align-items: baseline; gap: .5rem; padding: .4rem .55rem; border-radius: 7px; color: var(--ink); }
.qrow:hover { background: var(--surface-2); text-decoration: none; }
.qrow strong { color: var(--primary-2); }
.qtr { color: var(--muted); font-size: .88rem; margin-left: auto; text-align: right; }
.iconbtn {
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); cursor: pointer;
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 1rem; text-decoration: none;
}
.iconbtn:hover { border-color: var(--primary); text-decoration: none; }

main { max-width: 1060px; margin: 0 auto; padding: 1.6rem 1.2rem 4rem; }
main:focus { outline: none; }
.foot { max-width: 1060px; margin: 0 auto; padding: 0 1.2rem 2.5rem; color: var(--muted); font-size: .82rem; }

.page-head h1 { margin-bottom: .2rem; }
.lead { color: var(--ink-2); max-width: 70ch; }
.crumbs { display: flex; gap: .4rem; align-items: center; font-size: .85rem; color: var(--muted); margin-bottom: .7rem; }
.crumbs .sep { opacity: .6; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.sec-head h2 { margin-bottom: .5rem; }

/* ---------- kartlar / kutular ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin: 1.3rem 0; }
.stat {
  display: flex; align-items: center; gap: .7rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .8rem .9rem;
}
.stat-icon { font-size: 1.3rem; }
.stat-v { font-weight: 680; font-size: 1.12rem; }
.stat-l { color: var(--muted); font-size: .8rem; }
.actions .action { display: flex; gap: .8rem; align-items: flex-start; color: var(--ink); }
.action:hover { border-color: var(--primary); text-decoration: none; transform: translateY(-1px); }
.action { transition: transform .12s ease, border-color .12s ease; }
.action-icon { font-size: 1.4rem; }
.action-t { font-weight: 650; }
.action-d { color: var(--muted); font-size: .88rem; }
.action.primary { border-color: var(--primary); background: var(--primary-soft); }
.action.primary .action-t { color: var(--primary-2); }

.box { border: 1px solid var(--line); border-left: 4px solid var(--line-2); border-radius: var(--radius); background: var(--surface); padding: .85rem 1rem; }
.box-title { display: flex; align-items: center; gap: .45rem; font-weight: 650; margin-bottom: .35rem; }
.box-body { color: var(--ink-2); font-size: .94rem; }
.box-warn { border-left-color: var(--warn); background: var(--warn-soft); }
.box-tip { border-left-color: var(--tip); background: var(--tip-soft); margin: 1.2rem 0; }
.box-word { border-left-color: var(--word); background: var(--word-soft); }
.wotd { display: flex; align-items: baseline; gap: .5rem; }
.wotd-k { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; color: var(--word); }
.wotd-tr { color: var(--ink); }
.more { display: inline-block; margin-top: .4rem; font-size: .86rem; }

/* ---------- düğmeler ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem; padding: .48rem .85rem; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-size: .92rem;
  cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--primary); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.btn.primary:hover { background: var(--primary-2); }
.btn.ghost { background: transparent; }
.btn.big { padding: .6rem 1.2rem; font-size: 1rem; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.g0 { border-color: var(--bad); color: var(--bad); }
.btn.g1 { border-color: var(--warn); color: var(--warn); }
.btn.g2 { border-color: var(--ok); color: var(--ok); }
.row-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.row-actions.small { margin: .6rem 0 0; }
.badge { font-size: .72rem; padding: .1rem .4rem; border-radius: 6px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* ---------- çubuklar ---------- */
.bar { height: 7px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar span { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .25s ease; }
.bar.thin { height: 5px; }
.bar.big { height: 11px; margin: .6rem 0; }
.stackbar { display: flex; height: 13px; border-radius: 99px; overflow: hidden; background: var(--b0); border: 1px solid var(--line); }
.stackbar .learned { background: var(--b5); }
.stackbar .learning { background: var(--b2); }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-bottom: .45rem; }
.legend span { display: flex; align-items: center; gap: .35rem; }
.sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.sw.new { background: var(--b0); } .sw.learning { background: var(--b2); } .sw.learned { background: var(--b5); }

/* ---------- filtreler ---------- */
.filters { margin: 1rem 0; display: flex; flex-direction: column; gap: .55rem; }
.frow { display: flex; flex-wrap: wrap; gap: .32rem; align-items: center; }
.flabel { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); min-width: 74px; }
.fchip {
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-2); cursor: pointer;
  padding: .25rem .6rem; border-radius: 99px; font: inherit; font-size: .85rem;
}
.fchip:hover { border-color: var(--primary); }
.fchip.sel { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.fsum { margin: .2rem 0 0; font-size: .9rem; color: var(--ink-2); }
.search {
  width: 100%; padding: .6rem .8rem; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: inherit; margin: .8rem 0;
}
.search:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.alphabet { display: flex; flex-wrap: wrap; gap: .22rem; margin-top: .8rem; }
.al {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer;
  width: 29px; height: 29px; border-radius: 7px; font: inherit; font-size: .85rem;
}
.al:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- kelime listesi ---------- */
.wordlist { display: flex; flex-direction: column; gap: .3rem; }
.lhead {
  font-family: var(--serif); font-size: 1.15rem; font-weight: 700; color: var(--primary-2);
  margin: .9rem 0 .1rem; padding-bottom: .2rem; border-bottom: 1px solid var(--line);
}
.wrow {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .1rem .5rem .1rem 0; display: grid; grid-template-columns: 1fr auto auto; align-items: center;
}
.wrow.ogrenildi { border-left: 3px solid var(--b5); }
.wrow.ogreniliyor { border-left: 3px solid var(--b2); }
.whead {
  grid-column: 1; display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; width: 100%;
  background: none; border: 0; cursor: pointer; text-align: left; font: inherit; color: var(--ink); padding: .55rem .7rem;
}
.whead:hover .wk { color: var(--primary); }
.wk { font-weight: 640; font-size: 1.02rem; }
.pos { color: var(--muted); font-size: .78rem; text-transform: lowercase; }
.wtr { color: var(--ink-2); font-size: .93rem; }
.flag { color: var(--warn); font-size: .85rem; }
.boxtag { margin-left: auto; font-size: .7rem; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 0 .45rem; }
.boxtag.b3, .boxtag.b4, .boxtag.b5 { color: var(--ok); border-color: var(--ok); }
.say {
  background: none; border: 0; cursor: pointer; font-size: .95rem; padding: .2rem .3rem; border-radius: 6px; color: var(--muted);
}
.say:hover { background: var(--primary-soft); }
.say.big { font-size: 1.2rem; }
.starbtn { background: none; border: 0; cursor: pointer; font-size: .9rem; filter: grayscale(1); opacity: .45; padding: .2rem; }
.starbtn.on { filter: none; opacity: 1; }
.wdet { grid-column: 1 / -1; padding: .2rem .8rem .8rem; border-top: 1px dashed var(--line); }
.famtable { width: 100%; border-collapse: collapse; margin: .5rem 0; font-size: .92rem; }
.famtable td { padding: .28rem .5rem .28rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.famtable tr:last-child td { border-bottom: 0; }
.cols { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin: .5rem 0; }
.colchip {
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-2); cursor: pointer;
  padding: .18rem .5rem; border-radius: 7px; font: inherit; font-size: .86rem; font-style: italic;
}
.colchip:hover { border-color: var(--primary); color: var(--primary); }
.wnote { background: var(--warn-soft); border-left: 3px solid var(--warn); border-radius: 6px; padding: .4rem .6rem; font-size: .89rem; margin: .5rem 0; }
.wmeta { display: flex; flex-wrap: wrap; gap: .25rem .9rem; color: var(--muted); font-size: .8rem; margin-top: .5rem; }
.col { font-size: .9rem; color: var(--ink-2); }

/* ---------- kelime sayfası ---------- */
.wordpage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; box-shadow: var(--shadow); }
.wp-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
h1.wp-k { font-family: var(--serif); font-size: 2.3rem; }
.wp-tr { font-size: 1.05rem; color: var(--ink-2); margin: .2rem 0 .6rem; }
.hardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .5rem; margin: .6rem 0; }
.hardchip {
  display: flex; flex-direction: column; gap: .05rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .5rem .65rem; color: var(--ink); font-size: .88rem;
}
.hardchip:hover { border-color: var(--primary); text-decoration: none; }
.hardchip span { color: var(--muted); font-size: .84rem; }
.hardchip em { color: var(--bad); font-size: .76rem; font-style: normal; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.6rem; }
.mini-link { font-size: .82rem; color: var(--muted); }

/* ---------- kartlar (flashcard) ---------- */
.cardbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: .8rem 0 1.2rem; font-size: .9rem; color: var(--ink-2); }
.dirsel { display: flex; gap: .2rem; }
.flash-stage { max-width: 620px; margin: 0 auto; }
.flash-top { display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .85rem; margin-bottom: .4rem; }
.flash-top .mini-link { margin-left: auto; }
.flash {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  min-height: 230px; display: grid; place-items: center; padding: 1.8rem 1.4rem; margin: .7rem 0 1rem;
  cursor: pointer; text-align: center; transition: border-color .15s ease;
}
.flash:hover, .flash:focus { border-color: var(--primary); outline: none; }
.flash-back { display: none; }
.flash.flipped .flash-front { display: none; }
.flash.flipped .flash-back { display: block; animation: pop .16s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
.fk { font-family: var(--serif); font-size: 2.3rem; font-weight: 700; line-height: 1.15; }
.fk.tr { font-family: var(--font); font-size: 1.6rem; font-weight: 600; color: var(--ink-2); }
.flash .hint { color: var(--muted); font-size: .8rem; margin-top: .9rem; }
.ftr { font-size: 1.5rem; font-weight: 640; margin-bottom: .5rem; }
.fam { color: var(--muted); font-size: .9rem; margin-bottom: .4rem; }
.flash-back .col { margin-top: .4rem; }
.flash-back .wmeta { justify-content: center; margin-top: .8rem; }
.grades { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.grades .btn { flex: 1 1 160px; justify-content: center; }

/* ---------- test ---------- */
.quiz { max-width: 720px; margin: 1.2rem auto; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--muted); margin-bottom: .45rem; }
.quiz-tag { background: var(--primary-soft); color: var(--primary-2); border-radius: 99px; padding: .05rem .55rem; font-size: .78rem; }
.quizbar { margin-bottom: 1.1rem; }
.quiz-stage { min-height: 150px; }
.qhead { font-size: 1rem; color: var(--ink-2); margin-bottom: .5rem; }
.stem { font-size: 1.22rem; line-height: 1.7; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.stem em { font-style: italic; color: var(--ink); }
.qsub { color: var(--muted); font-size: .9rem; margin-top: .3rem; }
.qhint { font-family: var(--mono); color: var(--muted); font-size: .9rem; margin-top: .4rem; letter-spacing: .12em; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .45rem; margin-top: 1rem; }
.opt {
  text-align: left; padding: .6rem .8rem; border: 1px solid var(--line-2); background: var(--surface);
  border-radius: 10px; font: inherit; cursor: pointer; color: var(--ink);
}
.opt:hover:not(:disabled) { border-color: var(--primary); }
.opt.sel { border-color: var(--primary); background: var(--primary-soft); }
.opt.ok { border-color: var(--ok); background: var(--ok-soft); }
.opt.bad { border-color: var(--bad); background: var(--bad-soft); }
.opt:disabled { cursor: default; }
.gapline { align-items: baseline; }
.gapinput {
  min-width: 170px; padding: .35rem .6rem; border: 0; border-bottom: 2px solid var(--primary);
  background: var(--surface-2); border-radius: 7px 7px 0 0; font: inherit; font-size: 1.05rem; color: var(--ink);
}
.gapinput:focus { outline: none; background: var(--primary-soft); }
.gapinput.ok { border-color: var(--ok); background: var(--ok-soft); }
.gapinput.bad { border-color: var(--bad); background: var(--bad-soft); }
.roottag {
  font-size: .78rem; letter-spacing: .08em; background: var(--accent-soft); color: var(--accent);
  border-radius: 6px; padding: .1rem .45rem; margin-right: .4rem;
}
.chgrp { display: inline-flex; gap: .25rem; margin: 0 .2rem; }
.chip {
  border: 1px dashed var(--line-2); background: var(--surface-2); color: var(--ink); cursor: pointer;
  padding: .12rem .5rem; border-radius: 8px; font: inherit; font-size: .95rem;
}
.chip:hover:not(:disabled) { border-color: var(--primary); }
.chip.sel { border-style: solid; border-color: var(--primary); background: var(--primary-soft); }
.chip.ok { border-style: solid; border-color: var(--ok); background: var(--ok-soft); }
.chip.bad { border-style: solid; border-color: var(--bad); background: var(--bad-soft); }
.fb { display: none; margin-top: 1rem; padding: .7rem .85rem; border-radius: 10px; font-size: .95rem; }
.fb.show { display: block; }
.fb.ok { background: var(--ok-soft); border-left: 3px solid var(--ok); }
.fb.bad { background: var(--bad-soft); border-left: 3px solid var(--bad); }
.why { color: var(--ink-2); font-size: .9rem; margin-top: .3rem; }
.fb-link { display: inline-block; margin-top: .35rem; font-size: .84rem; }
.quiz-actions { display: flex; gap: .5rem; margin-top: 1.2rem; }
.result { text-align: center; max-width: 720px; margin: 1.2rem auto; }
.result-score { font-size: 2rem; font-weight: 700; font-family: var(--serif); }
.result-score.good { color: var(--ok); }
.result-score.mid { color: var(--warn); }
.result-score.low { color: var(--bad); }
.wronglist { text-align: left; margin: 1rem 0; }
.wrongrow { display: flex; gap: .6rem; align-items: baseline; padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.wr-q { flex: 1; color: var(--ink-2); }
.wr-a { color: var(--ok); font-weight: 600; }
.result .row-actions { justify-content: center; }
.empty { text-align: center; }

/* ---------- mod ızgarası ---------- */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .7rem; margin: 1rem 0; }
.mode { color: var(--ink); display: flex; flex-direction: column; gap: .2rem; }
.mode:hover { border-color: var(--primary); text-decoration: none; transform: translateY(-1px); }
.mode { transition: transform .12s ease, border-color .12s ease; }
.mode.hi { border-color: var(--primary); background: var(--primary-soft); }
.mode-icon { font-size: 1.15rem; font-weight: 700; color: var(--primary); font-family: var(--serif); }
.mode-t { font-weight: 650; }
.mode-d { color: var(--muted); font-size: .86rem; }
.mode .badge { align-self: flex-start; margin-top: .3rem; }

/* ---------- üniteler ---------- */
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .7rem; }
.unit { color: var(--ink); display: flex; flex-direction: column; gap: .3rem; }
.unit:hover { border-color: var(--primary); text-decoration: none; }
.u-top { display: flex; justify-content: space-between; align-items: center; }
.u-no { font-size: .78rem; letter-spacing: .06em; color: var(--muted); }
.u-title { font-weight: 650; font-size: 1.02rem; }
.u-meta, .u-p { color: var(--muted); font-size: .82rem; }

/* ---------- ilerleme ---------- */
.boxes { display: flex; flex-direction: column; gap: .4rem; }
.boxrow { display: grid; grid-template-columns: 70px 1fr 42px; align-items: center; gap: .6rem; font-size: .88rem; }
.bl { color: var(--muted); }
.bbar { display: block; background: var(--surface-2); border-radius: 99px; height: 14px; overflow: hidden; border: 1px solid var(--line); }
.bbar i { display: block; height: 100%; }
.bbar .b0 { background: var(--b0); } .bbar .b1 { background: var(--b1); } .bbar .b2 { background: var(--b2); }
.bbar .b3 { background: var(--b3); } .bbar .b4 { background: var(--b4); } .bbar .b5 { background: var(--b5); }
.bc { text-align: right; color: var(--ink-2); }
.heat { display: flex; flex-wrap: wrap; gap: 4px; }
.hd { width: 16px; height: 16px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); }
.hd.on { background: var(--primary); border-color: var(--primary); }
.hardtable, .histtable { width: 100%; border-collapse: collapse; font-size: .9rem; }
.hardtable th, .hardtable td, .histtable td { padding: .35rem .5rem; border-bottom: 1px solid var(--line); text-align: left; }
.hardtable th { color: var(--muted); font-weight: 600; font-size: .82rem; }
.unitbars { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .5rem 1.2rem; }
.ubar { display: grid; grid-template-columns: 62px 1fr 42px; align-items: center; gap: .5rem; font-size: .85rem; }
.ub-p { color: var(--muted); text-align: right; }

/* ---------- notlar ---------- */
.notegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .7rem; margin: 1rem 0; }
.note { border-left: 3px solid var(--warn); }
.note-h { display: flex; align-items: baseline; gap: .4rem; font-weight: 650; }
.note-tr { color: var(--muted); font-size: .88rem; margin-bottom: .3rem; }
.note-b { font-size: .92rem; color: var(--ink-2); }
.pairlist { margin: 0; padding-left: 1.1rem; }
.pairlist li { margin-bottom: .3rem; font-size: .93rem; }

/* ---------- ayarlar ---------- */
.setgrid { display: grid; gap: .1rem; }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.setrow:last-child { border-bottom: 0; }
.setrow select { padding: .3rem .5rem; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; }
.setrow input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.jsonbox {
  width: 100%; margin: .5rem 0; padding: .5rem .6rem; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--surface-2); color: var(--ink); font-family: var(--mono); font-size: .8rem; resize: vertical;
}

/* dar ekranda menü ikinci satıra insin, arama ve ayarlar görünür kalsın */
@media (max-width: 1000px) {
  .nav { order: 3; width: 100%; padding-bottom: .1rem; }
  .tools { margin-left: auto; }
}
/* ---------- telefon ---------- */
@media (max-width: 760px) {
  /* telefonda üst çubuk yapışkan değil: iki satırlık menü ekranın altıda birini yiyordu.
     Sayfa değişince zaten başa dönülüyor, menü orada. */
  .topbar {
    position: static;
    padding: .45rem .7rem; gap: .45rem;
    padding-top: max(.45rem, env(safe-area-inset-top));
  }
  .brand-txt { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  /* menü yatay kaymasın, ikinci satıra sarsın — yoksa Testler/Üniteler/İlerleme ekran dışında kalıyor */
  .nav { flex-wrap: wrap; overflow: visible; row-gap: .25rem; gap: .25rem; }
  .nav a { flex: 1 0 calc(33.333% - .25rem); justify-content: center; padding: .45rem .3rem; font-size: .88rem; gap: .3rem; }
  .tools { flex: 1; gap: .3rem; }
  .searchbox { flex: 1; min-width: 0; }
  .searchbox input { width: 100%; font-size: 16px; }   /* 16px: iOS odaklanınca sayfayı büyütmesin */
  .qres { width: min(92vw, 330px); }
  main { padding: 1rem .75rem 3rem; }
  .foot { padding: 0 .75rem calc(2rem + env(safe-area-inset-bottom)); }
  h1 { font-size: 1.45rem; }
  h2 { font-size: 1.12rem; margin-top: 1.5rem; }
  .lead { font-size: .95rem; }

  .stats { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .stat { padding: .6rem .65rem; gap: .5rem; }
  .stat-icon { font-size: 1.1rem; }
  .stat-v { font-size: 1rem; }
  .stat-l { font-size: .74rem; }
  .grid-2, .grid-3 { gap: .7rem; margin: 1rem 0; }

  /* dokunma hedefleri — parmakla rahat basılsın */
  .say { font-size: 1.1rem; padding: .45rem .5rem; }
  .starbtn { font-size: 1.05rem; padding: .45rem; }
  .fchip { padding: .42rem .75rem; }
  .al { width: 38px; height: 38px; }
  .colchip { padding: .3rem .6rem; }
  .btn { padding: .55rem .9rem; }
  .flabel { min-width: 100%; }

  .search, .gapinput { font-size: 16px; }
  .gapinput { min-width: 130px; }
  .opt { padding: .75rem .8rem; }
  .stem { font-size: 1.1rem; }
  .quiz { margin-top: .8rem; }
  .quiz-actions .btn { flex: 1; justify-content: center; }
  .quiz-actions .btn.big { padding: .7rem 1rem; }

  .flash { min-height: 200px; padding: 1.4rem 1rem; }
  .fk { font-size: 2rem; }
  .fk.tr { font-size: 1.35rem; }
  .grades { flex-direction: column; }
  .grades .btn { flex: 1 1 auto; padding: .65rem; }
  .cardbar { gap: .4rem .7rem; font-size: .86rem; }

  .boxrow { grid-template-columns: 60px 1fr 34px; }
  .unitbars { grid-template-columns: 1fr; }
  .hardgrid { grid-template-columns: 1fr 1fr; }
  .mode-grid, .unit-grid, .notegrid { grid-template-columns: 1fr; }
  .wmeta { gap: .2rem .6rem; font-size: .78rem; }
  .famtable { font-size: .88rem; }
  .pager { flex-direction: column; gap: .4rem; }
  .pager .btn { justify-content: center; }
}
@media (max-width: 380px) {
  .nav a .ni { display: none; }        /* çok dar ekranda ikonlar gitsin, yazılar kalsın */
  .hardgrid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ================= dil anahtarı ve hesap durumu ================= */
.langbtn { font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
/* Hesap düğmesi eşitleme durumunu taşıyor: sorun varsa uyarı rengi, giderken soluyor */
.iconbtn.warn { border-color: var(--warn); color: var(--warn); }
.iconbtn.busy { opacity: .55; }
.foot span + span { display: block; margin-top: .25rem; }

/* ================= hesap sayfası ================= */
.authtabs { display: flex; gap: .4rem; margin: .4rem 0 1rem; }
.authcard { max-width: 460px; }
.authcard h2 { margin: 0 0 .9rem; font-size: 1.1rem; }
.fieldrow { display: block; margin-bottom: .8rem; }
.fieldrow > span { display: block; margin-bottom: .25rem; font-size: .84rem; color: var(--ink-2); font-weight: 600; }
.inp {
  width: 100%; padding: .55rem .7rem; font: inherit; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
}
.inp:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
.formmsg { margin: .7rem 0 0; font-size: .88rem; min-height: 1.1em; }
.formmsg.bad { color: var(--bad); }
.formmsg.ok { color: var(--ok); }
.linkbtn {
  display: inline-block; margin-top: .9rem; padding: 0; border: 0; background: none;
  color: var(--primary); font: inherit; font-size: .88rem; text-decoration: underline; cursor: pointer;
}
.syncline { margin: 0 0 .5rem; font-size: .92rem; font-weight: 600; color: var(--ink-2); }
.syncline.offline, .syncline.error { color: var(--warn); }
.syncline.busy { color: var(--muted); }
.danger-zone { border-color: var(--bad); }
.danger-zone .inp { max-width: 300px; }

@media (max-width: 760px) {
  .authcard { max-width: none; }
  .inp { font-size: 16px; }              /* iOS odaklanınca sayfayı büyütmesin */
  .langbtn { font-size: .68rem; }
}
