:root {
  --bg: #FFF7F9;
  --card: #FFFFFF;
  --ink: #1F1B24;
  --ink-2: #4A4453;
  --muted: #8A8393;
  --line: #F0E4E9;
  --accent: #E8467C;
  --accent-soft: #FDE8EF;
  --accent-ink: #B41E52;
  --green: #1F9D6A;
  --green-soft: #E4F6EE;
  --blue: #2F6FE4;
  --blue-soft: #E8F0FE;
  --radius: 18px;
  --shadow: 0 2px 10px rgba(60, 20, 40, 0.06);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button { font: inherit; color: inherit; }
.loading { padding: 40px; text-align: center; color: var(--muted); }

.app { min-height: 100vh; display: flex; flex-direction: column; }
.page { flex: 1; padding: calc(12px + var(--safe-top)) 16px calc(84px + var(--safe-bottom)); max-width: 560px; width: 100%; margin: 0 auto; }
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 2px; }
.page-sub { color: var(--ink-2); margin: 0 0 14px; font-weight: 500; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 4px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 0 0 14px; }
.card h2 { font-size: 18px; font-weight: 800; margin: 0 0 10px; letter-spacing: -0.01em; }
.card h3 { font-size: 15px; font-weight: 800; margin: 14px 0 6px; }
.card p { margin: 0 0 8px; color: var(--ink-2); }
.card p:last-child { margin-bottom: 0; }
.card ul { margin: 0; padding-left: 20px; color: var(--ink-2); }
.card li { margin: 0 0 6px; }
.card.accent { background: linear-gradient(135deg, #FF6A9A 0%, #E8467C 100%); color: #fff; box-shadow: 0 8px 24px rgba(232, 70, 124, 0.28); }
.card.accent h2, .card.accent p, .card.accent .eyebrow { color: #fff; }
.card.accent .eyebrow { opacity: 0.85; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv .k { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.kv .v { font-size: 17px; font-weight: 700; color: var(--ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 14px 18px; font-weight: 700; font-size: 16px; cursor: pointer; background: var(--accent); color: #fff; width: 100%; }
.btn.light { background: #fff; color: var(--accent-ink); }
.btn.ghost { background: var(--accent-soft); color: var(--accent-ink); }
.btn.small { width: auto; padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; }

/* schedule table */
.sched { width: 100%; border-collapse: collapse; }
.sched td { padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.sched tr:last-child td { border-bottom: 0; }
.sched td:first-child { font-weight: 800; width: 34%; }
.sched td:last-child { color: var(--ink-2); font-weight: 500; }
.sched tr.today td { color: var(--accent-ink); }
.sched tr.today td:last-child { color: var(--accent-ink); font-weight: 700; }
.sched tr.rest td:last-child { color: var(--muted); }

/* segmented control */
.seg { display: flex; background: #F6E9EE; border-radius: 14px; padding: 4px; margin: 0 0 14px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 10px; border-radius: 11px; font-weight: 800; font-size: 15px; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--accent-ink); box-shadow: var(--shadow); }

/* exercises */
.section-label { display: flex; align-items: center; gap: 10px; margin: 18px 0 8px; font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-label small { font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); }
.ex { display: grid; grid-template-columns: 36px 1fr; gap: 12px; }
.ex .num { width: 36px; height: 36px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.ex.light .num { background: var(--blue-soft); color: var(--blue); }
.ex .name { font-weight: 800; font-size: 16px; line-height: 1.3; margin: 6px 0 4px; }
.ex .meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.chip { display: inline-block; padding: 3px 9px; border-radius: 999px; background: #F5F0F2; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.chip.main { background: var(--accent-soft); color: var(--accent-ink); }
.chip.ss { background: var(--green-soft); color: var(--green); }
.ex .note { color: var(--ink-2); font-size: 14.5px; margin: 0; }
.ex .optional { color: var(--muted); font-size: 13px; font-weight: 700; }

/* tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.94); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-top: 1px solid var(--line); display: flex; padding: 6px 4px calc(6px + var(--safe-bottom)); }
.tabbar a { flex: 1; text-decoration: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; padding: 4px 0; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.on { color: var(--accent-ink); }

/* login */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.login .logo { width: 84px; height: 84px; border-radius: 24px; background: linear-gradient(135deg, #FF6A9A, #E8467C); color: #fff; font-weight: 900; font-size: 40px; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 28px rgba(232,70,124,0.3); margin-bottom: 16px; }
.login h1 { font-size: 26px; margin: 0 0 4px; font-weight: 800; }
.login p { color: var(--ink-2); margin: 0 0 20px; }
.dots { display: flex; gap: 14px; justify-content: center; margin: 10px 0 22px; height: 18px; }
.dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent); }
.dots span.on { background: var(--accent); }
.dots.shake { animation: shake 0.35s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-8px)} 75%{transform:translateX(8px)} }
.pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px; }
.pad button { width: 76px; height: 76px; border-radius: 50%; border: 0; background: #fff; box-shadow: var(--shadow); font-size: 28px; font-weight: 700; color: var(--ink); }
.pad button:active { background: var(--accent-soft); }
.pad button.blank { background: transparent; box-shadow: none; }
.pad button.del { font-size: 22px; color: var(--ink-2); }
.err { color: var(--accent-ink); font-weight: 700; min-height: 22px; margin: 0 0 8px; }

.muted { color: var(--muted); }
.tiny { font-size: 13px; }
.soon { text-align: center; padding: 40px 16px; color: var(--ink-2); }
.soon .big { font-size: 40px; margin-bottom: 8px; }
