:root {
  --bg: #f7f5f0;
  --card: #ffffff;
  --text: #1d2321;
  --muted: #69716d;
  --line: #e3e0d8;
  --accent: #1f6f5c;
  --accent-text: #ffffff;
  --accent-soft: #e2efe9;
  --ok: #2e8b57;
  --ok-bg: rgba(46, 139, 87, .14);
  --warn: #c98a12;
  --bad: #c0442f;
  --grid: rgba(0, 0, 0, .09);
  --grid-weak: rgba(0, 0, 0, .04);
  --rec: #c0442f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 2px 8px rgba(0, 0, 0, .04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141816;
    --card: #1d2320;
    --text: #e8ece9;
    --muted: #97a09b;
    --line: #2d3531;
    --accent: #5fbf9f;
    --accent-text: #0e1a15;
    --accent-soft: #23362e;
    --ok: #5fcf8c;
    --ok-bg: rgba(95, 207, 140, .14);
    --warn: #e6b14a;
    --bad: #ef7a64;
    --grid: rgba(255, 255, 255, .10);
    --grid-weak: rgba(255, 255, 255, .04);
    --rec: #ef7a64;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(68px + env(safe-area-inset-bottom));
}
a { color: var(--accent); }
h2 { font-size: 1.35rem; margin: .2em 0 .5em; line-height: 1.25; }
h3 { font-size: 1.1rem; margin: .1em 0 .5em; }
h4 { font-size: .95rem; margin: 1em 0 .4em; }
p { margin: .5em 0; }
ul, ol { padding-left: 1.3em; margin: .5em 0; }
.small { font-size: .875rem; }
.muted { color: var(--muted); }
.center { text-align: center; }

.top {
  position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: .01em; }
.gear { font-size: 1.3rem; text-decoration: none; color: var(--muted); padding: 2px 6px; }
main { max-width: 680px; margin: 0 auto; padding: 14px 16px 24px; }

.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.nav a { flex: 1; text-align: center; padding: 14px 2px; color: var(--muted); text-decoration: none; font-size: .85rem; font-weight: 600; }
.nav a.active { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
body.in-session .nav { display: none; }
body.in-session { padding-bottom: 20px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 0 0 14px; box-shadow: var(--shadow); }
.card.subtle { background: transparent; box-shadow: none; }
.done-card { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.warn-card { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.why { color: var(--muted); font-size: .9rem; margin: 0 0 12px; }
.lead { font-size: 1.05rem; }
.health-note { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin: 12px 0; }
.warn-text { color: var(--warn); }
.fn { font-size: .85rem; color: var(--muted); border-left: 3px solid var(--line); padding-left: 10px; }

.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }
.row.spread { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 6px; }

.btn {
  appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 10px; padding: 10px 14px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
  touch-action: manipulation;
}
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); }
.btn.big { width: 100%; padding: 14px; font-size: 1.05rem; margin-top: 10px; }
.btn.sm { min-height: 36px; padding: 6px 10px; font-size: .9rem; }
.btn.rec { color: var(--rec); border-color: var(--rec); }
.btn.pulse { animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 30%, transparent); } }
.choices .btn.choice { flex: 1 1 40%; min-height: 56px; font-size: 1rem; }
.btn.rate { width: 48px; }
.btn.rate.sel { background: var(--accent); color: var(--accent-text); }

.input { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; flex: 1; min-width: 0; width: 100%; }
.input.sm { width: auto; flex: 0 0 auto; padding: 6px 8px; }
.row .input { width: auto; }
textarea.input { resize: vertical; }
.field { display: grid; grid-template-columns: 1fr; gap: 4px; margin: 12px 0; }
.field input[type=range] { width: 100%; }
.radio { display: flex; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer; }

/* Bugün */
.plan { list-style: none; padding: 0; margin: 12px 0; counter-reset: s; }
.plan li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); counter-increment: s; }
.plan li::before { content: counter(s) "."; color: var(--muted); width: 1.6em; }
.plan li span:first-of-type { flex: 1; }
.plan li.done { color: var(--muted); text-decoration: line-through; }
.stat { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.week { display: flex; gap: 6px; margin-top: 12px; }
.wd { flex: 1; text-align: center; font-size: .75rem; color: var(--muted); padding: 8px 0; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
.wd.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.wd.today { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Seans */
.session-head { position: sticky; top: 52px; background: var(--bg); z-index: 3; padding: 4px 0 2px; }
.steps-bar { display: flex; gap: 4px; }
.steps-bar span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.steps-bar span.done { background: var(--accent); }
.steps-bar span.cur { background: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.step-title { font-size: 1.1rem; margin: 10px 0; }
.step-timer { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); }
.step-timer.over { color: var(--warn); }
.session-foot { display: flex; gap: 10px; align-items: stretch; margin-top: 12px; }
.session-foot .btn.big { flex: 1; margin: 0; }
.big-timer { font-size: 2.4rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; margin: 10px 0; }
.dots { display: flex; gap: 6px; margin-bottom: 8px; }
.dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.dots .d-done { background: var(--accent); }
.dots .d-cur { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.status { font-size: 1.05rem; font-weight: 600; margin: 6px 0 10px; min-height: 1.5em; }
.status.go { color: var(--accent); font-size: 1.25rem; }
.status[data-state=ok], .feedback[data-state=ok] { color: var(--ok); }
.status[data-state=warn], .feedback[data-state=warn] { color: var(--warn); }
.status[data-state=bad], .feedback[data-state=bad] { color: var(--bad); }
.feedback { font-weight: 600; min-height: 1.5em; margin-top: 8px; }
.listen-icon { font-size: 2rem; text-align: center; color: var(--muted); margin: 10px 0; }
.hint-arrow { font-size: 1.2rem; font-weight: 700; min-height: 1.6em; }
.steps li { margin: 8px 0; }
blockquote.reading { font-size: 1.15rem; line-height: 1.7; margin: 12px 0; padding: 12px 14px; background: var(--bg); border-radius: 10px; border-left: 4px solid var(--accent); }
audio { width: 100%; margin: 8px 0; }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 700; }

/* Göstergeler */
.graph-wrap { width: 100%; margin: 8px 0; }
.pitch-graph { width: 100%; height: 220px; display: block; background: var(--bg); border-radius: 10px; }
canvas.contour { width: 100%; height: 160px; display: block; background: var(--bg); border-radius: 10px; margin: 6px 0; }
canvas.chart { width: 100%; height: 160px; display: block; }
.note-big { font-size: 3rem; font-weight: 700; text-align: center; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tuner { text-align: center; margin: 6px 0; }
.dev-text { text-align: center; font-size: .95rem; min-height: 1.5em; margin: 4px 0; }
.meter { margin: 10px 0; }
.meter-scale { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); }
.meter-track { position: relative; height: 22px; background: var(--bg); border-radius: 11px; border: 1px solid var(--line); }
.meter-ok { position: absolute; left: 37.5%; width: 25%; top: 0; bottom: 0; background: var(--ok-bg); }
.meter-needle { position: absolute; top: -3px; bottom: -3px; width: 6px; margin-left: -3px; border-radius: 3px; background: var(--muted); transition: left .08s linear; }
.meter-needle[data-state=ok] { background: var(--ok); }
.meter-needle[data-state=warn] { background: var(--warn); }
.meter-needle[data-state=bad] { background: var(--bad); }
.level { height: 8px; flex: 1; min-width: 80px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.level-fill { height: 100%; width: 0; background: var(--muted); transition: width .06s; }
.level-fill[data-on="1"] { background: var(--ok); }
.progress { height: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.progress-fill { height: 100%; width: 0; background: var(--accent); }
.progress.hold .progress-fill { background: var(--ok); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 10px 0; }

/* Klavye */
.kbd { position: relative; height: 130px; margin: 10px 0; user-select: none; -webkit-user-select: none; }
.key { position: absolute; top: 0; border: 1px solid var(--line); cursor: pointer; padding: 0; font: inherit; touch-action: manipulation; }
.key.white { height: 100%; background: #fdfdfb; border-radius: 0 0 6px 6px; color: #444; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; font-size: .62rem; }
.key.black { height: 60%; background: #23282a; border-color: #111; z-index: 2; border-radius: 0 0 4px 4px; }
.key.marked { box-shadow: inset 0 -5px 0 var(--accent); }
.key.pressed { background: var(--accent) !important; color: var(--accent-text); }

/* İlerleme */
.cal { display: grid; grid-template-rows: repeat(7, 12px); grid-auto-flow: column; grid-auto-columns: 12px; gap: 3px; overflow-x: auto; padding: 4px 0; }
.cal span { border-radius: 2px; background: var(--line); }
.cal span.on { background: var(--accent); }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 8px 0; }
.tbl th, .tbl td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 600; }
.roadmap .rm { padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.roadmap .rm.ready { color: var(--text); }
.tag { display: inline-block; font-size: .75rem; padding: 1px 8px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.rec-card { border-top: 1px solid var(--line); padding: 10px 0; }

/* Öğren */
details.learn { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin: 0 0 10px; box-shadow: var(--shadow); }
details.learn summary { padding: 14px 16px; font-weight: 600; cursor: pointer; list-style: none; }
details.learn summary::after { content: "+"; float: right; color: var(--muted); }
details.learn[open] summary::after { content: "–"; }
.learn-body { padding: 0 16px 12px; }
.learn-body sup { color: var(--accent); font-weight: 700; }
.refs li { margin: 6px 0; font-size: .875rem; }

/* Modal ve bildirim */
.modal-wrap { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
.modal { background: var(--card); color: var(--text); border-radius: 14px; padding: 18px; max-width: 440px; width: 100%; }
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; transition: .25s; z-index: 30;
  background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; font-size: .9rem; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.onboard h2 { font-size: 1.6rem; }
