/* Экраны Fitness поверх общего стиля Aurora (styles.css). Только классы — CSP запрещает встроенные стили. */
:root { --up: #22c55e; --down: #f59e0b; --hold: #8e95c6; }

main { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
h1 { font-size: 22px; margin: 0; }
h3 { font-size: 16px; margin: 0; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.link { background: none; border: 0; color: var(--accent); padding: 8px 0; min-height: 44px; font-weight: 600; }
.link.danger { color: var(--danger); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.wide { width: 100%; margin-top: 14px; }
.hint { font-size: 13px; margin: 10px 4px; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.btn.small { min-height: 40px; padding: 0 14px; }
.btn.danger { background: var(--danger); box-shadow: none; }
.btn-row { display: flex; gap: 8px; margin-top: 14px; }
.btn-row .btn { flex: 1; }

/* Переключатели */
.seg { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.seg-btn { flex: 1; min-height: 44px; min-width: 64px; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--card); font-weight: 600; }
.seg-btn.on { background: linear-gradient(135deg, var(--violet-1), var(--violet-2)); color: var(--accent-text); border-color: transparent; }
.chip { padding: 3px 9px; border-radius: 999px; font-size: 12px; border: 1px solid var(--glass-border); color: var(--hint); }
.chip.on { background: var(--accent); color: #fff; border-color: transparent; }

/* Упражнение в тренировке */
.ex-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ex-plan { font-size: 13px; color: var(--hint); margin-top: 2px; }
.sugg { font-size: 14px; margin-top: 6px; }
.sugg .up { color: var(--up); font-weight: 700; }
.sugg .down { color: var(--down); font-weight: 700; }
.sugg .hold { color: var(--hold); font-weight: 700; }
.prev { font-size: 12px; color: var(--hint); margin-top: 2px; }
.set-row { display: flex; align-items: center; gap: 8px; min-height: 44px; border-bottom: 1px solid var(--line); font-size: 15px; }
.set-row:last-child { border-bottom: 0; }
.set-n { width: 22px; color: var(--hint); font-size: 13px; text-align: center; flex: none; }
.set-main { flex: 1; min-width: 0; }
.set-meta { font-size: 12px; color: var(--hint); }
.pending { color: var(--down); font-size: 12px; }
.icon-btn { min-width: 40px; min-height: 40px; border-radius: 10px; border: 1px solid var(--glass-border); background: var(--card); font-size: 16px; }
.entry { display: grid; grid-template-columns: 1fr 1fr 52px; gap: 8px; align-items: end; margin-top: 10px; }
.entry label { display: flex; flex-direction: column; font-size: 12px; color: var(--hint); gap: 4px; }
.entry .field { min-height: 46px; text-align: center; font-size: 18px; font-weight: 600; padding: 0 6px; }
.check { min-height: 46px; border-radius: 14px; border: 0; font-size: 22px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--ok), #16a34a); }
.rir { display: flex; gap: 4px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.rir .lbl { font-size: 12px; color: var(--hint); margin-right: 4px; }
.rir .seg-btn { flex: none; min-width: 40px; min-height: 36px; font-size: 13px; }
.type-line { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }

/* Таймер отдыха — над вкладками */
.rest {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 7;
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 16px; width: min(560px, 94vw);
  background: rgba(20, 24, 60, 0.95); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow);
}
.rest-time { flex: 1; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rest-time.done { color: var(--ok); }

/* Шаблон */
.te { padding: 10px 0; border-bottom: 1px solid var(--line); }
.te:last-child { border-bottom: 0; }
.te-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.te-grid label { display: flex; flex-direction: column; font-size: 11px; color: var(--hint); gap: 2px; }
.te-grid .field { min-height: 40px; padding: 0 8px; text-align: center; }
.te-actions { display: flex; gap: 4px; }
.sched-row { display: flex; align-items: center; gap: 10px; min-height: 48px; border-bottom: 1px solid var(--line); }
.sched-row:last-child { border-bottom: 0; }
.sched-day { width: 44px; font-weight: 600; }
select.field { appearance: none; -webkit-appearance: none; }
.form-col { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

/* История и статусы */
.st { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--glass-border); }
.st.finished { color: var(--ok); border-color: var(--ok); }
.st.done_unlogged { color: var(--hold); }
.st.skipped, .st.missed { color: var(--down); border-color: var(--down); }
.st.in_progress, .st.planned { color: var(--accent); border-color: var(--accent); }

/* Прогресс */
.chart-svg { width: 100%; height: auto; display: block; margin-top: 6px; }
.chart-svg .grid { stroke: var(--line); stroke-width: 1; }
.chart-svg .axis { fill: var(--hint); font-size: 9px; }
.chart-svg .line { fill: none; stroke-width: 2; stroke: var(--accent); }
.chart-svg .line.alt { stroke: #2dd4bf; stroke-dasharray: 4 3; }
.chart-svg .dot { fill: var(--accent); }
.legend { font-size: 13px; display: flex; gap: 12px; margin: 6px 4px 0; color: var(--hint); }
.lg-main { color: var(--accent); }
.lg-alt { color: #2dd4bf; }

/* Нижние вкладки */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: center; gap: 4px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(10, 15, 42, 0.86); border-top: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
:root[data-theme="telegram"] .tabbar { background: var(--bg); }
:root[data-theme="telegram"] .rest { background: var(--card); }
.tab { flex: 1; max-width: 150px; min-height: 52px; border: 0; background: none; color: var(--hint); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; gap: 2px; }
.tab-icon { font-size: 20px; }
.tab.on { color: var(--text); background: var(--card); }
.clickable { cursor: pointer; }
