/* Fitness plán — Apple-like clean design, bez neonu a bez emoji */

:root {
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --card: #ffffff;
  --card-soft: #fafafc;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --muted-2: #8e8e93;
  --line: #e6e6eb;
  --line-strong: #d8d8de;
  --accent: #0071e3;
  --accent-press: #0062c4;
  --accent-soft: #eaf3fe;
  --accent-text: #0066cc;
  --success: #1b7f4b;
  --success-soft: #e8f5ee;
  --warn: #8a5a00;
  --warn-soft: #fff5e0;
  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.03);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  --tabbar-h: 76px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
html {
  --bg: #000000;
  --bg-elevated: #1c1c1e;
  --card: #1c1c1e;
  --card-soft: #232325;
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --muted-2: #8e8e93;
  --line: #2c2c2e;
  --line-strong: #3a3a3c;
  --accent: #0a84ff;
  --accent-press: #0071e3;
  --accent-soft: #12263d;
  --accent-text: #4aa3ff;
  --success: #34c759;
  --success-soft: #12281a;
  --warn: #ffd60a;
  --warn-soft: #2a2410;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.4);
}
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  min-height: 100vh;
  overscroll-behavior-y: none;
}

button { font-family: inherit; font-size: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, select { font-family: inherit; font-size: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.screen {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 20px calc(var(--tabbar-h) + var(--safe-b) + 28px);
  min-height: 100vh;
}
.screen.no-tabs { padding-bottom: 40px; }

/* ---------- Typografie ---------- */
.h-large { font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: -0.028em; }
.h-title { font-size: 22px; line-height: 1.2; font-weight: 650; letter-spacing: -0.02em; }
.h-section { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-2); }
.sub { color: var(--muted); font-size: 15px; }
.small { font-size: 13px; color: var(--muted); }
.tiny { font-size: 12px; color: var(--muted-2); }

.page-head { padding: 24px 0 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head .sub { margin-top: 6px; }

/* ---------- Karty ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.card + .card, .card + .section, .section + .section { margin-top: 14px; }
.card-flat { box-shadow: var(--shadow-soft); }
.card-tight { padding: 16px; }

.section { margin-top: 26px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding: 0 4px; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }

/* ---------- Ikony ---------- */
.ico { display: inline-block; vertical-align: middle; flex: none; }
.ico-box {
  width: 38px; height: 38px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-text); flex: none;
}
.ico-box.muted { background: var(--bg); color: var(--muted); }
.ico-box.success { background: var(--success-soft); color: var(--success); }

/* ---------- Tlačítka ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-weight: 600; font-size: 16px; letter-spacing: -0.01em;
  transition: background .18s ease, transform .12s ease, opacity .18s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-press); }
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-full { width: 100%; }
.btn-secondary { background: var(--bg); color: var(--text); }
.btn-secondary:hover { background: var(--line); }
.btn-ghost { background: transparent; color: var(--accent-text); height: 40px; padding: 0 10px; }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { background: transparent; color: #c9372c; }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn svg { width: 18px; height: 18px; }

/* ---------- Volby / segmented ---------- */
.choices { display: grid; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  padding: 15px 16px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
  transition: border-color .16s ease, background .16s ease;
}
.choice:hover { border-color: var(--line-strong); }
.choice.active { border-color: var(--accent); background: var(--accent-soft); }
.choice .t { font-weight: 600; font-size: 15px; }
.choice .d { font-size: 13px; color: var(--muted); margin-top: 2px; }
.choice-check {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center; flex: none; color: transparent;
}
.choice.active .choice-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.choice-check svg { width: 13px; height: 13px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 999px;
  background: var(--bg); color: var(--muted);
  font-size: 12.5px; font-weight: 550;
}
.chip svg { width: 14px; height: 14px; }
.chip.accent { background: var(--accent-soft); color: var(--accent-text); }
.chip.success { background: var(--success-soft); color: var(--success); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- Formuláře ---------- */
.field { display: block; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input {
  width: 100%; height: 50px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--card-soft); color: var(--text);
  font-size: 16px; font-weight: 500;
  appearance: none; -webkit-appearance: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
select.input { background-image: none; }
.input-wrap { position: relative; }
.input-wrap .unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 14px; pointer-events: none; }

.range { width: 100%; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 999px; background: var(--line); outline: none; margin: 14px 0 6px; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 1px solid var(--line-strong); box-shadow: 0 2px 6px rgba(0,0,0,.18); cursor: pointer; }
.range::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 1px solid var(--line-strong); box-shadow: 0 2px 6px rgba(0,0,0,.18); cursor: pointer; }

/* ---------- Tab bar ---------- */
.tabbar[hidden] { display: none; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: center; gap: 4px;
  padding: 8px 12px calc(8px + var(--safe-b));
  background: color-mix(in srgb, var(--bg-elevated) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1; max-width: 130px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0 4px; border-radius: 12px;
  color: var(--muted-2); font-size: 11px; font-weight: 550;
  transition: color .16s ease;
}
.tab .tab-ico svg { width: 24px; height: 24px; }
.tab.active { color: var(--accent-text); }

/* ---------- Dnes ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: 26px; padding: 24px;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.hero-tag { display: flex; align-items: center; gap: 8px; }
.hero h2 { margin-top: 14px; }
.hero .meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.hero .actions { margin-top: 18px; display: flex; gap: 10px; }
.hero.rest { background: var(--card); }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-soft); }
.stat .v { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; }
.stat .k { font-size: 12px; color: var(--muted); margin-top: 2px; }

.day-mini { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.day-mini:last-child { border-bottom: 0; }
.day-mini .date {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg); color: var(--muted); font-size: 11px; line-height: 1.1; font-weight: 600;
}
.day-mini .date b { font-size: 16px; color: var(--text); font-weight: 650; }
.day-mini.today .date { background: var(--accent); color: #fff; }
.day-mini.today .date b { color: #fff; }
.day-mini .t { font-weight: 600; font-size: 15px; }
.day-mini .d { font-size: 13px; color: var(--muted); }
.day-mini .end { color: var(--muted-2); display: flex; }

/* ---------- Trénink ---------- */
.exercise { border-bottom: 1px solid var(--line); padding: 16px 0; }
.exercise:last-child { border-bottom: 0; padding-bottom: 4px; }
.exercise-head { display: flex; gap: 14px; align-items: flex-start; }
.exercise-num { font-size: 12px; font-weight: 600; color: var(--muted-2); width: 20px; padding-top: 3px; flex: none; }
.exercise-name { font-weight: 600; font-size: 16px; }
.exercise-cue { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.exercise-presc { font-size: 14px; font-weight: 600; color: var(--accent-text); white-space: nowrap; }
.set-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-left: 34px; }
.set-dot {
  min-width: 44px; height: 36px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card-soft);
  font-size: 13px; font-weight: 600; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.set-dot svg { width: 14px; height: 14px; }
.set-dot.done { background: var(--success); border-color: var(--success); color: #fff; }
.exercise.done .exercise-name { color: var(--muted); }

.progress-bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s ease; }

.timerbar {
  position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px);
  margin-top: 14px; display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: 18px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.timerbar .t { font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }

/* ---------- Týden / plán ---------- */
.week-row { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow-soft); }
.week-row.active { border-color: var(--accent); background: var(--accent-soft); }
.week-row + .week-row { margin-top: 8px; }
.week-day { width: 40px; flex: none; text-align: center; font-size: 11px; font-weight: 600; color: var(--muted-2); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Heatmapa ---------- */
.heatmap { display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; }
.heat-cell { aspect-ratio: 1; border-radius: 4px; background: var(--line); }
.heat-cell.l1 { background: color-mix(in srgb, var(--accent) 32%, var(--line)); }
.heat-cell.l2 { background: color-mix(in srgb, var(--accent) 62%, var(--line)); }
.heat-cell.l3 { background: var(--accent); }
.heat-cell.today { outline: 1.5px solid var(--text); outline-offset: 1px; }
.heat-legend { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-top: 10px; }

/* ---------- Onboarding ---------- */
.onboarding { max-width: 560px; margin: 0 auto; padding: 28px 20px 40px; min-height: 100vh; display: flex; flex-direction: column; }
.ob-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ob-step { font-size: 13px; font-weight: 600; color: var(--muted-2); }
.ob-progress { height: 4px; background: var(--line); border-radius: 999px; margin-top: 16px; overflow: hidden; }
.ob-progress span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .32s cubic-bezier(.4,0,.2,1); }
.ob-body { flex: 1; padding: 34px 0 24px; }
.ob-title { font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -0.03em; }
.ob-desc { color: var(--muted); margin-top: 10px; font-size: 16px; }
.ob-content { margin-top: 28px; }
.ob-actions { display: flex; gap: 10px; align-items: center; }
.ob-actions .btn { flex: 1; }
.ob-actions .btn-secondary { flex: 0 0 auto; }
.ob-brand { width: 60px; height: 60px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-text); display: flex; align-items: center; justify-content: center; margin-bottom: 22px; }
.ob-brand svg { width: 32px; height: 32px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0, 0, 0, .35);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .2s ease;
}
.modal {
  width: 100%; max-width: 760px; max-height: 92vh; overflow-y: auto;
  background: var(--bg); border-radius: 26px 26px 0 0;
  padding: 10px 20px calc(28px + var(--safe-b));
  animation: slideUp .28s cubic-bezier(.32,.72,0,1);
}
.modal-grab { width: 38px; height: 5px; border-radius: 999px; background: var(--line-strong); margin: 4px auto 16px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.modal-close { width: 34px; height: 34px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--muted); }

@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { transform: translateY(24px); opacity: .6 } to { transform: none; opacity: 1 } }
@keyframes pop { 0% { transform: scale(.9) } 60% { transform: scale(1.04) } 100% { transform: scale(1) } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 18px);
  transform: translate(-50%, 16px);
  background: var(--text); color: var(--bg);
  padding: 11px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 550;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  opacity: 0; pointer-events: none; transition: opacity .22s ease, transform .22s ease;
  z-index: 90; max-width: calc(100vw - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Souhrn ---------- */
.summary-icon { width: 64px; height: 64px; border-radius: 20px; background: var(--success-soft); color: var(--success); display: flex; align-items: center; justify-content: center; margin: 0 auto; animation: pop .4s ease; }
.summary-icon svg { width: 30px; height: 30px; }

.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.kv:last-child { border-bottom: 0; }
.kv .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.kv .k { color: var(--muted); }

.notice { display: flex; gap: 12px; padding: 15px 16px; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); font-size: 13.5px; line-height: 1.45; }
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.notice.neutral { background: var(--bg); color: var(--muted); }

.list-plain li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.list-plain li:last-child { border-bottom: 0; }
.list-plain .bullet { color: var(--accent-text); flex: none; display: flex; padding-top: 2px; }
.list-plain .bullet svg { width: 18px; height: 18px; }

@media (min-width: 640px) {
  .grid-2.wide { grid-template-columns: repeat(3, 1fr); }
  .onboarding { padding-top: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
