/* gymlog — tasarım sistemi
 * Koyu öncelikli; tek vurgu rengi (volt). Açık temada vurgu metinleri
 * okunabilir koyu yeşil, birincil düğmeler siyah. */

:root {
  --bg: #f3f3f1;
  --surface: #ffffff;
  --surface-2: #f0f0ed;
  --surface-3: #e6e6e2;
  --line: rgba(10, 10, 12, 0.08);
  --line-strong: rgba(10, 10, 12, 0.14);
  --text: #0c0c0e;
  --text-2: #4a4b52;
  --muted: #8a8b93;
  --primary: #111113;
  --primary-ink: #ffffff;
  --accent: #4b7a06;
  --accent-fill: #c8f53c;
  --accent-ink: #111300;
  --accent-soft: rgba(132, 196, 18, 0.16);
  --danger: #d93a3a;
  --danger-soft: rgba(217, 58, 58, 0.1);
  --chart-line: #4b7a06;
  --chart-grid: rgba(10, 10, 12, 0.07);
  --photo-bg: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
  --radius: 18px;
  --radius-sm: 12px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090b;
    --surface: #141417;
    --surface-2: #1c1c20;
    --surface-3: #27272c;
    --line: rgba(255, 255, 255, 0.07);
    --line-strong: rgba(255, 255, 255, 0.13);
    --text: #f6f6f4;
    --text-2: #b0b1b8;
    --muted: #74757d;
    --primary: #d4ff3f;
    --primary-ink: #0b0d02;
    --accent: #d4ff3f;
    --accent-fill: #d4ff3f;
    --accent-ink: #0b0d02;
    --accent-soft: rgba(212, 255, 63, 0.11);
    --danger: #ff6b6b;
    --danger-soft: rgba(255, 107, 107, 0.12);
    --chart-line: #d4ff3f;
    --chart-grid: rgba(255, 255, 255, 0.06);
    --photo-bg: #ecece9;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #09090b; --surface: #141417; --surface-2: #1c1c20; --surface-3: #27272c;
  --line: rgba(255, 255, 255, 0.07); --line-strong: rgba(255, 255, 255, 0.13);
  --text: #f6f6f4; --text-2: #b0b1b8; --muted: #74757d;
  --primary: #d4ff3f; --primary-ink: #0b0d02; --accent: #d4ff3f; --accent-fill: #d4ff3f; --accent-ink: #0b0d02;
  --accent-soft: rgba(212, 255, 63, 0.11); --danger: #ff6b6b; --danger-soft: rgba(255, 107, 107, 0.12);
  --chart-line: #d4ff3f; --chart-grid: rgba(255, 255, 255, 0.06); --photo-bg: #ecece9; --shadow: none;
  color-scheme: dark;
}

/* ---------- Temel ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
a { color: inherit; }
.ic { flex: none; display: block; }
.muted { color: var(--muted); }
.small-t { font-size: 13px; }
.err { color: var(--danger); min-height: 1.2em; margin: 6px 0 0; font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }
.accent-t { color: var(--accent); }
.danger-t, .danger-t .t { color: var(--danger) !important; }

/* ---------- Giriş ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 340px; display: grid; gap: 12px; text-align: center; }
.login-card .logo-mark { width: 72px; height: 72px; margin: 0 auto 6px; border-radius: 20px; display: block; }
.logo { font-size: 34px; font-weight: 800; letter-spacing: -0.04em; }
.logo b { color: var(--accent); }

/* ---------- Üst bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(var(--safe-t) + 12px) 16px 12px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
}
.topbar h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.035em; }
.topbar .sub { display: block; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-bottom: 2px; text-transform: capitalize; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; color: var(--text); flex: none; text-decoration: none;
}
main { padding: 2px 16px calc(var(--tabbar-h) + var(--safe-b) + 96px); max-width: 680px; margin: 0 auto; }

/* ---------- Alt sekme çubuğu ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b)); padding: 6px 6px var(--safe-b);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
}
.tabbar button {
  background: none; border: 0; display: grid; place-items: center; align-content: center; gap: 3px;
  color: var(--muted); font-size: 10.5px; font-weight: 650; letter-spacing: 0.01em;
}
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; padding: 3px 14px; box-sizing: content-box; border-radius: 999px; transition: background .2s; }
.tabbar button.active { color: var(--text); }
.tabbar button.active svg { background: var(--accent-soft); color: var(--accent); }

/* ---------- Yerleşim yardımcıları ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.section-t {
  font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin: 26px 4px 10px;
}
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 750; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); }
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.card h3 { font-size: 17px; }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; font-size: 14px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 750; background: color-mix(in srgb, currentColor 14%, transparent); }

/* ---------- Düğmeler ---------- */
.btn {
  border: 0; border-radius: 14px; padding: 13px 16px; font-weight: 700; font-size: 15px; letter-spacing: -0.01em;
  background: var(--surface-2); color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; transition: transform .08s, opacity .15s, background .15s;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.good { background: var(--accent-fill); color: var(--accent-ink); }
.btn.ghost { background: var(--surface); border: 1px solid var(--line-strong); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.text { background: transparent; color: var(--muted); font-weight: 600; }
.btn.block { width: 100%; }
.btn.small { padding: 8px 12px; font-size: 13.5px; border-radius: 11px; }
.btn.big { padding: 17px 18px; font-size: 16.5px; border-radius: 16px; }
.btn:disabled { opacity: .45; }

/* ---------- Form ---------- */
input, select, textarea {
  width: 100%; padding: 13px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface-2); outline: none; min-width: 0; font-size: 16px;
  transition: border-color .15s, background .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: var(--surface); }
textarea { resize: vertical; min-height: 84px; }
label.f { display: grid; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--text-2); }

/* ---------- Çipler, segment ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  flex: none; border: 1px solid var(--line-strong); background: transparent; border-radius: 999px;
  padding: 8px 14px; font-size: 13.5px; font-weight: 650; white-space: nowrap; color: var(--text-2);
}
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 13px; padding: 3px; margin-bottom: 14px; border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 9px 6px; border-radius: 10px; font-weight: 700; font-size: 13.5px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.14); }
.seg.seg-sm { margin: 0; border-radius: 11px; }
.seg.seg-sm button { padding: 5px 12px; font-size: 13px; border-radius: 8px; min-width: 36px; }
.seg.seg-wrap { grid-auto-flow: row; grid-template-columns: repeat(6, 1fr); margin: 12px 0; }

.badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 750; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge.up, .badge.accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- Bugün: ana kart ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 18px; margin-bottom: 12px;
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--accent-fill) 22%, transparent) 0%, transparent 55%),
    var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hero-title { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; margin: 10px 0 8px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--text-2); font-size: 14px; font-weight: 600; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta .ic { color: var(--muted); }
.hero-strip { display: flex; gap: 6px; margin: 16px 0; overflow-x: auto; scrollbar-width: none; }
.hero-strip::-webkit-scrollbar { display: none; }
.hero-thumb { width: 52px; height: 52px; flex: none; border-radius: 12px; background: var(--photo-bg); overflow: hidden; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #888; }
.hero-thumb img { width: 100%; height: 100%; object-fit: cover; }

.list-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.row-item {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 14px; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--line);
}
.row-item:last-child { border-bottom: 0; }
.row-item:active { background: var(--surface-2); }
.row-item .idx { width: 18px; font-size: 13px; font-weight: 750; color: var(--muted); text-align: center; flex: none; }
.row-item .t, .scan-cta .t, .tile .t, .set-row .t { display: block; font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.row-item .s, .scan-cta .s, .tile .s, .set-row .s { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }

.scan-cta {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px; margin-top: 12px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.scan-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); flex: none; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 12px; box-shadow: var(--shadow); min-width: 0; }
.stat .l { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 650; }
.stat .v { font-size: 25px; font-weight: 800; letter-spacing: -0.04em; margin-top: 6px; white-space: nowrap; }
.stat .v small { font-size: 13px; font-weight: 650; color: var(--muted); letter-spacing: 0; }
.stat .d { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .d.pos { color: var(--accent); }
.stat .d.neg { color: var(--danger); }
.stat .bar { height: 5px; border-radius: 3px; background: var(--surface-3); margin-top: 9px; overflow: hidden; }
.stat .bar i { display: block; height: 100%; background: var(--accent-fill); border-radius: 3px; }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: grid; gap: 2px; text-align: left; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.tile-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 10px; }

/* ---------- Canlı antrenman ---------- */
.live { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.live-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.live-title { font-size: 24px; font-weight: 800; letter-spacing: -0.035em; margin-top: 6px; }
.live-time { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; color: var(--accent); white-space: nowrap; }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-fill); box-shadow: 0 0 0 4px var(--accent-soft); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.progress { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin: 14px 0 10px; }
.progress i { display: block; height: 100%; background: var(--accent-fill); border-radius: 4px; transition: width .4s cubic-bezier(.2,.8,.2,1); }
.live-stats { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.live-stats b { color: var(--text); font-weight: 800; font-size: 14px; }
.actions { margin-top: 4px; }

/* Egzersiz kartı */
.ex { padding: 0; overflow: hidden; transition: border-color .2s; }
.ex:not(.collapsed) { border-color: var(--line-strong); }
.ex-head { display: flex; gap: 12px; align-items: center; padding: 12px 14px; cursor: pointer; }
.ex-thumb {
  position: relative; width: 54px; height: 54px; border-radius: 14px; flex: none; overflow: hidden;
  background: var(--photo-bg); display: grid; place-items: center; color: #888; font-weight: 800; font-size: 13px;
}
.ex-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ex.done .ex-thumb::after {
  content: ""; position: absolute; inset: 0;
  background: color-mix(in srgb, var(--accent-fill) 82%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b0d02' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 26px no-repeat;
}
.ex-title { font-weight: 750; font-size: 16px; letter-spacing: -0.015em; }
.ex.done .ex-title { color: var(--text-2); }
.ex-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.ex-body { padding: 2px 14px 12px; }
.ex.collapsed .ex-body { display: none; }
.last { font-size: 13px; color: var(--text-2); margin: 8px 0 4px; }
.hint { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text-2); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.hint.good { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.set-list { display: grid; gap: 6px; margin: 10px 0; }
.set-list:empty { display: none; }
.set-item { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border-radius: 12px; padding: 9px 12px; font-weight: 700; font-size: 15px; }
.set-item .n { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-fill); color: var(--accent-ink); font-size: 12px; font-weight: 800; display: grid; place-items: center; flex: none; }
.set-item .x { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; padding: 0 4px; }
.entry { display: grid; grid-template-columns: 1fr 1fr 56px; gap: 8px; align-items: end; margin-top: 6px; }
.entry .lbl { font-size: 11px; font-weight: 750; color: var(--muted); margin: 0 0 5px 2px; text-transform: uppercase; letter-spacing: 0.06em; }
.stepper { display: flex; align-items: stretch; background: var(--surface-2); border-radius: 14px; border: 1px solid var(--line); overflow: hidden; height: 52px; }
.stepper button { border: 0; background: none; width: 38px; font-size: 20px; font-weight: 600; color: var(--text-2); flex: none; }
.stepper button:active { background: var(--surface-3); }
.stepper input { border: 0; background: none; text-align: center; padding: 0; font-weight: 800; font-size: 19px; border-radius: 0; letter-spacing: -0.02em; }
.stepper input:focus { background: none; }
.stepper.wide { height: 50px; }
.stepper .unit { align-self: center; color: var(--muted); font-weight: 650; font-size: 14px; padding-right: 6px; }
.log-btn { height: 52px; padding: 0; border-radius: 14px; }
.remove-ex { margin-top: 8px; width: 100%; color: var(--muted); }
.how-btn { border: 0; background: var(--surface-2); color: var(--text-2); font-weight: 800; border-radius: 50%; width: 34px; height: 34px; flex: none; font-size: 15px; }
.quick { border-color: var(--accent); border-width: 1.5px; }

/* ---------- Liste satırları ---------- */
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .x { border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; padding: 0 4px; }
.m-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.m-item:last-child { border-bottom: 0; }
.m-thumb { width: 46px; height: 46px; border-radius: 12px; background: var(--photo-bg); flex: none; display: grid; place-items: center; font-weight: 800; color: #888; font-size: 12px; overflow: hidden; }
.m-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Makine kartları ---------- */
.mgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .mgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mcard {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 6px 6px 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .1s; min-width: 0; box-shadow: var(--shadow);
}
.mcard:active { transform: scale(.98); }
.mcard-img { position: relative; aspect-ratio: 1; border-radius: 13px; overflow: hidden; background: var(--photo-bg); display: grid; place-items: center; color: #888; font-weight: 800; margin-bottom: 10px; }
.mcard-img img { width: 100%; height: 100%; object-fit: cover; }
.mcard-t { font-weight: 750; font-size: 14px; line-height: 1.25; letter-spacing: -0.01em; overflow-wrap: anywhere; padding: 0 6px; }
.mcard-s { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
.mcard-check {
  position: absolute; top: 8px; left: 8px; width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid rgba(0,0,0,.22); background: rgba(255,255,255,.92); color: transparent; display: grid; place-items: center;
}
.mcard.sel { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent); }
.mcard.sel .mcard-check { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-ink); }
.mcard-play { position: absolute; bottom: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; padding: 4px 7px; border-radius: 7px; background: rgba(10,10,12,.72); color: #fff; }
.mcard-info { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(10,10,12,.72); color: #fff; font-weight: 800; }

/* ---------- Toggle ---------- */
.toggle { position: relative; width: 50px; height: 30px; flex: none; }
.toggle input { opacity: 0; position: absolute; inset: 0; margin: 0; z-index: 1; cursor: pointer; }
.toggle span { position: absolute; inset: 0; background: var(--surface-3); border-radius: 999px; transition: .2s; }
.toggle span::after { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.toggle input:checked + span { background: var(--accent-fill); }
.toggle input:checked + span::after { transform: translateX(20px); }

/* ---------- Ayarlar / alt sayfalar ---------- */
.select-page { min-height: 100dvh; }
.sub-top, .sel-top { gap: 12px; justify-content: flex-start; border-bottom: 1px solid var(--line); }
.sub-top h1, .sel-top h1 { font-size: 20px !important; }
.sub-body, .sel-body { padding: 4px 16px calc(40px + var(--safe-b)); max-width: 680px; margin: 0 auto; }
.sel-body { max-width: 900px; padding-top: 14px; }
.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.group.pad { padding: 16px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; text-decoration: none; color: inherit; }
.set-row:last-child { border-bottom: 0; }
.set-row.col { display: block; }
.set-row.col .seg { margin: 12px 0 0; }
.set-row.link:active { background: var(--surface-2); }

/* ---------- Nasıl kullanılır ---------- */
.howto h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.035em; }
.howto .photo { width: 100%; border-radius: 14px; max-height: 300px; object-fit: cover; margin: 10px 0; }
.howto ol, .howto ul { padding-left: 22px; margin: 6px 0; }
.howto li { margin: 6px 0; line-height: 1.5; }
.howto li::marker { color: var(--muted); font-weight: 700; }
.howto h4 { margin: 22px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.howto .bad li::marker { content: "✕  "; color: var(--danger); }
.howto a { color: var(--accent); font-weight: 650; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #000; margin: 14px 0 8px; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; background: #000; }
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 2px; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: none; width: 44%; aspect-ratio: 1; object-fit: contain; background: var(--photo-bg); border-radius: 14px; scroll-snap-align: start; }

/* ---------- Alt pencere (sheet) ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: fade .2s; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92dvh; overflow-y: auto;
  background: var(--bg); border-radius: 26px 26px 0 0; padding: 0 16px calc(28px + var(--safe-b));
  animation: up .32s cubic-bezier(.2,.9,.25,1); max-width: 680px; margin: 0 auto;
  overscroll-behavior: contain; border-top: 1px solid var(--line);
}
.sheet-panel h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.sheet-grip { position: sticky; top: 0; height: 28px; background: var(--bg); z-index: 1; }
.sheet-grip::after { content: ""; position: absolute; left: 50%; top: 10px; width: 38px; height: 5px; border-radius: 3px; background: var(--line-strong); transform: translateX(-50%); }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- Dinlenme çubuğu ---------- */
.rest-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); z-index: 9;
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 18px;
  background: var(--text); color: var(--bg); box-shadow: 0 10px 30px rgba(0,0,0,.3); max-width: 656px; margin: 0 auto;
}
.rest-bar span { font-size: 13px; font-weight: 700; opacity: .7; }
.rest-bar b { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; margin-right: auto; letter-spacing: -0.03em; }
.rest-bar .btn { background: color-mix(in srgb, var(--bg) 16%, transparent); color: var(--bg); }
.rest-bar.done { background: var(--accent-fill); color: var(--accent-ink); }
.rest-bar.done .btn { color: var(--accent-ink); }
body:not([data-tab="today"]) .rest-bar { display: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 14px); transform: translateX(-50%); z-index: 99;
  background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 14px; font-weight: 650; font-size: 14px;
  max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.3); animation: fade .2s;
}

/* ---------- Grafik ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-weight: 600; }
.chart .series { fill: none; stroke: var(--chart-line); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--chart-line); opacity: .1; }
.chart .dot { fill: var(--chart-line); stroke: var(--surface); stroke-width: 2.5; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .tip { position: absolute; top: 0; pointer-events: none; background: var(--text); color: var(--bg); font-size: 12px; font-weight: 650; padding: 6px 9px; border-radius: 9px; white-space: nowrap; transform: translateX(-50%); }

/* ---------- Koç ---------- */
.chat { display: grid; gap: 10px; padding-bottom: 10px; }
.msg { max-width: 88%; padding: 11px 14px; border-radius: 20px; word-wrap: break-word; font-size: 15px; line-height: 1.5; }
.msg.user { justify-self: end; background: var(--primary); color: var(--primary-ink); border-bottom-right-radius: 6px; font-weight: 550; }
.msg.assistant { justify-self: start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; box-shadow: var(--shadow); }
.msg p { margin: 0 0 8px; } .msg p:last-child { margin: 0; }
.msg ul, .msg ol { margin: 4px 0 8px; padding-left: 20px; }
.msg li { margin: 3px 0; }
.msg.typing { color: var(--muted); animation: pulse 1.4s infinite; }
.chat-input {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b)); z-index: 8;
  display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line);
}
.chat-input textarea { resize: none; min-height: 46px; max-height: 120px; padding: 12px 14px; border-radius: 23px; }
.send-btn { width: 46px; height: 46px; padding: 0; border-radius: 50%; flex: none; }

/* ---------- Plan ---------- */
.plan-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.plan-item:last-child { border-bottom: 0; }
.plan-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; grid-column: 1 / -1; }
.plan-edit input { padding: 9px 10px; font-size: 15px; }
.mini-btns { display: flex; gap: 4px; }
.mini-btns button { border: 0; background: var(--surface-2); border-radius: 9px; width: 32px; height: 32px; color: var(--text-2); display: grid; place-items: center; }

/* ---------- QR tarayıcı ---------- */
.scanner { position: fixed; inset: 0; z-index: 80; background: #000; display: grid; place-items: center; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: relative; width: min(68vw, 290px); aspect-ratio: 1; border-radius: 28px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.6); }
.scan-frame::before { content: ""; position: absolute; inset: 0; border-radius: 28px; border: 3px solid var(--accent-fill); -webkit-mask: linear-gradient(#000 0 0) top/100% 30% no-repeat, linear-gradient(#000 0 0) bottom/100% 30% no-repeat; mask: linear-gradient(#000 0 0) top/100% 30% no-repeat, linear-gradient(#000 0 0) bottom/100% 30% no-repeat; }
.scan-frame::after { content: ""; position: absolute; left: 10%; right: 10%; height: 2px; top: 50%; background: var(--accent-fill); box-shadow: 0 0 12px var(--accent-fill); animation: scanline 2s ease-in-out infinite; }
@keyframes scanline { 0%, 100% { transform: translateY(-110px); } 50% { transform: translateY(110px); } }
.scan-hint { position: absolute; top: calc(var(--safe-t) + 30px); left: 16px; right: 16px; text-align: center; color: #fff; font-weight: 700; font-size: 16px; }
.scan-actions { position: absolute; left: 16px; right: 16px; bottom: calc(var(--safe-b) + 24px); display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.scan-actions .btn:not(.primary) { background: rgba(255,255,255,.14); color: #fff; backdrop-filter: blur(10px); }

/* ---------- Antrenman sırasında: alt aksiyon çubuğu + koç ---------- */
.live-dock {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); z-index: 8;
  display: flex; gap: 8px; max-width: 656px; margin: 0 auto;
}
.live-dock .btn { box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.live-dock .dock-coach { width: 54px; padding: 0; flex: none; background: var(--surface); border: 1px solid var(--line-strong); }
.live-dock .dock-finish { flex: 1; }
.live-dock .dock-time { font-variant-numeric: tabular-nums; opacity: .75; font-weight: 700; }
body.resting .live-dock { display: none; }
.coach-sheet .chat { min-height: 30dvh; }
.coach-sheet .chat-input { position: sticky; bottom: calc(-28px - var(--safe-b)); left: auto; right: auto; margin: 0 -16px; padding-bottom: calc(10px + var(--safe-b)); }

/* ---------- Geçmiş ---------- */
.day-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); width: 100%; text-align: left; display: block; }
.day-card .d-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.day-card .d-date { font-weight: 800; font-size: 17px; letter-spacing: -0.02em; text-transform: capitalize; }
.day-card .d-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 6px; }
.day-card .d-meta b { color: var(--text); font-weight: 750; }
.day-card .d-thumbs { display: flex; gap: 5px; margin-top: 10px; overflow: hidden; }
.day-card .d-thumbs span { width: 36px; height: 36px; border-radius: 9px; background: var(--photo-bg); overflow: hidden; flex: none; display: grid; place-items: center; font-size: 10px; color: #888; font-weight: 800; }
.day-card .d-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.month-t { font-size: 13px; font-weight: 750; color: var(--muted); margin: 18px 4px 8px; text-transform: capitalize; }
.wd-ex { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.wd-ex:last-child { border-bottom: 0; }
.wd-sets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.wd-sets span { background: var(--surface-2); border-radius: 8px; padding: 3px 8px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

.video video { cursor: pointer; }
.video-state { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .2s; }
.video.paused .video-state { opacity: 1; background: rgba(0,0,0,.25); }
.video.paused .video-state::after { content: ""; width: 60px; height: 60px; border-radius: 50%; background: rgba(10,10,12,.7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6.5v11l9-5.5z' fill='%23fff'/%3E%3C/svg%3E") center / 30px no-repeat; }

/* ---------- Serbest antrenman ---------- */
.hero-sub { color: var(--text-2); font-size: 14.5px; margin: 0 0 16px; max-width: 34ch; }
.hero-actions .btn { padding: 16px 10px; }
.lastbox { background: var(--surface-2); border-radius: 14px; padding: 12px; margin: 6px 0 8px; }
.lastbox .lb-top { display: flex; justify-content: space-between; align-items: baseline; }
.lastbox .wd-sets span { background: var(--surface); }
.lb-best { display: flex; align-items: center; gap: 6px; margin-top: 9px; font-size: 13px; color: var(--accent); font-weight: 600; }
.lb-best b { font-weight: 800; }
#pickList .row-item .ic.muted, .list-card .row-item .ic.muted { color: var(--accent); }

/* Makineye otomatik kaydırınca başlık sabit üst barın altında kalmasın */
.ex { scroll-margin-top: calc(var(--safe-t) + 76px); }

/* ---------- Vücut (tartı) ---------- */
.weigh { text-align: center; padding: 22px 16px; }
.weigh .big { font-size: 52px; font-weight: 800; letter-spacing: -0.05em; line-height: 1.05; margin: 6px 0 10px; }
.weigh .big small { font-size: 20px; color: var(--muted); font-weight: 700; letter-spacing: 0; }
.score { display: flex; gap: 16px; align-items: center; }
.ring { width: 84px; height: 84px; flex: none; }
.ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 8; }
.ring-fg { fill: none; stroke: var(--accent-fill); stroke-width: 8; stroke-linecap: round; transition: stroke-dasharray .6s; }
.ring text { fill: var(--text); font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.rate { display: inline-block; font-size: 11.5px; font-weight: 750; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.rate.ok { background: var(--accent-soft); color: var(--accent); }
.rate.warn { background: rgba(240, 160, 40, .16); color: #c27a00; }
.rate.bad { background: var(--danger-soft); color: var(--danger); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rate.warn { color: #ffb547; } }
:root[data-theme="dark"] .rate.warn { color: #ffb547; }
.chg { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.chg.pos { color: var(--accent); }
.chg.neg { color: var(--danger); }
.mtile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); display: grid; gap: 4px; align-content: start; min-width: 0; }
.mtile .l { font-size: 12px; color: var(--muted); font-weight: 650; }
.mtile .v { font-size: 21px; font-weight: 800; letter-spacing: -0.03em; }
.mtile .v small { font-size: 12px; color: var(--muted); font-weight: 650; letter-spacing: 0; }
.mtile.big .v { font-size: 28px; }
.mgrid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 360px) { .mgrid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.compbar { display: flex; gap: 3px; height: 14px; border-radius: 7px; overflow: hidden; margin-bottom: 14px; }
.compbar i { display: block; height: 100%; }
.complegend { display: grid; gap: 10px; }
.complegend > div { display: flex; align-items: center; gap: 10px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; margin-right: 4px; vertical-align: 0; }
/* Kategorik grafik renkleri — validate_palette.js ile iki temada da doğrulandı */
:root { --cat-1: #2563eb; --cat-2: #d97706; --cat-3: #8b5cf6; --cat-4: #0d9488; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cat-1: #3d8bfd; --cat-2: #d97706; --cat-3: #9b6bf2; --cat-4: #1ea896; } }
:root[data-theme="dark"] { --cat-1: #3d8bfd; --cat-2: #d97706; --cat-3: #9b6bf2; --cat-4: #1ea896; }
.c-water { background: var(--cat-1); } .c-fat { background: var(--cat-2); } .c-protein { background: var(--cat-3); } .c-bone { background: var(--cat-4); }
.btype { width: 100%; border-collapse: separate; border-spacing: 4px; font-size: 12.5px; table-layout: fixed; }
.btype th { text-align: left; font-weight: 700; color: var(--muted); font-size: 11.5px; width: 22%; }
.btype td { text-align: center; padding: 8px 2px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-weight: 600; }
.btype td.on { background: var(--accent-fill); color: var(--accent-ink); font-weight: 800; }
.btype tr.axis td { background: none; font-size: 11px; padding: 2px; }
.chart-t { font-size: 14px; font-weight: 750; margin-bottom: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 2px; }
.legend b { color: var(--text); margin-left: 4px; }
/* Kas (mavi) ve yağ (turuncu) kütlesi */
.chart .series.s1 { stroke: var(--cat-1); }
.chart .series.s2 { stroke: var(--cat-2); }
.sw.s1 { background: var(--cat-1); } .sw.s2 { background: var(--cat-2); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-fill); color: var(--accent-ink); font-weight: 800; font-size: 17px; flex: none; }
.dot-st { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); flex: none; }
.dot-st.on { background: var(--accent-fill); box-shadow: 0 0 0 4px var(--accent-soft); }

/* ---------- Bağlantı / senkron göstergesi ---------- */
.net-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.net-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.net-badge.off { background: var(--danger-soft); color: var(--danger); }
.net-badge.pending { background: var(--accent-soft); color: var(--accent); }
#pickAll.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- Takip: kaydırarak sekme değiştirme ---------- */
.seg-dots { display: flex; justify-content: center; gap: 6px; margin: -6px 0 12px; }
.seg-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--surface-3); transition: width .2s, background .2s; }
.seg-dots i.on { width: 18px; background: var(--accent-fill); }
#segBody.slide-l { animation: slideL .24s cubic-bezier(.2,.8,.2,1); }
#segBody.slide-r { animation: slideR .24s cubic-bezier(.2,.8,.2,1); }
@keyframes slideL { from { opacity: 0; transform: translateX(28px); } }
@keyframes slideR { from { opacity: 0; transform: translateX(-28px); } }
@media (prefers-reduced-motion: reduce) { #segBody.slide-l, #segBody.slide-r { animation: none; } }
.scale-st { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; min-width: 0; }

/* ---------- AI Koç ---------- */
body[data-tab="coach"] main { padding-bottom: 0; }
.coach { display: flex; flex-direction: column; background: var(--bg); }
.coach-tab { position: fixed; left: 0; right: 0; top: 0; bottom: 0; z-index: 4; max-width: 680px; margin: 0 auto; }
.coach-head { display: flex; align-items: center; gap: 10px; padding: 8px 16px 10px; border-bottom: 1px solid var(--line); flex: none; position: relative; }
.coach-title .t { font-weight: 800; font-size: 16px; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coach-title .s { font-size: 12px; color: var(--muted); font-weight: 600; }
.coach-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.coach-dock { flex: none; border-top: 1px solid var(--line); background: var(--bg); padding: 8px 12px calc(10px + var(--safe-b)); }
.coach-tab .coach-dock { padding-bottom: 10px; }
.coach-dock .chips:empty { display: none; }
.coach-dock .chips { margin-bottom: 8px; }
.coach-input { display: flex; gap: 8px; align-items: flex-end; }
.coach-input textarea { resize: none; min-height: 46px; max-height: 140px; padding: 12px 15px; border-radius: 23px; line-height: 1.4; }
.send-btn { width: 46px; height: 46px; border: 0; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); }
.send-btn.stop { background: var(--danger); color: #fff; }

.msg { max-width: 88%; padding: 11px 14px; border-radius: 20px; word-wrap: break-word; overflow-wrap: anywhere; font-size: 15px; line-height: 1.5; }
.msg.user { align-self: flex-end; background: var(--primary); color: var(--primary-ink); border-bottom-right-radius: 6px; font-weight: 550; }
.msg.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; max-width: 94%; }
.msg-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.msg-tools:empty { display: none; }
.msg-tools span { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 3px 8px; border-radius: 999px; margin-bottom: 8px; }
.msg-actions { display: flex; gap: 4px; margin: 8px -6px -4px; }
.msg-actions button { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 650; padding: 4px 6px; border-radius: 8px; }
.msg-actions button:active { background: var(--surface-2); }
.msg.streaming .msg-actions { display: none; }
.msg-error { align-self: center; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--danger); background: var(--danger-soft); padding: 8px 12px; border-radius: 12px; }
.msg-error button { border: 0; background: var(--danger); color: #fff; font-weight: 700; font-size: 12.5px; padding: 5px 10px; border-radius: 9px; }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.caret { display: inline-block; width: 7px; height: 15px; margin-left: 2px; vertical-align: -2px; background: var(--accent); border-radius: 2px; animation: blink 1s infinite; }

/* Markdown */
.md p { margin: 0 0 8px; } .md > :last-child { margin-bottom: 0; }
.md .md-h { font-weight: 800; font-size: 15.5px; margin: 10px 0 6px; } .md .md-h:first-child { margin-top: 0; }
.md ul, .md ol { margin: 4px 0 8px; padding-left: 20px; } .md li { margin: 3px 0; } .md li > ul, .md li > ol { margin: 3px 0; }
.md code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.md pre { background: var(--surface-2); padding: 10px 12px; border-radius: 10px; overflow-x: auto; margin: 6px 0 10px; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: 6px 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--accent); color: var(--text-2); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.md a { color: var(--accent); font-weight: 650; }
.md-table { overflow-x: auto; margin: 6px 0 10px; }
.md table { border-collapse: collapse; font-size: 13.5px; min-width: 100%; }
.md th, .md td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.md th { font-weight: 750; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

.coach-empty { margin: auto 0; text-align: center; padding: 20px 8px; color: var(--text-2); }
.coach-empty b { display: block; font-size: 17px; color: var(--text); margin: 12px 0 6px; letter-spacing: -0.02em; }
.coach-empty p { margin: 0 auto; max-width: 34ch; font-size: 14px; }
.coach-empty-ic { width: 56px; height: 56px; border-radius: 18px; margin: 0 auto; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.coach-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; text-align: left; }
.coach-cards button { display: grid; gap: 8px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 650; font-size: 13.5px; line-height: 1.3; }
.coach-cards .ic { color: var(--accent); }

/* Antrenman içindeki koç: tam boy alt pencere, başlıktan aşağı çekince kapanır */
.sheet-panel.tall { height: 92dvh; display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.sheet-panel.tall .sheet-grip { display: none; }
.sheet-panel.tall #sheetBody, .coach-sheet-host { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.coach-sheet { flex: 1; min-height: 0; }
.coach-sheet .coach-head { padding-top: 20px; cursor: grab; touch-action: none; }
.coach-grip { position: absolute; top: 8px; left: 50%; width: 38px; height: 5px; border-radius: 3px; background: var(--line-strong); transform: translateX(-50%); }

/* ---------- Planlar ---------- */
.plan-actions { margin-bottom: 4px; }
.plan-grid { display: grid; gap: 10px; }
@media (min-width: 560px) { .plan-grid { grid-template-columns: 1fr 1fr; } }
.plan-card { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); color: var(--text); position: relative; overflow: hidden; }
.plan-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent-fill); }
.plan-card.is-done { opacity: .7; } .plan-card.is-done::before { background: var(--surface-3); }
.plan-card:active { transform: scale(.99); }
.pc-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pc-title { font-weight: 800; font-size: 17px; letter-spacing: -0.02em; margin: 6px 0 2px; }
.pc-meta { font-size: 13px; color: var(--muted); font-weight: 600; }
.pc-thumbs { margin-top: 10px; }
.cardio-thumb { background: var(--accent-soft) !important; color: var(--accent); display: grid; place-items: center; }
.d-thumbs .cardio-thumb { width: 36px; height: 36px; border-radius: 9px; }
.row-item.static { cursor: default; }
.pe-item { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: grid; gap: 8px; }
.pe-item .t { font-weight: 700; font-size: 14.5px; }
.pe-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pe-fields.cardio { grid-template-columns: repeat(4, 1fr); }
.pe-fields input, .pe-note { padding: 8px 10px; font-size: 15px; }
.pe-fields .f { font-size: 11px; gap: 3px; }
.hint.plan-target { background: var(--accent-soft); color: var(--text); }
.hint.plan-target .ic { color: var(--accent); }
.cardio-ex .ex-head { cursor: default; }
.cardio-ex.done .ex-thumb::after { display: none; }
.mem-t { white-space: normal; line-height: 1.4; }
.mem-row { cursor: pointer; }
.pc-thumbs { display: flex; gap: 5px; overflow: hidden; }
.pc-thumbs > span { width: 36px; height: 36px; border-radius: 9px; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--photo-bg); color: #888; font-size: 10px; font-weight: 800; }
.pc-thumbs img { width: 100%; height: 100%; object-fit: cover; }
