*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #F2F2F7;
  --card: #FFFFFF;
  --primary: #007AFF;
  --primary-bg: #E8F1FF;
  --success: #34C759;
  --danger: #FF3B30;
  --warning: #FF9500;
  --text: #1C1C1E;
  --text2: #8E8E93;
  --text3: #C7C7CC;
  --sep: #E5E5EA;
  --r: 14px;
  --r-sm: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

#app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

/* ── SCREENS ─── */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}
.screen.active { display: flex; }

/* ── TOP BAR ─── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--sep);
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-bar h2 {
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  flex: 1;
}

.back-btn {
  background: none;
  border: none;
  font-size: 30px;
  color: var(--primary);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  min-width: 32px;
}

.placeholder { min-width: 32px; }

/* ── CALENDAR HEADER ─── */
.cal-header {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--sep);
  padding: 20px 20px 16px;
}

.cal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.logo-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.8px;
  margin-bottom: 0;
}

.settings-btn {
  background: var(--bg);
  border: none;
  font-size: 20px;
  color: var(--text2);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
  flex-shrink: 0;
}
.settings-btn:active { background: var(--sep); }

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cal-month-label {
  font-size: 17px;
  font-weight: 600;
}

.nav-arrow {
  background: var(--bg);
  border: none;
  font-size: 22px;
  color: var(--primary);
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.nav-arrow:active { background: var(--sep); }

/* ── CALENDAR GRID ─── */
.cal-body {
  padding: 16px 12px 8px;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 6px;
}
.cal-weekdays span {
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  padding: 4px 0;
}
.cal-weekdays .sun { color: var(--danger); }
.cal-weekdays .sat { color: var(--primary); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  transition: background 0.12s;
}
.cal-day:active { background: rgba(0,0,0,0.05); }

.cal-day .dn {
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
}

.cal-day.today {
  background: var(--primary);
}
.cal-day.today .dn {
  color: #fff;
  font-weight: 700;
}

.cal-day.done .dn { color: var(--success); font-weight: 600; }
.cal-day.done::after {
  content: '✓';
  position: absolute;
  bottom: 4px;
  font-size: 8px;
  color: var(--success);
  font-weight: 700;
}
.cal-day.today.done::after { color: rgba(255,255,255,0.85); }

.cal-day.miss .dn { color: #C7C7CC; }
.cal-day.miss::after {
  content: '✕';
  position: absolute;
  bottom: 4px;
  font-size: 8px;
  color: #C7C7CC;
}

.cal-day.future { opacity: 0.35; cursor: default; }
.cal-day.empty { pointer-events: none; }

/* weekday colors */
.cal-day[data-dow="0"] .dn { color: var(--danger); }
.cal-day[data-dow="0"].today .dn { color: #fff; }
.cal-day[data-dow="6"] .dn { color: var(--primary); }
.cal-day[data-dow="6"].today .dn { color: #fff; }

.cal-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 12px 0 20px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text2);
}
.dot-done, .dot-miss {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dot-done { background: var(--success); }
.dot-miss { background: #C7C7CC; }

/* ── SCREEN SCROLL ─── */
.screen-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px 120px;
}
.screen-scroll::-webkit-scrollbar { display: none; }

/* ── HINT TEXT ─── */
.hint-text {
  text-align: center;
  color: var(--text2);
  font-size: 14px;
  margin-bottom: 20px;
}

/* ── MUSCLE GRID ─── */
.muscle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.muscle-btn {
  background: var(--card);
  border: 2px solid var(--sep);
  border-radius: var(--r);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow);
}
.muscle-btn:active { transform: scale(0.96); }

.muscle-btn .m-icon { font-size: 28px; }
.muscle-btn .m-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.muscle-btn.selected {
  background: var(--primary-bg);
  border-color: var(--primary);
}
.muscle-btn.selected .m-name { color: var(--primary); }

/* ── BOTTOM BAR ─── */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--sep);
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 40;
}
.bottom-bar.single { display: flex; justify-content: center; }
.bottom-bar.single .btn-primary,
.bottom-bar.single .btn-secondary {
  flex: 0 0 auto;
  width: 65%;
  max-width: 280px;
}
.bottom-bar.double { display: flex; gap: 10px; }

/* ── BUTTONS ─── */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  flex: 1;
  transition: opacity 0.15s;
}
.btn-primary:active { opacity: 0.82; }
.btn-primary:disabled { background: var(--text3); cursor: default; }

.btn-secondary {
  background: var(--primary-bg);
  color: var(--primary);
  border: none;
  border-radius: var(--r-sm);
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  flex: 1;
  transition: opacity 0.15s;
}
.btn-secondary:active { opacity: 0.75; }

/* ── EXERCISE SECTION ─── */
.ex-section {
  margin-bottom: 28px;
}

.ex-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}
.ex-section-icon { font-size: 16px; }

/* ── EXERCISE CARD ─── */
.ex-card {
  background: var(--card);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

.ex-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.ex-select {
  flex: 1;
  background: var(--bg);
  border: 1.5px solid var(--sep);
  border-radius: var(--r-sm);
  padding: 10px 30px 10px 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238E8E93' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.ex-del-btn {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 22px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  border-radius: 50%;
  transition: background 0.12s;
}
.ex-del-btn:active { background: rgba(255,59,48,0.1); }

.ex-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.ctrl-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.ctrl-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.sets-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sets-pm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--sep);
  font-size: 16px;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.12s;
}
.sets-pm:active { background: var(--primary-bg); }

.sets-num {
  font-size: 20px;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
}

.tap-num {
  background: var(--bg);
  border: 1.5px solid var(--sep);
  border-radius: var(--r-sm);
  padding: 7px 12px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  min-width: 58px;
  text-align: center;
  transition: all 0.1s;
  font-family: inherit;
}
.tap-num:active {
  background: var(--primary-bg);
  border-color: var(--primary);
  color: var(--primary);
}

.ctrl-unit {
  font-size: 11px;
  color: var(--text2);
}

/* ── SET ROWS ─── */
.set-col-header {
  display: grid;
  grid-template-columns: 26px 1fr 1fr 28px;
  gap: 6px;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--sep);
  margin-bottom: 4px;
}
.set-col-header.col3 { grid-template-columns: 26px 1fr 28px; }
.set-col-header span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  text-align: center;
}

.set-row {
  display: grid;
  grid-template-columns: 26px 1fr 1fr 28px;
  gap: 6px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--bg);
}
.set-row.col3 { grid-template-columns: 26px 1fr 28px; }

.set-badge {
  width: 22px;
  height: 22px;
  background: var(--primary-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
}

.set-field {
  display: flex;
  align-items: center;
  gap: 4px;
}

.set-tap {
  flex: 1;
  background: var(--bg);
  border: 1.5px solid var(--sep);
  border-radius: 8px;
  padding: 7px 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: all 0.1s;
  min-width: 0;
}
.set-tap:active {
  background: var(--primary-bg);
  border-color: var(--primary);
  color: var(--primary);
}

.set-unit {
  font-size: 11px;
  color: var(--text2);
  flex-shrink: 0;
}

.set-kg-conv {
  font-size: 10px;
  color: var(--text3);
  flex-shrink: 0;
}

.set-del-btn {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 17px;
  cursor: pointer;
  padding: 2px;
  transition: color 0.1s;
  font-family: inherit;
}
.set-del-btn:active { color: var(--danger); }

.add-set-btn {
  width: 100%;
  background: none;
  border: none;
  padding: 10px 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: opacity 0.12s;
}
.add-set-btn:active { opacity: 0.6; }

/* ── CUSTOM EXERCISE INPUT ─── */
.custom-input-wrap {
  margin: -4px 0 12px;
}
.custom-ex-input {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--primary);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  font-family: inherit;
  outline: none;
  -webkit-appearance: none;
}
.custom-ex-input::placeholder { color: var(--text3); }

/* ── ADD EXERCISE BUTTON ─── */
.add-ex-btn {
  width: 100%;
  background: none;
  border: 1.5px dashed var(--text3);
  border-radius: var(--r);
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
  margin-top: 4px;
}
.add-ex-btn:active { background: var(--primary-bg); border-color: var(--primary); }

/* ── 임시저장 버튼 ─── */
.draft-save-btn {
  width: 100%;
  background: var(--primary-bg);
  border: 1.5px solid var(--primary);
  border-radius: var(--r);
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
  margin-top: 10px;
}
.draft-save-btn:active { background: var(--primary); color: #fff; }

/* ── SHEET OVERLAY ─── */
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
}
.sheet-overlay.hidden { display: none; }

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.sheet-content {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  padding: 16px 20px 32px;
  max-height: 88vh;
  overflow-y: auto;
}
.sheet-content::-webkit-scrollbar { display: none; }

.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--text3);
  border-radius: 2px;
  margin: 0 auto 20px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.sheet-header h3 { font-size: 18px; font-weight: 700; }

.sheet-close-btn {
  background: var(--bg);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── NUMPAD ─── */
.numpad-wrap {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: #F9F9F9;
  border-radius: 22px 22px 0 0;
  padding: 20px 16px 24px;
}

.numpad-top {
  background: var(--card);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
}

.numpad-label-text {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.numpad-display {
  font-size: 44px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -1px;
  min-height: 52px;
  line-height: 1.1;
}

.numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.nkey {
  background: var(--card);
  border: none;
  border-radius: var(--r-sm);
  font-size: 24px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  padding: 16px 10px;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: all 0.08s;
}
.nkey:active { background: #D1D1D6; transform: scale(0.95); }

.nkey-sym {
  font-size: 18px;
  color: var(--text2);
}

.numpad-confirm-btn {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  padding: 16px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}
.numpad-confirm-btn:active { opacity: 0.82; }

/* ── LOG SCREEN ─── */
.log-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.log-stat {
  background: var(--card);
  border-radius: var(--r-sm);
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.log-stat-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.log-stat-lbl {
  font-size: 11px;
  color: var(--text2);
  margin-top: 3px;
}

.log-muscle-card {
  background: var(--card);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.log-muscle-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--sep);
}
.log-ex-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--bg);
}
.log-ex-row:last-child { border-bottom: none; }
.log-ex-name { font-size: 14px; font-weight: 500; }
.log-ex-detail {
  font-size: 13px;
  color: var(--text2);
  text-align: right;
}

.log-date-sub {
  text-align: center;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 20px;
}

/* ── TOAST ─── */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(28,28,30,0.88);
  color: #fff;
  padding: 11px 22px;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 500;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── LOGIN SCREEN ─── */
.login-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 28px 60px;
  min-height: 100vh;
}

.login-logo {
  text-align: center;
  margin-bottom: 40px;
}
.login-logo-icon { font-size: 52px; margin-bottom: 12px; }
.login-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text);
  margin-bottom: 6px;
}
.login-sub {
  font-size: 14px;
  color: var(--text2);
}

.auth-card {
  width: 100%;
  background: var(--card);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.auth-input {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--sep);
  border-radius: var(--r-sm);
  padding: 13px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  font-family: inherit;
  outline: none;
  -webkit-appearance: none;
  transition: border-color 0.15s;
}
.auth-input:focus { border-color: var(--primary); }
.auth-input::placeholder { color: var(--text3); }

.auto-login-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
  cursor: pointer;
  width: fit-content;
}
.auto-login-check {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}
.auto-login-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text2);
}

.auth-submit {
  width: 100%;
  margin-top: 0;
}

.auth-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.auth-link-btn {
  background: none;
  border: none;
  font-size: 14px;
  color: var(--text2);
  cursor: pointer;
  font-family: inherit;
  padding: 4px 0;
  transition: color 0.12s;
}
.auth-link-btn:active { color: var(--primary); }
.auth-link-sep { color: var(--text3); font-size: 12px; }

/* ── FORM SECTIONS ─── */
.form-section {
  background: var(--card);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.form-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 14px;
}
.form-group {
  margin-bottom: 12px;
}
.form-group:last-child { margin-bottom: 0; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
}
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── BIRTHDATE PICKER ─── */
.birthdate-row {
  display: flex;
  gap: 6px;
}
.birthdate-sel {
  flex: 1;
  background: var(--bg);
  border: 1.5px solid var(--sep);
  border-radius: var(--r-sm);
  padding: 10px 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
  cursor: pointer;
  outline: none;
}
.birthdate-sel:focus { border-color: var(--primary); }

/* ── PROFILE SCREEN ─── */
.profile-id-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}
.profile-id-val {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* ── LOGOUT BTN ─── */
.btn-logout {
  width: 100%;
  background: rgba(255,59,48,0.10);
  color: var(--danger);
  border: none;
  border-radius: var(--r-sm);
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}
.btn-logout:active { opacity: 0.75; }

/* ── DARK MODE: AUTH ─── */
body.dark .auth-card { background: var(--card); }
body.dark .auth-input { background: var(--bg); }
body.dark .birthdate-sel { background: var(--bg); }

/* ── DRAFT INDICATOR ─── */
.cal-day.has-draft::before {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  background: var(--warning);
  border-radius: 50%;
}

/* ── BTN RESET (기록보기 하단) ─── */
.btn-reset {
  background: rgba(255,59,48,0.10);
  color: var(--danger);
  border: none;
  border-radius: var(--r-sm);
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  flex: 1;
  transition: opacity 0.15s;
}
.btn-reset:active { opacity: 0.75; }

/* ── RESET CONFIRM SHEET ─── */
.reset-confirm-sheet {
  text-align: center;
  padding-bottom: 40px;
}
.reset-confirm-icon { font-size: 40px; margin-bottom: 12px; }
.reset-confirm-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.reset-confirm-desc {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 28px;
}
.btn-reset-confirm {
  width: 100%;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 10px;
  transition: opacity 0.15s;
}
.btn-reset-confirm:active { opacity: 0.82; }
.btn-reset-cancel {
  width: 100%;
  background: var(--bg);
  color: var(--text2);
  border: none;
  border-radius: var(--r-sm);
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}
.btn-reset-cancel:active { opacity: 0.75; }

/* ── SETTINGS SCREEN ─── */
.settings-section {
  margin-bottom: 32px;
}
.settings-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
  padding: 0 4px;
}
.settings-row {
  background: var(--card);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--shadow);
}
.settings-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.settings-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}
.settings-desc {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.5;
}

/* ── THEME SEGMENTED CONTROL ─── */
.theme-seg {
  display: flex;
  background: var(--bg);
  border-radius: var(--r-sm);
  padding: 3px;
  gap: 3px;
}
.theme-seg-btn {
  flex: 1;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.theme-seg-btn.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

/* ── 종목별 단위 토글 ─── */
.unit-col-toggle {
  background: var(--bg);
  border: 1px solid var(--text3);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
  padding: 2px 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.unit-col-toggle:active {
  background: var(--text3);
}

/* ── CACHE CLEAR BTN ─── */
.btn-cache-clear {
  background: rgba(255,59,48,0.10);
  color: var(--danger);
  border: none;
  border-radius: var(--r-sm);
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.btn-cache-clear:active { opacity: 0.75; }

/* ── CALENDAR HEADER BTNS ─── */
.cal-header-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── MONTHLY REPORT ─── */
.report-month-label {
  font-size: 13px;
  color: var(--text2);
  text-align: center;
  margin-bottom: 16px;
}

.report-days-banner {
  background: var(--card);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  text-align: center;
  font-size: 15px;
  color: var(--text2);
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.report-days-banner strong {
  color: var(--primary);
  font-size: 18px;
}

.report-card {
  background: var(--card);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.report-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--sep);
}
.report-ex-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--bg);
  gap: 12px;
}
.report-ex-row:last-child { border-bottom: none; }
.report-ex-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.report-ex-detail {
  font-size: 13px;
  color: var(--text2);
  text-align: right;
}
.report-empty {
  text-align: center;
  color: var(--text2);
  font-size: 15px;
  margin-top: 80px;
  line-height: 1.6;
}

/* ── DARK MODE ─── */
body.dark {
  --bg: #1C1C1E;
  --card: #2C2C2E;
  --primary: #0A84FF;
  --primary-bg: #0A3055;
  --success: #30D158;
  --danger: #FF453A;
  --warning: #FF9F0A;
  --text: #FFFFFF;
  --text2: #AEAEB2;
  --text3: #48484A;
  --sep: #38383A;
  --shadow: 0 2px 12px rgba(0,0,0,0.35), 0 1px 3px rgba(0,0,0,0.25);
}

/* ── 신기록 보드 ── */
.pr-tab-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px 0;
  scrollbar-width: none;
  flex-shrink: 0;
}
.pr-tab-scroll::-webkit-scrollbar { display: none; }

.pr-tab-bar {
  display: flex;
  gap: 8px;
  padding-bottom: 12px;
  width: max-content;
}

.pr-tab-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--sep);
  background: var(--card);
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.pr-tab-btn.selected {
  background: var(--primary-bg);
  border-color: var(--primary);
  color: var(--primary);
}
.pr-tab-btn:active { transform: scale(0.95); }

.pr-board-list {
  padding: 4px 16px 80px;
}

.pr-board-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
  border-bottom: 1px solid var(--sep);
  gap: 12px;
}
.pr-board-row:last-child { border-bottom: none; }
.pr-board-row.no-pr { opacity: 0.4; }

.pr-board-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}

.pr-board-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.pr-board-weight {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.pr-board-date {
  font-size: 11px;
  color: var(--text2);
}

.pr-board-empty {
  font-size: 13px;
  color: var(--text2);
}

body.dark .top-bar {
  background: rgba(28,28,30,0.92);
}
body.dark .cal-header {
  background: rgba(28,28,30,0.92);
}
body.dark .bottom-bar {
  background: rgba(28,28,30,0.95);
}
body.dark .numpad-wrap {
  background: #2C2C2E;
}
body.dark .nkey {
  background: #3A3A3C;
}
body.dark .nkey:active {
  background: #48484A;
}
body.dark .cal-day.today {
  background: var(--primary);
}
body.dark .dot-miss {
  background: #48484A;
}
body.dark .cal-day.miss .dn { color: #48484A; }
body.dark .cal-day.miss::after { color: #48484A; }
body.dark .ex-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23AEAEB2' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
body.dark .numpad-top {
  background: #3A3A3C;
}
body.dark .theme-seg-btn.active {
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* ── 이번달 운동 횟수 ── */
.cal-month-count {
  text-align: center;
  font-size: 13px;
  color: var(--text2);
  padding: 2px 0 8px;
  min-height: 22px;
}

/* ── 루틴 저장 버튼 (운동기록 top-bar) ── */
.routine-save-btn {
  background: none;
  border: none;
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  white-space: nowrap;
}

/* ── 루틴 섹션 (부위선택 화면) ── */
.routine-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  padding: 16px 20px 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.routine-list {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}
.routine-card {
  display: flex;
  align-items: center;
  background: var(--card);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  gap: 10px;
}
.routine-card:active { opacity: 0.75; }
.routine-card-body { flex: 1; }
.routine-card-name { font-size: 15px; font-weight: 600; }
.routine-card-desc { font-size: 12px; color: var(--text2); margin-top: 2px; }
.routine-del {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 15px;
  padding: 4px 6px;
  cursor: pointer;
  line-height: 1;
}

/* ── 휴식 타이머 ── */
.timer-strip {
  display: flex;
  align-items: center;
  padding: 9px 16px;
  background: var(--card);
  border-top: 1px solid var(--sep);
  gap: 10px;
  flex-shrink: 0;
}
.timer-icon { font-size: 15px; }
.timer-presets { display: flex; gap: 6px; }
.timer-preset-btn {
  background: var(--bg);
  border: 1px solid var(--sep);
  border-radius: 20px;
  padding: 5px 13px;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
}
.timer-preset-btn:active { background: var(--sep); }
.timer-active { display: flex; align-items: center; gap: 10px; flex: 1; }
.timer-prog-bg {
  flex: 1;
  height: 4px;
  background: var(--sep);
  border-radius: 2px;
  overflow: hidden;
}
.timer-prog {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 1s linear;
  width: 100%;
}
.timer-count { font-size: 20px; font-weight: 700; color: var(--primary); min-width: 44px; }
.timer-stop-btn {
  background: none;
  border: 1px solid var(--sep);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  white-space: nowrap;
}

/* ── PR 참고 ── */
.ex-pr-ref {
  font-size: 12px;
  color: var(--warning);
  font-weight: 600;
  padding: 0 0 6px;
}

/* ── 체중 기록 ── */
.weight-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.weight-save-btn { width: 70px !important; flex-shrink: 0; }
.weight-log-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--sep);
}
.weight-log-row:last-child { border-bottom: none; }
.weight-log-date { font-size: 14px; color: var(--text2); }
.weight-log-val { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.weight-diff { font-size: 12px; font-weight: 500; }
.weight-diff.up { color: var(--danger); }
.weight-diff.down { color: var(--success); }

/* ── dark mode 추가 ── */
body.dark .timer-strip { background: #2C2C2E; border-color: #3A3A3C; }
body.dark .timer-preset-btn { background: #3A3A3C; border-color: #48484A; color: #FFF; }
body.dark .timer-prog-bg { background: #3A3A3C; }
body.dark .routine-card { background: #2C2C2E; }

/* ── 직전 기록 ── */
.btn-prev-record {
  display: block;
  width: 100%;
  background: none;
  border: 1px dashed var(--sep);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 10px;
  cursor: pointer;
  text-align: left;
}
.btn-prev-record:active { background: var(--bg); }
.prev-record-date {
  font-size: 13px;
  color: var(--text2);
  font-weight: 500;
  margin-bottom: 12px;
}
.prev-record-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--sep);
  font-size: 15px;
}
.prev-record-row:last-child { border-bottom: none; }
.prev-record-set { color: var(--text2); font-size: 13px; }
.prev-record-detail { font-weight: 600; }
body.dark .btn-prev-record { border-color: #3A3A3C; }
