:root {
  --bg: #0b0e1a;
  --bg2: #10142a;
  --card: #151a2e;
  --card2: #1b2140;
  --line: #262d4d;
  --text: #f2f3fa;
  --muted: #8a90ad;
  --dim: #5d6384;
  --accent: #7c5cff;
  --accent2: #9b82ff;
  --accent-soft: rgba(124, 92, 255, .16);
  --green: #2fd47c;
  --green-soft: rgba(47, 212, 124, .14);
  --yellow: #f7b733;
  --yellow-soft: rgba(247, 183, 51, .12);
  --blue: #3d8bff;
  --blue-soft: rgba(61, 139, 255, .14);
  --red: #ff5f6d;
  --red-soft: rgba(255, 95, 109, .14);
  --radius: 20px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  padding-bottom: calc(96px + var(--safe-b));
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
[hidden] { display: none !important; }

.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px; }

/* ---------- ust bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 14, 26, .88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.04);
  padding: calc(14px + var(--safe-t)) 0 14px;
}
.topbar .wrap { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #c06cff); font-weight: 700; font-size: 20px;
}
.hello b { display: block; font-size: 19px; }
.hello span { color: var(--muted); font-size: 14px; }

/* ---------- basliklar */
.eyebrow { font-size: 12px; letter-spacing: .14em; font-weight: 700; text-transform: uppercase; color: var(--accent2); }
.eyebrow.y { color: var(--yellow); } .eyebrow.g { color: var(--green); } .eyebrow.b { color: var(--blue); } .eyebrow.m { color: var(--muted); }
h1 { font-size: 34px; margin: 4px 0 2px; letter-spacing: -.02em; }
h2 { font-size: 20px; margin: 0; }
.sub { color: var(--muted); font-size: 15px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 22px 0 18px; }

/* ---------- kartlar */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin: 14px 0;
}
.card.tight { padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.big { font-size: 44px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.big small { font-size: 18px; color: var(--muted); font-weight: 500; margin-left: 4px; letter-spacing: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; min-width: 0; }
.stat .k { font-size: 11px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.stat .v { font-size: 24px; font-weight: 650; margin-top: 4px; white-space: nowrap; }
.stat .v small { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat .d { font-size: 12px; margin-top: 2px; color: var(--dim); min-height: 16px; }
.stat.center { text-align: center; padding: 10px 6px; }
.stat.center .v { font-size: 18px; }
.up { color: var(--yellow) !important; } .down { color: var(--green) !important; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 650; background: var(--accent-soft); color: var(--accent2);
}
.pill.y { background: var(--yellow-soft); color: var(--yellow); border: 1px solid rgba(247,183,51,.45); }
.pill.b { background: var(--blue-soft); color: #7fb2ff; border: 1px solid rgba(61,139,255,.45); }
.pill.g { background: var(--green-soft); color: var(--green); border: 1px solid rgba(47,212,124,.45); }
.pill.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- butonlar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 20px; border-radius: 16px; font-weight: 650;
  background: var(--card2); border: 1px solid var(--line);
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.green { background: var(--green-soft); border-color: rgba(47,212,124,.5); color: var(--green); }
.btn.danger { color: var(--red); }
.btn.block { width: 100%; }
.btn.sm { height: 38px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.btn:disabled { opacity: .5; }
.icon-btn {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line);
}
.icon-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 8px 24px rgba(124,92,255,.45); }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn.sm svg { width: 18px; height: 18px; }
.link { color: var(--accent2); font-weight: 600; font-size: 14px; }

/* ---------- ilerleme */
.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .4s ease; }
.bar.blue > i { background: var(--blue); } .bar.yellow > i { background: var(--yellow); } .bar.green > i { background: var(--green); }
.ring { position: relative; width: 96px; height: 96px; flex-shrink: 0; }
.ring svg { width: 96px; height: 96px; transform: rotate(-90deg); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .lbl b { font-size: 24px; color: var(--green); display: block; line-height: 1; }
.ring .lbl span { font-size: 10px; color: var(--muted); letter-spacing: .06em; }

/* ---------- hafta seridi */
.weekdots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; margin-top: 12px; }
.weekdots .d { font-size: 13px; color: var(--muted); }
.weekdots .d.today { color: var(--text); font-weight: 700; }
.weekdots .c {
  width: 34px; height: 34px; margin: 8px auto 0; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--accent); color: var(--accent2);
}
.weekdots .c svg { width: 16px; height: 16px; }
.weekdots .c.done { background: var(--accent); color: #fff; }
.weekdots .c.today { background: var(--accent); color: #fff; }
.weekdots .c.rest { border-color: transparent; color: var(--dim); }
.weekdots .c.missed { border-color: var(--red); color: var(--red); }

.daytabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 14px; margin: 0 -16px;
  scrollbar-width: none; scroll-snap-type: x proximity;
}
.daytabs::-webkit-scrollbar { display: none; }
.daytab {
  flex: 0 0 92px; scroll-snap-align: center; border-radius: 18px; padding: 12px 6px 10px; text-align: center;
  background: var(--card); border: 1.5px solid var(--line); position: relative;
}
.daytab .dn { font-weight: 700; font-size: 14px; color: var(--muted); }
.daytab .ic { margin: 6px auto; height: 24px; display: grid; place-items: center; color: var(--dim); }
.daytab .ic .chk { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; }
.daytab .ic .chk svg { width: 14px; height: 14px; stroke-width: 3; }
.daytab .wn { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daytab.today { border-color: var(--accent); }
.daytab.today::after { content: ""; position: absolute; bottom: 4px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent); }
.daytab.sel { background: var(--accent); border-color: var(--accent); box-shadow: 0 8px 22px rgba(124,92,255,.4); }
.daytab.sel .dn, .daytab.sel .wn, .daytab.sel .ic { color: #fff; }
.daytab.sel .ic .chk { background: #fff; color: var(--accent); }

/* ---------- antrenman */
.hero {
  background: linear-gradient(180deg, #221f4a 0%, var(--bg) 100%);
  padding: calc(14px + var(--safe-t)) 0 8px;
}
.hero .bar-top { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.hero h1 { font-size: 38px; }
.banner {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 16px; font-weight: 700;
  background: var(--yellow-soft); border: 1px solid rgba(247,183,51,.45); color: var(--yellow); margin: 10px 0 14px;
}
.ex {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px 16px 22px; margin: 12px 0; overflow: hidden;
}
.ex::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--red); }
.ex.ss::before { background: var(--accent); }
.ex.ss.warmup::before { background: var(--yellow); }
.ex.ss.cooldown::before { background: var(--blue); }
.ex.ss { border-color: rgba(124,92,255,.4); }
.ex .no { color: var(--dim); font-size: 13px; font-weight: 600; }
.ex .nm { font-size: 19px; font-weight: 650; margin: 2px 0; }
.ex .meta { color: var(--muted); font-size: 15px; }
.ex .note { color: var(--dim); font-style: italic; font-size: 14px; margin-top: 6px; }
.ex .info { position: absolute; right: 14px; top: 14px; color: var(--muted); }
.ex .sub-ex { border-top: 1px solid var(--line); padding: 12px 36px 12px 0; position: relative; }
.ex .sub-ex .info { top: 14px; right: 0; }
.ss-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.ss-head .rr { color: var(--accent2); font-weight: 650; font-size: 15px; }
.ss-explain { background: rgba(124,92,255,.08); border: 1px solid rgba(124,92,255,.3); border-radius: 14px; padding: 10px 14px; color: #b9a8ff; font-size: 14px; margin-bottom: 4px; }
.sets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.set {
  min-width: 40px; height: 34px; padding: 0 10px; border-radius: 10px; border: 1.5px solid var(--line);
  color: var(--muted); font-size: 13px; font-weight: 650; display: grid; place-items: center; background: var(--bg2);
}
.set.on { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.done-ribbon { display: flex; align-items: center; gap: 10px; }

/* ---------- grafik */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 10px; stroke: none; font-family: inherit; }
.chart .lbl { fill: var(--text); font-size: 11px; font-weight: 600; }
.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 4 4; fill: none; }
.chart svg, svg.chart { width: 100%; height: auto; }
.empty { color: var(--dim); font-size: 14px; padding: 18px 0; text-align: center; }

/* ---------- olcum fotolari */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 12px; }
.photo { border-radius: 14px; overflow: hidden; background: var(--bg2); border: 1px solid var(--line); }
.photo img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.photo span { display: block; text-align: center; font-size: 12px; color: var(--muted); padding: 6px 0; }
.pick {
  border: 1.5px dashed var(--line); border-radius: 14px; aspect-ratio: 3/4; display: grid; place-items: center;
  text-align: center; font-size: 12px; color: var(--muted); position: relative; overflow: hidden; background: var(--bg2);
}
.pick img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pick input { position: absolute; inset: 0; opacity: 0; }
.pick .lb { padding: 6px; }
.pick .lb svg { color: var(--accent2); display: block; margin: 0 auto 6px; }

/* ---------- formlar */
label.f { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 6px; }
.input, select.input, textarea.input {
  width: 100%; height: 50px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg2);
  padding: 0 14px; outline: none; font-size: 16px;
}
textarea.input { height: auto; min-height: 260px; padding: 12px 14px; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.input:focus { border-color: var(--accent); }
.input-unit { position: relative; }
.input-unit span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--dim); font-size: 14px; pointer-events: none; }
.err { color: var(--red); font-size: 14px; margin-top: 8px; white-space: pre-wrap; }
.hint { color: var(--muted); font-size: 14px; }
code, .code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 2px 6px; word-break: break-all; }
ol.steps-howto { padding-left: 20px; color: var(--muted); font-size: 14px; } ol.steps-howto li { margin: 6px 0; }

/* ---------- alt menu */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  padding: 8px 8px calc(8px + var(--safe-b)); background: rgba(13, 16, 32, .94);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--dim); padding: 6px 0; }
.tabbar a.on { color: var(--accent2); }
.tabbar .fab {
  justify-self: center; width: 60px; height: 60px; border-radius: 50%; margin-top: -26px;
  background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 28px rgba(124,92,255,.55);
}
.tabbar .fab svg { width: 28px; height: 28px; stroke-width: 2.5; }

/* ---------- alt sayfa (sheet) */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(4, 6, 14, .66); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet {
  width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; background: var(--card);
  border-radius: 26px 26px 0 0; border: 1px solid var(--line); border-bottom: 0;
  padding: 10px 20px calc(20px + var(--safe-b)); animation: up .22s ease;
}
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 14px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.sheet-head h2 { font-size: 24px; }
.sheet-foot { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; margin-top: 20px; }
.qa { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.qa button { background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; padding: 18px 14px; text-align: left; }
.qa button b { display: block; margin-top: 8px; }
.qa button span { font-size: 13px; color: var(--muted); }
.qa .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- zamanlayici / toast */
.timer {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + var(--safe-b)); z-index: 40;
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 20px; border-radius: 999px;
  background: #1f2550; border: 1px solid var(--accent); box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.timer b { font-size: 22px; font-variant-numeric: tabular-nums; min-width: 54px; }
.timer.end { border-color: var(--green); background: #12382a; }
.toast {
  position: fixed; left: 50%; top: calc(16px + var(--safe-t)); transform: translateX(-50%); z-index: 60;
  background: var(--card2); border: 1px solid var(--line); padding: 12px 18px; border-radius: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: calc(100% - 32px);
}
.toast.err { border-color: var(--red); color: var(--red); }

/* ---------- giris */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login .card { width: 100%; max-width: 380px; text-align: center; }
.login .logo { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 22px; display: grid; place-items: center; background: var(--accent); }
.login .logo svg { width: 38px; height: 38px; color: #fff; }

/* ---------- karsilastirma */
table.cmp { width: 100%; border-collapse: collapse; font-size: 15px; }
table.cmp th, table.cmp td { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: right; }
table.cmp th:first-child, table.cmp td:first-child { text-align: left; color: var(--muted); font-weight: 500; }
table.cmp th { font-size: 12px; color: var(--muted); font-weight: 600; }
.cmp-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.viewer { position: fixed; inset: 0; z-index: 70; background: #000; display: grid; place-items: center; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }

@media (max-width: 380px) {
  .grid3 { gap: 8px; }
  .stat .v { font-size: 20px; }
  .big { font-size: 38px; }
  h1 { font-size: 30px; }
}
