:root {
  --bg: #F8FAFB;
  --surface: #FFFFFF;
  --surface-alt: #F1F5F4;
  --primary: #10B981;
  --primary-hover: #059669;
  --primary-light: #D1FAE5;
  --accent: #FF6B6B;
  --accent-light: #FFE4E4;
  --text-primary: #1A1D21;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --border: #E8ECEF;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --font: 'Pretendard Variable', system-ui, sans-serif;
  --rest-duration: 90;
  --nav-h: 56px;
  --tab-h: 68px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

button { cursor: pointer; font-family: var(--font); }
button:active { transform: scale(0.97); }
input, select, textarea { font-family: var(--font); }
.hidden { display: none !important; }

.app-wrap {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 20px 100px;
  position: relative;
}

/* ── SHARED COMPONENTS ── */

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 56px;
  border: none;
  border-radius: 28px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #fff;
  font-family: var(--font);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(16,185,129,0.3);
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary.small { height: 44px; border-radius: 22px; font-size: 15px; }

.btn-outline {
  flex: 1;
  height: 15vw;
  border-radius: 7.5vw;
  border: 0.4vw solid var(--border);
  background: var(--surface);
  font-size: 4.3vw;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.2s;
}
.btn-outline:active { background: var(--surface-alt); }

.btn-end {
  flex: 1;
  height: 15vw;
  border-radius: 7.5vw;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 4.3vw;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: transform 0.2s;
}
.btn-end:active { transform: scale(0.97); }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* ── Active Users Banner ── */
.active-banner {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 4vw 5vw;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 5vw;
  display: flex;
  align-items: center;
  gap: 3.5vw;
  overflow: hidden;
}
.active-banner__avatars {
  display: flex;
  flex-shrink: 0;
}
.active-banner__avatar {
  width: 9vw;
  height: 9vw;
  border-radius: 50%;
  border: 0.5vw solid var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4vw;
  margin-left: -2.5vw;
  position: relative;
}
.active-banner__avatar:first-child { margin-left: 0; }
.active-banner__avatar:nth-child(1) { background: linear-gradient(135deg, #10B981, #059669); z-index: 4; }
.active-banner__avatar:nth-child(2) { background: linear-gradient(135deg, #FF6B6B, #E55A5A); z-index: 3; }
.active-banner__avatar:nth-child(3) { background: linear-gradient(135deg, #64748B, #475569); z-index: 2; }
.active-banner__avatar:nth-child(4) { background: linear-gradient(135deg, #10B981, #059669); z-index: 1; }
.active-banner__avatar--float1 { animation: af1 2.4s ease-in-out infinite; }
.active-banner__avatar--float2 { animation: af2 2.8s ease-in-out infinite 0.3s; }
.active-banner__avatar--float3 { animation: af3 2.6s ease-in-out infinite 0.6s; }
.active-banner__avatar--float4 { animation: af4 3.0s ease-in-out infinite 0.15s; }
@keyframes af1 { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-0.8vw)} }
@keyframes af2 { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-1vw)} }
@keyframes af3 { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-0.6vw)} }
@keyframes af4 { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-0.9vw)} }
.active-banner__pulse {
  position: absolute;
  bottom: 0; right: 0;
  width: 3vw; height: 3vw;
  border-radius: 50%;
  background: var(--primary);
  border: 0.4vw solid var(--surface);
  z-index: 5;
  animation: apulse 1.8s ease-in-out infinite;
}
@keyframes apulse { 0%,100%{box-shadow:0 0 0 0 rgba(16,185,129,0.4)} 50%{box-shadow:0 0 0 1.2vw rgba(16,185,129,0)} }
.active-banner__text { flex: 1; min-width: 0; }
.active-banner__title { font-size: 4vw; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.active-banner__sub { font-size: 3.2vw; font-weight: 500; color: var(--text-muted); margin-top: 0.5vw; }
.active-banner__empty { font-size: 3.5vw; color: var(--text-muted); }

/* active-banner — 데스크탑 오버라이드 */
@media (min-width: 600px) {
  .active-banner { padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius); gap: 12px; }
  .active-banner__avatar { width: 32px; height: 32px; font-size: 14px; margin-left: -8px; border-width: 2px; }
  .active-banner__pulse { width: 10px; height: 10px; border-width: 2px; }
  .active-banner__title { font-size: 14px; }
  .active-banner__sub { font-size: 12px; margin-top: 2px; }
  .active-banner__empty { font-size: 13px; }
}
@media (min-width: 1025px) {
  .active-banner { padding: 14px 20px; margin-bottom: 20px; }
  .active-banner__avatar { width: 36px; height: 36px; font-size: 15px; margin-left: -10px; border-width: 2px; }
  .active-banner__title { font-size: 15px; }
  .active-banner__sub { font-size: 13px; }
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5vw 0 6vw;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.progress-track {
  width: 100%;
  height: 1vw;
  background: var(--border);
  border-radius: 0.5vw;
  margin-bottom: 8.5vw;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ── LANDING SCREEN ── */

.screen-landing .container {
  width: 100%;
  min-height: 100vh;
  padding: 48px 24px 32px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.screen-landing .deco-circle {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.06;
  pointer-events: none;
}
.screen-landing .deco-circle-2 {
  position: absolute;
  bottom: 40px;
  left: -80px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.04;
  pointer-events: none;
}

.screen-landing .hero {
  text-align: left;
  padding-top: 40px;
  position: relative;
  z-index: 1;
}

.screen-landing .hero-sub {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1.3;
  margin-bottom: 4px;
}
.screen-landing .hero-title {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: transparent;
  background: linear-gradient(135deg, #10B981 0%, #059669 50%, #FF6B6B 100%);
  -webkit-background-clip: text;
  background-clip: text;
  margin-bottom: 24px;
}

.screen-landing .feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 40px;
}

.screen-landing .feature-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.screen-landing .feature-number {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 8px;
}
.screen-landing .feature-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.screen-landing .feature-desc {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.4;
}

.screen-landing .spacer { flex: 1; }
.screen-landing .login-link {
  text-align: center;
  padding-top: 20px;
  padding-bottom: 16px;
}
.screen-landing .login-link span {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.screen-landing .login-link span strong {
  color: var(--primary);
  font-weight: 600;
}
.screen-landing .app-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
  animation: float 3s ease-in-out infinite;
}
.screen-landing .app-title {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.screen-landing .tagline {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 48px;
}

/* ── Live Badge (active users) ── */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-hover);
  margin-bottom: 32px;
  animation: fadeInUp 0.4s ease;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}
.live-badge strong { color: var(--primary-hover); }
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary);
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.subtext-muted {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 12px; color: var(--text-muted); margin-top: 8px;
}
.mini-dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--primary); flex-shrink: 0;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 4px 20px rgba(16,185,129,0.3); }
  50% { box-shadow: 0 4px 32px rgba(16,185,129,0.5), 0 0 60px rgba(16,185,129,0.15); }
}

.btn-set-complete {
  animation: pulse-glow 2.5s ease-in-out infinite;
}

/* ── LOGIN SCREEN ── */

.screen-login .container {
  width: 100%;
  min-height: 100vh;
  padding: 48px 24px 32px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.screen-login .deco-circle {
  position: absolute;
  bottom: -60px;
  left: -60px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.05;
  pointer-events: none;
}
.screen-login .login-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 1;
}
.screen-login .brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 48px;
}
.screen-login .brand-icon {
  width: 60px;
  height: 60px;
  margin-bottom: 16px;
}
.screen-login .brand-name {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.screen-login .brand-sub {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.screen-login .user-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
  width: 100%;
}
.screen-login .user-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 70px;
}
.screen-login .user-card:active { transform: scale(0.95); }
.screen-login .user-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}
.screen-login .user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}
.screen-login .user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.screen-login .pin-dots { font-size: 14px; letter-spacing: 4px; color: var(--text-muted); }

.screen-login .pin-input-wrap {
  width: 100%;
  max-width: 260px;
  margin-bottom: 20px;
}
.screen-login .pin-input-wrap input {
  width: 100%;
  padding: 14px 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 12px;
  background: var(--surface);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}
.screen-login .pin-input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.screen-login .pin-input-wrap input::placeholder { font-size: 14px; letter-spacing: 4px; color: var(--text-muted); }

.screen-login .spacer { flex: 0.15; }
.screen-login .footer-text {
  margin-top: 40px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── ONBOARDING SCREEN ── */

.screen-onboard .container {
  width: 100%;
  min-height: 100vh;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.screen-onboard .onboard-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 40px;
  padding-top: 40px;
}
.screen-onboard .onboard-progress .seg {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  transition: background 0.3s;
}
.screen-onboard .onboard-progress .seg.active { background: var(--primary); }
.screen-onboard .onboard-progress .seg.done { background: var(--primary); }

.screen-onboard .onboard-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}
.screen-onboard .onboard-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
}
.screen-onboard .onboard-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.screen-onboard .onboard-input {
  width: 100%;
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  background: var(--surface);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}
.screen-onboard .onboard-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.screen-onboard .option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}
.screen-onboard .option-grid .opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s;
  min-height: 80px;
}
.screen-onboard .option-grid .opt:active { transform: scale(0.96); }
.screen-onboard .option-grid .opt.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}
.screen-onboard .option-grid .opt .label { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.screen-onboard .option-grid .opt .sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.screen-onboard .pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.screen-onboard .pill-group .pill {
  padding: 10px 18px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.screen-onboard .pill-group .pill:active { transform: scale(0.96); }
.screen-onboard .pill-group .pill.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-hover);
}

.screen-onboard .btn-next {
  width: 100%;
  height: 56px;
  border: none;
  border-radius: 28px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(16,185,129,0.3);
  transition: transform 0.2s;
  margin-bottom: 40px;
}
.screen-onboard .btn-next:active { transform: scale(0.97); }
.screen-onboard .btn-next:disabled { opacity: 0.4; cursor: default; transform: none; }

/* ── MAIN SHELL ── */

.shell-wrap {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

.shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 0;
}
.shell-greeting {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}
.shell-greeting small {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
}
.shell-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.shell-content {
  padding: 0 20px 100px;
  min-height: calc(100vh - var(--tab-h) - 60px);
}

.bottom-tab {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--tab-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: 8px;
  z-index: 20;
}
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: 6px 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  transition: color 0.15s;
}
.tab-item svg { width: 24px; height: 24px; color: var(--text-muted); }
.tab-item.active svg { color: var(--primary); }
.tab-icon { width: 24px; height: 24px; display: block; }
.tab-icon svg { width: 100%; height: 100%; }
.tab-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}
.tab-item.active { color: var(--primary); }
.tab-item.active .tab-label { color: var(--primary); font-weight: 700; }

/* ── HOME TAB ── */

.streak-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
}
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary-light);
  color: var(--primary-hover);
  font-size: 14px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
}
.streak-text h3 {
  font-size: 17px;
  font-weight: 700;
  margin-top: 8px;
}
.streak-text p {
  font-size: 14px;
  color: var(--text-secondary);
}

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 28px;
}
.quick-card {
  background: var(--surface);
  border-radius: var(--radius);
  height: 100px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.2s;
}
.quick-card:active { transform: scale(0.96); }
.quick-emoji { font-size: 28px; line-height: 1; }
.quick-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }

.recent-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.recent-scroll::-webkit-scrollbar { display: none; }
.recent-card {
  flex-shrink: 0;
  width: 160px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.recent-date { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.recent-exercise { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.recent-meta { font-size: 13px; color: var(--text-secondary); }
.recent-meta strong { color: var(--primary); }

.btn-fab {
  position: fixed;
  bottom: calc(var(--tab-h) + 20px);
  right: calc(50% - 240px + 20px);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #fff;
  border: none;
  font-size: 28px;
  font-weight: 300;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16,185,129,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  z-index: 10;
}
.btn-fab:active { transform: scale(0.92); }

/* ── ROUTINE TAB ── */

.routine-templates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.routine-template-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
}
.routine-template-card:active { transform: scale(0.97); }
.routine-template-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}
.routine-template-card h4 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.routine-template-card p { font-size: 12px; color: var(--text-muted); }
.routine-template-card .badge {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary-hover);
  font-size: 11px;
  font-weight: 600;
}

.day-editor {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 16px;
}
.day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.day-header h4 { font-size: 15px; font-weight: 700; }
.day-header .day-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-alt);
  padding: 4px 10px;
  border-radius: 12px;
}
.exercise-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.exercise-row:last-child { border-bottom: none; }
.exercise-row:active { background: var(--surface-alt); }
.exercise-row .drag { color: var(--text-muted); font-size: 18px; cursor: grab; flex-shrink: 0; }
.exercise-row .ex-name { flex: 1; font-size: 14px; font-weight: 600; }
.exercise-row .ex-meta { font-size: 12px; color: var(--text-muted); }
.exercise-row .ex-del { color: var(--accent); font-size: 16px; cursor: pointer; background: none; border: none; }

.add-exercise-btn {
  width: 100%;
  padding: 14px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 8px;
}
.add-exercise-btn:active { border-color: var(--primary); color: var(--primary); }

.routine-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* ── TRAINING TAB ── */

.page-wrap {
  width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 5vw 26vw;
  position: relative;
}

.exercise-name {
  font-size: 5.5vw;
  font-weight: 700;
}
.exercise-name small {
  display: block;
  font-size: 3.5vw;
  font-weight: 500;
  color: var(--text-muted);
}

.btn-close {
  width: 10vw;
  height: 10vw;
  border-radius: 50%;
  border: none;
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: 5vw;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.main-layout { display: block; }
.exercise-sidebar { display: none; }
.right-panel { display: none; }
.center-area { margin: 0 auto; }

.counter-section {
  text-align: center;
  margin-bottom: 8.5vw;
  position: relative;
}
.set-counter {
  font-size: 14vw;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 2vw;
}
.set-counter .total { color: var(--text-muted); font-weight: 600; }

.weight-reps {
  font-size: 5vw;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8.5vw;
}
.weight-reps input[type="number"] {
  width: 21vw;
  text-align: center;
  font-size: 5vw;
  font-weight: 700;
  color: var(--text-primary);
  border: none;
  border-bottom: 0.8vw solid var(--border);
  background: transparent;
  padding: 1vw 0;
  outline: none;
  font-family: var(--font);
}
.weight-reps .label { font-weight: 500; color: var(--text-muted); font-size: 3.7vw; }

.btn-complete-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 4vw;
  position: relative;
}
.btn-ring-wrap {
  position: relative;
  width: 36vw;
  height: 36vw;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  opacity: 0;
  transition: opacity 0.4s;
}
.btn-ring-svg circle {
  fill: none;
  stroke: var(--primary);
  stroke-width: 4;
  stroke-linecap: round;
}
.btn-set-complete {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(16,185,129,0.3);
  transition: transform 0.2s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  position: relative;
  z-index: 1;
  animation: pulse-glow 2.5s ease-in-out infinite;
}
.btn-set-complete:active { transform: scale(0.94); }
.btn-set-complete small { font-size: 12px; font-weight: 500; opacity: 0.85; }

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 4px 20px rgba(16,185,129,0.3); }
  50% { box-shadow: 0 4px 32px rgba(16,185,129,0.5), 0 0 60px rgba(16,185,129,0.15); }
}

.btn-set-complete .check-anim {
  font-size: 28px;
  opacity: 0;
  transform: scale(1.5);
  transition: all 0.3s ease;
  position: absolute;
}
.btn-set-complete .check-anim.show { opacity: 1; transform: scale(1); }

.pose-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 4vw;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 3.7vw;
  margin-bottom: 4vw;
  cursor: pointer;
  transition: transform 0.2s;
}
.pose-card:active { transform: scale(0.98); }
.pose-icon {
  width: 13vw;
  height: 13vw;
  border-radius: 3vw;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6vw;
  flex-shrink: 0;
}
.pose-info h4 { font-size: 4vw; font-weight: 700; margin-bottom: 0.5vw; }
.pose-info p { font-size: 3.5vw; color: var(--text-muted); }
.pose-arrow { margin-left: auto; color: var(--text-muted); font-size: 5vw; }

.history-section { margin-bottom: 6vw; padding-top: 4vw; }
.history-title {
  font-size: 4vw;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 2.7vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.history-title small { font-weight: 500; color: var(--text-muted); font-size: 3.5vw; }
.history-list { display: flex; flex-direction: column; gap: 1.5vw; }
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-radius: 3vw;
  padding: 3vw 4vw;
  border: 1px solid var(--border);
}
.history-item .set-num { font-size: 3.7vw; font-weight: 600; color: var(--primary); }
.history-item .set-detail { font-size: 3.7vw; color: var(--text-secondary); }
.history-item .set-status { font-size: 4vw; }

.exercise-sidebar {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.sidebar-title { font-size: 14px; font-weight: 700; color: var(--text-secondary); padding: 14px 16px 8px; }
.sidebar-list { display: flex; flex-direction: column; gap: 2px; padding: 0 8px 8px; }
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.sidebar-item.active { background: var(--primary-light); color: var(--primary-hover); font-weight: 700; }
.sidebar-item.completed { color: var(--text-muted); }
.sidebar-item .status-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.sidebar-item.completed .status-icon { background: var(--primary-light); color: var(--primary); }
.sidebar-item:not(.completed):not(.active) .status-icon { border: 2px solid var(--border); background: transparent; }
.sidebar-item.active .status-icon { background: var(--primary); color: #fff; }

.volume-chart {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.volume-chart h4 { font-size: 14px; font-weight: 700; color: var(--text-secondary); margin-bottom: 12px; }

.chart-bars-inline {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  height: 80px;
}
.chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.chart-bar {
  width: 100%;
  max-width: 28px;
  border-radius: 4px 4px 0 0;
  background: var(--primary-light);
  transition: height 0.5s ease;
  min-height: 4px;
}
.chart-bar.fill { background: var(--primary); }
.chart-label { font-size: 10px; color: var(--text-muted); font-weight: 500; }

.bottom-actions {
  display: flex;
  gap: 2.7vw;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 4vw 5vw 7vw;
  background: var(--bg);
  z-index: 10;
}

/* ── REST OVERLAY ── */

.rest-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  display: none;
  overflow: hidden;
}
.rest-overlay.active { display: block; }

.rest-video-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.rest-video-bg iframe {
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}

.rest-overlay .rest-ui {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 40px 24px 120px;
  background: linear-gradient(transparent 40%, rgba(0,0,0,0.7));
  pointer-events: none;
}
.rest-overlay .rest-ui > * { pointer-events: auto; }

.rest-timer-card {
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 24px;
  text-align: center;
  color: #fff;
  max-width: 280px;
  margin: 0 auto;
}
.rest-timer-card .timer-display {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.rest-timer-card .timer-label { font-size: 14px; font-weight: 500; color: rgba(255,255,255,0.6); margin-bottom: 12px; }
.rest-timer-card .timer-progress {
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.15);
  overflow: hidden;
  margin-bottom: 16px;
}
.rest-timer-card .timer-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  width: 100%;
  transition: width 1s linear;
}
.rest-timer-card .rest-actions { display: flex; gap: 10px; justify-content: center; }
.rest-timer-card .rest-actions button {
  padding: 10px 20px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
  min-height: 44px;
}
.rest-timer-card .rest-actions button:active { background: rgba(255,255,255,0.2); }

.rest-tablet-split { display: none; }
.rest-desktop-split { display: none; }

/* ── ANALYSIS / CHART TAB ── */

.screen-analysis .container {
  width: 100%;
  position: relative;
}

.stats-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.stat-circle {
  flex: 1;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 8px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.stat-number { font-size: 28px; font-weight: 800; color: var(--primary); line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.calendar-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.calendar-header h4 { font-size: 15px; font-weight: 700; color: var(--text-secondary); }
.calendar-nav { display: flex; gap: 8px; }
.calendar-nav button {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}
.calendar-grid .day-label { font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 4px 0; }
.calendar-grid .day-num {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  padding: 6px 0;
  border-radius: 50%;
  position: relative;
}
.calendar-grid .day-num.has-workout::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
}
.calendar-grid .day-num.today { background: var(--primary-light); color: var(--primary-hover); font-weight: 700; }

.chart-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.chart-card .card-title { margin-bottom: 12px; }
.chart-card canvas { width: 100% !important; }

/* ── SETTINGS TAB ── */

.profile-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}
.profile-info { flex: 1; }
.profile-name { font-size: 17px; font-weight: 700; }
.profile-level { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.profile-level .level-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary-hover);
  font-size: 11px;
  font-weight: 600;
}
.profile-edit { font-size: 14px; font-weight: 600; color: var(--primary); text-decoration: none; cursor: pointer; }

.settings-group {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  overflow: hidden;
}
.group-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 16px 20px 8px;
}
.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.setting-item:first-child { border-top: none; }
.setting-left { flex: 1; }
.setting-label { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.setting-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.toggle {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--border);
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle.on { background: var(--primary); }
.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle.on::after { transform: translateX(18px); }

.select-pill { display: flex; gap: 6px; }
.select-pill button {
  padding: 6px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.select-pill button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.danger-zone {
  border-color: var(--accent);
  border-width: 1.5px;
}
.danger-zone .group-header { color: var(--accent); }
.danger-zone .setting-item .setting-label { color: var(--accent); }

.version-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 24px 0 8px;
}

/* ════════════════════════════════════════════
   RESPONSIVE: MOBILE (≤599px)
   ════════════════════════════════════════════ */
@media (max-width: 599px) {
  .center-area {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 42vw);
    justify-content: flex-start;
  }
  .counter-section { margin-bottom: 0; }
  .btn-complete-wrap { align-items: center; margin-bottom: 0; }
  .btn-ring-wrap { width: 45vw; height: 45vw; }
  .btn-set-complete { width: 85%; height: 85%; font-size: 5.3vw; }
  .btn-set-complete small { font-size: 3.5vw; }
  .pose-card { margin-bottom: 0; }
}

/* ════════════════════════════════════════════
   RESPONSIVE: EXTRA SMALL (≤360px)
   ════════════════════════════════════════════ */
@media (max-width: 360px) {
  .page-wrap { padding: 0 3vw 26vw; }

  .screen-landing .container { padding: 32px 16px 24px; }
  .screen-landing .tagline { display: none; }
  .screen-landing .app-title { font-size: 28px; }
  .screen-landing .app-icon { width: 60px; height: 60px; margin-bottom: 16px; }
  .screen-landing .feature-grid { grid-template-columns: 1fr; gap: 8px; }
  .screen-landing .feature-card:nth-child(n+2) { display: none; }
  .screen-landing .hero { padding-top: 24px; }

  .screen-login .container { padding: 32px 16px 24px; }
  .screen-login .brand-icon { width: 40px; height: 40px; margin-bottom: 12px; }
  .screen-login .brand-name { font-size: 24px; }
  .screen-login .brand { margin-bottom: 32px; }
  .screen-login .btn-social { height: 48px; border-radius: 24px; font-size: 14px; }
  .screen-login .btn-group { gap: 8px; }

  .screen-onboard .container { padding: 0 12px; }
  .screen-onboard .onboard-card { padding: 20px 16px; }
  .screen-onboard .onboard-title { font-size: 18px; }
  .screen-onboard .option-grid { grid-template-columns: 1fr; gap: 8px; }
  .screen-onboard .option-grid .opt { min-height: 60px; padding: 12px; }

  .shell-greeting { font-size: 18px; }
  .page-title { font-size: 20px; }
  .quick-grid { grid-template-columns: 1fr; gap: 8px; }
  .quick-card { height: 80px; }
  .streak-card { padding: 14px; gap: 12px; }
  .stat-number { font-size: 22px; }
  .stats-row { flex-wrap: wrap; gap: 8px; }
  .stat-circle { flex: 0 0 calc(50% - 4px); padding: 12px 8px; }
  .routine-templates { grid-template-columns: 1fr; }
  .profile-card { display: none !important; }
  .setting-item { padding: 12px 16px; }
  .calendar-grid .day-num { font-size: 11px; padding: 4px 0; }
  .exercise-name { font-size: 17px; }
}

/* ════════════════════════════════════════════
   RESPONSIVE: FOLD / SMALL TABLET (600-767px) — preview 기준
   ════════════════════════════════════════════ */
@media (min-width: 600px) and (max-width: 767px) {
  .app-wrap { max-width: 600px; padding: 0 24px 100px; }
  .shell-wrap { max-width: 600px; }
  .bottom-tab { max-width: 600px; }

  .screen-landing .container { max-width: 600px; padding: 48px 32px 32px; margin: 0 auto; }
  .screen-landing .feature-grid { gap: 14px; }
  .screen-landing .app-title { font-size: 56px; }
  .screen-landing .tagline { font-size: 24px; }

  .screen-login .container { max-width: 600px; padding: 48px 32px 32px; margin: 0 auto; }
  .screen-login .btn-group { max-width: 400px; }
  .screen-login .brand-icon { width: 72px; height: 72px; }
  .screen-login .brand-name { font-size: 36px; }

  .screen-onboard .container { max-width: 600px; padding: 0 32px; margin: 0 auto; }
  .screen-onboard .option-grid { grid-template-columns: 1fr 1fr 1fr; }

  .shell-content { padding: 0 24px 100px; }
  .shell-header { padding: 20px 24px 0; }

  .quick-grid { grid-template-columns: 1fr 1fr 1fr; }
  .recent-scroll .recent-card { width: 200px; }
  .recent-scroll .recent-card:nth-child(n+3) { display: none; }

  .page-wrap { max-width: 600px; padding: 0 24px 100px; }
  .bottom-actions { max-width: 600px; padding: 16px 24px 28px; }
  .main-layout { display: grid; grid-template-columns: 55% 45%; gap: 20px; align-items: start; }
  .center-area { max-width: 100%; margin: 0; }
  .counter-section { margin-bottom: 24px; }
  .set-counter { font-size: 56px; }
  .weight-reps { margin-bottom: 24px; }
  .btn-ring-wrap { width: 120px; height: 120px; }
  .btn-set-complete { width: 104px; height: 104px; font-size: 15px; }
  .right-panel { display: block !important; background: transparent; border: none; padding: 0; }
  .right-panel .history-section { max-height: none; overflow: visible; }
  .right-panel .volume-chart { display: none; }
  .center-area > .pose-card { display: none; }
  .center-area > .history-section { display: none; }

  .rest-timer-card { max-width: 360px; padding: 32px; }
  .rest-timer-card .timer-display { font-size: 64px; }

  .screen-analysis .container { max-width: 600px; padding: 0; margin: 0 auto; }
  .stats-row { gap: 12px; }
  .stat-number { font-size: 32px; }
  .routine-templates { grid-template-columns: 1fr 1fr 1fr; }

  .settings-group { max-width: 100%; }
}

/* ════════════════════════════════════════════
   RESPONSIVE: TABLET (768-1024px) — preview 기준
   ════════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1024px) {
  .app-wrap { max-width: 720px; padding: 0 40px 100px; }
  .shell-wrap { max-width: 720px; }
  .bottom-tab { max-width: 720px; }

  .screen-landing .container { max-width: 720px; padding: 64px 40px 40px; margin: 0 auto; }
  .screen-landing .app-title { font-size: 80px; }
  .screen-landing .tagline { font-size: 26px; margin-bottom: 52px; }
  .screen-landing .app-icon { width: 96px; height: 96px; }
  .screen-landing .feature-grid { gap: 16px; }
  .screen-landing .feature-card { padding: 24px 20px; }
  .screen-landing .feature-number { font-size: 36px; }
  .screen-landing .login-link { padding-bottom: 24px; }

  .screen-login .container { max-width: 720px; padding: 64px 40px 40px; margin: 0 auto; }
  .screen-login .btn-group { max-width: 420px; }
  .screen-login .brand-icon { width: 80px; height: 80px; }
  .screen-login .brand-name { font-size: 40px; }
  .screen-login .brand { margin-bottom: 56px; }
  .screen-login .btn-social { height: 60px; font-size: 17px; }

  .screen-onboard .container { max-width: 600px; padding: 0 32px; margin: 0 auto; }
  .screen-onboard .option-grid { grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

  .shell-content { padding: 0 40px 100px; }
  .shell-header { padding: 20px 40px 0; }
  .shell-greeting { font-size: 28px; }

  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .quick-card { height: 120px; }
  .recent-scroll { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; overflow-x: visible; padding-bottom: 0; }
  .recent-scroll .recent-card { width: auto; }
  .streak-card { padding: 24px; }
  .section-title { font-size: 18px; }

  .page-wrap { max-width: 100%; padding: 0 32px 100px; }
  .bottom-actions { max-width: 100%; padding: 16px 32px 28px; }
  .main-layout { display: grid; grid-template-columns: 220px 1fr 280px; gap: 24px; align-items: start; }
  .exercise-sidebar { display: block; position: sticky; top: 20px; }
  .right-panel { display: block; position: sticky; top: 20px; }
  .center-area { max-width: 100%; margin: 0; }
  .set-counter { font-size: 64px; }
  .weight-reps { margin-bottom: 28px; }
  .btn-ring-wrap { width: 140px; height: 140px; }
  .btn-set-complete { width: 124px; height: 124px; font-size: 17px; }
  .history-section { max-height: 240px; overflow-y: auto; }

  .rest-overlay .rest-ui { display: none; }
  .rest-tablet-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100%;
  }
  .rest-tablet-split .video-half { position: relative; overflow: hidden; }
  .rest-tablet-split .video-half iframe { width: 100%; height: 100%; border: 0; pointer-events: none; }
  .rest-tablet-split .panel-half {
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    text-align: center;
    gap: 24px;
  }
  .rest-tablet-split .panel-half .timer-large {
    font-size: 96px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
  }
  .rest-tablet-split .panel-half .timer-label { font-size: 16px; color: var(--text-secondary); }
  .rest-tablet-split .panel-half .next-set-info { font-size: 15px; color: var(--text-secondary); }
  .rest-tablet-split .panel-half .next-set-info strong { color: var(--text-primary); font-weight: 700; }
  .rest-tablet-split .panel-half .rest-actions-row { display: flex; gap: 10px; }
  .rest-tablet-split .panel-half .rest-actions-row button {
    padding: 12px 24px; border-radius: 24px; border: 1.5px solid var(--border);
    background: var(--surface); font-size: 15px; font-weight: 600;
    color: var(--text-primary); min-height: 48px; transition: background 0.2s;
  }
  .rest-tablet-split .panel-half .rest-actions-row button:active { background: var(--surface-alt); }
  .rest-tablet-split .panel-half .rest-actions-row button.primary { background: var(--primary); color: #fff; border-color: var(--primary); }

  .stats-row { gap: 14px; }
  .stat-number { font-size: 32px; }

  .routine-templates { grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

  .profile-card { padding: 24px; }
  .page-title { font-size: 26px; }

  .settings-group { max-width: 100%; }
  .calendar-grid { max-width: 400px; margin: 0 auto; }
}

/* ════════════════════════════════════════════
   RESPONSIVE: DESKTOP (1025px+) — preview 기준
   ════════════════════════════════════════════ */
@media (min-width: 1025px) {
  body { background: #F0F4F3; }

  .app-wrap { max-width: 960px; padding: 0 48px 100px; }
  .shell-wrap { max-width: 960px; }
  .bottom-tab { max-width: 960px; }

  .screen-landing .container { max-width: 960px; padding: 80px 48px 48px; margin: 0 auto; }
  .screen-landing .app-title { font-size: 96px; }
  .screen-landing .tagline { font-size: 28px; margin-bottom: 56px; }
  .screen-landing .app-icon { width: 100px; height: 100px; }
  .screen-landing .feature-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .screen-landing .feature-card { padding: 28px 24px; }
  .screen-landing .feature-number { font-size: 40px; }
  .screen-landing .btn-primary { max-width: 400px; align-self: center; }
  .screen-landing .login-link { padding-bottom: 24px; }

  .screen-login .container { max-width: 960px; padding: 80px 48px 48px; margin: 0 auto; }
  .screen-login .btn-group { max-width: 460px; }
  .screen-login .brand-icon { width: 88px; height: 88px; }
  .screen-login .brand-name { font-size: 44px; }
  .screen-login .brand { margin-bottom: 64px; }
  .screen-login .btn-social { height: 64px; font-size: 18px; }
  .screen-login .user-grid { gap: 16px; }
  .screen-login .user-card { padding: 16px 24px; }

  .screen-onboard .container { max-width: 720px; padding: 0 48px; margin: 0 auto; }
  .screen-onboard .option-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .screen-onboard .option-grid .opt { min-height: 100px; padding: 20px 16px; }

  .shell-content { padding: 0 48px 100px; }
  .shell-header { padding: 24px 48px 0; }
  .shell-greeting { font-size: 30px; }
  .shell-avatar { width: 40px; height: 40px; font-size: 16px; }

  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .quick-card { height: 120px; }
  .streak-card { padding: 24px; }
  .section-title { font-size: 18px; }
  .recent-scroll { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; overflow-x: visible; padding-bottom: 0; }
  .recent-scroll .recent-card { width: auto; }

  .page-wrap { max-width: 1100px; padding: 0; min-height: 100vh; display: grid; grid-template-columns: 240px 1fr 340px; grid-template-rows: auto 1fr; gap: 0; background: var(--bg); border-left: 1px solid var(--border); border-right: 1px solid var(--border); box-shadow: var(--shadow); width: 100%; }
  .page-wrap .top-bar { grid-column: 1 / -1; padding: 24px 32px; border-bottom: 1px solid var(--border); }
  .page-wrap .progress-track { grid-column: 1 / -1; margin: 0; border-radius: 0; }
  .page-wrap .main-layout { display: contents; }
  .page-wrap .exercise-sidebar { display: block; padding: 24px 16px; border-right: 1px solid var(--border); background: var(--surface); }
  .page-wrap .center-area { max-width: 480px; margin: 0 auto; padding: 40px 32px; display: flex; flex-direction: column; justify-content: center; min-height: 100%; }
  .page-wrap .right-panel { display: block; padding: 24px 20px; border-left: 1px solid var(--border); background: var(--surface); overflow-y: auto; }
  .page-wrap .counter-section { margin-bottom: 40px; }
  .page-wrap .set-counter { font-size: 80px; }
  .page-wrap .weight-reps { font-size: 20px; margin-bottom: 40px; }
  .page-wrap .btn-ring-wrap { width: 160px; height: 160px; }
  .page-wrap .btn-ring-svg { opacity: 1; }
  .page-wrap .btn-set-complete { width: 140px; height: 140px; font-size: 19px; }
  .page-wrap .pose-card { margin-bottom: 24px; }
  .page-wrap .history-section { max-height: 300px; overflow-y: auto; }
  .page-wrap .bottom-actions { position: static; transform: none; max-width: 100%; padding: 0; background: transparent; margin-top: 24px; gap: 12px; }
  .page-wrap .bottom-actions button { height: 52px; border-radius: 26px; }

  .rest-overlay .rest-ui { display: none; }
  .rest-tablet-split { display: none; }
  .rest-desktop-split {
    display: grid;
    grid-template-columns: 60% 40%;
    height: 100%;
  }
  .rest-desktop-split .video-half { position: relative; overflow: hidden; }
  .rest-desktop-split .video-half iframe { width: 100%; height: 100%; border: 0; pointer-events: none; }
  .rest-desktop-split .panel-half {
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 36px;
    text-align: center;
    gap: 28px;
    overflow-y: auto;
  }
  .rest-desktop-split .ring-timer-wrap { position: relative; width: 200px; height: 200px; }
  .rest-desktop-split .ring-timer-wrap svg { transform: rotate(-90deg); }
  .rest-desktop-split .ring-timer-wrap .ring-bg { fill: none; stroke: var(--border); stroke-width: 6; }
  .rest-desktop-split .ring-timer-wrap .ring-fg { fill: none; stroke: var(--primary); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 565.48; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; }
  .rest-desktop-split .ring-timer-wrap .ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .rest-desktop-split .ring-timer-wrap .ring-center .time { font-size: 48px; font-weight: 800; letter-spacing: 0.02em; color: var(--text-primary); font-variant-numeric: tabular-nums; line-height: 1; }
  .rest-desktop-split .ring-timer-wrap .ring-center .sub { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
  .rest-desktop-split .next-set-card { background: var(--surface-alt); border-radius: var(--radius); padding: 16px 20px; width: 100%; text-align: left; }
  .rest-desktop-split .next-set-card h4 { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
  .rest-desktop-split .next-set-card p { font-size: 16px; font-weight: 700; color: var(--text-primary); }
  .rest-desktop-split .pill-actions { display: flex; gap: 10px; }
  .rest-desktop-split .pill-actions button { padding: 10px 24px; border-radius: 24px; border: 1.5px solid var(--border); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--text-primary); min-height: 44px; transition: all 0.2s; }
  .rest-desktop-split .pill-actions button:active { background: var(--surface-alt); }
  .rest-desktop-split .pill-actions button.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
  .rest-desktop-split .tips-card { background: var(--surface-alt); border-radius: var(--radius); padding: 16px 20px; width: 100%; text-align: left; }
  .rest-desktop-split .tips-card h4 { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
  .rest-desktop-split .tips-card ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
  .rest-desktop-split .tips-card li { font-size: 13px; color: var(--text-secondary); padding-left: 14px; position: relative; }
  .rest-desktop-split .tips-card li::before { content: ''; position: absolute; left: 0; top: 7px; width: 4px; height: 4px; border-radius: 50%; background: var(--primary); }

  .stats-row { gap: 16px; }
  .stat-number { font-size: 36px; }

  .routine-templates { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .page-title { font-size: 28px; }
  .settings-group { max-width: 100%; }

  .btn-fab { bottom: calc(var(--tab-h) + 24px); }
}

/* ═══════════════════════════════════════════════════════
   COMPONENT CLASSES (used by JS render functions)
   ═════════════════════════════════════════════════════ */

/* ── Badge Variants ── */
.badge-primary {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
}

/* ── Feedback Cards ── */
.feedback-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.feedback-bar {
  height: 4px;
  background: var(--surface-alt);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.feedback-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .3s;
}

/* ── Option Cards (onboarding, exercise selection) ── */
.option-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  text-align: center;
}
.option-card:hover { border-color: var(--primary); }
.option-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ── Onboarding ── */
.onboard-step {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 60px 20px 20px;
  max-width: 480px;
  margin: 0 auto;
}
.onboard-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 32px;
}
.onboard-progress span {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
}
.onboard-progress span.done { background: var(--primary); }
.onboard-progress span.current { background: var(--primary); opacity: .5; }

/* ── Login Page ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-box {
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.login-logo {
  font-size: 3rem;
  margin-bottom: 12px;
}
.login-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.login-subtitle {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* ── User Card (login user list) ── */
.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: background .15s;
  text-align: left;
  width: 100%;
}
.user-card:hover { background: var(--surface-alt); }
.user-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Social Login Buttons ── */
.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 56px;
  border: none;
  border-radius: 28px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-social:active { transform: scale(0.97); }
.btn-social svg { flex-shrink: 0; }
.btn-google {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.btn-kakao {
  background: #FEE500;
  color: #3A1D1D;
}
.btn-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.browse-link, .browse-link:hover { display: none; }
.training-exercise {
  background: var(--surface);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.training-exercise.completed {
  opacity: .7;
}
.training-exercise-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  cursor: pointer;
}
.set-row {
  display: grid;
  grid-template-columns: 40px 1fr 1fr 40px 44px;
  gap: 6px;
  align-items: center;
  padding: 6px 12px;
  border-top: 1px solid var(--border);
}
.set-row.completed { opacity: .6; }
.set-input {
  width: 100%;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  text-align: center;
  font-size: .85rem;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text-primary);
}
.set-input:focus {
  outline: none;
  border-color: var(--primary);
}
.set-check {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s;
}
.set-check.done {
  background: var(--primary);
  border-color: var(--primary);
}

/* ── Rest Timer Overlay ── */
.rest-timer-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.rest-timer-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 6px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  transition: border-color .3s;
}
.rest-timer-circle.warning { border-color: var(--accent); }
.rest-timer-circle.done { border-color: var(--primary); }

/* ── Calendar ── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background .15s;
}
.cal-day:hover { background: var(--surface-alt); }
.cal-day.other-month { visibility: hidden; }
.cal-day.has-workout {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.cal-day.today {
  border: 2px solid var(--primary);
}
.cal-day.selected {
  background: var(--primary);
  color: #fff;
}

/* ── Chart Containers ── */
.chart-container {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.chart-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.analysis-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.exercise-chart-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  gap: 10px;
}

/* ── Landing Page (od- classes) ── */
.od-landing {
  min-height: 100vh;
  overflow-x: hidden;
}
.od-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.od-orb {
  position: absolute;
  border-radius: 50%;
  opacity: .12;
}
.od-orb-1 { width: 300px; height: 300px; background: var(--primary); top: -80px; right: -60px; }
.od-orb-2 { width: 200px; height: 200px; background: var(--accent); bottom: 10%; left: -40px; }
.od-orb-3 { width: 150px; height: 150px; background: var(--primary); top: 40%; right: -30px; }
.od-icon-wrap {
  width: 80px;
  height: 80px;
  border-radius: 24px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}
.od-icon-wrap svg { width: 44px; height: 44px; }
.od-hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
.od-hero-tagline {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}
.od-hero-desc {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}
.od-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 0 40px;
  border: none;
  border-radius: 28px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #fff;
  font-family: var(--font);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(16,185,129,.3);
  position: relative;
  z-index: 1;
}
.od-btn-primary:active { transform: scale(.97); }
.od-section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}
.od-feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.od-feature-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 20px 16px;
  box-shadow: var(--shadow);
}
.od-feature-number {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}
.od-feature-card h3 {
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.4;
}
.od-bottom-cta {
  padding: 40px 20px 60px;
  text-align: center;
}
.od-cta-sub {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 12px;
}

/* ── Modal Overlay ── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header strong {
  font-size: 1.05rem;
}
.modal-header button {
  background: none;
  border: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.modal-header button svg { width: 18px; height: 18px; }
.modal-body {
  padding: 20px;
}

/* ── Utility Classes ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-lg { font-size: 1.125rem; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.p-3 { padding: 12px; }
.cols-2 { grid-template-columns: 1fr 1fr; }

/* ════════════════════════════════════════════
   POSE GUIDE PAGE
   ════════════════════════════════════════════ */
.pg-wrap {
  width:100%; min-height:100vh; background:var(--bg);
}
.pg-nav {
  position:sticky;top:0;z-index:30;background:var(--bg);
  display:flex;align-items:center;height:var(--nav-h);padding:0 16px;
  border-bottom:1px solid var(--border);backdrop-filter:blur(8px);
}
.pg-nav .back-btn {
  width:36px;height:36px;border:none;background:none;font-size:20px;
  cursor:pointer;display:flex;align-items:center;justify-content:center;
  border-radius:10px;color:var(--text-primary);flex-shrink:0;
}
.pg-nav .back-btn:active { background:var(--surface-alt); }
.pg-nav h1 { font-size:17px;font-weight:700;margin-left:8px;flex:1; }

/* tab strip (phone) */
.pg-tab-wrap {
  position:sticky;top:var(--nav-h);z-index:25;background:var(--bg);
  padding:8px 12px;border-bottom:1px solid var(--border);
}
.pg-tab-strip {
  display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding:0 4px;
}
.pg-tab-strip::-webkit-scrollbar { display:none; }
.pg-tab-strip button {
  flex-shrink:0;padding:8px 14px;border-radius:10px;
  border:1px solid var(--border);background:var(--surface);
  font-family:var(--font);font-size:14px;font-weight:600;
  color:var(--text-secondary);cursor:pointer;white-space:nowrap;
  transition:all 0.2s;min-height:44px;display:flex;align-items:center;gap:4px;
}
.pg-tab-strip button:active { transform:scale(0.96); }
.pg-tab-strip button.active { background:var(--primary);color:#fff;border-color:var(--primary); }

/* sidebar tabs (tablet+) */
.pg-sidebar { display:none;flex-direction:column;gap:4px; }
.pg-sidebar button {
  width:100%;text-align:left;padding:10px 12px;border-radius:10px;border:none;
  background:transparent;font-family:var(--font);font-size:14px;font-weight:500;
  color:var(--text-secondary);cursor:pointer;transition:all 0.15s;
  min-height:44px;display:flex;align-items:center;gap:6px;
}
.pg-sidebar button:hover { background:var(--surface-alt); }
.pg-sidebar button.active { background:var(--primary-light);color:var(--primary-hover);font-weight:700; }

/* video section */
.pg-video { padding:16px; }
.pg-video-wrap {
  position:relative;width:100%;max-height:400px;border-radius:var(--radius-sm);
  overflow:hidden;background:#000;
}
.pg-video-wrap iframe { width:100%;height:100%;aspect-ratio:9/16;display:block;border:0; }
.pg-meta { display:flex;align-items:center;gap:8px;margin-top:12px;flex-wrap:wrap; }
.pg-meta h2 { font-size:17px;font-weight:700;flex:1;min-width:0; }
.pg-muscle-badge {
  display:inline-flex;align-items:center;gap:4px;background:var(--primary-light);
  color:var(--primary-hover);font-size:12px;font-weight:600;padding:4px 10px;border-radius:20px;
}
.pg-primary-badge {
  display:inline-flex;align-items:center;gap:4px;background:#FEF3C7;
  color:#D97706;font-size:12px;font-weight:600;padding:4px 10px;border-radius:20px;
}

/* tips */
.pg-tips {
  background:var(--surface);border-radius:var(--radius-sm);padding:16px;
  box-shadow:var(--shadow);border:1px solid var(--border);margin:16px;
}
.pg-tips h3 { font-size:15px;font-weight:700;margin-bottom:8px;display:flex;align-items:center;gap:6px; }
.pg-tips ul { list-style:none;display:flex;flex-direction:column;gap:6px; }
.pg-tips li { font-size:14px;color:var(--text-secondary);padding-left:16px;position:relative; }
.pg-tips li::before {
  content:'';position:absolute;left:0;top:10px;width:6px;height:6px;
  border-radius:50%;background:var(--primary);
}

/* other videos */
.pg-other { padding:0 16px 16px; }
.pg-other h3 { font-size:15px;font-weight:700;margin-bottom:12px; }
.pg-search { display:flex;gap:8px;margin-bottom:12px; }
.pg-search input {
  flex:1;padding:10px 14px;border:1px solid var(--border);border-radius:10px;
  font-family:var(--font);font-size:14px;background:var(--surface);color:var(--text-primary);
  outline:none;min-height:44px;
}
.pg-search input:focus { border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-light); }
.pg-search input::placeholder { color:var(--text-muted); }
.pg-chips { display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px; }
.pg-chips button {
  padding:6px 12px;border-radius:20px;border:1px solid var(--border);background:var(--surface);
  font-family:var(--font);font-size:12px;font-weight:500;color:var(--text-secondary);
  cursor:pointer;transition:all 0.15s;min-height:36px;
}
.pg-chips button:active { background:var(--surface-alt); }
.pg-vlist { display:flex;flex-direction:column;gap:10px; }
.pg-vcard {
  display:flex;gap:12px;background:var(--surface);border-radius:var(--radius-sm);
  padding:12px;box-shadow:var(--shadow);border:1px solid var(--border);
  align-items:flex-start;transition:transform 0.15s;
}
.pg-vcard:active { transform:scale(0.98); }
.pg-vcard .thumb {
  width:100px;height:68px;border-radius:8px;object-fit:cover;flex-shrink:0;
  background:var(--surface-alt);
}
.pg-vcard .info { flex:1;min-width:0; }
.pg-vcard .info .title {
  font-size:14px;font-weight:600;display:-webkit-box;
  -webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin-bottom:2px;
}
.pg-vcard .info .channel { font-size:12px;color:var(--text-muted); }
.pg-vcard .star-btn {
  width:36px;height:36px;border:none;background:none;cursor:pointer;
  font-size:18px;border-radius:8px;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;transition:all 0.15s;
}
.pg-vcard .star-btn:active { background:var(--surface-alt); }
.pg-vcard .star-btn.active { color:#F59E0B; }

/* add url */
.pg-add-url {
  margin:16px;background:var(--surface);border-radius:var(--radius-sm);padding:16px;
  box-shadow:var(--shadow);border:1px solid var(--border);
}
.pg-add-url h3 { font-size:14px;font-weight:700;margin-bottom:8px; }
.pg-add-url .row { display:flex;gap:8px;flex-wrap:wrap; }
.pg-add-url input {
  flex:1;min-width:0;padding:10px 14px;border:1px solid var(--border);border-radius:10px;
  font-family:var(--font);font-size:14px;background:var(--bg);color:var(--text-primary);
  outline:none;min-height:44px;
}
.pg-add-url input:focus { border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-light); }
.pg-add-url input::placeholder { color:var(--text-muted); }
.pg-add-url .add-btn {
  padding:10px 18px;border:none;border-radius:10px;background:var(--primary);color:#fff;
  font-family:var(--font);font-size:14px;font-weight:600;cursor:pointer;
  min-height:44px;white-space:nowrap;transition:background 0.15s;
}
.pg-add-url .add-btn:active { background:var(--primary-hover); }

/* desktop right panel */
.pg-right-panel { display:none;padding:24px 20px;border-left:1px solid var(--border);background:var(--surface);overflow-y:auto; }
.pg-vgrid { display:grid;grid-template-columns:1fr 1fr;gap:12px; }

/* main-area grid for tablet/desktop split */
.pg-main-area { }

/* ── POSE GUIDE RESPONSIVE ── */
@media (min-width:600px) and (max-width:767px) {
  .pg-page { max-width:600px;margin:0 auto; }
  .pg-sidebar { display:none!important; }
  .pg-main-area { display:grid;grid-template-columns:55% 45%;gap:16px;padding:16px;align-items:start; }
  .pg-video { padding:0; }
  .pg-video-wrap { max-height:450px; }
  .pg-tips { margin:12px 0 0; }
  .pg-other { padding:0; }
  .pg-vcard .thumb { width:120px;height:80px; }
  .pg-vlist { max-height:460px;overflow-y:auto; }
  .pg-add-url { margin:12px 0 0; }
}
@media (min-width:768px) and (max-width:1024px) {
  .pg-page { max-width:100%;padding:0;display:grid;grid-template-columns:180px 1fr;grid-template-rows:var(--nav-h) 1fr; }
  .pg-nav { grid-column:1/-1;padding:0 24px;max-width:100%; }
  .pg-tab-wrap { display:none!important; }
  .pg-sidebar {
    display:flex;position:sticky;top:var(--nav-h);align-self:start;
    padding:16px 12px;border-right:1px solid var(--border);
    height:calc(100vh - var(--nav-h));overflow-y:auto;background:var(--surface);
  }
  .pg-main-area { display:grid;grid-template-columns:1fr 1fr;gap:20px;padding:20px 24px;align-items:start; }
  .pg-video { padding:0; }
  .pg-video-wrap { max-height:500px; }
  .pg-tips { margin:16px 0 0; }
  .pg-other { padding:0; }
  .pg-vcard .thumb { width:140px;height:90px; }
  .pg-vlist { max-height:420px;overflow-y:auto; }
  .pg-vcard { padding:14px; }
  .pg-add-url { margin:16px 0 0; }
}
@media (min-width:1025px) {
  .pg-page {
    max-width:1100px;margin:0 auto;display:grid;
    grid-template-columns:200px 1fr 320px;grid-template-rows:var(--nav-h) 1fr;
    height:100vh;overflow:hidden;box-shadow:var(--shadow);background:var(--bg);
    border-left:1px solid var(--border);border-right:1px solid var(--border);
  }
  .pg-nav { grid-column:1/-1;padding:0 32px;background:var(--surface); }
  .pg-tab-wrap { display:none!important; }
  .pg-sidebar {
    display:flex;padding:20px 12px;border-right:1px solid var(--border);
    overflow-y:auto;background:var(--surface);
  }
  .pg-sidebar button { font-size:15px;padding:12px 14px; }
  .pg-main-area { display:block!important;overflow-y:auto;padding:24px 32px; }
  .pg-right-panel { display:block!important; }
  .pg-video { padding:0; }
  .pg-video-wrap { max-height:560px;border-radius:var(--radius); }
  .pg-video-wrap iframe { aspect-ratio:16/9; }
  .pg-meta { margin-top:16px; }
  .pg-meta h2 { font-size:20px; }
  .pg-tips { margin:20px 0;padding:20px; }
  .pg-tips h3 { font-size:16px; }
  .pg-tips li { font-size:15px; }
  .pg-vgrid .pg-vcard { flex-direction:column;padding:10px;gap:8px; }
  .pg-vgrid .pg-vcard .thumb { width:100%;height:auto;aspect-ratio:16/9; }
  .pg-vgrid .pg-vcard .info .title { font-size:12px;-webkit-line-clamp:2; }
  .pg-add-url { margin:20px 0 0; }
}
@media (max-width:360px) {
  .pg-meta h2 { font-size:15px; }
  .pg-video { padding:12px; }
  .pg-other { padding:0 12px 12px; }
  .pg-tips { margin:12px; }
  .pg-add-url { margin:12px; }
  .pg-vcard { padding:10px;gap:10px; }
  .pg-vcard .thumb { width:80px;height:56px; }
}

/* ════════════════════════════════════════════
   MEAL CALCULATOR (.mc-)
   ════════════════════════════════════════════ */
.mc-page { padding:0 20px 100px; }
.mc-topbar { display:flex; align-items:center; justify-content:space-between; padding:20px 0 24px; }
.mc-title { font-size:24px; font-weight:700; }
.mc-date-badge { display:inline-flex; align-items:center; gap:4px; padding:6px 14px; border-radius:20px; font-size:13px; font-weight:600; background:var(--surface); border:1px solid var(--border); color:var(--text-secondary); }
.mc-summary { background:var(--surface); border-radius:20px; padding:20px; box-shadow:var(--shadow); border:1px solid var(--border); margin-bottom:20px; }
.mc-summary-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.mc-summary-title { font-size:15px; font-weight:700; color:var(--text-secondary); }
.mc-summary-kcal { font-size:28px; font-weight:800; color:var(--primary); }
.mc-summary-kcal span { font-size:14px; font-weight:600; color:var(--text-muted); }
.mc-cal-bar { width:100%; height:8px; background:var(--border); border-radius:4px; margin-top:16px; overflow:hidden; }
.mc-cal-fill { height:100%; border-radius:4px; transition:width .5s ease; background:linear-gradient(90deg,#10B981,#059669); }
.mc-cal-fill.over { background:linear-gradient(90deg,#FF6B6B,#EF4444); }
.mc-macros { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; margin-top:16px; }
.mc-macro-item { text-align:center; padding:10px 4px; border-radius:var(--radius-xs); background:var(--surface-alt); }
.mc-macro-val { font-size:18px; font-weight:700; color:var(--text-primary); }
.mc-macro-label { font-size:11px; font-weight:600; color:var(--text-muted); margin-top:2px; }
.mc-search-wrap { margin-bottom:16px; position:relative; }
.mc-search-input { width:100%; height:48px; border-radius:24px; border:1.5px solid var(--border); background:var(--surface); padding:0 20px 0 44px; font-size:15px; font-weight:500; color:var(--text-primary); outline:none; transition:border-color .2s; }
.mc-search-input:focus { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-light); }
.mc-search-input::placeholder { color:var(--text-muted); }
.mc-search-icon { position:absolute; left:16px; top:50%; transform:translateY(-50%); width:18px; height:18px; color:var(--text-muted); pointer-events:none; }
.mc-food-list { display:flex; flex-direction:column; gap:8px; margin-bottom:20px; }
.mc-food-card { background:var(--surface); border-radius:var(--radius-sm); padding:14px 16px; box-shadow:var(--shadow); border:1px solid var(--border); display:flex; align-items:center; gap:12px; cursor:pointer; transition:transform .2s; }
.mc-food-card:active { transform:scale(.98); }
.mc-food-emoji { font-size:28px; line-height:1; flex-shrink:0; }
.mc-food-info { flex:1; min-width:0; }
.mc-food-name { font-size:15px; font-weight:600; color:var(--text-primary); }
.mc-food-meta { font-size:12px; color:var(--text-muted); margin-top:2px; }
.mc-food-kcal { font-size:16px; font-weight:700; color:var(--primary); white-space:nowrap; }
.mc-portion-overlay { position:fixed; inset:0; z-index:200; background:rgba(0,0,0,.5); display:flex; align-items:flex-end; justify-content:center; backdrop-filter:blur(4px); }
.mc-portion-sheet { background:var(--surface); border-radius:24px 24px 0 0; width:100%; max-width:480px; padding:24px 20px 40px; max-height:70vh; overflow-y:auto; }
.mc-portion-handle { width:40px; height:4px; border-radius:2px; background:var(--border); margin:0 auto 20px; }
.mc-portion-title { font-size:17px; font-weight:700; margin-bottom:16px; }
.mc-portion-grid { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; margin-bottom:16px; }
.mc-portion-btn { padding:12px 8px; border-radius:var(--radius-xs); border:2px solid var(--border); background:var(--surface); text-align:center; cursor:pointer; transition:all .15s; font-family:var(--font); }
.mc-portion-btn.active { border-color:var(--primary); background:var(--primary-light); }
.mc-p-val { font-size:16px; font-weight:700; color:var(--text-primary); }
.mc-portion-btn.active .mc-p-val { color:var(--primary); }
.mc-p-label { font-size:11px; color:var(--text-muted); margin-top:2px; }
.mc-log-item { background:var(--surface-alt); border-radius:var(--radius-xs); padding:12px 14px; display:flex; align-items:center; gap:10px; margin-bottom:8px; border:1px solid var(--border); }
.mc-log-emoji { font-size:22px; flex-shrink:0; }
.mc-log-info { flex:1; min-width:0; }
.mc-log-name { font-size:14px; font-weight:600; }
.mc-log-detail { font-size:12px; color:var(--text-muted); }
.mc-log-kcal { font-size:14px; font-weight:700; color:var(--primary); }
.mc-log-del { width:28px; height:28px; border-radius:50%; border:none; background:transparent; display:flex; align-items:center; justify-content:center; color:var(--text-muted); cursor:pointer; flex-shrink:0; }
.mc-log-del:active { background:var(--accent-light); color:var(--accent); }
.mc-section-label { font-size:17px; font-weight:700; margin-bottom:12px; display:flex; align-items:center; justify-content:space-between; }
.mc-empty { text-align:center; padding:40px 20px; color:var(--text-muted); font-size:14px; }
.mc-empty-icon { font-size:40px; margin-bottom:8px; }
.mc-chip-row { display:flex; gap:8px; overflow-x:auto; padding-bottom:4px; -webkit-overflow-scrolling:touch; scrollbar-width:none; margin-bottom:16px; }
.mc-chip-row::-webkit-scrollbar { display:none; }
.mc-chip { white-space:nowrap; padding:8px 16px; border-radius:99px; background:var(--surface); border:1px solid var(--border); font-size:14px; font-weight:500; transition:all .15s; display:flex; align-items:center; gap:6px; flex-shrink:0; cursor:pointer; }
.mc-chip:active { transform:scale(.96); }
.mc-chip:hover { border-color:var(--primary); color:var(--primary); }
.mc-chip .mc-chip-emoji { font-size:16px; }
.mc-reset-btn { display:block; margin:12px auto 0; padding:8px 18px; border-radius:99px; font-size:13px; font-weight:500; background:var(--surface); border:1px solid var(--border); color:var(--text-muted); cursor:pointer; transition:all .15s; }
.mc-reset-btn:hover { border-color:var(--accent); color:var(--accent); }

/* ════════════════════════════════════════════
   BODY PHOTO (.bp-)
   ════════════════════════════════════════════ */
.bp-page { padding:0 20px 100px; }
.bp-topbar { display:flex; align-items:center; justify-content:space-between; padding:20px 0 24px; }
.bp-title { font-size:24px; font-weight:700; }
.bp-actions { display:flex; gap:8px; }
.bp-action-btn { height:36px; padding:0 14px; border-radius:18px; border:1.5px solid var(--border); background:var(--surface); font-size:13px; font-weight:600; color:var(--text-primary); cursor:pointer; display:flex; align-items:center; gap:4px; }
.bp-action-btn:active { background:var(--surface-alt); }
.bp-action-btn.primary { border-color:var(--primary); color:var(--primary); }
.bp-gallery { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; margin-bottom:20px; }
.bp-photo-card { aspect-ratio:3/4; border-radius:var(--radius-sm); overflow:hidden; position:relative; cursor:pointer; border:2px solid transparent; transition:border-color .2s; }
.bp-photo-card.selected { border-color:var(--primary); }
.bp-photo-card img { width:100%; height:100%; object-fit:cover; display:block; }
.bp-photo-date { position:absolute; bottom:0; left:0; right:0; padding:4px 6px; font-size:10px; font-weight:600; color:#fff; background:linear-gradient(transparent,rgba(0,0,0,.6)); }
.bp-photo-check { position:absolute; top:6px; right:6px; width:22px; height:22px; border-radius:50%; background:var(--primary); display:none; align-items:center; justify-content:center; color:#fff; font-size:12px; }
.bp-photo-card.selected .bp-photo-check { display:flex; }
.bp-add-card { aspect-ratio:3/4; border-radius:var(--radius-sm); border:2px dashed var(--border); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; cursor:pointer; color:var(--text-muted); transition:all .2s; }
.bp-add-card:active { border-color:var(--primary); color:var(--primary); }
.bp-add-icon { font-size:24px; }
.bp-add-label { font-size:11px; font-weight:600; }
.bp-compare { background:var(--surface); border-radius:var(--radius); padding:20px; box-shadow:var(--shadow); border:1px solid var(--border); margin-bottom:20px; }
.bp-compare-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.bp-compare-title { font-size:15px; font-weight:700; }
.bp-compare-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:16px; }
.bp-compare-side { border-radius:var(--radius-sm); overflow:hidden; position:relative; min-height:200px; background:var(--surface-alt); display:flex; align-items:center; justify-content:center; }
.bp-compare-side img { width:100%; height:100%; object-fit:cover; }
.bp-compare-label { position:absolute; bottom:0; left:0; right:0; padding:8px; text-align:center; font-size:12px; font-weight:700; color:#fff; background:linear-gradient(transparent,rgba(0,0,0,.6)); }
.bp-compare-placeholder { font-size:14px; color:var(--text-muted); text-align:center; }
.bp-camera-overlay { position:fixed; inset:0; z-index:200; background:#000; display:flex; flex-direction:column; }
.bp-camera-video { flex:1; width:100%; object-fit:cover; }
.bp-camera-controls { padding:20px; display:flex; align-items:center; justify-content:center; gap:24px; }
.bp-cam-btn { width:64px; height:64px; border-radius:50%; border:4px solid #fff; background:transparent; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.bp-cam-btn:active { transform:scale(.9); }
.bp-cam-btn-inner { width:52px; height:52px; border-radius:50%; background:#fff; }
.bp-cam-close { width:44px; height:44px; border-radius:50%; border:none; background:rgba(255,255,255,.2); color:#fff; font-size:20px; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.bp-share-row { display:flex; gap:8px; margin-top:12px; }
.bp-share-btn { flex:1; height:44px; border-radius:22px; border:none; font-size:14px; font-weight:600; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:6px; transition:transform .2s; }
.bp-share-btn:active { transform:scale(.97); }
.bp-share-btn.instagram { background:linear-gradient(135deg,#833AB4,#FD1D1D,#F77737); color:#fff; }
.bp-share-btn.save { background:var(--surface); border:1.5px solid var(--border); color:var(--text-primary); }
.bp-watermark { position:absolute; inset:0; z-index:2; pointer-events:none; }
.bp-wm-logo { position:absolute; top:12px; right:12px; display:flex; align-items:center; gap:5px; color:#fff; font-size:12px; font-weight:700; text-shadow:0 1px 4px rgba(0,0,0,.4); background:rgba(16,185,129,.75); padding:5px 12px; border-radius:99px; backdrop-filter:blur(4px); letter-spacing:-.3px; }
.bp-wm-logo::before { content:'🏋️'; font-size:13px; }
.bp-wm-ts { position:absolute; bottom:12px; left:12px; color:#fff; font-size:12px; font-weight:500; text-shadow:0 1px 4px rgba(0,0,0,.4); background:rgba(0,0,0,.35); padding:4px 12px; border-radius:99px; backdrop-filter:blur(4px); }

/* ════════════════════════════════════════════
   PWA INSTALL / A2HS (.pw-)
   ════════════════════════════════════════════ */
.pw-page { padding:0 20px 100px; }
.pw-topbar { display:flex; align-items:center; gap:12px; padding:20px 0 24px; }
.pw-back { width:36px; height:36px; border-radius:50%; border:1px solid var(--border); background:var(--surface); display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--text-secondary); font-size:18px; }
.pw-back:active { background:var(--surface-alt); }
.pw-title { font-size:24px; font-weight:700; }
.pw-hero { background:var(--surface); border-radius:20px; padding:32px 24px; box-shadow:var(--shadow); border:1px solid var(--border); text-align:center; margin-bottom:24px; }
.pw-hero-icon { font-size:56px; margin-bottom:12px; }
.pw-hero-title { font-size:20px; font-weight:700; margin-bottom:6px; }
.pw-hero-desc { font-size:14px; color:var(--text-secondary); line-height:1.6; }
.pw-install-btn { width:100%; height:56px; border-radius:28px; border:none; background:linear-gradient(135deg,#10B981 0%,#059669 100%); color:#fff; font-size:17px; font-weight:700; cursor:pointer; box-shadow:0 4px 14px rgba(16,185,129,.3); margin-top:24px; display:flex; align-items:center; justify-content:center; gap:8px; }
.pw-install-btn:active { transform:scale(.97); }
.pw-install-btn:disabled { opacity:.5; cursor:not-allowed; transform:none; }
.pw-guide-card { background:var(--surface); border-radius:var(--radius); padding:20px; box-shadow:var(--shadow); border:1px solid var(--border); margin-bottom:12px; }
.pw-guide-platform { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.pw-guide-icon { font-size:28px; }
.pw-guide-name { font-size:15px; font-weight:700; }
.pw-steps { display:flex; flex-direction:column; gap:8px; }
.pw-step { display:flex; align-items:flex-start; gap:10px; font-size:14px; color:var(--text-secondary); line-height:1.5; }
.pw-step-num { width:22px; height:22px; border-radius:50%; background:var(--primary-light); color:var(--primary); font-size:12px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; margin-top:1px; }
.pw-benefits { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:24px; }
.pw-benefit { background:var(--surface); border-radius:var(--radius-sm); padding:16px; box-shadow:var(--shadow); border:1px solid var(--border); text-align:center; }
.pw-benefit-icon { font-size:28px; margin-bottom:6px; }
.pw-benefit-title { font-size:14px; font-weight:700; }
.pw-benefit-desc { font-size:12px; color:var(--text-muted); margin-top:2px; }
.pw-installed { background:var(--primary-light); border-radius:var(--radius); padding:20px; text-align:center; margin-bottom:24px; }
.pw-installed-icon { font-size:40px; margin-bottom:8px; }
.pw-installed-text { font-size:15px; font-weight:700; color:var(--primary); }
.pw-icon-grid { display:flex; gap:16px; flex-wrap:wrap; margin-bottom:24px; }
.pw-icon-card { flex:1; min-width:120px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:16px; text-align:center; }
.pw-icon-card .pw-ip-title { font-size:12px; font-weight:500; color:var(--text-muted); margin-bottom:10px; }
.pw-icon-preview { width:64px; height:64px; border-radius:14px; background:linear-gradient(135deg,var(--primary),#059669); margin:0 auto 8px; display:flex; align-items:center; justify-content:center; font-size:28px; box-shadow:0 2px 8px rgba(16,185,129,.3); }
.pw-icon-preview.round { border-radius:50%; }
.pw-icon-label { font-size:13px; font-weight:500; }
.pw-icon-sub { font-size:11px; color:var(--text-muted); margin-top:2px; }

/* ════════════════════════════════════════════
   HOME TAB — 인라인 style 제거용 클래스
   ════════════════════════════════════════════ */

/* 홈 컨테이너 */
.home-wrap { padding: 0 5vw 26vw; }

/* 상단바 */
.home-topbar { display:flex; align-items:center; justify-content:space-between; padding:5vw 0 6vw; }
.home-greeting { font-size:6vw; font-weight:700; }
.home-avatar { width:10vw; height:10vw; border-radius:50%; background:linear-gradient(135deg,#10B981,#059669); display:flex; align-items:center; justify-content:center; color:#fff; font-size:4vw; font-weight:700; flex-shrink:0; }

/* 스트릭 카드 */
.home-streak { background:var(--surface); border-radius:5vw; padding:5vw; box-shadow:var(--shadow); border:1px solid var(--border); margin-bottom:5vw; display:flex; align-items:center; gap:4vw; }
.home-streak-text { flex:1; min-width:0; }
.home-streak-badge { display:inline-flex; align-items:center; gap:1vw; background:var(--primary-light); color:var(--primary-hover); font-size:3.7vw; font-weight:700; padding:1.5vw 3.5vw; border-radius:5vw; }
.home-streak-title { font-size:4.5vw; font-weight:700; margin-top:3vw; }
.home-streak-subtitle { font-size:3.7vw; color:var(--text-secondary); margin-top:1.5vw; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.home-streak-btn { flex-shrink:0; width:auto; padding:0 5vw; }

/* 섹션 제목 */
.home-section-title { font-size:4.5vw; font-weight:700; margin-bottom:3vw; }

/* 바로시작 그리드 */
.home-quick-grid { display:grid; grid-template-columns:1fr 1fr; gap:2.7vw; margin-bottom:7vw; }
.home-quick-card { background:var(--surface); border-radius:var(--radius); height:26vw; box-shadow:var(--shadow); border:1px solid var(--border); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1.5vw; cursor:pointer; transition:transform 0.2s; }
.home-quick-card:active { transform:scale(0.96); }
.home-quick-emoji { font-size:7vw; line-height:1; }
.home-quick-name { font-size:4vw; font-weight:600; }

/* 최근 운동 */
.home-recent-wrap { display:flex; gap:3vw; overflow-x:auto; padding-bottom:2vw; scrollbar-width:none; }
.home-recent-card { flex-shrink:0; width:42vw; background:var(--surface); border-radius:var(--radius); padding:4vw; box-shadow:var(--shadow); border:1px solid var(--border); }
.home-recent-date { font-size:3.2vw; color:var(--text-muted); margin-bottom:1.5vw; }
.home-recent-dayname { font-size:4vw; font-weight:700; margin-bottom:1vw; }
.home-recent-stats { font-size:3.5vw; color:var(--text-secondary); }
.home-recent-stats strong { color:var(--primary); }

/* 바디포토 카드 */
.home-body-card { background:var(--surface); border-radius:5vw; overflow:hidden; box-shadow:var(--shadow); border:1px solid var(--border); margin-top:5vw; cursor:pointer; }
.home-body-info { padding:4vw 5vw; display:flex; align-items:center; gap:4vw; }
.home-body-emoji { font-size:7vw; }
.home-body-text-wrap { flex:1; }
.home-body-title { font-size:4vw; font-weight:700; }
.home-body-subtitle { font-size:3.5vw; color:var(--text-secondary); }
.home-body-shoot-btn { padding:2vw 3.5vw; border-radius:5vw; border:none; background:linear-gradient(135deg,#10B981,#059669); color:#fff; font-size:3.5vw; font-weight:600; cursor:pointer; font-family:inherit; }
.home-body-photo { height:32vw; overflow:hidden; position:relative; }
.home-body-photo img { width:100%; height:100%; object-fit:cover; opacity:0.8; }
.home-body-photo-overlay { position:absolute; bottom:0; left:0; right:0; background:linear-gradient(transparent,rgba(0,0,0,.5)); padding:3vw 4vw; }
.home-body-photo-date { color:#fff; font-size:3.2vw; font-weight:600; }

/* FAB */
.btn-fab { position:fixed; bottom:20vw; right:5vw; width:15vw; height:15vw; border-radius:50%; background:linear-gradient(135deg,#10B981,#059669); color:#fff; border:none; font-size:7vw; font-weight:300; cursor:pointer; box-shadow:0 1vw 4vw rgba(16,185,129,0.35); display:flex; align-items:center; justify-content:center; z-index:10; transition:transform 0.2s; }
.btn-fab:active { transform:scale(0.92); }

/* ════════════════════════════════════════════
   HOME TAB — 데스크탑 @media 오버라이드
   ════════════════════════════════════════════ */

@media (min-width: 600px) and (max-width: 767px) {
  .home-wrap { padding: 0 24px 100px; }
  .home-topbar { padding: 20px 0 24px; }
  .home-greeting { font-size: 24px; }
  .home-avatar { width: 40px; height: 40px; font-size: 16px; }
  .home-streak { border-radius: 16px; padding: 20px; margin-bottom: 20px; }
  .home-streak-badge { font-size: 14px; padding: 6px 14px; border-radius: 20px; }
  .home-streak-title { font-size: 18px; margin-top: 12px; }
  .home-streak-subtitle { font-size: 14px; margin-top: 6px; }
  .home-streak-btn { padding: 0 20px; }
  .home-section-title { font-size: 18px; margin-bottom: 12px; }
  .home-quick-grid { grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 28px; }
  .home-quick-card { height: 100px; }
  .home-quick-emoji { font-size: 28px; }
  .home-quick-name { font-size: 16px; }
  .home-recent-card { width: 200px; padding: 16px; }
  .home-recent-date { font-size: 13px; }
  .home-recent-dayname { font-size: 16px; }
  .home-recent-stats { font-size: 14px; }
  .home-body-card { border-radius: 16px; margin-top: 20px; }
  .home-body-info { padding: 16px 20px; }
  .home-body-emoji { font-size: 28px; }
  .home-body-title { font-size: 16px; }
  .home-body-subtitle { font-size: 14px; }
  .home-body-shoot-btn { padding: 8px 14px; border-radius: 20px; font-size: 14px; }
  .home-body-photo { height: 160px; }
  .home-body-photo-date { font-size: 13px; }
  .btn-fab { width: 56px; height: 56px; bottom: 88px; right: 24px; font-size: 28px; box-shadow: 0 4px 16px rgba(16,185,129,0.35); }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .home-wrap { padding: 0 40px 100px; }
  .home-topbar { padding: 20px 0 28px; }
  .home-greeting { font-size: 28px; }
  .home-avatar { width: 44px; height: 44px; font-size: 18px; }
  .home-streak { border-radius: 16px; padding: 24px; margin-bottom: 24px; }
  .home-streak-badge { font-size: 14px; padding: 6px 14px; border-radius: 20px; }
  .home-streak-title { font-size: 18px; margin-top: 12px; }
  .home-streak-subtitle { font-size: 15px; margin-top: 6px; }
  .home-streak-btn { padding: 0 20px; }
  .home-section-title { font-size: 18px; margin-bottom: 12px; }
  .home-quick-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
  .home-quick-card { height: 120px; }
  .home-quick-emoji { font-size: 32px; }
  .home-quick-name { font-size: 16px; }
  .home-recent-wrap { display:grid; grid-template-columns:repeat(4, 1fr); gap:12px; overflow-x:visible; padding-bottom:0; }
  .home-recent-card { width:auto; padding:16px; }
  .home-recent-date { font-size: 13px; }
  .home-recent-dayname { font-size: 16px; }
  .home-recent-stats { font-size: 14px; }
  .home-body-card { border-radius: 16px; margin-top: 24px; }
  .home-body-info { padding: 20px 24px; }
  .home-body-emoji { font-size: 32px; }
  .home-body-title { font-size: 17px; }
  .home-body-subtitle { font-size: 14px; }
  .home-body-shoot-btn { padding: 8px 14px; border-radius: 20px; font-size: 14px; }
  .home-body-photo { height: 200px; }
  .home-body-photo-date { font-size: 13px; }
  .btn-fab { width: 56px; height: 56px; bottom: 88px; right: 40px; font-size: 28px; box-shadow: 0 4px 16px rgba(16,185,129,0.35); }
}

@media (min-width: 1025px) {
  .home-wrap { padding: 0 48px 100px; }
  .home-topbar { padding: 24px 0 32px; }
  .home-greeting { font-size: 30px; }
  .home-avatar { width: 44px; height: 44px; font-size: 18px; }
  .home-streak { border-radius: 16px; padding: 24px; margin-bottom: 24px; }
  .home-streak-badge { font-size: 14px; padding: 6px 14px; border-radius: 20px; }
  .home-streak-title { font-size: 18px; margin-top: 12px; }
  .home-streak-subtitle { font-size: 15px; margin-top: 6px; }
  .home-streak-btn { padding: 0 20px; }
  .home-section-title { font-size: 18px; margin-bottom: 12px; }
  .home-quick-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
  .home-quick-card { height: 120px; }
  .home-quick-emoji { font-size: 32px; }
  .home-quick-name { font-size: 16px; }
  .home-recent-wrap { display:grid; grid-template-columns:repeat(4, 1fr); gap:14px; overflow-x:visible; padding-bottom:0; }
  .home-recent-card { width:auto; padding:16px; }
  .home-recent-date { font-size: 13px; }
  .home-recent-dayname { font-size: 16px; }
  .home-recent-stats { font-size: 14px; }
  .home-body-card { border-radius: 16px; margin-top: 24px; }
  .home-body-info { padding: 20px 24px; }
  .home-body-emoji { font-size: 32px; }
  .home-body-title { font-size: 17px; }
  .home-body-subtitle { font-size: 14px; }
  .home-body-shoot-btn { padding: 8px 14px; border-radius: 20px; font-size: 14px; }
  .home-body-photo { height: 200px; }
  .home-body-photo-date { font-size: 13px; }
  .btn-fab { width: 56px; height: 56px; bottom: 88px; right: 48px; font-size: 28px; box-shadow: 0 4px 16px rgba(16,185,129,0.35); }
}
