/* Fitness Quest – Design System (FLEEK 벤치마킹 다크 테마) */
@import url('../vendor/pretendard/pretendardvariable-dynamic-subset.css');

:root {
  --bg: #F2F4F6;
  --surface: #FFFFFF;
  --surface-2: #F2F4F6;
  --surface-3: #E5E8EB;
  --border: #E5E8EB;
  --line: rgba(17, 24, 39, .07);
  --text: #191F28;
  --text-2: #4E5968;
  --text-3: #8B95A1;
  --ink: #191F28;
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 6px 20px rgba(17, 24, 39, .04);

  --weight: #3B82F6;
  --hike: #10B981;
  --cali: #F59E0B;
  --danger: #EF4444;
  --weight-t: rgba(59, 130, 246, .10);
  --hike-t: rgba(16, 185, 129, .11);
  --cali-t: rgba(245, 158, 11, .13);
  --danger-t: rgba(239, 68, 68, .09);
  --weight-l: #2563EB;
  --hike-l: #059669;
  --cali-l: #D97706;
  --danger-l: #DC2626;

  --r-xl: 24px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --gutter: 20px;
  --tabbar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #E4E7EB; color: var(--text); }
body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', system-ui, sans-serif;
  font-size: 15px; line-height: 1.5; letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: 12px; word-break: break-all; }
h1, h2, h3, h4, p { margin: 0; }
.ic { flex-shrink: 0; display: block; }

/* ───────── 프레임 & 레이아웃 ───────── */
#app-frame { position: relative; max-width: 480px; height: 100%; margin: 0 auto; background: var(--bg); overflow: hidden; overflow: clip; }
@media (min-width: 481px) { #app-frame { box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(17, 24, 39, .12); } }
#view {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; outline: none; overscroll-behavior: contain;
  padding: 0 var(--gutter) calc(var(--tabbar-h) + var(--safe-b) + 48px);
}
#view > * + * { margin-top: 16px; }
#view > .section-title { margin-top: 28px; }

.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 22px; }
.top > div { min-width: 0; flex: 1; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--text-3); letter-spacing: 0; display: flex; align-items: center; gap: 6px; }
.title { font-size: 28px; font-weight: 800; letter-spacing: -.035em; line-height: 1.2; margin-top: 2px; }
.title span { color: var(--text-2); }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.section-title h2 { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.section-title h2 small { font-size: 13px; font-weight: 600; color: var(--text-3); margin-left: 6px; }
.section-title a, .text-btn { font-size: 13px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 2px; background: none; border: 0; padding: 0; }

.muted { color: var(--text-3); }
.small { font-size: 12px; }
.center { text-align: center; }
.hike-text { color: var(--hike-l); }
.cali-text { color: var(--cali-l); }
.error-text { color: var(--danger-l); }
.danger-text { color: var(--danger-l) !important; }

/* ───────── 카드 ───────── */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); }
.card.flush { padding: 6px 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.card-head h3 { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.desc { color: var(--text-2); font-size: 14px; line-height: 1.65; }

.chip-ic { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text-2); flex-shrink: 0; }
.chip-ic.sm { width: 32px; height: 32px; border-radius: 10px; }
.chip-ic.weight { background: var(--weight-t); color: var(--weight-l); }
.chip-ic.hike { background: var(--hike-t); color: var(--hike-l); }
.chip-ic.cali { background: var(--cali-t); color: var(--cali-l); }
.chip-ic.danger { background: var(--danger-t); color: var(--danger-l); }

/* ───────── 버튼 ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 18px;
  border-radius: var(--r-md); border: 0; background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 15px;
  transition: transform .12s var(--ease), background .2s, opacity .2s; user-select: none; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .35; pointer-events: none; }
.btn.primary { background: var(--weight); color: #fff; }
.btn.hike { background: var(--hike); color: #fff; }
.btn.cali { background: var(--cali); color: #fff; }
.btn.danger { background: var(--danger-t); color: var(--danger-l); }
.btn.white { background: var(--ink); color: #fff; }
.btn.ghost { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.card .btn.ghost, .modal .btn.ghost { background: var(--surface-2); box-shadow: none; }
.btn.outline { background: transparent; box-shadow: inset 0 0 0 1.5px var(--border); }
.btn.block { display: flex; width: 100%; }
.btn.lg { height: 56px; font-size: 16px; border-radius: 16px; }
.btn.sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 11px; }
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform .12s; }
.icon-btn:active { transform: scale(.92); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 10px; }
.card .icon-btn, .modal .icon-btn { background: var(--surface-2); box-shadow: none; }
.icon-btn.ghost, .card .icon-btn.ghost { background: transparent; box-shadow: none; }
.round-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--ink); color: #fff; flex-shrink: 0; transition: transform .12s; }
.round-btn:active { transform: scale(.92); }
.round-btn.weight { background: var(--weight); color: #fff; }
.round-btn.cali { background: var(--cali); color: #fff; }
.file-btn { cursor: pointer; }

/* ───────── 태그 ───────── */
.tag, .badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--text-2); white-space: nowrap; letter-spacing: 0; }
.tag.weight, .badge.weight { background: var(--weight-t); color: var(--weight-l); }
.tag.hike, .badge.hike { background: var(--hike-t); color: var(--hike-l); }
.tag.cali, .badge.cali { background: var(--cali-t); color: var(--cali-l); }
.tag.danger { background: var(--danger-t); color: var(--danger-l); }

/* ───────── 폼 ───────── */
.input { width: 100%; height: 48px; background: var(--surface); border: 0; border-radius: var(--r-md); padding: 0 14px; outline: none; box-shadow: inset 0 0 0 1px var(--border); transition: box-shadow .15s; }
.card .input, .modal .input { background: var(--surface-2); box-shadow: inset 0 0 0 1px transparent; }
.input:focus, .card .input:focus, .modal .input:focus { box-shadow: inset 0 0 0 1.5px var(--weight); }
textarea.input { height: auto; padding: 12px 14px; resize: none; }
.input::placeholder { color: var(--text-3); }
.field { display: block; }
.field + .field, .field-row + .field, .field + .field-row { margin-top: 14px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-3); margin: 0 0 7px 2px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 12.5px; color: var(--text-3); line-height: 1.6; margin-top: 10px; }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); }
.card .chips { margin: 0 -18px; padding: 0 18px; }
.modal .chips { margin: 0 -20px; padding: 0 20px; }
.chips.center { justify-content: center; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; height: 34px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); color: var(--text-2); font-size: 13px; font-weight: 600; transition: background .15s, color .15s; font-variant-numeric: tabular-nums; }
.card .chip, .modal .chip { background: var(--surface-2); box-shadow: none; }
.chip.on, .card .chip.on, .modal .chip.on { background: var(--ink); color: #fff; box-shadow: none; }

.segmented { display: flex; background: var(--surface-3); border-radius: 13px; padding: 4px; }
.segmented button { flex: 1; height: 36px; border: 0; background: transparent; color: var(--text-3); border-radius: 10px; font-weight: 700; font-size: 14px; transition: background .2s, color .2s; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(17, 24, 39, .08); }
.segmented button:disabled { opacity: .35; }
.segmented.sm { padding: 3px; border-radius: 11px; }
.segmented.sm button { height: 28px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }

/* ───────── 리스트 ───────── */
.list-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 18px; border: 0; background: none; text-align: left; position: relative; transition: background .15s; }
.list-item:active { background: rgba(17, 24, 39, .03); }
.list-item + .list-item::before { content: ''; position: absolute; top: 0; left: 72px; right: 18px; height: 1px; background: var(--line); }
.li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.li-main b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-main small { color: var(--text-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-end { color: var(--text-3); display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.empty-state { text-align: center; color: var(--text-3); padding: 36px 20px; font-size: 14px; line-height: 1.7; }
.empty-state .chip-ic { margin: 0 auto 12px; width: 52px; height: 52px; border-radius: 16px; }

/* ───────── 지표 ───────── */
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); }
.metrics.four { grid-template-columns: repeat(4, 1fr); }
.metrics.two { grid-template-columns: repeat(2, 1fr); row-gap: 16px; }
.metric { min-width: 0; padding: 0 4px; }
.metrics > .metric + .metric { border-left: 1px solid var(--line); padding-left: 14px; }
.metrics.two > .metric:nth-child(odd) { border-left: 0; padding-left: 4px; }
.metrics.four > .metric:nth-child(4n+1) { border-left: 0; padding-left: 4px; }
.metrics.four { row-gap: 16px; }
.metric small { display: block; font-size: 12px; font-weight: 600; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.3; }
.metric b i { font-style: normal; font-size: 13px; font-weight: 600; color: var(--text-3); margin-left: 2px; letter-spacing: 0; }
.metric.weight b { color: var(--weight-l); }
.metric.hike b { color: var(--hike-l); }
.metric.cali b { color: var(--cali-l); }
.metrics.sm .metric b { font-size: 18px; }

.progress { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--hike); border-radius: inherit; transition: width .6s var(--ease); }
.progress.lg { height: 8px; }

/* ───────── 탭바 ───────── */
#tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + var(--safe-b)); padding: 0 8px var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr); z-index: 30;
  background: rgba(255, 255, 255, .9); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: inset 0 1px 0 var(--line);
}
#tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-3); font-size: 11px; font-weight: 600; transition: color .2s; }
#tabbar a.on { color: var(--text); }
#tabbar a.on::before { content: ''; position: absolute; top: 0; width: 22px; height: 2.5px; border-radius: 0 0 3px 3px; background: var(--ink); }
#tabbar a.live::after { content: ''; position: absolute; top: 12px; left: calc(50% + 8px); width: 7px; height: 7px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--bg); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* ───────── 홈 ───────── */
.avatar { position: relative; width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #3B82F6, #10B981); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; box-shadow: 0 4px 12px rgba(59, 130, 246, .25); flex-shrink: 0; }
.avatar .sync-dot { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--surface-3); box-shadow: 0 0 0 3px var(--bg); }
.avatar .sync-dot.on { background: var(--hike); }
.avatar .sync-dot.pending { background: var(--cali); }

.hero { background: radial-gradient(120% 90% at 100% 0%, rgba(59, 130, 246, .09), transparent 60%), radial-gradient(90% 80% at 0% 100%, rgba(16, 185, 129, .07), transparent 60%), var(--surface); border-radius: var(--r-xl); padding: 20px; box-shadow: var(--shadow); }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; }
.hero-num { font-size: 44px; font-weight: 800; letter-spacing: -.05em; line-height: 1.1; font-variant-numeric: tabular-nums; margin-top: 2px; }
.hero-num span { font-size: 17px; font-weight: 600; color: var(--text-3); letter-spacing: -.01em; margin-left: 4px; }
.label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.streak { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px; border-radius: 999px; background: var(--cali-t); color: var(--cali-l); font-size: 13px; font-weight: 700; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 18px 0 20px; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.wd small { font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.wd.today small { color: var(--text); }
.ring { position: relative; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-3); }
.ring::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--surface); }
.wd.today .ring { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink); }
.hero .metrics { padding-top: 16px; border-top: 1px solid var(--line); }

.qs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qs { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 14px; border: 0; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); text-align: left; transition: transform .12s var(--ease); min-width: 0; }
.qs:active { transform: scale(.97); }
.qs b { display: block; font-size: 15px; font-weight: 700; }
.qs small { display: block; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qs > div { min-width: 0; width: 100%; }

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head h3 { font-size: 16px; font-weight: 700; }
.cal-nav { display: flex; gap: 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; }
.cal-week div { text-align: center; font-size: 12px; font-weight: 600; color: var(--text-3); padding-bottom: 6px; }
.cal-week div:last-child { color: #F04452; }
.cal-cell { height: 46px; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0; color: var(--text-3); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.cal-cell span { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.cal-cell.empty { pointer-events: none; }
.cal-cell.has span { color: var(--text); font-weight: 700; }
.cal-cell.today span { box-shadow: inset 0 0 0 1.5px var(--text-3); color: var(--text); }
.cal-cell.sel span { background: var(--ink); color: #fff; box-shadow: none; font-weight: 700; }
.dots { display: flex; gap: 3px; height: 5px; }
.dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; }
.dot.hike { background: var(--hike); }
.dot.weight { background: var(--weight); }
.dot.cali { background: var(--cali); }
.legend { display: flex; gap: 16px; justify-content: center; font-size: 12px; color: var(--text-3); margin-top: 12px; font-weight: 500; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.day-detail { margin: 14px -18px -18px; border-top: 1px solid var(--line); padding: 4px 0 6px; }
.day-detail h4 { font-size: 12.5px; font-weight: 600; color: var(--text-3); padding: 10px 18px 2px; }
.day-detail.empty { color: var(--text-3); font-size: 13px; text-align: center; padding: 16px; }

.h-scroll { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter); scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); }
.h-scroll::-webkit-scrollbar { display: none; }
.quest-card { flex: 0 0 150px; scroll-snap-align: start; background: var(--surface); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; text-align: left; border: 0; }
.quest-card b { font-size: 14px; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px; }
.quest-card small { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; font-weight: 600; }
.pring { position: relative; width: 52px; height: 52px; }
.pring svg { transform: rotate(-90deg); display: block; }
.pring em { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ───────── 운동 ───────── */
.cta-card { display: flex; align-items: center; gap: 14px; width: 100%; padding: 18px; border: 0; border-radius: var(--r-lg); text-align: left; color: #fff; background: linear-gradient(135deg, #3B82F6, #2563EB); box-shadow: 0 10px 30px rgba(37, 99, 235, .25); transition: transform .12s var(--ease); }
.cta-card:active { transform: scale(.98); }
.cta-card .chip-ic { background: rgba(255, 255, 255, .18); color: #fff; }
.cta-card b { display: block; font-size: 17px; font-weight: 700; }
.cta-card small { display: block; font-size: 13px; opacity: .8; }
.cta-card.hike { background: linear-gradient(135deg, #10B981, #059669); box-shadow: 0 10px 30px rgba(5, 150, 105, .22); color: #fff; }
.cta-card.hike .chip-ic { background: rgba(255, 255, 255, .2); color: #fff; }
.cta-card > div { flex: 1; min-width: 0; }

.routine-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; position: relative; }
.routine-card + .routine-card::before { content: ''; position: absolute; top: 0; left: 18px; right: 18px; height: 1px; background: var(--line); }
.routine-card .li-main small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.5; margin-top: 3px; }
.routine-card .li-main b { white-space: normal; display: flex; align-items: center; gap: 8px; }
.routine-card .actions { display: flex; align-items: center; gap: 6px; }

.session-bar {
  position: sticky; top: 0; z-index: 20; margin: 0 calc(var(--gutter) * -1); padding: 14px var(--gutter) 12px;
  background: rgba(242, 244, 246, .9); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  box-shadow: inset 0 -1px 0 var(--line);
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px;
}
.sb-timer { display: flex; align-items: center; gap: 7px; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: blink 1.6s infinite; flex-shrink: 0; }
.sb-title { min-width: 0; width: 100%; text-align: center; font-weight: 700; font-size: 14px; color: var(--text-2); background: transparent; border: 0; border-radius: 8px; padding: 6px 4px; outline: none; text-overflow: ellipsis; }
.sb-title:focus { background: var(--surface-2); color: var(--text); }
.sb-stats { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.sb-stats b { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--weight-l); }
.sb-stats small { color: var(--text-3); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.btn-finish { height: 38px; border: 0; background: var(--hike); color: #fff; font-weight: 800; border-radius: 11px; padding: 0 14px; font-size: 14px; white-space: nowrap; }
.session-body { padding-top: 16px; }
.session-body > * + * { margin-top: 14px; }

.ex-card { background: var(--surface); border-radius: var(--r-lg); padding: 16px 14px 14px; box-shadow: var(--shadow); }
.ex-head { display: flex; align-items: center; gap: 12px; padding: 0 2px 14px; }
.ex-head > div { flex: 1; min-width: 0; }
.ex-head h3 { font-size: 16px; font-weight: 700; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-head small { display: flex; gap: 6px; align-items: center; margin-top: 2px; font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.orm { font-variant-numeric: tabular-nums; }
.set-head, .set-row { display: grid; grid-template-columns: 34px minmax(30px, 1fr) 100px 92px 38px; gap: 6px; align-items: center; }
.set-head { font-size: 11.5px; color: var(--text-3); text-align: center; padding: 0 0 6px; font-weight: 600; }
.set-row { padding: 4px 0; border-radius: 12px; transition: background .25s; }
.set-row + .set-row { margin-top: 2px; }
.set-row.done { background: var(--hike-t); }
.set-row.done .stepper { background: transparent; }
.set-row.done .stepper input { color: var(--hike-l); }
.set-row.done .stepper button { opacity: 0; pointer-events: none; }
.set-type { height: 32px; border-radius: 9px; border: 0; background: transparent; font-weight: 800; font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.set-type.t-W { color: var(--cali-l); }
.set-type.t-F { color: var(--danger-l); }
.prev { font-size: 12.5px; color: var(--text-3); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; font-weight: 500; }
.stepper { display: flex; align-items: center; background: var(--surface-2); border-radius: 10px; height: 38px; overflow: hidden; transition: background .2s; }
.stepper button { width: 24px; height: 100%; border: 0; background: transparent; color: var(--text-3); padding: 0; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: opacity .2s; }
.stepper button:active { color: var(--text); }
.stepper input { width: 100%; min-width: 0; text-align: center; background: transparent; border: 0; outline: none; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; padding: 0; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.check { width: 38px; height: 38px; border-radius: 11px; border: 0; background: var(--surface-2); color: var(--text-3); display: flex; align-items: center; justify-content: center; transition: background .2s, color .2s, transform .12s; }
.check:active { transform: scale(.9); }
.check.on { background: var(--hike); color: #fff; }
.ex-foot { display: flex; gap: 8px; margin-top: 10px; }
.ex-foot .btn { flex: 1; height: 40px; font-size: 13.5px; color: var(--text-2); }
.ex-foot .btn.icon-only { flex: 0 0 40px; padding: 0; }
.add-ex { height: 56px; border-radius: var(--r-lg); border: 1.5px dashed var(--surface-3); background: transparent; color: var(--text-2); font-weight: 700; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }

.mini-table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: center; font-variant-numeric: tabular-nums; }
.mini-table th { color: var(--text-3); font-weight: 600; font-size: 11.5px; padding: 0 4px 8px; }
.mini-table td { padding: 9px 4px; border-top: 1px solid var(--line); font-weight: 600; }
.mini-table td:first-child { color: var(--text-3); font-weight: 800; }
.pr-box { width: 100%; padding: 14px; border-radius: var(--r-md); background: var(--cali-t); color: var(--cali-l); font-size: 14px; font-weight: 600; line-height: 1.7; display: flex; gap: 10px; text-align: left; }

/* ───────── 휴식 타이머 ───────── */
.rest-timer {
  position: absolute; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); z-index: 25;
  background: rgba(25, 31, 40, .94); color: #fff; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-radius: 20px; overflow: hidden; box-shadow: 0 16px 40px rgba(17, 24, 39, .28);
  transform: translateY(calc(100% + 24px)); opacity: 0; transition: transform .35s var(--ease), opacity .25s; pointer-events: none;
}
.rest-timer.show { transform: none; opacity: 1; pointer-events: auto; }
.rest-timer.done { background: rgba(5, 150, 105, .96); }
.rt-progress { height: 3px; background: rgba(255, 255, 255, .1); }
.rt-progress span { display: block; height: 100%; background: var(--weight); transition: width .25s linear; }
.rest-timer.done .rt-progress span { background: #fff; }
.rt-body { display: flex; align-items: center; gap: 6px; padding: 12px 12px 12px 16px; }
.rt-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rt-label { color: rgba(255, 255, 255, .7); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-time { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; letter-spacing: -.03em; }
.rt-btn { height: 38px; border: 0; color: #fff; background: rgba(255, 255, 255, .12); border-radius: 11px; padding: 0 11px; font-weight: 700; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rt-btn.skip { background: #fff; color: var(--ink); }

/* ───────── 등산 ───────── */
.map-box { position: relative; z-index: 0; isolation: isolate; height: 260px; border-radius: var(--r-lg); overflow: hidden; background: #E8EBEE; box-shadow: var(--shadow); }
.map-hero { position: relative; margin: 0 calc(var(--gutter) * -1); }
.map-hero .map-box { height: 340px; border-radius: 0; box-shadow: none; }
.map-hero.tall .map-box { height: 46vh; min-height: 300px; }
.map-hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(rgba(242, 244, 246, 0), var(--bg)); pointer-events: none; z-index: 1; }
.map-hero .float-back { position: absolute; top: 16px; left: 16px; z-index: 2; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); color: var(--text); box-shadow: 0 2px 10px rgba(17, 24, 39, .12); }
.map-hero .float-chip { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); z-index: 2; height: 32px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); font-size: 12.5px; font-weight: 700; white-space: nowrap; box-shadow: 0 2px 10px rgba(17, 24, 39, .12); }
#view > .map-hero + * { margin-top: -40px; position: relative; z-index: 2; }
.map-fallback { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 13px; }
.leaflet-container { background: #E8EBEE; font-family: inherit; }
.leaflet-control-attribution { background: rgba(255, 255, 255, .8) !important; color: var(--text-3) !important; font-size: 9.5px; border-radius: 6px 0 0 0; }
.leaflet-control-attribution a { color: var(--text-3) !important; }
.leaflet-bar { border: 0 !important; box-shadow: 0 2px 10px rgba(17, 24, 39, .12) !important; border-radius: 10px !important; overflow: hidden; }
.leaflet-bar a { background: rgba(255, 255, 255, .96) !important; color: var(--text) !important; border-color: var(--line) !important; width: 32px !important; height: 32px !important; line-height: 32px !important; }
.leaflet-control-layers { background: rgba(255, 255, 255, .96) !important; color: var(--text) !important; border: 0 !important; border-radius: 10px !important; box-shadow: 0 2px 10px rgba(17, 24, 39, .12) !important; font-size: 13px; }
.leaflet-control-layers-toggle { width: 34px !important; height: 34px !important; background-size: 18px !important; }
.leaflet-control-layers-expanded { padding: 8px 12px !important; }
.map-hero .leaflet-top.leaflet-right { top: 60px; }
.map-hero .leaflet-top.leaflet-left { top: 60px; }
.map-hero .leaflet-bottom { bottom: 44px; }
.pin-icon span { display: flex; width: 24px; height: 24px; border-radius: 50%; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 11px; box-shadow: 0 0 0 3px #fff, 0 3px 8px rgba(17, 24, 39, .3); }
.live-dot span { display: block; width: 20px; height: 20px; border-radius: 50%; background: var(--weight); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(59, 130, 246, .3); animation: livepulse 1.8s infinite; }
@keyframes livepulse { 50% { box-shadow: 0 0 0 14px rgba(59, 130, 246, 0); } }

.elev-chart { width: 100%; height: auto; display: block; overflow: visible; }
.elev-chart text { fill: var(--text-3); font-size: 12px; font-weight: 600; font-family: inherit; }
.elev-chart text.peak { fill: var(--text); font-weight: 800; font-size: 13px; }
.elev-chart .grid { stroke: var(--line); stroke-width: 1; }
.chart-empty { color: var(--text-3); text-align: center; padding: 30px 0; font-size: 13px; }

.group-head { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 12px; }
.group-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.group-head .count { font-size: 12.5px; font-weight: 700; color: var(--text-3); display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.group-head .count .progress { width: 48px; height: 4px; }
.course-list { display: flex; flex-direction: column; gap: 10px; }
.course-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); transition: transform .12s var(--ease); }
.course-card:active { transform: scale(.985); }
.course-card > div { flex: 1; min-width: 0; }
.course-card b { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.course-card b .ic { color: var(--hike); }
.course-card .region { font-size: 12.5px; color: var(--text-3); margin-top: 1px; display: block; }
.cc-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 10px; font-size: 13px; color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.cc-stats span { display: inline-flex; align-items: center; gap: 4px; }
.cc-stats .ic { color: var(--text-3); }
.spark { width: 76px; height: 44px; flex-shrink: 0; }
.diff { display: inline-flex; height: 22px; align-items: center; font-size: 11.5px; font-weight: 700; padding: 0 8px; border-radius: 7px; background: var(--hike-t); color: var(--hike-l); white-space: nowrap; }
.diff.d-보통 { background: var(--weight-t); color: var(--weight-l); }
.diff.d-어려움 { background: var(--cali-t); color: var(--cali-l); }
.diff.d-매우어려움 { background: var(--danger-t); color: #F87171; }
.tracking-banner { display: flex; align-items: center; gap: 10px; background: var(--danger-t); color: var(--danger-l); padding: 0 16px; height: 50px; border-radius: var(--r-md); font-weight: 700; font-size: 14px; }
.tracking-banner span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.detail-head .title { font-size: 26px; }
.detail-head .meta { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.sticky-cta { position: sticky; bottom: -40px; z-index: 5; margin: 24px calc(var(--gutter) * -1) 0; padding: 24px var(--gutter) 12px; background: linear-gradient(rgba(242, 244, 246, 0), var(--bg) 40%); display: flex; gap: 10px; }
.sticky-cta .btn.ghost { flex: 0 0 auto; }
.sticky-cta .btn { flex: 1; }

.track-panel { background: var(--surface); border-radius: var(--r-xl); padding: 20px; box-shadow: 0 -6px 30px rgba(17, 24, 39, .08); }
.track-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.track-main .lbl, .track-main .time small { font-size: 12px; font-weight: 600; color: var(--text-3); display: block; }
.track-main .big { font-size: 52px; font-weight: 800; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--hike-l); }
.track-main .big i { font-style: normal; font-size: 18px; color: var(--text-3); font-weight: 600; margin-left: 4px; letter-spacing: 0; }
.track-main .time { text-align: right; }
.track-main .time b { display: block; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.track-controls { display: flex; align-items: center; justify-content: center; gap: 28px; padding: 6px 0 2px; }
.ctrl { display: flex; flex-direction: column; align-items: center; gap: 8px; border: 0; background: none; font-size: 12px; font-weight: 600; color: var(--text-3); }
.ctrl > span { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--surface); color: var(--text); box-shadow: var(--shadow); transition: transform .12s; }
.ctrl:active > span { transform: scale(.92); }
.ctrl.stop > span { width: 72px; height: 72px; background: var(--danger); color: #fff; box-shadow: 0 10px 30px rgba(239, 68, 68, .3); }
.sim-speed { display: flex; align-items: center; gap: 12px; }
.sim-speed > span { font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.sim-speed .chips { margin: 0; padding: 0; flex: 1; justify-content: flex-end; }
.sim-speed .chip { height: 30px; padding: 0 11px; }

/* ───────── 트로피 ───────── */
.trophy-hero { background: radial-gradient(100% 100% at 50% 0%, rgba(245, 158, 11, .10), transparent 70%), var(--surface); border-radius: var(--r-xl); padding: 22px 18px 18px; box-shadow: var(--shadow); }
.trophy-medals { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.trophy-medals > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.trophy-medals b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.trophy-medals small { color: var(--text-3); font-size: 12px; font-weight: 600; }
.trophy-total { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.trophy-total .progress { flex: 1; }
.quest-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quest-tile { background: var(--surface); border: 0; border-radius: var(--r-lg); padding: 18px 14px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; box-shadow: var(--shadow); transition: transform .12s var(--ease); }
.quest-tile:active { transform: scale(.97); }
.quest-tile b { font-size: 14px; font-weight: 700; line-height: 1.35; letter-spacing: -.02em; }
.quest-tile small { color: var(--text-3); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.quest-tile .progress { width: 100%; height: 4px; margin-top: 2px; }
.quest-tile.won.gold { box-shadow: inset 0 0 0 1px rgba(245, 158, 11, .35); background: linear-gradient(180deg, rgba(245, 158, 11, .08), transparent 60%), var(--surface); }
.quest-tile.won.silver { box-shadow: inset 0 0 0 1px rgba(203, 213, 225, .25); background: linear-gradient(180deg, rgba(203, 213, 225, .06), transparent 60%), var(--surface); }
.quest-tile.won.emerald { box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .35); background: linear-gradient(180deg, rgba(16, 185, 129, .08), transparent 60%), var(--surface); }
.won-date { color: var(--hike-l) !important; }

/* ───────── 클라우드 ───────── */
.account { display: flex; align-items: center; gap: 14px; }
.account > div { flex: 1; min-width: 0; }
.account b { display: block; font-size: 16px; font-weight: 700; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-3); }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.status.on { color: var(--hike-l); }
.status.on::before { background: var(--hike); box-shadow: 0 0 0 3px var(--hike-t); }
.kv { display: flex; flex-direction: column; }
.kv > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; font-size: 14px; }
.kv > div + div { border-top: 1px solid var(--line); }
.kv span { color: var(--text-2); display: flex; align-items: center; gap: 10px; min-width: 0; }
.kv span .ic { color: var(--text-3); }
.kv b { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13.5px; }
.kv b.ok { color: var(--hike-l); }
.kv b.wait { color: var(--cali-l); }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); font-weight: 600; cursor: pointer; }
.switch input { display: none; }
.switch span { width: 44px; height: 26px; border-radius: 999px; background: var(--surface-3); position: relative; transition: background .25s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.switch input:checked + span { background: var(--hike); }
.switch input:checked + span::after { transform: translateX(18px); }
.table-wrap { overflow: auto; max-height: 340px; border-radius: 12px; background: #fff; margin-top: 14px; box-shadow: inset 0 0 0 1px var(--border); }
.sheet-table { border-collapse: separate; border-spacing: 0; font-size: 12px; color: #1F2937; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 100%; }
.sheet-table th { position: sticky; top: 0; z-index: 1; background: #F1F5F3; color: #0F5132; font-weight: 700; padding: 8px 10px; border-bottom: 1px solid #D9E2DC; border-right: 1px solid #E8ECEA; text-align: left; }
.sheet-table td { padding: 7px 10px; border-bottom: 1px solid #EEF0F2; border-right: 1px solid #F3F4F6; }
.sheet-table td.rn, .sheet-table th:first-child { position: sticky; left: 0; background: #F8F9FA; color: #9CA3AF; text-align: center; font-weight: 600; }
.sheet-table th:first-child { z-index: 2; }
.table-foot { font-size: 12px; color: var(--text-3); margin-top: 10px; }
.menu-list .list-item { padding: 14px 18px; }
.menu-list .list-item .chip-ic { width: 34px; height: 34px; border-radius: 10px; }
.menu-list .list-item + .list-item::before { left: 66px; }

/* ───────── 모달 / 바텀시트 ───────── */
.modal-wrap { position: absolute; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .38); opacity: 0; transition: opacity .3s; }
.modal { position: relative; width: 100%; max-height: 90%; overflow-y: auto; background: var(--surface); border-radius: 26px 26px 0 0; padding-bottom: var(--safe-b); transform: translateY(100%); transition: transform .4s var(--ease); box-shadow: 0 -10px 40px rgba(17, 24, 39, .12); }
.modal::before { content: ''; display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 10px auto 0; }
.modal-wrap.show .modal-backdrop { opacity: 1; }
.modal-wrap.show .modal { transform: none; }
.modal-wrap.small, .modal-wrap.cert-modal { align-items: center; padding: 24px; }
.modal-wrap.small .modal, .modal-wrap.cert-modal .modal { border-radius: 24px; transform: scale(.94); opacity: 0; transition: transform .3s var(--ease), opacity .2s; }
.modal-wrap.small .modal::before, .modal-wrap.cert-modal .modal::before { display: none; }
.modal-wrap.small.show .modal, .modal-wrap.cert-modal.show .modal { transform: none; opacity: 1; }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 14px 20px 10px; background: var(--surface); }
.modal-head h3 { font-size: 19px; font-weight: 800; letter-spacing: -.03em; }
.modal-body { padding: 8px 20px 24px; }
.modal-body > * + * { margin-top: 14px; }
.modal-body.center { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 20px; }
.modal-body.center .btn-row, .modal-body.center .summary-box { width: 100%; }
.modal h2 { font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.confirm-msg { white-space: pre-line; font-size: 16px; font-weight: 600; line-height: 1.6; padding: 4px 0; }
.done-badge { width: 72px; height: 72px; border-radius: 24px; display: flex; align-items: center; justify-content: center; background: var(--hike-t); color: var(--hike-l); }
.summary-box { background: var(--surface-2); border-radius: var(--r-md); padding: 16px 12px; text-align: left; }
.picker-list { max-height: 48vh; overflow-y: auto; margin: 0 -20px; }
.picker-list .list-item { padding: 12px 20px; }
.picker-list .list-item + .list-item::before { left: 74px; right: 20px; }
.cert-modal .modal { background: transparent; box-shadow: none; overflow: visible; }
.cert-badge { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 999px; font-size: 15px; font-weight: 800; background: #fff; box-shadow: var(--shadow); animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
.cert-svg { width: 100%; max-width: 340px; animation: pop .55s cubic-bezier(.2, 1.4, .4, 1); filter: drop-shadow(0 20px 40px rgba(17, 24, 39, .25)); }
.cert-svg > svg { width: 100%; height: auto; display: block; }
.cert-modal .btn-row { max-width: 340px; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.confetti-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 100; }

/* ───────── 토스트 ───────── */
.toast { position: absolute; left: 50%; top: 16px; z-index: 80; width: max-content; max-width: calc(100% - 32px); display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 10px; border-radius: 16px; background: rgba(25, 31, 40, .94); color: #fff; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); font-size: 14px; font-weight: 600; box-shadow: 0 12px 32px rgba(17, 24, 39, .25); transform: translate(-50%, -160%); opacity: 0; transition: transform .4s var(--ease), opacity .3s; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast .t-ic { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: rgba(255, 255, 255, .14); color: #fff; }
.toast.success .t-ic { background: var(--hike); color: #fff; }
.toast.error .t-ic { background: var(--danger); color: #fff; }
.toast.warn .t-ic { background: var(--cali); color: #fff; }
.toast span { min-width: 0; }

/* 진입 애니메이션 */
#view.enter > * { animation: rise .45s var(--ease) both; }
#view.enter > *:nth-child(2) { animation-delay: .03s; }
#view.enter > *:nth-child(3) { animation-delay: .06s; }
#view.enter > *:nth-child(4) { animation-delay: .09s; }
#view.enter > *:nth-child(5) { animation-delay: .12s; }
#view.enter > *:nth-child(n+6) { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 370px) {
  :root { --gutter: 16px; }
  .set-head, .set-row { grid-template-columns: 30px minmax(26px, 1fr) 90px 84px 36px; gap: 4px; }
  .stepper button { width: 20px; }
  .metric b { font-size: 19px; }
  .session-bar { grid-template-columns: auto 1fr auto; }
  .session-bar .sb-stats { display: none; }
  .title { font-size: 25px; }
}
.cta-card:disabled { opacity: .4; pointer-events: none; }

/* ───────── 운동 동작 애니메이션 ───────── */
.motion-thumb { width: 52px; height: 52px; border-radius: 14px; border: 0; padding: 2px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--weight-t); transition: transform .12s; }
.motion-thumb.cali { background: var(--cali-t); }
.motion-thumb:active { transform: scale(.94); }
.picker-list .motion-thumb { width: 48px; height: 48px; }
.motion-stage { display: flex; justify-content: center; padding: 12px; border-radius: var(--r-lg); background: var(--weight-t); }
.motion-stage.cali { background: var(--cali-t); }
.motion-stage svg { width: 100%; max-width: 240px; height: auto; }
.meta-row { display: flex; gap: 6px; flex-wrap: wrap; }
.cues { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: cue; display: flex; flex-direction: column; gap: 10px; }
.cues li { counter-increment: cue; display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.5; color: var(--text-2); }
.cues li::before { content: counter(cue); flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--text); font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-top: 1px; }

/* ───────── 등산 개요 지도 ───────── */
.map-card { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.map-card .map-box { height: 240px; border-radius: 0; box-shadow: none; }
.map-card-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 0; }
.map-card-bar .chips { flex: 1; margin: 0; padding: 0 0 0 12px; }
.map-card-bar .chip { height: 30px; padding: 0 11px; display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); box-shadow: none; }
.map-card-bar .chip.on { background: var(--ink); color: #fff; }
.map-card-bar .icon-btn { background: var(--surface-2); box-shadow: none; }
#archive-map { height: 220px; }
.course-pin span { display: flex; width: 26px; height: 26px; border-radius: 50%; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 11.5px; box-shadow: 0 0 0 2.5px #fff, 0 3px 8px rgba(17, 24, 39, .3); }
.leaflet-tooltip.course-tip { background: var(--ink); color: #fff; border: 0; border-radius: 8px; font-family: inherit; font-weight: 600; font-size: 12px; padding: 4px 8px; box-shadow: none; }
.leaflet-tooltip.course-tip::before { border-top-color: var(--ink); }

/* ───────── 온보딩 · 로그인 ───────── */
#app-frame.bare #tabbar, #app-frame.bare .rest-timer { display: none; }
#app-frame.bare #view { padding-bottom: 0; }
.welcome { min-height: 100%; display: flex; flex-direction: column; padding: 0 4px calc(24px + var(--safe-b)); }
#view > .welcome { margin-top: 0; }
.welcome-hero { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 48px 0 24px; }
.welcome-hero h1 { font-size: 30px; font-weight: 800; letter-spacing: -.04em; line-height: 1.3; margin-top: 28px; }
.welcome-hero p { margin-top: 12px; color: var(--text-2); font-size: 15.5px; line-height: 1.6; }
.hero-figs { display: flex; gap: 12px; }
.hero-figs .motion-thumb { width: 80px; height: 80px; border-radius: 24px; }
.welcome-actions { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; }
.login-btn { position: relative; height: 54px; border: 0; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: 16px; transition: transform .12s, opacity .2s; }
.login-btn svg { position: absolute; left: 20px; }
.login-btn:active { transform: scale(.98); }
.login-btn:disabled { opacity: .5; }
.login-btn.loading span::after { content: ' …'; }
.login-btn.kakao { background: #FEE500; color: rgba(0, 0, 0, .85); }
.login-btn.google { background: #fff; color: #1F1F1F; box-shadow: inset 0 0 0 1px #DADCE0; }
.text-btn.guest { align-self: center; height: 44px; color: var(--text-3); font-size: 14px; }
.nickname .top { padding-top: 16px; min-height: 56px; }
.nick-body { flex: 1; padding-top: 12px; }
.nick-body .title { margin-top: 6px; }
.nick-avatar { display: flex; justify-content: center; margin: 32px 0 24px; }
.input.lg { height: 56px; font-size: 18px; font-weight: 700; }
.nick-msg { font-size: 13px; color: var(--text-3); margin: 8px 2px 20px; font-weight: 600; }
.nick-msg.ok { color: var(--hike-l); }
.nick-msg.bad { color: var(--danger-l); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 0; transition: transform .15s; }
.swatch.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); transform: scale(1.05); }
.avatar-c { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 800; flex-shrink: 0; letter-spacing: 0; }

/* ───────── 친구 ───────── */
.me-card { display: flex; align-items: center; gap: 14px; }
.search-bar { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 8px 0 16px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); color: var(--text-3); }
.search-input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font-size: 15px; color: var(--text); }
.search-input::placeholder { color: var(--text-3); }
.friend-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 8px 0 4px; }
.friend-hero .title { font-size: 24px; }
.heat { display: grid; grid-template-columns: repeat(14, 1fr); gap: 5px; }
.heat i { aspect-ratio: 1; border-radius: 6px; background: var(--surface-2); }
.heat i.hike { background: var(--hike); }
.heat i.weight { background: var(--weight); }
.heat i.cali { background: var(--cali); }
.heat i.multi { background: linear-gradient(135deg, var(--weight) 50%, var(--hike) 50%); }
.list-item .btn.sm { flex-shrink: 0; }
.account-card { display: flex; align-items: center; gap: 14px; }
