:root {
  color-scheme: light;
  --bg: #f4f4f1;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink2: #52514e;
  --muted: #898781;
  --line: #e1e0d9;
  --accent: #1c5cab;
  --accent-2: #2a78d6;
  --accent-soft: #e3eefb;
  --alt: #eb6834;
  --good: #006300;
  --bad: #c42f2f;
  --track: #ebeae4;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11, 11, 11, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0d0d0d;
    --surface: #1a1a19;
    --ink: #f0efec;
    --ink2: #c3c2b7;
    --muted: #898781;
    --line: #2c2c2a;
    --accent: #5598e7;
    --accent-2: #3987e5;
    --accent-soft: #17283d;
    --alt: #d95926;
    --good: #0ca30c;
    --bad: #e66767;
    --track: #2c2c2a;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 1.4rem; margin: 8px 0 14px; }
h2 { font-size: 1.05rem; margin: 26px 0 10px; color: var(--ink2); }
small, .small { font-size: .82rem; }
.muted { color: var(--muted); }
.sub { display: block; font-size: .85rem; color: var(--ink2); }
.g { color: var(--good); }
.r { color: var(--bad); }
.grow { flex: 1; min-width: 0; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* Üst çubuk */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; color: var(--ink); }
.countdown { margin-left: auto; font-size: .85rem; color: var(--ink2); background: var(--accent-soft); padding: 3px 10px; border-radius: 99px; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; padding: 4px; display: flex; }
.menu summary::-webkit-details-marker { display: none; }
.menu svg { width: 24px; height: 24px; }
.menu nav {
  position: absolute; right: 0; top: 38px; min-width: 190px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .15); overflow: hidden;
}
.menu nav a { display: block; padding: 13px 16px; color: var(--ink); border-bottom: 1px solid var(--line); }
.menu nav a:last-child { border: 0; }

svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

main { max-width: 760px; margin: 0 auto; padding: 12px 16px 24px; }
.narrow { max-width: 420px; margin: 24px auto; }

/* Alt navigasyon */
.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; color: var(--muted); font-size: .72rem; }
.bottom a.on { color: var(--accent); font-weight: 600; }
.bottom svg { width: 23px; height: 23px; }

/* Kartlar */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card.block { display: block; color: inherit; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "⌄"; float: right; color: var(--muted); }
details.card[open] > summary::after { content: "⌃"; }
.note { white-space: normal; color: var(--ink2); font-size: .92rem; background: var(--bg); padding: 10px 12px; border-radius: 10px; }

/* Formlar */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: .88rem; color: var(--ink2); }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; width: 100%; min-height: 46px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-2); outline-offset: 0; border-color: transparent; }
.row2, .row3 { display: grid; gap: 10px; }
.row2 { grid-template-columns: 1fr 1fr; }
.row3 { grid-template-columns: 1fr 1fr 1fr; }
.form .dogru input { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.form .yanlis input { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.grid-soru { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }

.btn {
  display: inline-flex; justify-content: center; align-items: center;
  font: inherit; font-weight: 600; border: 0; cursor: pointer;
  background: var(--accent); color: #fff; border-radius: 12px;
  padding: 12px 18px; min-height: 48px; text-align: center;
}
.btn.big { width: 100%; font-size: 1.05rem; margin-bottom: 14px; }
.btn.alt { background: var(--alt); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid var(--line); }
.btn.small { min-height: 38px; padding: 8px 14px; font-size: .9rem; }
form + form { margin-top: 4px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: -4px; }
.chip {
  font: inherit; font-size: .88rem; padding: 7px 12px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink2); cursor: pointer; white-space: nowrap;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip small { opacity: .75; }

.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; background: #e3f3e3; color: #0f4d0f; }
.flash.err { background: #fbe4e4; color: #7d1616; }
@media (prefers-color-scheme: dark) {
  .flash { background: #133013; color: #b8e6b8; }
  .flash.err { background: #3a1414; color: #f4c2c2; }
}

/* İstatistik kutuları */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; color: inherit; box-shadow: var(--shadow); }
.stat .lbl { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat .num { font-size: 1.45rem; font-weight: 700; margin: 2px 0; }
.stat .num small { font-size: .8rem; font-weight: 500; color: var(--ink2); }
.stat .bar { margin-top: 8px; }

.bar { height: 8px; background: var(--track); border-radius: 99px; overflow: hidden; margin: 6px 0 2px; }
.bar span { display: block; height: 100%; background: var(--accent-2); border-radius: 99px; }

/* Liste satırları */
.daylabel { font-size: .8rem; font-weight: 600; color: var(--muted); margin: 16px 2px 6px; text-transform: uppercase; letter-spacing: .03em; }
.item {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 13px; margin-bottom: 6px; color: inherit;
}
.item .right { text-align: right; white-space: nowrap; font-weight: 600; }
.item .right .sub { font-weight: 400; }
.konu select.durum { width: auto; min-height: 36px; padding: 5px 8px; font-size: .82rem; border-radius: 99px; flex-shrink: 0; max-width: 128px; }
select.durum.d1 { background: #fff4d6; border-color: #f0d48a; color: #6b4b00; }
select.durum.d2 { background: #def3de; border-color: #a9d9a9; color: #0d4d0d; }
select.durum.d3 { background: #dde9fa; border-color: #a8c6ef; color: #123d73; }
@media (prefers-color-scheme: dark) {
  select.durum.d1 { background: #3a2f10; border-color: #6b5520; color: #f5d98a; }
  select.durum.d2 { background: #143214; border-color: #2b5e2b; color: #b5e6b5; }
  select.durum.d3 { background: #142944; border-color: #2b4f80; color: #b9d4f7; }
}
.plus { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); font-size: 1.3rem; font-weight: 600; }

.tabs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.tabrow { display: flex; gap: 6px; overflow-x: auto; align-items: center; padding-bottom: 2px; scrollbar-width: none; }
.tabrow::-webkit-scrollbar { display: none; }
.tag { font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--accent); color: #fff; flex-shrink: 0; }
.tag.ayt { background: var(--alt); }
.tag.now { background: var(--good); margin-right: 6px; }

/* Program */
.blok { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.card > .blok:first-child, .between + .blok { border-top: 0; }
.blok .dk { flex-shrink: 0; width: 46px; text-align: center; font-weight: 700; font-size: .9rem; color: var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 5px 0; }
.blok.done { opacity: .6; }
.blok.done b { text-decoration: line-through; }
.blok form { margin: 0; }
.x { border: 0; background: none; color: var(--muted); font-size: 1.4rem; cursor: pointer; padding: 0 6px; }
.day.today { border-color: var(--accent-2); }
.donem.aktif { border-color: var(--good); }
.klist { list-style: none; margin: 0; padding: 0; columns: 2 220px; column-gap: 18px; font-size: .9rem; }
.klist li { padding: 3px 0 3px 20px; position: relative; break-inside: avoid; }
.klist li::before { content: "○"; position: absolute; left: 0; color: var(--muted); }
.klist li.d1::before { content: "◐"; color: #c98500; }
.klist li.d2::before, .klist li.d3::before { content: "●"; color: var(--good); }
.klist small { color: var(--muted); }

/* Satır grafikleri */
.hrow { display: grid; grid-template-columns: 118px 1fr 84px; align-items: center; gap: 10px; padding: 5px 0; font-size: .88rem; }
.hrow .hname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrow .hval { text-align: right; color: var(--ink2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Deneme tabloları */
.dtable, .ntable { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.dtable th, .ntable th { font-size: .78rem; color: var(--muted); font-weight: 600; text-align: center; padding: 4px; }
.dtable th:first-child, .ntable th:first-child, .ntable td:first-child { text-align: left; }
.dtable td { padding: 4px 3px; border-top: 1px solid var(--line); }
.dtable td:first-child { font-size: .9rem; }
.dtable td small { display: block; color: var(--muted); font-size: .72rem; }
.dtable td:nth-child(2), .dtable td:nth-child(3), .dtable td:nth-child(4) { width: 58px; }
.dtable input { padding: 8px 4px; text-align: center; min-height: 42px; }
.dtable .net, .dtable .net-toplam { text-align: center; font-weight: 700; min-width: 48px; }
.dtable tfoot td { font-weight: 700; padding-top: 10px; }
.dtable tr.asim input { border-color: var(--bad); }
.ntable td { padding: 6px 4px; border-top: 1px solid var(--line); text-align: center; font-size: .9rem; }
.deneme summary { display: flex !important; align-items: center; gap: 10px; }
.deneme summary::after { display: none; }
.deneme summary > span:nth-child(2) { flex: 1; }
.bignet { font-size: 1.3rem; font-weight: 700; }
.bignet small { font-size: .78rem; font-weight: 500; color: var(--ink2); }
.deneme .ntable { margin: 10px 0; }

.filter { margin-bottom: 6px; }
.chart { position: relative; height: 230px; margin-top: 8px; }

@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .hrow { grid-template-columns: 170px 1fr 96px; }
}
.between select { width: auto; max-width: 58%; min-height: 40px; padding: 7px 10px; }
.between > b { white-space: nowrap; }

/* Koç */
.koc { border-radius: var(--radius); padding: 16px; margin-bottom: 14px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent-2) 30%, transparent); }
.koc.ruh-sitem, .koc.ruh-hatirlat, .koc.ruh-alarm { background: #fff4d6; border-color: #f0d48a; }
.koc.ruh-kizgin, .koc.ruh-ciddi { background: #fde6e1; border-color: #f2b5a8; }
.koc.ruh-gurur, .koc.ruh-bonus { background: #e4f4e4; border-color: #a9d9a9; }
.koc-ust { display: flex; gap: 12px; align-items: flex-start; }
.koc-emoji { font-size: 2.1rem; line-height: 1; flex-shrink: 0; }
.koc-selam { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink2); }
.koc-metin { margin: 3px 0 0; font-size: 1.02rem; font-weight: 600; }
.koc-notlar { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid rgba(0, 0, 0, .08); font-size: .9rem; color: var(--ink2); display: flex; flex-direction: column; gap: 6px; }
@media (prefers-color-scheme: dark) {
  .koc.ruh-sitem, .koc.ruh-hatirlat, .koc.ruh-alarm { background: #33290f; border-color: #6b5520; }
  .koc.ruh-kizgin, .koc.ruh-ciddi { background: #3a1a14; border-color: #6e3226; }
  .koc.ruh-gurur, .koc.ruh-bonus { background: #142e14; border-color: #2b5e2b; }
  .koc-notlar { border-color: rgba(255, 255, 255, .1); }
}

/* Rozetler */
.rozet-yeni { display: flex; gap: 12px; align-items: center; padding: 12px 14px; margin-bottom: 12px; border-radius: 12px; background: #fff7e0; border: 1px solid #f0d48a; animation: pop .5s ease; }
.rozet-yeni .em { font-size: 1.8rem; }
@media (prefers-color-scheme: dark) { .rozet-yeni { background: #33290f; border-color: #6b5520; } }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.rozet-serit .ems { font-size: 1.5rem; letter-spacing: 4px; display: block; }
.rozet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-top: 10px; }
.rozet { text-align: center; padding: 10px 6px; border-radius: 12px; background: var(--bg); font-size: .8rem; }
.rozet .em { font-size: 1.6rem; display: block; }
.rozet .sub { font-size: .72rem; }
.rozet.yok { opacity: .5; }
.form label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--ink); font-size: .92rem; }
.form label.check input { width: 22px; min-height: 22px; height: 22px; flex-shrink: 0; }
code.cmd { display: block; font-size: .78rem; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; word-break: break-all; }
.bar.split { display: flex; gap: 2px; background: none; }
.bar.split span { border-radius: 99px; }
.bar.split .s-tyt { background: var(--accent-2); }
.bar.split .s-ayt { background: var(--alt); }
.bar.split .s-genel { background: var(--muted); }
.chart.short { height: 180px; }
.okuma-kart .hrow { grid-template-columns: 96px 1fr 84px; }
.okuma-kart .sub { color: var(--accent); margin-top: 4px; }
.item.kitap .bar { margin: 6px 0 2px; }
.item.kitap.bitti b { color: var(--ink2); }
.oneri { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; font-size: .88rem; }
.oneri .ok-ad { flex: 1 1 180px; min-width: 0; }
.oneri .neden { display: inline-block; font-size: .7rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 1px 6px; margin-left: 2px; }
.oneri .ok-btn { display: flex; gap: 6px; }
.oneri .chip { padding: 4px 10px; font-size: .8rem; }
.blok { align-items: flex-start; }
.blok .dk { margin-top: 2px; }
