:root {
  --bg: #f4f6f5; --card: #ffffff; --text: #16211e; --muted: #5f6f6a; --border: #dde3e0;
  --accent: #0f766e; --accent-soft: #d8f0ec; --good: #15803d; --warn: #b45309; --bad: #b91c1c; --track: #e3e8e6;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1513; --card: #182220; --text: #e6ecea; --muted: #9bb0aa; --border: #2a3835; --accent: #2dd4bf; --accent-soft: #123b36; --track: #243331; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
#app { min-height: 100vh; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.top { position: sticky; top: 0; z-index: 5; background: var(--accent); color: #fff; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
.top .title { font-size: 20px; font-weight: 700; }
.top .sub { font-size: 13px; opacity: .9; }
main#view { padding: 14px 16px 24px; max-width: 720px; margin: 0 auto; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--card); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabs button { flex: 1; border: 0; background: none; color: var(--muted); font-size: 20px; padding: 8px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
.tabs button span { font-size: 11px; font-weight: 600; }
.tabs button.on { color: var(--accent); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.card h2 { margin: 0 0 8px; font-size: 16px; }
.card h3 { margin: 12px 0 6px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--accent-soft); border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 22px; line-height: 1.1; }
.stat span { font-size: 12px; color: var(--muted); }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
input, select, textarea { width: 100%; margin-top: 4px; padding: 11px 12px; font-size: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); }
textarea { min-height: 70px; resize: vertical; }
input[type=checkbox] { width: auto; margin: 0 8px 0 0; transform: scale(1.3); }
.check { display: flex; align-items: center; font-size: 16px; color: var(--text); padding: 8px 0; }
.btn { display: inline-block; border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: 15px; font-weight: 600; padding: 11px 16px; border-radius: 10px; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; width: 100%; font-size: 17px; }
.btn.ghost { padding: 6px 10px; font-size: 13px; }
.btn.danger { color: var(--bad); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.pill.good { background: #dcfce7; color: var(--good); } .pill.warn { background: #fef3c7; color: var(--warn); } .pill.bad { background: #fee2e2; color: var(--bad); }
.ex { padding: 8px 0; border-bottom: 1px solid var(--border); }
.ex:last-child { border-bottom: 0; }
.ex b { display: block; }
.ex .sr { font-weight: 700; color: var(--accent); }
.ex .cue { font-size: 13px; color: var(--muted); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 12px; }
.week div { padding: 8px 2px; border-radius: 8px; background: var(--track); }
.week div.strength { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.week div.cardio { background: #fef3c7; color: var(--warn); font-weight: 700; }
.week div.today { outline: 2px solid var(--accent); }
.bar { height: 10px; background: var(--track); border-radius: 5px; overflow: hidden; margin: 6px 0; }
.bar i { display: block; height: 100%; background: var(--accent); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 7px 4px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-size: 12px; font-weight: 600; }
td.num, th.num { text-align: right; }
.tablewrap { overflow-x: auto; }
ul.list { padding-left: 18px; margin: 6px 0; } ul.list li { margin-bottom: 6px; }
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: #16211e; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; transition: .2s; pointer-events: none; z-index: 9; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; margin: 60px auto; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.err { color: var(--bad); font-size: 14px; min-height: 18px; margin-top: 8px; }
svg.chart { width: 100%; height: auto; display: block; }
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 28px 22px; width: 100%; max-width: 380px; text-align: center; }
.login-card h1 { margin: 6px 0 4px; }
.login-card .logo { font-size: 44px; }
.login-card form { text-align: left; margin-top: 16px; }
.datenav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.verdict { border-left: 6px solid var(--muted); }
.verdict.on { border-left-color: var(--good); } .verdict.slightly { border-left-color: var(--warn); } .verdict.behind { border-left-color: var(--bad); }
.verdict h2 { font-size: 18px; }
.verdict .flag { font-size: 13px; color: var(--warn); margin-top: 6px; }
.ex .how { float: right; margin-left: 8px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.modal .box { background: var(--card); color: var(--text); border-radius: 16px 16px 0 0; width: 100%; max-width: 720px; max-height: 92vh; overflow-y: auto; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }
.modal h2 { margin: 0 0 8px; font-size: 17px; padding-right: 40px; }
.modal .close { position: absolute; right: 12px; top: 10px; }
.modal .box { position: relative; }
.vid { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; }
.vid video, .vid iframe { width: 100%; height: 100%; border: 0; display: block; }
.credit { font-size: 12px; color: var(--muted); margin-top: 6px; }
.steps { padding-left: 18px; margin: 8px 0 0; } .steps li { margin-bottom: 5px; }
.datenav b { font-size: 16px; }
