/* Koyu cam (A) — tek tema, iOS PWA için tasarlandı */
:root {
  color-scheme: dark;
  --bg: #07080C;
  --fg: #F4F6F8;
  --muted: rgba(244, 246, 248, 0.6);
  --faint: rgba(244, 246, 248, 0.42);
  --line: rgba(255, 255, 255, 0.08);
  --glass: rgba(255, 255, 255, 0.07);
  --glass-strong: rgba(255, 255, 255, 0.11);
  --glass-border: rgba(255, 255, 255, 0.14);
  --lime: #C6FF4D;
  --lime-ink: #0B0F05;
  --cyan: #4CD8FF;
  --violet: #B794FF;
  --amber: #FFC94D;
  --amber-ink: #FFE3A3;
  --red: #FF6B6B;
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --tab-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 16px; line-height: 1.4; }
body { overscroll-behavior-y: none; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

.blobs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.blobs i { position: absolute; border-radius: 50%; filter: blur(90px); }
.blobs i:nth-child(1) { width: 320px; height: 320px; background: #7CFF3C; opacity: .38; top: -90px; left: -100px; }
.blobs i:nth-child(2) { width: 300px; height: 300px; background: #2DD4FF; opacity: .28; top: 45%; right: -130px; }
.blobs i:nth-child(3) { width: 260px; height: 260px; background: #8B5CF6; opacity: .32; bottom: -40px; left: -70px; }

.app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: calc(var(--safe-t) + 20px) 16px calc(var(--tab-h) + var(--safe-b) + 40px); display: flex; flex-direction: column; gap: 14px; }

.g {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.card { border-radius: 24px; padding: 16px; }
.card.tight { padding: 6px 16px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.lime { color: var(--lime); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 8px; }
.head h1 { font-size: 32px; font-weight: 600; letter-spacing: -0.5px; line-height: 1.1; }
.section-title { font-size: 13px; font-weight: 500; color: var(--muted); padding: 6px 4px 0; display: flex; justify-content: space-between; align-items: center; }
.section-title button { color: var(--lime); background: none; border: 0; padding: 4px 0; font-size: 13px; font-weight: 500; cursor: pointer; }

.pill { border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.pill.streak { color: #FFB25C; }

.btn { height: 48px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--glass-border); background: var(--glass-strong); font-weight: 500; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
a.btn { text-decoration: none; color: var(--fg); }
.how { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.how summary { cursor: pointer; color: var(--lime); font-weight: 500; padding: 4px 0; list-style: none; }
.how summary::-webkit-details-marker { display: none; }
.how summary::before { content: '+ '; }
.how[open] summary::before { content: '– '; }
.how > div { padding: 4px 0 2px; line-height: 1.5; }
.md { font-size: 15px; line-height: 1.55; display: flex; flex-direction: column; gap: 6px; }
.md h3 { font-size: 15px; font-weight: 600; color: var(--violet); margin: 8px 0 0; }
.md h3:first-child { margin-top: 0; }
.md p, .md ul, .md ol { margin: 0; }
.md ul, .md ol { padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.md strong { font-weight: 600; color: var(--fg); }
.how-img { display: block; width: 100%; max-height: 260px; object-fit: contain; background: #fff; border-radius: 14px; margin: 6px 0; }
.btn.primary { background: var(--lime); color: var(--lime-ink); border-color: transparent; font-weight: 600; }
.btn.danger { color: var(--red); }
.btn.block { width: 100%; }
.btn.sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn:active { transform: scale(0.98); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--glass-border); background: var(--glass); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.link-btn { background: none; border: 0; color: var(--lime); font-weight: 500; padding: 6px 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

.ring-card { display: flex; align-items: center; gap: 18px; }
.big-num { font-size: 32px; font-weight: 600; line-height: 1; }

.alert { border-radius: 18px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert .t { font-size: 15px; }
.alert .s { font-size: 13px; opacity: .8; margin-top: 2px; }
.alert.warn { background: rgba(255, 190, 60, 0.12); border-color: rgba(255, 190, 60, 0.35); color: var(--amber-ink); }
.alert.info { background: rgba(76, 216, 255, 0.1); border-color: rgba(76, 216, 255, 0.3); color: #CDF3FF; }
.alert.danger { background: rgba(255, 107, 107, 0.12); border-color: rgba(255, 107, 107, 0.4); color: #FFD0D0; }
.alert.good { background: rgba(198, 255, 77, 0.1); border-color: rgba(198, 255, 77, 0.35); color: #E6FFB8; }

.macro { border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.macro .v { font-size: 17px; font-weight: 600; }
.macro .v span { font-size: 12px; color: var(--faint); font-weight: 400; }
.bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; }

.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); min-height: 52px; }
.list-item:last-child { border-bottom: 0; }
button.list-item { width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; }
.check { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.3); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: none; cursor: pointer; padding: 0; }
.check.on { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.check.partial { border-color: var(--lime); }

.tabbar { position: fixed; z-index: 20; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 12px); height: var(--tab-h); border-radius: 34px; display: flex; align-items: center; justify-content: space-around; background: rgba(20, 22, 28, 0.6); max-width: 536px; margin: 0 auto; }
.tabbar a { width: 56px; height: 46px; border-radius: 23px; display: flex; align-items: center; justify-content: center; color: rgba(244, 246, 248, 0.55); }
.tabbar a.on { background: rgba(198, 255, 77, 0.18); color: var(--lime); }

/* Alt sayfa (bottom sheet) */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.55); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s ease-out; }
.sheet { width: 100%; max-width: 560px; max-height: calc(100% - var(--safe-t) - 24px); overflow-y: auto; -webkit-overflow-scrolling: touch; border-radius: 28px 28px 0 0; padding: 10px 18px calc(var(--safe-b) + 22px); background: rgba(22, 24, 30, 0.92); border-bottom: 0; animation: up .22s ease-out; }
.sheet .grabber { width: 40px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.25); margin: 0 auto 12px; }
.sheet h2 { font-size: 20px; font-weight: 600; margin-bottom: 14px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 13px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; height: 48px; border-radius: 14px; border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.06); padding: 0 14px; font-size: 16px; color: var(--fg); outline: none;
  -webkit-appearance: none; appearance: none;
}
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.input:focus { border-color: var(--lime); }
.input::placeholder { color: var(--faint); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 36px; min-width: 44px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--glass-border); background: var(--glass); font-size: 14px; cursor: pointer; }
.chip.on { background: var(--lime); color: var(--lime-ink); border-color: transparent; font-weight: 600; }

.seg { display: flex; padding: 4px; border-radius: 14px; gap: 4px; }
.seg button { flex: 1; height: 38px; border: 0; border-radius: 10px; background: none; font-size: 14px; cursor: pointer; color: var(--muted); }
.seg button.on { background: rgba(255, 255, 255, 0.14); color: var(--fg); font-weight: 500; }

.switch { position: relative; width: 50px; height: 30px; flex-shrink: 0; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 15px; background: rgba(255, 255, 255, 0.16); transition: background .15s; }
.switch span::after { content: ''; position: absolute; width: 26px; height: 26px; top: 2px; left: 2px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--lime); }
.switch input:checked + span::after { transform: translateX(20px); }

/* Antrenman seansı */
.set-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 72px 60px 44px; gap: 8px; align-items: center; padding: 6px 0; }
.set-row.head-row { font-size: 12px; color: var(--faint); padding: 2px 0; }
.set-row .input { height: 42px; padding: 0 8px; text-align: center; border-radius: 12px; }
.set-row.done .input { border-color: rgba(198, 255, 77, 0.4); background: rgba(198, 255, 77, 0.08); }
.set-no { font-weight: 600; color: var(--muted); text-align: center; }
.rest { position: fixed; z-index: 25; left: 16px; right: 16px; bottom: calc(var(--safe-b) + var(--tab-h) + 22px); max-width: 528px; margin: 0 auto; border-radius: 22px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; background: rgba(30, 34, 20, 0.75); border-color: rgba(198, 255, 77, 0.35); }
.rest .t { font-size: 24px; font-weight: 600; color: var(--lime); font-variant-numeric: tabular-nums; }

.empty { text-align: center; padding: 22px 8px; color: var(--muted); display: flex; flex-direction: column; gap: 10px; align-items: center; }

.toast { position: fixed; z-index: 60; left: 50%; top: calc(var(--safe-t) + 12px); transform: translate(-50%, -140%); transition: transform .25s; background: rgba(30, 32, 38, 0.95); border: 1px solid var(--glass-border); border-radius: 18px; padding: 12px 18px; max-width: calc(100% - 32px); font-size: 15px; }
.toast.show { transform: translate(-50%, 0); }

.chart { width: 100%; height: 170px; display: block; }
.auth { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.auth h1 { font-size: 36px; font-weight: 700; letter-spacing: -0.8px; }
.err { color: var(--red); font-size: 14px; min-height: 18px; }
.date-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.date-nav .d { font-weight: 500; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
