/* =========================================================
   세트로그 — 디자인 시스템 & 레이아웃
   테마 3종: dark(다크+네온) / light(밝고 미니멀) / vivid(비비드)
   ========================================================= */

/* ---------- 웹폰트 (셀프호스팅 · 오프라인 PWA 대응) ----------
   Pretendard (SIL OFL) — 본문/UI 전반 · Anton (SIL OFL) — 대형 숫자 */
@font-face {
  font-family: "Pretendard Variable";
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/PretendardVariable.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Anton";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/Anton.woff2") format("woff2");
}
/* Black Han Sans (SIL OFL) — Nike Futura ND의 한글 카운터파트 (컨덴스드 블랙 디스플레이)
   단일 웨이트지만 400~900 매칭 선언 → 미포함 글자가 Pretendard로 빠질 때 900으로 렌더 */
@font-face {
  font-family: "Black Han Sans";
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/BlackHanSans.woff2") format("woff2");
}

:root {
  --font: "Pretendard Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard",
    "Malgun Gothic", "Apple SD Gothic Neo", Roboto, sans-serif;
  --font-num: "Anton", "Pretendard Variable", "Malgun Gothic", sans-serif;
  --font-display: "Anton", "Black Han Sans", "Pretendard Variable", "Malgun Gothic", sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --tab-h: 64px;
  --maxw: 440px;
  --ease: cubic-bezier(.22,.61,.36,1);

  /* 세트 타입 색 (테마 공통, 고정 hue) */
  --t-normal: var(--accent);
  --t-warmup: #ffcf33;
  --t-compound: #7c9cff;
  --t-super: #b57cff;
  --t-tri: #ff9f45;
  --t-drop: #ff6fae;
  --t-amrap: #4dd6c1;
  --t-fail: #ff5470;
  --t-assist: #9aa7b0;
}

/* ---------- 다크 + 네온 (기본) ---------- */
[data-theme="dark"] {
  --bg: #0b0f10;
  --bg-grad: radial-gradient(120% 80% at 50% -10%, #12201c 0%, #0b0f10 55%);
  --surface: #141b1d;
  --surface-2: #1c2528;
  --surface-3: #232f33;
  --border: #29353a;
  --border-soft: #202a2d;
  --text: #eaf3ef;
  --text-dim: #8ba09c;
  --text-mute: #5f7370;
  --accent: #34e27f;
  --accent-ink: #04140b;
  --accent-soft: rgba(52,226,127,.14);
  --danger: #ff5470;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --glow: 0 0 0 1px rgba(52,226,127,.35), 0 8px 24px rgba(52,226,127,.18);
  color-scheme: dark;
}

/* ---------- 밝고 미니멀 (화이트 + 블루) ---------- */
[data-theme="light"] {
  --bg: #eef2f8;
  --bg-grad: linear-gradient(180deg, #f5f8fd 0%, #e9eef6 100%);
  --surface: #ffffff;
  --surface-2: #f3f6fb;
  --surface-3: #e9eff7;
  --border: #dde5f0;
  --border-soft: #e9eef5;
  --text: #10203a;
  --text-dim: #61748f;
  --text-mute: #93a3ba;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --accent-soft: rgba(37,99,235,.10);
  --danger: #e11d48;
  --shadow: 0 12px 30px rgba(31,54,102,.12);
  --glow: 0 0 0 1px rgba(37,99,235,.28), 0 10px 24px rgba(37,99,235,.16);
  color-scheme: light;
}

/* ---------- 비비드 (크림 + 오렌지) ---------- */
[data-theme="vivid"] {
  --bg: #f7ecd9;
  --bg-grad: linear-gradient(180deg, #fdf5e6 0%, #f4e5cd 100%);
  --surface: #fffaf1;
  --surface-2: #fdefdb;
  --surface-3: #fbe4c6;
  --border: #efd8b6;
  --border-soft: #f2e2c8;
  --text: #3a2413;
  --text-dim: #8a6a4a;
  --text-mute: #b39a7c;
  --accent: #ff6b35;
  --accent-ink: #fff6ef;
  --accent-soft: rgba(255,107,53,.12);
  --danger: #d7263d;
  --shadow: 0 12px 30px rgba(122,74,30,.16);
  --glow: 0 0 0 1px rgba(255,107,53,.3), 0 10px 24px rgba(255,107,53,.18);
  color-scheme: light;
}

/* ---------- Claude (크림 + 코랄 · awesome-design-md) ---------- */
[data-theme="claude"] {
  --bg: #faf9f5;
  --bg-grad: linear-gradient(180deg, #faf9f5 0%, #f3ede1 100%);
  --surface: #fffdf9;
  --surface-2: #f5f0e8;
  --surface-3: #efe9de;
  --border: #e6dfd8;
  --border-soft: #ece7df;
  --text: #141413;
  --text-dim: #6c6a64;
  --text-mute: #8e8b82;
  --accent: #cc785c;
  --accent-ink: #ffffff;
  --accent-soft: rgba(204,120,92,.12);
  --danger: #c64545;
  --shadow: 0 12px 30px rgba(60,42,30,.10);
  --glow: 0 0 0 1px rgba(204,120,92,.28), 0 10px 24px rgba(204,120,92,.16);
  color-scheme: light;
}
/* Claude 에디토리얼 보이스 — 헤더에 세리프 */
[data-theme="claude"] .app-header h1,
[data-theme="claude"] .sheet-head h2,
[data-theme="claude"] .empty h3,
[data-theme="claude"] .stat-title {
  font-family: "Copernicus", Georgia, "Times New Roman", "Nanum Myeongjo", "Batang", serif;
  letter-spacing: -0.01em;
}

/* ---------- Nike (블랙 + 볼트 · Run Club 스포츠 · awesome-design-md) ---------- */
[data-theme="nike"] {
  --bg: #111111;
  --bg-grad: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
  --surface: #1b1b1b;
  --surface-2: #242424;
  --surface-3: #2d2d2d;
  --border: #343434;
  --border-soft: #282828;
  --text: #ffffff;
  --text-dim: #a5a5a7;
  --text-mute: #707072;
  --accent: #cdfe00;
  --accent-ink: #111111;
  --accent-soft: rgba(205,254,0,.12);
  --danger: #ff4438;
  --shadow: 0 10px 30px rgba(0,0,0,.5);
  --glow: 0 0 0 1px rgba(205,254,0,.35), 0 8px 24px rgba(205,254,0,.18);
  color-scheme: dark;
}
/* Nike 헤드라인 보이스 — Futura ND 스펙 (컨덴스드 블랙 · 대문자 · 자간 0 · 타이트 행간)
   라틴/숫자 = Anton, 한글 = Black Han Sans */
[data-theme="nike"] .app-header h1,
[data-theme="nike"] .sheet-head h2,
[data-theme="nike"] .empty h3,
[data-theme="nike"] .stat-title {
  font-family: var(--font-display);
  font-weight: 900; font-style: normal;
  letter-spacing: 0; line-height: 1.05; text-transform: uppercase;
}

/* ---------- Linear (다크 + 인디고 · SaaS 슬릭 · awesome-design-md) ---------- */
[data-theme="linear"] {
  --bg: #08090a;
  --bg-grad: radial-gradient(120% 80% at 50% -10%, #191b2b 0%, #08090a 55%);
  --surface: #141517;
  --surface-2: #1b1d20;
  --surface-3: #232529;
  --border: #2a2d34;
  --border-soft: #1f2126;
  --text: #f7f8f8;
  --text-dim: #8a8f98;
  --text-mute: #62666d;
  --accent: #5e6ad2;
  --accent-ink: #ffffff;
  --accent-soft: rgba(94,106,210,.16);
  --danger: #eb5757;
  --shadow: 0 10px 30px rgba(0,0,0,.5);
  --glow: 0 0 0 1px rgba(94,106,210,.4), 0 8px 24px rgba(94,106,210,.25);
  --radius: 12px; --radius-sm: 8px;
  color-scheme: dark;
}

/* ---------- Tesla (화이트 + 건메탈 · 프리미엄 미니멀 · awesome-design-md) ---------- */
[data-theme="tesla"] {
  --bg: #ffffff;
  --bg-grad: linear-gradient(180deg, #ffffff 0%, #f4f4f4 100%);
  --surface: #ffffff;
  --surface-2: #f4f4f4;
  --surface-3: #ebebec;
  --border: #e2e3e4;
  --border-soft: #ededee;
  --text: #171a20;
  --text-dim: #5c5e62;
  --text-mute: #8e8e8e;
  --accent: #3e6ae1;
  --accent-ink: #ffffff;
  --accent-soft: rgba(62,106,225,.10);
  --danger: #e82127;
  --shadow: 0 12px 30px rgba(23,26,32,.08);
  --glow: 0 0 0 1px rgba(62,106,225,.28), 0 10px 24px rgba(62,106,225,.16);
  --radius: 10px; --radius-sm: 7px;
  color-scheme: light;
}
/* Tesla 타이포 보이스 — 와이드 트래킹 */
[data-theme="tesla"] .app-header h1,
[data-theme="tesla"] .sheet-head h2,
[data-theme="tesla"] .empty h3,
[data-theme="tesla"] .stat-title {
  font-weight: 700; letter-spacing: 0.06em;
}

/* ---------- Vercel (모노크롬 · 초미니멀 · awesome-design-md) ---------- */
[data-theme="vercel"] {
  --bg: #fafafa;
  --bg-grad: linear-gradient(180deg, #ffffff 0%, #f5f5f5 100%);
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --surface-3: #efefef;
  --border: #eaeaea;
  --border-soft: #f0f0f0;
  --text: #000000;
  --text-dim: #666666;
  --text-mute: #999999;
  --accent: #171717;
  --accent-ink: #ffffff;
  --accent-soft: rgba(0,0,0,.06);
  --danger: #ee0000;
  --shadow: 0 8px 24px rgba(0,0,0,.08);
  --glow: 0 0 0 1px rgba(0,0,0,.30), 0 8px 20px rgba(0,0,0,.12);
  --radius: 10px; --radius-sm: 6px;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; overflow: hidden; } /* 셸 고정 — 페이지 자체가 당겨지지 않게(탭바 안 사라짐) */
body {
  font-family: var(--font);
  background: #05080a;
  color: var(--text);
  overscroll-behavior: none;
  position: fixed; inset: 0; /* iOS/안드로이드 러버밴드로 body가 끌려가는 것 차단 */
}
button { font-family: inherit; cursor: pointer; }
input, select, button { font-family: inherit; }

/* ---------- 디바이스 프레임 ---------- */
.device {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 0;
}
@media (min-width: 620px) {
  .device { padding: 28px 16px; background: #05080a; }
  .app {
    height: min(880px, calc(100dvh - 56px));
    border-radius: 34px;
    border: 1px solid #1b2427;
    box-shadow: 0 30px 80px rgba(0,0,0,.6), inset 0 0 0 6px #0a0d0f;
    overflow: hidden;
  }
}

.app {
  position: relative;
  width: 100%;
  max-width: var(--maxw);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  background-image: var(--bg-grad);
  transition: background .3s var(--ease), color .3s var(--ease);
}

.screen {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: none; /* 맨 위에서 더 당겨도 앱이 밀리며 하단 탭바가 사라지지 않게 */
  padding: 0 0 calc(var(--tab-h) + 20px);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }

/* ---------- 상단 헤더 ---------- */
.app-header {
  position: sticky; top: 0; z-index: 20;
  padding: max(14px, env(safe-area-inset-top)) 20px 12px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 12px;
}
.app-header .h-titles { flex: 1; min-width: 0; }
.app-header h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.app-header .h-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--text-dim); }
.app-header .h-btn {
  width: 40px; height: 40px; flex: none;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  display: grid; place-items: center; font-size: 17px;
}
.app-header .h-btn:active { transform: scale(.94); }

.section-pad { padding: 16px 20px 0; }

/* ---------- 탭바 ---------- */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
}
.tab {
  flex: 1; border: 0; background: none; color: var(--text-mute);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 11px; font-weight: 700; letter-spacing: -.01em;
  transition: color .2s;
}
.tab .ic { font-size: 21px; line-height: 1; }
.tab.active { color: var(--accent); }
.tab.active .ic { filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent) 60%, transparent)); }

/* 모바일: 탭바를 '보이는 화면' 맨 아래에 고정 — 주소창이 접히거나 위로 드래그해도 절대 안 사라짐.
   (데스크톱 폰프레임 모드에서는 위 기본값 position:absolute 유지 — 프레임 안에 붙어야 하므로) */
@media (max-width: 619px) {
  .tabbar {
    position: fixed;
    left: 50%; right: auto;
    transform: translateX(-50%);
    width: 100%; max-width: var(--maxw);
  }
}

/* ---------- 카드 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.card + .card { margin-top: 12px; }

.muted { color: var(--text-dim); }
.mute2 { color: var(--text-mute); }
.center { text-align: center; }

/* ---------- 버튼 ---------- */
.btn {
  appearance: none; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 15px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .08s, background .2s, border-color .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--accent); color: var(--accent-ink); border-color: transparent;
  box-shadow: var(--glow);
}
.btn-ghost { background: transparent; }
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 15px 18px; font-size: 16px; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); background: transparent; }

.fab-add {
  width: 100%;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, var(--border));
  background: var(--accent-soft); color: var(--accent);
  border-radius: var(--radius); padding: 16px; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.fab-add:active { transform: scale(.98); }

/* 슬라이더(레인지) — 알림 소리·진동 크기 */
input[type="range"].rng { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 5px; background: var(--surface-3); outline: none; margin: 4px 0; }
input[type="range"].rng::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.4); cursor: pointer; }
input[type="range"].rng::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); cursor: pointer; }

/* ---------- 칩 / 뱃지 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface-2);
  font-size: 12.5px; font-weight: 700; color: var(--text-dim);
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 800; padding: 3px 9px;
  border-radius: var(--radius-pill);
}

/* ---------- 볼륨 히어로 숫자 ---------- */
.vhero { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.vhero .big {
  font-size: 34px; font-weight: 400; letter-spacing: .01em;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.vhero .unit { font-size: 15px; font-weight: 800; color: var(--text-dim); }
.vhero .paren { font-size: 14px; color: var(--text-dim); font-weight: 700; }
.delta { font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; gap: 3px; }
.delta.up { color: var(--accent); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--text-mute); }

/* =========================================================
   운동 탭 (홈)
   ========================================================= */
.today-summary { margin: 4px 20px 0; }
.ex-list { padding: 14px 20px 0; display: flex; flex-direction: column; gap: 12px; }

.ex-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 15px;
  display: flex; align-items: center; gap: 13px;
  transition: transform .08s, border-color .2s;
  cursor: pointer; -webkit-user-select: none; user-select: none;
}
.ex-card:active { transform: scale(.985); }
/* 카드에서 바로 종목 빼기 */
.ex-del {
  flex: none; width: 30px; height: 30px; margin: -4px -6px -4px -2px;
  border: none; border-radius: 9px; background: transparent;
  color: var(--text-mute); font-size: 14px; font-weight: 800;
  display: grid; place-items: center;
}
.ex-del:active { background: var(--surface-3); color: var(--danger); }
/* 분할 카드 (Fleek 스타일) — 눌러서 오늘 시작 */
.routine-list { display: flex; flex-direction: column; gap: 10px; }
.routine-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px 15px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); transition: transform .08s; color: var(--text);
  font-family: var(--font);
}
.routine-card:active { transform: scale(.985); }
.rc-ico { width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); display: grid; place-items: center; font-size: 17px; flex: none; }
.rc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rc-body b { font-size: 15px; font-weight: 800; }
.rc-body small { color: var(--text-dim); font-size: 12px; }
.rc-last { flex: none; font-size: 12px; color: var(--text-mute); font-weight: 700; }
.ex-card .ex-icon {
  width: 44px; height: 44px; border-radius: 13px; flex: none;
  display: grid; place-items: center; font-size: 22px;
  background: var(--surface-2); border: 1px solid var(--border);
}
/* 운동 일러스트 (Everkinetic 선화 · CSS mask에 부위색) */
.ex-art {
  display: block; width: 84%; height: 84%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
}
.ex-art-card { padding: 12px 14px; }
.ex-art-stage { position: relative; height: 158px; }
.ex-art-stage .ex-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.ex-art-stage .pose-a { animation: ex-pose-a 2.6s ease-in-out infinite; }
.ex-art-stage .pose-b { opacity: 0; animation: ex-pose-b 2.6s ease-in-out infinite; }
@keyframes ex-pose-a { 0%, 42% { opacity: 1; } 54%, 88% { opacity: 0; } 100% { opacity: 1; } }
@keyframes ex-pose-b { 0%, 42% { opacity: 0; } 54%, 88% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .ex-art-stage .pose-a { animation: none; opacity: 0; }
  .ex-art-stage .pose-b { animation: none; opacity: 1; }
}
/* 운동 세션(시작~완료) 행 */
.session-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.btn-session {
  border: none; border-radius: 11px; padding: 10px 16px;
  font-weight: 800; font-size: 14px; font-family: var(--font);
  background: var(--accent); color: var(--accent-ink); flex: none;
}
.btn-session.finish { background: var(--danger); color: #fff; }
.btn-session.ghost { background: var(--surface-3); color: var(--text); font-weight: 700; }
.sess-clock { font-size: 13.5px; font-weight: 700; color: var(--text-dim); }
.sess-clock b {
  color: var(--text); font-family: var(--font-num); font-weight: 400;
  font-size: 18px; letter-spacing: .02em; font-variant-numeric: tabular-nums;
}
.session-row.on .sess-clock b { color: var(--accent); }

.ex-card .ex-body { flex: 1; min-width: 0; }
.ex-card .ex-name { font-size: 15.5px; font-weight: 800; letter-spacing: -.01em; }
.ex-card .ex-meta { margin-top: 3px; font-size: 12px; color: var(--text-dim); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ex-card .ex-vol { text-align: right; flex: none; }
.ex-card .ex-vol .n { font-size: 16px; font-weight: 400; font-family: var(--font-num); letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.ex-card .ex-vol .s { font-size: 11px; color: var(--text-mute); }
.ex-card .prog {
  height: 5px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: 8px;
}
.ex-card .prog > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s var(--ease); }

.empty {
  margin: 40px 24px; text-align: center; color: var(--text-dim);
}
.empty .em-emoji { font-size: 46px; }
.empty h3 { margin: 12px 0 4px; color: var(--text); font-size: 17px; }

/* =========================================================
   홈 히어로 (첫 화면 상단 — 주간 진척) · 다른 운동앱 홈 패턴
   ========================================================= */
.home-hero {
  position: relative; overflow: hidden;
  margin: 10px 20px 2px; padding: 20px 20px 18px;
  border-radius: 20px; border: 1px solid var(--border);
  background:
    radial-gradient(130% 150% at 88% -10%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 58%),
    var(--surface);
}
.hh-greet { font-size: 14.5px; font-weight: 700; color: var(--text-dim); }
.hh-greet b { color: var(--text); }
.hh-vol-wrap { margin-top: 12px; }
.hh-label { font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-mute); }
.hh-vol { display: flex; align-items: baseline; gap: 6px; margin-top: 3px; }
.hh-big {
  font-size: 46px; font-weight: 900; line-height: .95; color: var(--accent);
  font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -.015em;
}
.hh-unit { font-size: 17px; font-weight: 800; color: var(--text-dim); }
.hh-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 16px; }
.hh-day { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hh-day i {
  width: 100%; height: 28px; border-radius: 9px;
  background: var(--surface-3); border: 1px solid var(--border-soft);
  transition: transform .12s;
}
.hh-day.on i {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.hh-day.today i { outline: 2px solid var(--accent); outline-offset: 2px; }
.hh-day.today.on i { outline-color: color-mix(in srgb, var(--accent) 55%, var(--text)); }
.hh-day.future i { opacity: .45; }
.hh-day em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--text-mute); }
.hh-day.today em { color: var(--accent); }
.hh-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.hh-stat {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 13px; padding: 11px 8px 9px; text-align: center;
}
.hh-stat b { display: block; font-size: 19px; font-weight: 900; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.hh-stat small { display: block; margin-top: 3px; font-size: 11px; font-weight: 700; color: var(--text-mute); }
/* 새 사용자(기록 0) — 초라한 이모지 대신 볼드 동기부여 */
.home-hero.fresh { text-align: left; }
.home-hero .hh-kicker { font-size: 12px; font-weight: 900; letter-spacing: .2em; color: var(--accent); }
.home-hero .hh-title { margin: 10px 0 8px; font-size: 27px; font-weight: 900; line-height: 1.14; color: var(--text); letter-spacing: -.01em; }
.home-hero .hh-fresh-sub { margin: 0 0 2px; font-size: 13px; font-weight: 600; color: var(--text-dim); line-height: 1.5; }
[data-theme="nike"] .home-hero .hh-title { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0; }

/* =========================================================
   운동 상세 (세트 입력)
   ========================================================= */
.detail-top { padding: 14px 20px 0; }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tag-select {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 13px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; font-weight: 700; color: var(--text);
}
.tag-select .lb { color: var(--text-mute); font-weight: 700; }
.tag-select:active { transform: scale(.97); }
.tag-select.rest-on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.tag-select.rest-on .lb { color: var(--accent); }

.unit-toggle {
  display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface); overflow: hidden; padding: 3px;
}
.unit-toggle button {
  border: 0; background: none; color: var(--text-dim);
  padding: 6px 14px; font-size: 13px; font-weight: 800; border-radius: var(--radius-pill);
}
.unit-toggle button.on { background: var(--accent); color: var(--accent-ink); }

.yt-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 13px; border-radius: var(--radius-pill);
  border: 1px solid color-mix(in srgb, #ff0033 30%, var(--border));
  background: color-mix(in srgb, #ff0033 8%, transparent); color: #ff5470;
  font-size: 13px; font-weight: 800;
}

/* 세트 테이블 */
.set-table { padding: 16px 20px 0; }
.set-head, .set-row {
  display: grid; grid-template-columns: 34px 1fr 78px 62px 44px;
  align-items: center; gap: 8px;
}
.set-head { padding: 0 6px 8px; font-size: 11.5px; font-weight: 800; color: var(--text-mute); letter-spacing: .02em; }
.set-head .r { text-align: center; }
.set-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px 8px; margin-bottom: 9px;
  transition: opacity .2s, border-color .2s;
}
.set-row.undone { opacity: .58; }
.set-row .snum {
  width: 26px; height: 26px; margin: 0 auto; border-radius: 8px;
  display: grid; place-items: center; font-size: 13px; font-weight: 800;
  background: var(--surface-2); color: var(--text-dim);
}
.set-row .stype {
  border: 0; background: none; font-weight: 800; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px; color: var(--text); padding: 4px 2px;
  max-width: 100%;
}
.set-row .stype .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.num-input {
  width: 100%; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); border-radius: 9px; padding: 9px 6px; text-align: center;
  font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.num-input:focus { outline: none; border-color: var(--accent); }
.num-cell { position: relative; }
.num-cell .suffix { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 10px; color: var(--text-mute); font-weight: 700; pointer-events: none; }
.chk {
  width: 30px; height: 30px; margin: 0 auto; border-radius: 9px;
  border: 1.5px solid var(--border); background: var(--surface-2);
  display: grid; place-items: center; color: var(--text-mute); font-size: 15px;
}
.chk.on { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.row-actions { display: flex; justify-content: flex-end; padding: 2px 6px 0; }
.set-del { border: 0; background: none; color: var(--text-mute); font-size: 12px; font-weight: 700; padding: 6px; }
.set-del:active { color: var(--danger); }

/* =========================================================
   종목 선택 시트 / 바텀시트
   ========================================================= */
.sheet-scrim {
  position: absolute; inset: 0; z-index: 60;
  background: rgba(0,0,0,.5); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .25s var(--ease);
}
.sheet-scrim.show { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 61;
  max-height: 86%; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--border);
  transform: translateY(100%); transition: transform .3s var(--ease);
  box-shadow: 0 -20px 50px rgba(0,0,0,.4);
}
.sheet.show { transform: translateY(0); }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--border); margin: 10px auto 4px; }
.sheet-head { padding: 6px 20px 12px; display: flex; align-items: center; gap: 10px; }
.sheet-head h2 { margin: 0; font-size: 18px; font-weight: 800; flex: 1; }
.sheet-close { border: 0; background: var(--surface-2); color: var(--text-dim); width: 32px; height: 32px; border-radius: 9px; font-size: 16px; }
.sheet-body { overflow-y: auto; padding: 0 20px 24px; scrollbar-width: none; }
.sheet-body::-webkit-scrollbar { display: none; }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 13px; margin-bottom: 12px;
}
.search input { flex: 1; border: 0; background: none; color: var(--text); font-size: 15px; }
.search input:focus { outline: none; }

.filter-row { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: none; padding: 7px 13px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim);
  font-size: 13px; font-weight: 700; white-space: nowrap;
}
.filter-chip.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

.pick-group-title { font-size: 12px; font-weight: 800; color: var(--text-mute); margin: 14px 4px 8px; letter-spacing: .02em; }
.recent-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 4px; scrollbar-width: none; }
.recent-row::-webkit-scrollbar { display: none; }
.recent-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 9px 13px; border-radius: var(--radius-pill);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); background: var(--accent-soft);
  color: var(--text); font-size: 13px; font-weight: 700;
}
.recent-chip:active { transform: scale(.96); }
.pick-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px; border: 1px solid var(--border); background: var(--surface-2);
  border-radius: 13px; margin-bottom: 8px; color: var(--text); text-align: left;
}
.pick-item:active { transform: scale(.99); border-color: var(--accent); }
.pick-item .pi-ic { width: 38px; height: 38px; border-radius: 11px; background: var(--surface-3); display: grid; place-items: center; font-size: 19px; flex: none; }
.pick-item .pi-body { flex: 1; min-width: 0; }
.pick-item .pi-name { font-size: 15px; font-weight: 800; }
.pick-item .pi-sub { font-size: 12px; color: var(--text-dim); margin-top: 1px; }
.pick-item .pi-yt { color: #ff5470; font-size: 18px; padding: 4px; }
.custom-tag { display: inline-block; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; vertical-align: middle; }

/* 운동 직접 추가 폼 */
.cx-label { font-size: 12px; font-weight: 800; color: var(--text-mute); margin: 4px 2px 8px; letter-spacing: .02em; }
.cx-manage { display: flex; flex-direction: column; gap: 6px; }
.cx-mrow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 11px; font-size: 14px; font-weight: 600; }
.cx-mrow .cx-mname { flex: 1; min-width: 0; }
.cx-del { flex: none; width: 30px; height: 30px; border: 1px solid var(--border); background: var(--surface); color: var(--text-mute); border-radius: 8px; font-size: 13px; }
.cx-del:active { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }

/* 옵션 리스트(제조사/그립/타입 선택 시트) */
.opt-list { display: flex; flex-direction: column; gap: 7px; }
.opt {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 13px 14px; border: 1px solid var(--border); background: var(--surface-2);
  border-radius: 13px; color: var(--text); text-align: left; font-size: 15px; font-weight: 700;
}
.opt .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.opt .chk-mark { margin-left: auto; color: var(--accent); font-weight: 900; }
.opt .opt-desc { font-size: 11.5px; color: var(--text-dim); font-weight: 600; margin-top: 2px; }

/* =========================================================
   기록 탭 (캘린더 + 통계)
   ========================================================= */
.cal {
  margin: 14px 20px 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px;
}
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head .m { font-size: 16px; font-weight: 800; }
.cal-nav { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); width: 32px; height: 32px; border-radius: 9px; font-size: 15px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 800; color: var(--text-mute); padding: 4px 0; }
.cal-cell {
  aspect-ratio: 1; border-radius: 10px; border: 0; background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text); font-size: 13px; font-weight: 700; position: relative;
}
.cal-cell.other { color: var(--text-mute); opacity: .5; }
.cal-cell.today { outline: 1.5px solid var(--accent); outline-offset: -1.5px; }
.cal-cell.sel { background: var(--accent); color: var(--accent-ink); }
.cal-cell.sel .cal-dot { background: var(--accent-ink); }
.cal-cell.has { background: var(--accent-soft); }
.cal-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

.stat-block { margin: 16px 20px 0; }
.stat-title { font-size: 13px; font-weight: 800; color: var(--text-dim); margin: 0 4px 10px; letter-spacing: .01em; display: flex; align-items: center; gap: 7px; }

.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px;
}
.kpi .k-label { font-size: 12px; color: var(--text-dim); font-weight: 700; }
.kpi .k-value { font-size: 24px; font-weight: 850; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .k-value small { font-size: 13px; font-weight: 800; color: var(--text-dim); }
.kpi .k-sub { font-size: 11.5px; color: var(--text-mute); margin-top: 2px; }

.pr-row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--border-soft); }
.pr-row:last-child { border-bottom: 0; }
.pr-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-size: 17px; flex: none; }
.pr-name { flex: 1; font-size: 14px; font-weight: 700; }
.pr-val { font-weight: 850; font-variant-numeric: tabular-nums; }
.pr-val small { color: var(--text-dim); font-weight: 700; font-size: 12px; }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bar-row .bl { width: 42px; font-size: 12px; font-weight: 700; color: var(--text-dim); flex: none; }
.bar-track { flex: 1; height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; }
.bar-row .bv { width: 46px; text-align: right; font-size: 11.5px; font-weight: 800; color: var(--text-dim); font-variant-numeric: tabular-nums; flex: none; }

/* 차트 svg */
.chart-wrap { width: 100%; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }

/* =========================================================
   설정 탭
   ========================================================= */
.set-group { margin: 16px 20px 0; }
.set-group-title { font-size: 12px; font-weight: 800; color: var(--text-mute); margin: 0 4px 8px; letter-spacing: .03em; text-transform: uppercase; }
.set-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.set-item { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--border-soft); }
.set-item:last-child { border-bottom: 0; }
.set-item .si-ic { font-size: 18px; width: 24px; text-align: center; }
.set-item .si-label { flex: 1; font-size: 15px; font-weight: 600; }
.set-item .si-value { color: var(--text-dim); font-size: 14px; font-weight: 700; }

.seg {
  display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface-2); padding: 3px;
}
.seg button { border: 0; background: none; color: var(--text-dim); padding: 7px 14px; font-size: 13px; font-weight: 800; border-radius: var(--radius-pill); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }

.theme-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.theme-card {
  border: 1.5px solid var(--border); border-radius: 14px; padding: 10px; background: var(--surface);
  text-align: center; color: var(--text);
}
.theme-card.on { border-color: var(--accent); box-shadow: var(--glow); }
.theme-swatch { height: 46px; border-radius: 10px; margin-bottom: 8px; position: relative; overflow: hidden; border: 1px solid rgba(0,0,0,.15); }
.theme-swatch .s-accent { position: absolute; right: 8px; bottom: 8px; width: 16px; height: 16px; border-radius: 50%; }
.theme-card .tc-name { font-size: 12px; font-weight: 800; }

.name-input {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 10px; padding: 9px 12px; font-size: 14px; font-weight: 700; text-align: right; width: 130px;
}
.name-input:focus { outline: none; border-color: var(--accent); }

.app-foot { text-align: center; color: var(--text-mute); font-size: 11.5px; padding: 24px 20px; }

/* ---------- 토스트 ---------- */
#toast-root { position: absolute; left: 0; right: 0; bottom: calc(var(--tab-h) + 20px); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: var(--text); color: var(--bg); font-size: 13px; font-weight: 800;
  padding: 11px 18px; border-radius: var(--radius-pill); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(10px); transition: all .25s var(--ease);
  max-width: 80%;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* =========================================================
   v2 — 피드 / 랭킹 / 인증 사진 / 계정
   ========================================================= */
.seg-tabs { display: flex; gap: 6px; margin: 14px 20px 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 4px; }
.seg-tabs button { flex: 1; border: 0; background: none; color: var(--text-dim); padding: 9px; font-size: 14px; font-weight: 800; border-radius: var(--radius-pill); }
.seg-tabs button.on { background: var(--accent); color: var(--accent-ink); }

/* 피드 카드 */
.feed { padding: 14px 20px 0; display: flex; flex-direction: column; gap: 14px; }
.post {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.post-head { display: flex; align-items: center; gap: 11px; padding: 13px 15px; }
.post-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 850; font-size: 15px; flex: none; }
.post-who { flex: 1; min-width: 0; }
.post-who .pn { font-size: 14px; font-weight: 800; }
.post-who .pd { font-size: 12px; color: var(--text-dim); }
.post-vol { text-align: right; }
.post-vol .n { font-size: 15px; font-weight: 850; font-variant-numeric: tabular-nums; }
.post-vol .s { font-size: 11px; color: var(--text-mute); }

.post-photos { display: grid; grid-auto-flow: column; grid-auto-columns: 82%; gap: 8px; overflow-x: auto; padding: 0 15px 12px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.post-photos::-webkit-scrollbar { display: none; }
.post-photo { position: relative; scroll-snap-align: center; border-radius: 13px; overflow: hidden; aspect-ratio: 4/3; background: var(--surface-2); }
.post-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-photo .rm { position: absolute; top: 7px; right: 7px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; }

.post-lifts { display: flex; gap: 7px; flex-wrap: wrap; padding: 2px 15px 14px; }
.lift-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 700; }
.lift-chip b { font-variant-numeric: tabular-nums; }

.post-add {
  border-top: 1px solid var(--border-soft); display: flex; gap: 8px; padding: 11px 15px;
}
.post-add button { flex: 1; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 10px; padding: 10px; font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.post-add button.primary { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }

.feed-peer-label { text-align: center; font-size: 11.5px; color: var(--text-mute); font-weight: 700; margin: 6px 0 -4px; }

/* 랭킹 (상위 %) */
.rank-hero { margin: 14px 20px 0; }
.rank-hero .card { background: linear-gradient(135deg, var(--accent-soft), transparent); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.rank-big { display: flex; align-items: baseline; gap: 6px; }
.rank-big .pct { font-size: 40px; font-weight: 400; letter-spacing: .01em; font-family: var(--font-num); color: var(--accent); font-variant-numeric: tabular-nums; }
.rank-big .lb { font-size: 15px; font-weight: 800; color: var(--text-dim); }

.rank-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px; }
.rank-card + .rank-card { margin-top: 10px; }
.rank-top { display: flex; align-items: center; gap: 11px; }
.rank-ic { width: 38px; height: 38px; border-radius: 11px; background: var(--surface-2); display: grid; place-items: center; font-size: 19px; flex: none; }
.rank-name { flex: 1; }
.rank-name .rn { font-size: 15px; font-weight: 800; }
.rank-name .rm { font-size: 12px; color: var(--text-dim); }
.level-badge { padding: 5px 11px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 850; }
.lv-0 { background: rgba(154,167,176,.18); color: #9aa7b0; }
.lv-1 { background: rgba(77,214,193,.16); color: #4dd6c1; }
.lv-2 { background: rgba(124,156,255,.16); color: #7c9cff; }
.lv-3 { background: rgba(181,124,255,.18); color: #b57cff; }
.lv-4 { background: rgba(255,207,51,.18); color: #ffcf33; }

.rank-bar { margin-top: 12px; }
.rank-scale { position: relative; height: 8px; border-radius: 5px; background: linear-gradient(90deg,#9aa7b0,#4dd6c1,#7c9cff,#b57cff,#ffcf33); opacity: .35; }
.rank-scale .mark { position: absolute; top: -4px; width: 4px; height: 16px; border-radius: 3px; background: var(--text); box-shadow: 0 0 0 3px var(--surface); }
.rank-scale-labels { display: flex; justify-content: space-between; margin-top: 8px; font-size: 10px; font-weight: 700; color: var(--text-mute); }
.rank-next { margin-top: 10px; font-size: 12px; color: var(--text-dim); font-weight: 700; }
.rank-next b { color: var(--accent); }
.rank-topline { margin-top: 4px; font-size: 12.5px; font-weight: 800; }
.rank-topline .u { color: var(--accent); }

.rank-note { margin: 14px 20px 0; font-size: 11.5px; color: var(--text-mute); line-height: 1.5; }
.rank-empty { margin: 16px 20px; }

/* 계정 (설정) */
.account-hero { display: flex; align-items: center; gap: 12px; }
.account-hero .ah-ic { width: 44px; height: 44px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 22px; flex: none; }
.account-hero .ah-body { flex: 1; }
.demo-note { display: inline-block; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 5px; background: var(--surface-3); color: var(--text-dim); margin-left: 6px; vertical-align: middle; }

/* =========================================================
   폴리시 — 루틴 · 직전기록 · 휴식타이머
   ========================================================= */
/* 종목추가 + 루틴 버튼 행 */
.add-row { display: flex; gap: 10px; }
.add-row .fab-add { flex: 1; }
.fab-sub {
  flex: none; border-style: solid;
  border-color: var(--border); background: var(--surface); color: var(--text);
}

/* 루틴 시트 */
.routine-list { display: flex; flex-direction: column; gap: 9px; }
.routine-item { display: flex; align-items: stretch; gap: 8px; }
.routine-load {
  flex: 1; display: flex; align-items: center; gap: 12px; text-align: left;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 13px; padding: 12px 13px;
}
.routine-load:active { transform: scale(.99); border-color: var(--accent); }
.routine-load .ri-emoji { font-size: 18px; min-width: 30px; }
.routine-load .ri-body { flex: 1; min-width: 0; }
.routine-load .ri-name { font-size: 15px; font-weight: 800; }
.routine-load .ri-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.routine-del, .routine-edit { flex: none; width: 44px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-mute); border-radius: 13px; font-size: 15px; }
.routine-del:active { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.routine-edit:active { border-color: var(--accent); }

/* 분할 편집기 — 담김 토글 */
.split-pick { justify-content: flex-start; }
.split-pick .split-check {
  margin-left: auto; flex: none; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; font-size: 16px; font-weight: 800;
  background: var(--surface-3); color: var(--text-mute); border: 1px solid var(--border);
}
.split-pick.on { border-color: var(--accent); background: var(--accent-soft); }
.split-pick.on .split-check { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* 직전 기록 힌트 */
.prev-hint {
  background: var(--surface-2); border: 1px dashed var(--border);
  border-radius: 12px; padding: 9px 12px; margin-bottom: 12px;
  font-size: 12.5px; font-weight: 700; color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.prev-hint b { color: var(--text); }

/* 휴식바가 떠 있을 때: 스크롤 하단 여백을 늘려 '종목 추가' 버튼이 가려지지 않게 */
.screen { transition: padding-bottom .25s ease; }
body.rest-on .screen { padding-bottom: calc(var(--tab-h) + 84px); }
/* 토스트가 휴식바(카운트다운)를 가리지 않도록 위로 올림 */
body.rest-on #toast-root { bottom: calc(var(--tab-h) + 74px); }

/* 휴식 타이머 (플로팅) */
.rest-bar {
  position: absolute; left: 12px; right: 12px; bottom: calc(var(--tab-h) + 14px); z-index: 40;
  display: flex; align-items: center; gap: 8px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--border); border-radius: 16px; padding: 8px 10px;
  box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transform: translateY(20px); opacity: 0; transition: transform .28s var(--ease), opacity .28s var(--ease);
}
.rest-bar.show { transform: translateY(0); opacity: 1; }
.rest-bar.done { border-color: var(--accent); box-shadow: var(--glow); }
.rest-adj {
  flex: none; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 10px; padding: 8px 10px; font-size: 13px; font-weight: 800;
}
.rest-adj:active { transform: scale(.94); }
.rest-mid { flex: 1; min-width: 0; }
.rest-track { height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.rest-fill { display: block; height: 100%; background: var(--accent); border-radius: 3px; width: 100%; transition: width 1s linear; }
.rest-bar.done .rest-fill { width: 100% !important; }
.rest-time { text-align: center; font-size: 13px; margin-top: 4px; color: var(--text-dim); font-weight: 700; }
.rest-time b { color: var(--text); font-variant-numeric: tabular-nums; font-size: 15px; }
.rest-skip { flex: none; width: 34px; height: 34px; border: 0; background: var(--surface-2); color: var(--text-mute); border-radius: 10px; font-size: 15px; }
.rest-skip:active { color: var(--danger); }

/* ---------- 유틸 ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap12 { gap: 12px; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.wrap { flex-wrap: wrap; }
.fade-in { animation: fade .3s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pop { animation: pop .3s var(--ease); }
@keyframes pop { 0% { transform: scale(.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ── 루틴 훈련 유형 (스트렝스/근비대/근지구력) ── */
.rtype-title { font-size: 12.5px; font-weight: 800; color: var(--text); margin: 4px 0 8px; }
.rtype-title .muted { font-weight: 600; font-size: 11.5px; }
.rtype-pick { display: flex; flex-direction: column; gap: 6px; }
.rtype-opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  text-align: left; padding: 9px 12px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface-2); cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.rtype-opt:active { transform: scale(.99); }
.rtype-opt b { font-size: 13.5px; font-weight: 800; color: var(--text); }
.rtype-opt small { font-size: 11px; color: var(--text-dim); }
.rtype-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.rtype-opt.on b { color: var(--text); }
.rtype-badge {
  display: inline-flex; align-items: center; gap: 3px; flex: none;
  font-size: 10.5px; font-weight: 800; line-height: 1;
  padding: 3px 7px; border-radius: 999px; border: 1px solid; white-space: nowrap;
  vertical-align: middle; margin-left: 2px;
}
.rc-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rc-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ri-name .rtype-badge { margin-left: 5px; }
