:root {
  /* 아이보리 + 오렌지 포인트. 통증 색은 오렌지와 헷갈리지 않게 노랑→빨강 계열 */
  color-scheme: light;
  --bg: #faf6ec;
  --surface: #fffdf7;
  --surface-2: #f3ecdd;
  --text: #2d2720;
  --muted: #8d8270;
  --line: #e8dfcc;
  --accent: #e0702a;
  --accent-soft: #fdeadb;
  --on-accent: #ffffff;
  --danger: #c0392b;
  --caution-bg: #fcebe6;
  --caution-line: #f1c4b9;
  --pain-low: #f2c94c;
  --pain-mid: #e5684f;
  --pain-high: #b8282e;
  --region: #eee5d2;
  --region-hover: #f7d9bf;
  --body-line: #c4b59b;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(74, 52, 20, .05), 0 2px 8px rgba(74, 52, 20, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Noto Sans KR", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}
h1, h2, h3, h4 { margin: 0; }
h1 { font-size: 22px; }
h3 { font-size: 15px; margin-bottom: 12px; }
h4 { font-size: 13px; color: var(--muted); margin: 14px 0 6px; font-weight: 500; }
p { margin: 8px 0 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pad { padding: 16px; }
.spacer { flex: 1; }

/* ── 상단바·레이아웃 ── */
.topbar {
  height: 52px; display: flex; align-items: center; gap: 12px;
  padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 17px; color: var(--accent); }
.topbar-sub { font-size: 12px; color: var(--muted); background: var(--surface-2); padding: 2px 8px; border-radius: 99px; }

.layout { display: flex; height: calc(100% - 52px); }
.sidebar {
  width: 300px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.sidebar-head { padding: 14px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); }
.main { flex: 1; overflow-y: auto; padding: 24px 28px 60px; }

.empty-state { height: 100%; display: grid; place-items: center; text-align: center; color: var(--muted); }

/* ── 회원 목록 ── */
.member-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.member-item { padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.member-item:hover { background: var(--surface-2); }
.member-item.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.member-item-top { display: flex; align-items: center; gap: 6px; }
.member-item-sub { font-size: 12.5px; color: var(--muted); }
.badge { font-size: 11px; padding: 1px 7px; border-radius: 99px; color: #fff; font-weight: 500; }
.badge.caution { background: var(--danger); }

/* ── 버튼·입력 ── */
.btn {
  font: inherit; font-size: 14px; padding: 8px 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 500; }
.btn.primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.small { padding: 4px 10px; font-size: 13px; }

input, select, textarea {
  font: inherit; font-size: 14px; width: 100%; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input[type="range"] { padding: 0; accent-color: var(--accent); }
input[type="date"] { width: auto; }
textarea { resize: vertical; }

/* ── 칩 ── */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: inherit; font-size: 13.5px; padding: 6px 12px; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  transition: background .1s, border-color .1s;
}
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 13px; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.tag.caution { background: var(--danger); color: #fff; }

/* ── 회원 상세 ── */
.member-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.member-head-main { flex: 1; }
.member-memo { margin-top: 6px; font-size: 13.5px; background: var(--surface-2); padding: 6px 10px; border-radius: 8px; display: inline-block; }
.back { display: none; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab {
  font: inherit; font-size: 14px; padding: 10px 14px; border: 0; background: none; color: var(--muted);
  border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap;
}
.tab.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 700; }
.tab:disabled { cursor: not-allowed; opacity: .55; }
.tab small { font-size: 11px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card, .consult-form > .card { margin-top: 14px; }
.empty-card { text-align: center; padding: 40px; }
.empty-card .btn { margin-top: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack > .card + .card { margin-top: 0; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }

.consult-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.consult-bar > div:first-child { display: flex; align-items: center; gap: 10px; }
.consult-bar-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.consult-bar.sticky {
  position: sticky; top: -24px; z-index: 5; background: var(--bg);
  padding: 12px 0; margin: -12px 0 2px; border-bottom: 1px solid var(--line);
}
.consult-pick { width: auto; padding: 4px 8px; }
label.inline { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }

.caution-card { background: var(--caution-bg); border-color: var(--caution-line); margin-bottom: 14px; }
.caution-card h3 { color: var(--danger); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 10px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.history { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }

/* ── 인체 도식 ── */
.bodymap { display: flex; justify-content: center; gap: 20px; margin-bottom: 8px; }
.bodymap figure { margin: 0; text-align: center; }
.bodymap svg { width: 190px; height: auto; display: block; }
.bodymap figcaption { font-size: 12px; color: var(--muted); }
.body-base { fill: var(--region); }
.body-outline { fill: none; stroke: var(--body-line); stroke-width: 1; pointer-events: none; }
.body-detail { fill: none; stroke: var(--body-line); stroke-width: .6; opacity: .55; pointer-events: none; stroke-linecap: round; }
.region { fill: transparent; stroke: var(--surface); stroke-width: .7; stroke-opacity: .7; transition: fill .1s; }
.region.on { fill-opacity: .35; }
.region-glow { opacity: .9; pointer-events: none; }
.region.clickable { cursor: pointer; }
.region.clickable:hover:not(.on) { fill: var(--region-hover); }
.side-label { font-size: 11px; fill: var(--muted); font-weight: 700; }

.pain-row { padding: 10px 0; border-top: 1px solid var(--line); }
.pain-row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pain-row-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.pain-bar { display: flex; align-items: center; gap: 8px; width: 140px; }
.pain-bar > span { display: block; height: 6px; border-radius: 3px; }
.pain-bar em { font-style: normal; font-weight: 700; font-size: 13px; margin-left: auto; }

/* ── 상담 폼 ── */
.field { margin-top: 14px; }
.field:first-of-type { margin-top: 0; }
.field-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.row2 > .field { margin-top: 0; }
.pain-edit-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.pain-edit, .hist-edit { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: var(--surface-2); }
.pain-edit .chip, .hist-edit .chip { background: var(--surface); }
.pain-edit .chip.on, .hist-edit .chip.on { background: var(--accent); }
.pain-edit-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.slider-row { display: flex; align-items: center; gap: 12px; }
.pain-val { font-size: 20px; width: 28px; text-align: right; }
.form-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ── 사진·표시점 ── */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 12px; }
.photo-item { display: flex; flex-direction: column; gap: 8px; }
.photo-box { position: relative; border-radius: 10px; overflow: hidden; background: var(--surface-2); line-height: 0; }
.photo-box img { width: 100%; display: block; }
.photo-box.editable img { cursor: crosshair; }
.marker {
  position: absolute; transform: translate(-50%, -50%); width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; line-height: 22px;
  text-align: center; box-shadow: 0 0 0 2px #fff; pointer-events: none;
}
.marker.static { position: static; transform: none; display: inline-block; flex-shrink: 0; }
.marker-list { display: flex; flex-direction: column; gap: 6px; }
.marker-row { display: flex; align-items: center; gap: 6px; }
.marker-notes { margin: 0; padding-left: 20px; font-size: 13.5px; }
.photo-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── 평가 표 ── */
.eval-table { display: flex; flex-direction: column; }
.eval-row { display: grid; grid-template-columns: 110px repeat(3, minmax(0, 1fr)); gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.eval-row.head { border-top: 0; font-size: 12.5px; color: var(--muted); padding-top: 0; }
.eval-label { font-size: 14px; font-weight: 500; }
.eval-cell { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.eval-cell.empty { color: var(--line); justify-content: center; }
.eval-row.head > span:not(:first-child) { text-align: center; }
.cell-side { display: none; font-size: 12px; color: var(--muted); width: 100%; }
.eval-row .chip { padding: 4px 10px; font-size: 13px; }
.pain-check { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.pain-check input { width: auto; accent-color: var(--danger); }

.align-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.align-table th, .align-table td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.align-table thead th { border-top: 0; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.align-table tbody th { width: 110px; font-weight: 500; }
.align-table td.flag { color: var(--danger); font-weight: 500; }
.align-table thead th:not(:first-child) { text-align: center; }
.align-table.lr td { text-align: center; }
.good { color: #3c8a4e; }
.pain-dot { color: var(--danger); font-size: 12px; }

/* ── 수업 기록 ── */
.exercise-row { display: grid; grid-template-columns: minmax(0, 2fr) 70px 70px minmax(0, 1.4fr) auto; gap: 6px; align-items: center; }
.ex-list { margin: 8px 0 0; padding-left: 18px; font-size: 14px; }
.next-plan { background: var(--accent-soft); padding: 8px 12px; border-radius: 8px; font-size: 14px; }
.session-card .photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin-top: 10px; }
.trend { width: 100%; height: auto; max-height: 220px; margin-top: 8px; }
.trend .grid { stroke: var(--line); }
.trend text { font-size: 9px; fill: var(--muted); }
.trend polyline { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.trend .before { stroke: var(--pain-mid); fill: var(--pain-mid); }
.trend polyline.before, .trend polyline.after { fill: none; }
.trend .after { stroke: var(--accent); fill: var(--accent); }
.trend polyline.before { stroke-dasharray: 5 4; }
.legend { display: flex; gap: 12px; font-size: 12.5px; color: var(--muted); }
.lg::before { content: ""; display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.lg.before::before { background: var(--pain-mid); }
.lg.after::before { background: var(--accent); }

/* ── 예약·패키지 ── */
.booking-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.booking-when { display: flex; flex-direction: column; min-width: 150px; }
.booking-row .chip { padding: 4px 10px; font-size: 13px; }
.package-row { padding: 10px 0; border-top: 1px solid var(--line); }
.package-row .btn { margin-top: 4px; padding-left: 0; }
.package-left { font-weight: 700; color: var(--accent); }
.package-row.low .package-left { color: var(--danger); }
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); margin: 6px 0 4px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); }
.warn { color: var(--danger); }
.inline-form { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.inline-form summary { cursor: pointer; color: var(--accent); font-weight: 500; font-size: 14px; }
.inline-form .btn { margin-top: 12px; }

#btn-schedule.on, #btn-home.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.sms-card { margin-bottom: 14px; }
.sms-row { display: grid; grid-template-columns: 160px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.sms-bubble { background: var(--surface-2); padding: 8px 12px; border-radius: 12px 12px 12px 2px; font-size: 13.5px; }

/* ── 바로 수정 UI (iOS 그룹 목록) ── */
button, .chip, .irow, .region { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.list-group { padding: 6px 18px 4px; }
.list-group > h3 { margin: 12px 0 4px; }
.list-group.caution-card { margin-bottom: 0; }
.consult-view > .list-group { margin-bottom: 14px; }
.irow {
  display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 10px 2px;
  border-top: 1px solid var(--line); cursor: pointer; border-radius: 6px;
}
.list-group > h3 + .irow, .list-group > h3 + .irow-wrap > .irow, .list-group > h3 + div > .irow:first-child { border-top: 0; }
.irow:active { background: var(--surface-2); }
.irow-label { flex: 0 0 110px; font-size: 14px; color: var(--muted); }
.irow-value { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.irow-value.text { display: block; }
.irow-text { white-space: pre-wrap; }
.irow-chev::after { content: "›"; font-size: 22px; line-height: 1; color: var(--muted); display: inline-block; transition: transform .15s; }
.irow-wrap.open .irow-chev::after { transform: rotate(90deg); }
.irow-wrap.open > .irow { background: var(--accent-soft); }
.irow-editor { display: none; padding: 6px 0 14px; }
.irow-wrap.open > .irow-editor { display: block; }
.irow.editing { cursor: default; background: transparent; }
.irow-input { font-size: 15px; }
.irow.add { justify-content: flex-start; }
.placeholder { color: var(--muted); opacity: .75; }
.accent-text { color: var(--accent); font-weight: 500; }
.caution-card .irow-label, .caution-card h3 { color: var(--danger); }
.caution-card .irow { border-top-color: var(--caution-line); }
.pain-row.tappable { cursor: pointer; border-radius: 8px; padding-left: 6px; padding-right: 6px; }
.pain-row.tappable:active { background: var(--surface-2); }
.save-status { font-size: 13px; color: var(--muted); align-self: center; margin-right: 4px; }
.save-status.ok { color: #3c8a4e; }
.save-status.err { color: var(--danger); }
.date-chip { width: auto; padding: 6px 10px; border-radius: 99px; background: var(--surface); }

/* ── 아래에서 올라오는 시트 ── */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(45, 35, 20, .32); z-index: 50; animation: fade-in .18s ease-out; }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 51;
  width: min(620px, 100%); max-height: 88vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: 0 -8px 40px rgba(45, 35, 20, .18);
  padding: 6px 22px calc(24px + env(safe-area-inset-bottom));
  animation: sheet-up .22s cubic-bezier(.2, .8, .2, 1);
}
.sheet.closing { animation: sheet-down .18s ease-in forwards; }
.sheet-backdrop.closing { animation: fade-out .18s ease-in forwards; }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 6px auto 8px; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: sticky; top: -6px; background: var(--surface); padding: 8px 0 12px; z-index: 1; font-size: 17px;
}
.sheet-body .field:first-child { margin-top: 0; }
.sheet-delete { margin-top: 20px; width: 100%; }
.slider-row.big input[type="range"] { height: 32px; }
.big-val { font-size: 30px; width: 44px; text-align: right; }
@keyframes sheet-up { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
@keyframes sheet-down { to { transform: translate(-50%, 100%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

/* ── 손가락 입력(아이패드·아이폰): 누르는 영역 44px 이상 ── */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn.small { min-height: 38px; }
  .chip { min-height: 42px; padding: 9px 15px; font-size: 15px; }
  .eval-row .chip, .booking-row .chip { min-height: 38px; padding: 7px 12px; }
  .tab { min-height: 46px; }
  .member-item { padding: 14px 16px; }
  input, select, textarea { font-size: 16px; min-height: 44px; } /* 16px 미만이면 iOS가 확대한다 */
  .bodymap svg { width: 210px; }
}
.ichips .chip { min-height: 40px; padding: 8px 14px; font-size: 14.5px; }

/* ── 운동 기록 (단계별 시트) ── */
.nav-sheet { height: 92vh; display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
.nav-head { display: grid; grid-template-columns: 70px 1fr 70px; align-items: center; padding: 4px 0 10px; border-bottom: 1px solid var(--line); }
.nav-back { font: inherit; font-size: 34px; line-height: 1; background: none; border: 0; color: var(--accent); cursor: pointer; text-align: left; padding: 0 6px; min-height: 44px; }
.nav-title { text-align: center; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-right { display: flex; justify-content: flex-end; }
.nav-content { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 12px 0 calc(24px + env(safe-area-inset-bottom)); }
.nav-page.from-right { animation: from-right .22s cubic-bezier(.2, .8, .2, 1); }
.nav-page.from-left { animation: from-left .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes from-right { from { transform: translateX(40px); opacity: 0; } }
@keyframes from-left { from { transform: translateX(-40px); opacity: 0; } }
.nav-search { margin-bottom: 8px; border-radius: 12px; background: var(--surface-2); border-color: transparent; }
.nav-section { font-size: 12.5px; color: var(--muted); font-weight: 700; margin: 16px 0 4px; }
.nav-row { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.nav-row:active { background: var(--surface-2); }
.nav-row-main { flex: 1; min-width: 0; }
.nav-row .irow-chev::after { color: var(--accent); }
.nav-row.add { justify-content: center; }
.cat-thumb { width: 52px; height: 64px; border-radius: 10px; border: 1.5px solid var(--accent); background: var(--surface-2); display: grid; place-items: center; flex-shrink: 0; overflow: hidden; }
.mini-body { height: 58px; width: auto; }
.mini-base { fill: var(--region); stroke: var(--body-line); stroke-width: 1.5; }
.mini-zone { fill: var(--accent); }
.cat-name { font-size: 16px; font-weight: 700; }
.equip-tag { font-size: 11.5px; color: var(--muted); background: var(--surface-2); padding: 1px 7px; border-radius: 99px; margin-left: 8px; }
.equip-filter { margin: 4px 0 8px; overflow-x: auto; }
.equip-filter .chips { flex-wrap: nowrap; }
.equip-filter .chip { white-space: nowrap; }
.log-meta { margin-bottom: 10px; }
.num-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
/* 빠른 버튼은 휠 폭에 맞춰 한 줄로 균등 배치 */
.num-field .quick { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; margin-top: 8px; }
.num-field .quick .chip { padding: 6px 0; min-width: 0; text-align: center; white-space: nowrap; font-size: 14px; }
@media (pointer: coarse) { .num-field .quick .chip { padding: 9px 0; } }
.weight-label { display: flex; align-items: center; justify-content: space-between; }
.unit-toggle .chips { background: var(--surface-2); border-radius: 8px; padding: 2px; gap: 2px; flex-wrap: nowrap; }
.unit-toggle .chip { min-height: 40px; min-width: 56px; padding: 4px 14px; font-size: 15px; font-weight: 600; border: 0; background: transparent; border-radius: 6px; }
.unit-toggle .chip.on { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.wheel { position: relative; height: 220px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.wheel::before, .wheel::after { content: ""; position: absolute; left: 0; right: 0; height: 88px; z-index: 2; pointer-events: none; }
.wheel::before { top: 0; background: linear-gradient(var(--surface), rgba(255, 253, 247, .4)); }
.wheel::after { bottom: 0; background: linear-gradient(rgba(255, 253, 247, .4), var(--surface)); }
.wheel-band { position: absolute; left: 8px; right: 8px; top: 88px; height: 44px; border-radius: 10px; background: var(--accent-soft); z-index: 0; }
.wheel-list { position: relative; z-index: 1; height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.wheel-list::-webkit-scrollbar { display: none; }
.wheel-pad { height: 88px; }
.wheel-item { height: 44px; line-height: 44px; text-align: center; scroll-snap-align: center; font-size: 18px; color: var(--muted); cursor: pointer; user-select: none; }
.wheel-item.on { font-size: 24px; font-weight: 700; color: var(--accent); }
.num-input { font-size: 26px; font-weight: 700; text-align: center; padding: 10px; min-height: 56px; }
.big-btn { width: 100%; min-height: 50px; font-size: 16px; margin-top: 14px; }
.set-list { display: flex; flex-direction: column; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.set-no, .ex-no { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; display: grid; place-items: center; flex-shrink: 0; }
.set-val { flex: 1; font-size: 16px; font-weight: 500; }
.segmented { margin: 18px 0 8px; }
.segmented .chips { background: var(--surface-2); border-radius: 10px; padding: 3px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.segmented .chip { border: 0; border-radius: 8px; background: transparent; }
.segmented .chip.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.hist-row { display: flex; gap: 14px; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.stat { background: var(--surface-2); border-radius: 10px; padding: 10px; text-align: center; }
.stat small { display: block; color: var(--muted); font-size: 12px; }
.stat strong { font-size: 22px; color: var(--accent); }
.ex-rows .irow:first-child { border-top: 0; }

/* ── 캘린더 (일·주·월) ── */
.sms-card summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none; min-height: 32px; }
.sms-card summary::-webkit-details-marker { display: none; }
.sms-card summary::before { content: "›"; color: var(--muted); font-size: 20px; transition: transform .15s; }
.sms-card[open] summary::before { transform: rotate(90deg); }
.sms-card summary strong { flex: 1; }
.cal-card { padding: 14px; margin-top: 14px; }
.cal-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-arrow { font-size: 24px; line-height: 1; padding: 2px 10px; color: var(--accent); }
.cal-title { font-size: 18px; margin-left: 4px; }
.cal-switch { margin: 0; }
.cal-switch .chips { grid-template-columns: repeat(3, 52px); }
.cal-switch .chip { min-height: 32px; padding: 4px 0; }

.tg { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tg-head { display: grid; border-bottom: 1px solid var(--line); background: var(--surface); }
.tg-day { font: inherit; background: none; border: 0; border-left: 1px solid var(--line); padding: 6px 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; color: var(--text); }
.tg-day small { font-size: 11.5px; color: var(--muted); }
.tg-date { font-size: 18px; font-weight: 700; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; }
.tg-day.today small { color: var(--accent); }
.tg-day.today .tg-date { background: var(--accent); color: var(--on-accent); }
.tg-body { max-height: 62vh; overflow-y: auto; }
.tg-grid { display: grid; position: relative; }
.tg-hours { position: relative; }
.tg-hour { font-size: 11px; color: var(--muted); text-align: right; padding-right: 6px; transform: translateY(-7px); }
.tg-hour:first-child { transform: none; }
.tg-col { position: relative; border-left: 1px solid var(--line); cursor: copy; }
.tg-col.today { background: rgba(224, 112, 42, .04); }
.tg-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); pointer-events: none; }
.tg-event {
  position: absolute; border-radius: 7px; padding: 3px 6px; font-size: 12px; line-height: 1.3; overflow: hidden; cursor: pointer;
  background: var(--accent-soft); border-left: 3px solid var(--accent); color: var(--text); display: flex; flex-direction: column;
}
.tg-event strong { font-size: 12.5px; }
.tg-event span { color: var(--muted); font-size: 11px; }
.tg-event em { font-style: normal; font-size: 11px; font-weight: 700; }
.tg-now { position: absolute; left: -4px; right: 0; border-top: 2px solid var(--danger); pointer-events: none; z-index: 2; }
.tg-now::before { content: ""; position: absolute; left: 0; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }

.mg { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.mg-wd { font-size: 12px; color: var(--muted); text-align: center; padding: 6px 0; border-bottom: 1px solid var(--line); background: var(--surface); }
.mg-cell { min-height: 104px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.mg-cell:nth-child(7n + 7) { border-right: 0; }
.mg-cell.other { background: var(--surface-2); }
.mg-cell.other .mg-date { color: var(--muted); }
.mg-date { font-size: 13px; font-weight: 700; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.mg-cell.today .mg-date { background: var(--accent); color: var(--on-accent); }
.mg-event { font-size: 12px; border-radius: 5px; padding: 2px 5px; background: var(--accent-soft); border-left: 3px solid var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-event small { color: var(--muted); margin-left: 3px; }
.status-완료 { background: #e8f1e9; border-left-color: #3c8a4e; }
.status-완료 em { color: #3c8a4e; }
.status-취소 { background: var(--surface-2); border-left-color: var(--muted); opacity: .6; text-decoration: line-through; }
.status-노쇼 { background: var(--caution-bg); border-left-color: var(--danger); }
.status-노쇼 em { color: var(--danger); }
.mg-more { font-size: 11.5px; color: var(--muted); padding-left: 4px; }
.booking-sheet-when { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.sheet-actions .btn { flex: 1; }

/* ── 모달·토스트 ── */
dialog {
  border: 0; border-radius: 14px; padding: 0; width: min(440px, calc(100% - 32px));
  background: var(--surface); color: var(--text); box-shadow: 0 10px 40px rgba(0, 0, 0, .2);
}
dialog::backdrop { background: rgba(0, 0, 0, .35); }
dialog form { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
dialog h2 { font-size: 18px; }
dialog label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.dialog-actions { display: flex; gap: 6px; align-items: center; margin-top: 6px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── 홈 ── */
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi-row .kpi { margin: 0; text-align: left; font: inherit; color: inherit; padding: 16px 18px; min-width: 0; }
button.kpi { cursor: pointer; }
button.kpi:hover { border-color: var(--accent); }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-size: 30px; font-weight: 700; line-height: 1.2; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.warn .kpi-value { color: var(--accent); }
.home-grid { margin-bottom: 14px; }
.home-grid .card + .card { margin-top: 0; }

.today-row {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  padding: 10px 12px; margin-top: 8px; border: 0; border-left: 3px solid var(--accent); border-radius: 8px; background: var(--accent-soft);
}
.today-row:first-of-type { margin-top: 0; }
.today-row:hover { filter: brightness(.98); }
.today-time { display: flex; flex-direction: column; min-width: 52px; font-variant-numeric: tabular-nums; }
.today-time strong { font-size: 16px; }
.today-time span { font-size: 12px; color: var(--muted); }
.today-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.today-status { font-size: 12px; color: var(--muted); white-space: nowrap; }
.today-row.next { box-shadow: 0 0 0 1.5px var(--accent) inset; }
.today-row.next .today-status { color: var(--accent); font-weight: 700; }

.renew-row {
  width: 100%; display: flex; align-items: center; gap: 8px; font: inherit; color: inherit; cursor: pointer; text-align: left;
  padding: 10px 2px; background: none; border: 0; border-bottom: 1px solid var(--line);
}
.renew-row:last-child { border-bottom: 0; }
.renew-row:hover strong:first-child { color: var(--accent); }

.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 72px 1fr 76px; align-items: center; gap: 10px; }
.bar-label { font-size: 13.5px; }
.bar-track { height: 14px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar-track span { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.bar-row.empty .bar-track span { background: var(--body-line); }
.bar-value { font-size: 13.5px; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.bar-value small { color: var(--muted); font-weight: 400; }

/* ── 변화 리포트 ── */
.report-host { display: flex; justify-content: center; }
.report-sheet {
  width: 100%; max-width: 440px; background: #fffdf7; color: #2d2720; border: 1px solid var(--line);
  border-radius: 20px; padding: 26px 24px 24px; box-shadow: var(--shadow);
}
.rp-head { border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.rp-kicker { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .04em; }
.rp-head h2 { font-size: 23px; margin-top: 4px; }
.rp-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.rp-hero { text-align: center; padding: 22px 0 18px; border-bottom: 1px solid var(--line); }
.rp-hero-label { font-size: 13px; color: var(--muted); }
.rp-hero-nums { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.rp-from { font-size: 34px; font-weight: 700; color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }
.rp-arrow { font-size: 22px; color: var(--muted); }
.rp-to { font-size: 56px; font-weight: 700; color: var(--accent); line-height: 1; }
.rp-unit { font-size: 15px; color: var(--muted); }
.rp-hero-sub { margin-top: 6px; font-weight: 700; color: var(--accent); }
.rp-sec { padding: 16px 0; border-bottom: 1px solid var(--line); }
.rp-sec h3 { font-size: 14px; margin-bottom: 10px; }
.rp-sec h3 small { font-weight: 400; color: var(--muted); font-size: 12px; }
.rp-pain-row { display: grid; grid-template-columns: 92px 1fr 64px; gap: 10px; align-items: center; margin-top: 8px; }
.rp-pain-name { font-size: 13.5px; }
.rp-pain-bars { display: flex; flex-direction: column; gap: 3px; }
.rp-bar { display: block; height: 7px; border-radius: 0 4px 4px 0; }
.rp-bar.before { background: var(--body-line); }
.rp-bar.after { background: var(--accent); }
.rp-pain-val { font-size: 13px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.rp-pain-val strong { color: var(--text); }
.rp-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.rp-legend span::before { content: ""; display: inline-block; width: 10px; height: 7px; border-radius: 2px; margin-right: 5px; vertical-align: 1px; }
.rp-legend .lg-before::before { background: var(--body-line); }
.rp-legend .lg-after::before { background: var(--accent); }
.rp-trend { width: 100%; height: auto; }
.rp-trend .grid { stroke: var(--line); }
.rp-trend text { font-size: 10px; fill: var(--muted); }
.rp-trend text.val { font-size: 13px; font-weight: 700; fill: var(--text); }
.rp-trend polyline { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.rp-trend circle { fill: var(--accent); stroke: #fffdf7; stroke-width: 2; }
.rp-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rp-checks + .rp-checks { margin-top: 10px; }
.rp-checks li { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.rp-checks b { width: 16px; flex-shrink: 0; text-align: center; }
.rp-checks .ok b { color: #3c8a4e; }
.rp-checks .keep b { color: var(--muted); }
.rp-checks em { margin-left: auto; font-style: normal; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.rp-checks .ok em { color: #3c8a4e; font-weight: 500; }
.rp-strength { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rp-st { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.rp-st-name { font-size: 12.5px; color: var(--muted); }
.rp-st-val { font-size: 14px; font-variant-numeric: tabular-nums; }
.rp-st-pct { font-size: 13px; font-weight: 700; color: var(--accent); }
.rp-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rp-photos + .rp-photos { margin-top: 8px; }
.rp-photos figure { margin: 0; }
.rp-photos img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; display: block; }
.rp-photos figcaption { font-size: 12px; color: var(--muted); text-align: center; margin-top: 3px; }
.rp-more { font-size: 13px; color: #3c8a4e; margin: 8px 0 0 24px; }
.rp-moment { display: flex; gap: 10px; font-size: 14px; padding: 4px 0; }
.rp-moment span { color: var(--muted); font-size: 12.5px; min-width: 36px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.rp-comment { margin-top: 16px; background: var(--accent-soft); border-radius: 12px; padding: 14px 16px; }
.rp-comment p { margin: 0; font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.rp-sign { text-align: right; font-size: 13px; font-weight: 700; color: var(--accent); margin-top: 8px; }
.report-controls textarea { width: 100%; }
.report-controls h3 { white-space: nowrap; }
@media (min-width: 1101px) {
  .report-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 440px; align-items: start; gap: 18px; }
  .report-wrap .report-controls { position: sticky; top: 0; }
}

/* ── AI 가설 ── */
.ai-card { margin-top: 14px; }
.ai-card textarea { width: 100%; margin-top: 10px; }
.ai-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.ai-loading { color: var(--accent); font-weight: 500; }
.ai-prev-label { margin-top: 16px; }
.ai-result { margin-top: 12px; }
.ai-paste { margin-top: 12px; }
.ai-paste textarea { width: 100%; }
.ai-text { white-space: pre-wrap; font-size: 14px; line-height: 1.65; background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.ai-result h4 { margin-top: 16px; }
.ai-summary { font-size: 15px; font-weight: 500; background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; }
.ai-q { font-size: 13px; color: var(--muted); }
.ai-redflag { background: var(--caution-bg); border: 1px solid var(--caution-line); border-radius: 10px; padding: 12px 14px; color: var(--danger); margin-bottom: 10px; }
.ai-redflag ul { margin: 6px 0 0; padding-left: 18px; color: var(--text); }
.ai-hyp { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-top: 8px; }
.ai-hyp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ai-hyp p { margin: 6px 0 0; font-size: 14px; }
.ai-evidence { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.ai-checks { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.ai-plan { display: flex; flex-direction: column; gap: 8px; }
.ai-phase { display: flex; gap: 10px; align-items: flex-start; }
.ai-phase-tag { flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 2px 10px; margin-top: 1px; min-width: 56px; text-align: center; }
.ai-cautions { margin: 0; padding-left: 18px; font-size: 14px; }
.ai-history { margin-top: 14px; }
.ai-note { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.ai-note textarea { width: 100%; margin-top: 8px; }
.ai-history-item { margin: 8px 0 0 10px; }
.ai-history summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }

/* ── 인바디 ── */
.ib-main { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.ib-stat { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.ib-label { font-size: 12.5px; color: var(--muted); }
.ib-value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.25; }
.ib-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.ib-delta { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ib-delta.good { color: #3c8a4e; font-weight: 700; }
.ib-delta.bad { color: var(--danger); font-weight: 700; }
.ib-more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 14px; margin-top: 14px; font-size: 13.5px; }
.ib-more div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); padding: 5px 0; }
.ib-seg-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; text-align: center; }
.ib-seg-grid div { background: var(--surface-2); border-radius: 8px; padding: 8px 4px; display: flex; flex-direction: column; }
.ib-chart { overflow: visible; touch-action: manipulation; }
.ib-chart .hit { fill: transparent; cursor: pointer; }
.ib-chart circle.on { r: 5.5; }
.ib-chart .tip rect { fill: var(--text); }
.ib-chart .tip text { fill: #fff; }
.ib-chart .tip .tip-v { font-size: 11px; font-weight: 700; }
.ib-chart .tip .tip-d { font-size: 9px; fill: #e8dfcc; }
.ib-trends { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.inbody-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.inbody-row:last-child { border-bottom: 0; }
.ib-check { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 0 0 10px; }
.ib-photo img { width: 100%; max-height: 260px; object-fit: contain; border-radius: 10px; background: var(--surface-2); }
.ib-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; }
.ib-form-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ib-form-grid input { width: 100%; }
.ib-form-grid .field, .ib-form-grid .field:first-of-type { margin-top: 10px; }
.rp-st-pct.neutral { color: var(--muted); }
.ib-judge-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.ib-judges { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.ib-judge { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; }
.ib-judge.ok { background: #e8f1e9; color: #2f7a43; }
.ib-judge.warn { background: var(--accent-soft); color: #b5561c; }
.ib-judge.bad { background: var(--caution-bg); color: var(--danger); }
.ib-src { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 7px; align-self: center; }
.ib-control { margin-top: 14px; }
.ib-control-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; text-align: center; }
.ib-control-grid div { background: var(--accent-soft); border-radius: 8px; padding: 8px 4px; display: flex; flex-direction: column; }
.ib-pct { font-size: 11px; color: var(--muted); }
.ib-pct.low { color: var(--danger); font-weight: 700; }
.ib-form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ib-eval { margin-top: 6px; }
.ib-eval-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; margin-bottom: 6px; }
@media (max-width: 760px) {
  .ib-main { gap: 6px; }
  .ib-stat { padding: 10px; }
  .ib-value { font-size: 21px; }
  .ib-more { grid-template-columns: 1fr 1fr; }
  .ib-trends { grid-template-columns: 1fr; }
  .ib-form-grid { grid-template-columns: 1fr 1fr; }
  .ib-form-grid.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ib-form-grid.four, .ib-control-grid { grid-template-columns: 1fr 1fr; }
  .ib-seg-grid { font-size: 12.5px; }
}

/* ── 인바디 결과지 보기 ── */
.ibp { padding: 0; overflow: hidden; }
.ibp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 12px 18px; border-bottom: 2px solid var(--text); font-size: 13.5px; color: var(--muted); }
.ibp-title { font-size: 17px; color: var(--text); margin-right: 6px; }
.ibp-photo-link { margin-left: auto; color: var(--accent); font-weight: 500; }
.ibp-cols { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.ibp-left { padding: 6px 18px 14px; border-right: 1px solid var(--line); }
.ibp-right { padding: 6px 18px 14px; }
.ibp-sec { margin-top: 12px; }
.ibp-sec-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--on-accent); background: var(--text); padding: 3px 10px; border-radius: 4px; margin-bottom: 8px; }
.ibp-zones-head { margin-left: auto; display: grid; grid-template-columns: repeat(3, 1fr); width: calc(100% - 210px); max-width: 360px; text-align: center; font-weight: 500; font-size: 11.5px; opacity: .85; }
.ibp-hint { margin-left: auto; font-weight: 400; font-size: 11.5px; opacity: .8; }
.ibp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ibp-table th, .ibp-table td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.ibp-table th { font-size: 12px; color: var(--muted); font-weight: 500; }
.ibp-table td.v { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.ibp-table td.g { color: var(--muted); font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; }
.ibp-table.compact td { padding: 5px 4px; }
.ibp-bar-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 84px; align-items: center; gap: 10px; margin: 7px 0; }
.ibp-bar-name { font-size: 13px; font-weight: 500; }
.ibp-bar-name small { color: var(--muted); font-weight: 400; font-size: 11px; }
.ibp-bar-track { position: relative; height: 18px; display: grid; grid-template-columns: repeat(3, 1fr); }
.ibp-zone { border-left: 1px dashed var(--line); }
.ibp-zone.mid { background: var(--surface-2); border-left: 1px solid var(--body-line); border-right: 1px solid var(--body-line); }
.ibp-bar { position: absolute; left: 0; top: 4px; height: 10px; border-radius: 0 4px 4px 0; background: var(--text); }
.ibp-bar.ok { background: var(--text); }
.ibp-bar.low, .ibp-bar.high { background: var(--accent); }
.ibp-bar-val { position: absolute; top: 0; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 18px; white-space: nowrap; }
.ibp-bar-range { font-size: 11.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.ibp-note { font-size: 11.5px; color: var(--muted); margin: 4px 0 0; }
.ibp-body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ibp-seg { background: var(--surface-2); border-radius: 8px; padding: 7px 6px; text-align: center; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.ibp-seg.trunk { grid-row: span 2; justify-content: center; }
.ibp-seg-name { font-size: 11.5px; color: var(--muted); }
.ibp-seg strong { font-size: 14px; }
.ibp-seg-pct { font-size: 11.5px; color: var(--muted); }
.ibp-seg.low { box-shadow: inset 0 0 0 1.5px var(--danger); }
.ibp-seg.low .ibp-seg-pct { color: var(--danger); font-weight: 700; }
.ibp-seg-gap { display: none; }
.ibp-gap { margin: 6px 0 0; }
.ibp-score { text-align: center; }
.ibp-score-v { font-size: 40px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ibp-score-v small { font-size: 14px; color: var(--muted); font-weight: 500; }
.ibp-delta div { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: baseline; font-size: 13.5px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.ibp-history { padding: 0 18px 16px; }
.ibp-history .ib-chart { max-height: 120px; }
.ibp-zone-labels { margin: 0 0 -2px; font-size: 11.5px; color: var(--muted); }
.ibp-zone-labels > span:last-child { text-align: right; }
.ibp-zone-names { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
@media (max-width: 1100px) {
  .ibp-cols { grid-template-columns: 1fr; }
  .ibp-left { border-right: 0; }
  .ibp-right { order: -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; border-bottom: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .ibp-head, .ibp-left, .ibp-right, .ibp-history { padding-left: 12px; padding-right: 12px; }
  .ibp-right { grid-template-columns: 1fr; }
  .ibp-bar-row { grid-template-columns: 70px minmax(0, 1fr) 62px; gap: 6px; }
  .ibp-bar-name small { display: none; }
}

/* ── 자세 사진 분석 ── */
.pose-card { margin-top: 14px; }
.pose-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 12px 0; }
.pose-item img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: var(--surface-2); border-radius: 10px; cursor: pointer; display: block; }
.pose-item-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; }
.pose-item-metrics { margin: 6px 0 0; padding-left: 16px; font-size: 13px; }
.pose-body { display: flex; flex-direction: column; gap: 10px; }
.pose-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pose-blur { font-size: 13.5px; display: flex; align-items: center; gap: 4px; }
.pose-stage { position: relative; align-self: center; max-width: 100%; }
.pose-stage img { display: block; max-width: 100%; max-height: 62vh; border-radius: 10px; }
.pose-svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.pose-line { stroke-width: 2.5; }
.pose-line.level, .pose-line.chain { stroke: #e0302a; }
.pose-line.plumb { stroke: var(--accent); stroke-dasharray: 6 5; stroke-width: 2; }
.pose-dot { fill: #e0302a; stroke: #fff; stroke-width: .4; cursor: grab; }
.pose-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px; }
.pose-metric { display: flex; justify-content: space-between; gap: 10px; background: var(--surface-2); border-radius: 8px; padding: 8px 12px; font-size: 14px; }
.pose-status { margin: 0; }
.pose-label-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pose-label-pick .btn { padding: 14px; font-size: 15px; }
.pose-compare { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 6px; }
.pose-cmp-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; align-items: start; margin-top: 10px; }
.pose-cmp-row figure { margin: 0; }
.pose-cmp-row img { width: 100%; border-radius: 10px; display: block; }
.pose-cmp-row figcaption { font-size: 12px; color: var(--muted); text-align: center; margin-top: 3px; }
.pose-cmp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pose-cmp-table th, .pose-cmp-table td { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: left; vertical-align: top; }
.pose-cmp-table th { color: var(--muted); font-weight: 500; font-size: 12px; }
.pose-cmp-table td.good { color: #2f7a43; font-weight: 700; }
.pose-cmp-table td:first-child { white-space: nowrap; color: var(--muted); }
.pose-cmp-hint { margin-top: 8px; }

/* 가이드 촬영 화면 */
.gc-root { position: fixed; inset: 0; z-index: 200; background: #111; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: max(10px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom)); }
.gc-top { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gc-frame { position: relative; overflow: hidden; border-radius: 6px; }
.gc-frame video { width: 100%; height: 100%; display: block; object-fit: fill; background: #000; }
.gc-ghost { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: .35; pointer-events: none; }
.gc-guide { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.gc-center { stroke: rgba(224, 112, 42, .95); stroke-width: .35; stroke-dasharray: 1.5 1; vector-effect: non-scaling-stroke; }
.gc-band { stroke: rgba(255, 255, 255, .75); stroke-width: 1; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.gc-sil { position: absolute; left: 50%; top: 6%; height: 88%; transform: translateX(-50%); pointer-events: none; }
.gc-sil path { fill: rgba(255, 255, 255, .08); stroke: rgba(255, 255, 255, .9); stroke-width: 1.4; stroke-dasharray: 5 3; }
.gc-btn { font: inherit; font-size: 14px; color: #fff; background: rgba(255, 255, 255, .14); border: 0; border-radius: 99px; padding: 9px 14px; min-height: 44px; cursor: pointer; }
.gc-btn.on { background: var(--accent); }
.ghost-none { visibility: hidden; }
.gc-level { font-size: 13px; font-weight: 700; background: rgba(192, 57, 43, .85); border-radius: 99px; padding: 7px 12px; cursor: pointer; min-width: 92px; text-align: center; }
.gc-level.ok { background: #2f7a43; }
.gc-tip { font-size: 13px; opacity: .85; text-align: center; }
.gc-bottom { width: 100%; max-width: 480px; display: flex; align-items: center; justify-content: space-between; }
.gc-shutter { width: 72px; height: 72px; border-radius: 50%; border: 5px solid #fff; background: var(--accent); cursor: pointer; }
.gc-shutter:active { transform: scale(.94); }
.gc-count { position: fixed; top: 45%; left: 50%; transform: translate(-50%, -50%); font-size: 96px; font-weight: 700; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); pointer-events: none; }
@media (max-width: 760px) {
  .pose-cmp-row { grid-template-columns: 1fr 1fr; }
  .pose-cmp-table { grid-column: 1 / -1; }
  .pose-grid { grid-template-columns: 1fr 1fr; }
}

/* ── 태블릿 ── */
@media (max-width: 1100px) {
  .grid2 { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mg-event small { display: none; }
  }

/* ── 휴대폰: 목록 ↔ 상세 전환 ── */
@media (max-width: 760px) {
  .topbar { padding: 0 16px; gap: 8px; }
  .topbar-sub { display: none; }
  .topbar .btn { white-space: nowrap; padding: 7px 11px; }
  .brand { white-space: nowrap; }
  .sidebar { width: 100%; border-right: 0; }
  .main { display: none; padding: 16px 16px 60px; }
  body.detail-open .sidebar { display: none; }
  body.detail-open .main { display: block; }
  .back { display: inline-block; padding-left: 0; }
  .member-head { flex-wrap: wrap; }
  .member-head-main { flex-basis: 100%; order: 3; }
  .row2 { grid-template-columns: 1fr; }
  .consult-bar.sticky { top: -16px; }
  .consult-bar-actions { margin-left: 0; width: 100%; }
  .consult-bar-actions .btn.primary { margin-left: auto; }
  .bodymap svg { width: 130px; }
  .eval-row { grid-template-columns: 1fr; gap: 6px; }
  .eval-row.head { display: none; }
  .eval-cell.empty { display: none; }
  .cell-side { display: block; }
  .exercise-row { grid-template-columns: 1fr 60px 60px auto; }
  .exercise-row .ex-load { grid-column: 1 / 4; }
  .sms-row { grid-template-columns: 1fr; }
  .mg-cell { min-height: 64px; }
  .mg-event { font-size: 10.5px; padding: 1px 3px; }
  .mg-event small { display: none; }
  .cal-title { width: 100%; order: 10; margin: 4px 0 0; }
  .kpi-row { gap: 10px; }
  .kpi-row .kpi { padding: 12px 14px; }
  .kpi-value { font-size: 24px; }
  .report-sheet { padding: 22px 18px 20px; border-radius: 16px; }
  .rp-pain-row { grid-template-columns: 80px 1fr 58px; }
    }

/* ── 사전 질문지 (회원용 /q/…) ── */
.iq-body { height: auto; min-height: 100%; }
.iq { max-width: 560px; margin: 0 auto; padding: 20px 16px calc(110px + env(safe-area-inset-bottom)); }
.iq h1 { font-size: 22px; margin: 6px 0 18px; }
.iq .field { margin-top: 22px; }
.iq .field:first-child { margin-top: 0; }
.iq .field-label { font-size: 15.5px; color: var(--text); font-weight: 700; line-height: 1.45; margin-bottom: 8px; }
.iq .row2 { grid-template-columns: 1fr 1fr; margin-top: 22px; }
.iq .chip { font-size: 15px; padding: 10px 15px; min-height: 44px; }
.iq-hint { margin: -4px 0 8px; font-size: 13px; color: var(--muted); }
.iq-hello { font-size: 17px; font-weight: 500; margin: 0 0 4px; }
.iq-progress { height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.iq-progress span { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.iq-step { margin-top: 12px; font-size: 13px; color: var(--accent); font-weight: 700; }
.iq-fields { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 16px; box-shadow: var(--shadow); }
.iq-fields > .field:first-child, .iq-fields > .iq-hello:first-child + .row2 { margin-top: 0; }
.iq-fields .bodymap { gap: 6px; margin-top: 4px; }
.iq-fields .bodymap svg { width: min(160px, 42vw); }
.iq-pains { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.iq-meals { display: flex; flex-direction: column; gap: 10px; }
.iq-meal { display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: 6px; }
.iq-meal-label { font-weight: 600; }
.iq-pain { font: inherit; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; text-align: left; padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); cursor: pointer; }
.iq-nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 10px; justify-content: center;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.iq-nav .btn { min-height: 50px; font-size: 16px; flex: 1; max-width: 264px; }
.iq-nav .btn.primary { flex: 2; }
.iq-intro { text-align: center; padding-top: 12vh; }
.iq-intro h1 { font-size: 26px; margin: 12px 0; }
.iq-intro p { font-size: 16px; line-height: 1.6; color: var(--text); }
.iq-badge { display: inline-block; padding: 5px 12px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; }
.iq-points { list-style: none; padding: 0; margin: 22px auto; max-width: 300px; text-align: left; display: grid; gap: 8px; }
.iq-points li { padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; }
.iq-points li::before { content: "✓ "; color: var(--accent); font-weight: 700; }
.iq-start { min-height: 52px; font-size: 17px; width: 100%; max-width: 300px; }
.iq-check { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; background: var(--accent); color: #fff; font-size: 32px; line-height: 64px; font-weight: 700; }

/* ── 사전 질문지 (선생님 화면) ── */
.intake-card .irow { cursor: pointer; }
.intake-new { color: var(--accent); font-weight: 700; }
.intake-link { display: flex; gap: 8px; margin: 6px 0 14px; }
.intake-link input { flex: 1; font-size: 13px; }
.intake-msg { width: 100%; font-size: 14px; }
.intake-share { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.intake-share .btn { min-height: 46px; }
.intake-warn { background: var(--caution-bg); border: 1px solid var(--caution-line); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 12px; }
.intake-qa { margin-bottom: 16px; }
.intake-qa summary { cursor: pointer; font-weight: 700; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; min-height: 32px; list-style: none; }
.intake-qa summary .muted { grid-row: 2; font-weight: 400; }
.intake-qa summary::after { grid-row: 1; grid-column: 2; }
.intake-qa summary::-webkit-details-marker { display: none; }
.intake-qa summary::after { content: "펼치기"; margin-left: auto; font-size: 13px; color: var(--muted); font-weight: 400; }
.intake-qa[open] summary::after { content: "접기"; }
.intake-qa dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; margin: 12px 0 0; font-size: 14px; }
.intake-qa dt { color: var(--muted); }
.intake-qa dd { margin: 0; white-space: pre-wrap; }
.intake-qa .qa-sec { grid-column: 1 / -1; font-size: 12.5px; font-weight: 700; color: var(--accent); margin-top: 6px; }
@media (max-width: 760px) { .intake-qa dl { grid-template-columns: 1fr; gap: 2px; } .intake-qa dd { margin-bottom: 8px; } }
.badge.intake { background: var(--accent); }
.member-head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.empty-card .member-head-actions { justify-content: center; }
.iq .row2 > .field { margin-top: 0; }
.iq .chips + input, .iq .chips + textarea { margin-top: 10px; }
.custom-add { display: flex; gap: 8px; margin-top: 10px; }
.custom-add input { flex: 1; }
.custom-add .btn { min-height: 44px; white-space: nowrap; }

/* ── 로그인 ── */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100%; padding: 16px; }
.login { width: 100%; max-width: 360px; display: grid; gap: 14px; padding: 28px 24px; }
.login .brand { font-size: 22px; }
.login p { margin: 0; font-size: 14px; }
.login input { min-height: 48px; font-size: 16px; }
.login .btn { min-height: 48px; font-size: 16px; }
.login-error { color: var(--danger); font-size: 14px; min-height: 20px; }

/* ── 개인정보 동의 ── */
.consent-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 14px 16px; }
.consent-box details summary { cursor: pointer; color: var(--muted); font-size: 14px; min-height: 32px; }
.consent-text { white-space: pre-line; font-size: 13.5px; line-height: 1.65; color: var(--text); margin-top: 8px; }
.consent-check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 8px 0; font-size: 15px; cursor: pointer; }
.consent-check input { width: 22px; height: 22px; min-height: 0; padding: 0; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.consent-state { font-size: 13px; color: var(--muted); }
.consent-state.missing { color: var(--danger); background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: 13px; text-decoration: underline; }
a.irow { color: inherit; text-decoration: none; }
#member-form .consent-box { margin-top: 12px; }
#member-form .consent-box label.consent-check { flex-direction: row; color: var(--text); margin: 0; }

/* ── 식단 (diet-core.js · diet.js · diet-public.js) ── */
.dt-page { max-width: 560px; margin: 0 auto; padding: 20px 16px calc(40px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.dt-page-head h1 { font-size: 22px; margin-top: 8px; }
.dt-foot { text-align: center; }
.dt-start ul { padding-left: 18px; margin: 10px 0 16px; }
.dt-datenav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dt-datenav .btn { min-width: 48px; min-height: 44px; font-size: 20px; padding: 0 12px; }
.dt-datenav strong { font-size: 17px; }
.dt-sum-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.dt-sum-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.dt-sum-num { margin-top: 2px; color: var(--muted); font-size: 14px; }
.dt-sum-num strong { font-size: 26px; color: var(--text); }
.dt-bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.dt-bar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.dt-bar.protein span { background: #3f8f5a; }
.dt-bar.over span { background: var(--danger); }
.dt-sum-left { margin-top: 6px; font-size: 14px; font-weight: 500; }
.dt-sum-left.over { color: var(--danger); }
.dt-sum-left.ok { color: #3f8f5a; }
.dt-tomorrow { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.dt-body-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.dt-weight-wrap { display: flex; flex-direction: column; gap: 4px; }
.dt-weight-box { display: flex; align-items: center; gap: 6px; }
.dt-weight-box input { width: 110px; min-height: 44px; font-size: 18px; }
.dt-body-row .chip { min-height: 44px; }
.dt-meal { padding: 12px 0; border-bottom: 1px solid var(--line); }
.dt-meal-head { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.dt-meal-head strong { font-size: 16px; }
.dt-add { margin-left: auto; min-height: 40px; padding: 4px 14px; }
.dt-item { font: inherit; color: inherit; display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 6px; min-height: 44px; cursor: pointer; }
.dt-item-name { min-width: 0; }
.dt-item-num { white-space: nowrap; font-size: 14px; }
.dt-foods { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.dt-food { min-height: 40px; }
.dt-food-k { opacity: .65; font-size: 12px; }
.dt-food.del { border-color: var(--danger); color: var(--danger); }
.dt-add-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.dt-add-actions .btn { min-height: 44px; }
.dt-add-actions .btn.primary { margin-left: auto; }
.dt-note:empty { display: none; }
.dt-draft { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.dt-draft-row { display: grid; grid-template-columns: minmax(0, 1fr) 92px 72px 36px; gap: 6px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.dt-draft-names { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dt-draft-names input, .dt-draft-num input { min-height: 38px; padding: 6px 8px; width: 100%; }
.dt-draft-num { display: flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); }
.dt-confirm { width: 100%; margin-top: 12px; min-height: 48px; }
.dt-fc + .dt-fc { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.dt-fc-title { font-weight: 700; margin-bottom: 8px; }
.dt-fc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dt-fc-grid > div { display: flex; flex-direction: column; background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.dt-fc-grid strong { font-size: 17px; }
.dt-ok { color: #3f8f5a; }
.dt-warn { color: var(--danger); }
.dt-wk-head, .dt-wk-row { display: grid; grid-template-columns: 76px 1fr 56px 64px 24px; gap: 6px; align-items: center; }
.dt-wk-head { font-size: 12px; color: var(--muted); padding: 0 8px 4px; }
.dt-wk-row { font: inherit; color: inherit; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 8px; min-height: 44px; cursor: pointer; font-size: 14px; }
.dt-wk-row.on { background: var(--accent-soft); border-radius: 8px; }
.dt-wk-k.over { color: var(--danger); }
.dt-wk-p.ok { color: #3f8f5a; font-weight: 500; }
.dt-wk-avg { margin: -6px 0 10px; }
.dt-set-sec + .dt-set-sec { margin-top: 18px; padding-top: 4px; border-top: 1px solid var(--line); }
.dt-save { width: 100%; margin-top: 20px; min-height: 48px; }
@media (max-width: 760px) {
  .dt-fc-grid { grid-template-columns: 1fr 1fr; }
}
.dt-set-sec h4 { color: var(--text); font-size: 15px; font-weight: 700; margin: 16px 0 4px; }
.dt-label:not(:empty) { margin-top: 14px; padding: 14px; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-soft); }
.dt-label-head { font-weight: 700; }
.dt-label-basis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.dt-label-basis label { display: flex; flex-direction: column; gap: 4px; }
.dt-label-basis input { min-height: 42px; width: 100%; }
.dt-label-eat { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dt-label-eat input { width: 110px; min-height: 44px; font-size: 17px; }
.dt-label-out { font-weight: 700; }
.dt-trend-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.dt-trend-head h3 { margin: 0; }
.dt-trend-head .chip { min-height: 36px; }
.dt-trend-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.dt-chart-box { min-width: 0; }
.dt-chart-title { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.dt-chart { width: 100%; height: auto; display: block; overflow: visible; touch-action: manipulation; }
.dt-chart text { font-size: 9.5px; fill: var(--muted); }
.dt-chart .grid { stroke: var(--line); stroke-width: 1; }
.dt-chart .avg { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.dt-chart .pt { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.dt-chart .pt.pred { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.dt-chart line.pred { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 4; }
.dt-chart .bar { fill: var(--accent); }
.dt-chart .bar.over { fill: var(--danger); }
.dt-chart .bar.prot { fill: #9cc7a9; }
.dt-chart .bar.good { fill: #3f8f5a; }
.dt-chart .target { fill: none; stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 5 4; opacity: .7; }
.dt-chart .col { fill: transparent; cursor: pointer; }
.dt-chart .col.on { fill: rgba(224, 112, 42, .1); }
.dt-chart-cap { min-height: 20px; margin-top: 2px; font-size: 13px; }
@media (min-width: 1101px) { .dt-page .dt-trend-grid { grid-template-columns: 1fr 1fr; } }
.dt-chart .bar.today { opacity: .45; }
.consent-sec + .consent-sec { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.consent-sec summary { font-weight: 500; color: var(--text) !important; }

/* ── 현장 동의 (consent.js) ── */
body.cs-open { overflow: hidden; }
.cs-overlay { position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.cs-page { max-width: 720px; margin: 0 auto; padding: 24px 20px calc(40px + env(safe-area-inset-bottom)); }
.cs-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cs-head h2 { font-size: 22px; margin-top: 8px; }
.cs-sec { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-top: 14px; }
.cs-sec h3 { margin-bottom: 8px; }
.cs-check { font-size: 16px; font-weight: 500; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 12px; }
.cs-check input { width: 26px; height: 26px; }
.cs-name { display: flex; align-items: center; gap: 12px; }
.cs-name span { color: var(--muted); font-size: 14px; min-width: 32px; }
.cs-name input { flex: 1; min-height: 48px; font-size: 18px; }
.cs-sign-head { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 6px; color: var(--muted); font-size: 14px; }
.cs-sign { width: 100%; height: 200px; display: block; background: #fff; border: 2px dashed var(--line); border-radius: 12px; touch-action: none; cursor: crosshair; }
.cs-hint { color: var(--danger); text-align: center; min-height: 22px; margin-top: 16px; }
.cs-hint:empty { visibility: hidden; }
.cs-submit { width: 100%; min-height: 56px; font-size: 17px; margin-top: 6px; }
.cs-done { text-align: center; padding-top: 60px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cs-done .intake-msg { width: 100%; text-align: left; }
.cs-done .intake-share { width: 100%; }
.cs-close-done { margin-top: 8px; }
.consent-state.link { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; text-align: left; }
.cs-log { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.cs-log-head { display: flex; gap: 8px; align-items: center; }
.cs-log-sign { max-width: 240px; max-height: 90px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.equip-tag.custom { color: var(--accent); background: var(--accent-soft); }
.ex-form .chips { gap: 6px; }
.nav-row.ex-base { cursor: default; }
.nav-row.hidden-ex .nav-row-main { opacity: .45; text-decoration: line-through; }
/* 운동 썸네일·상세 (exercise.js) */
.ex-row { gap: 12px; }
.ex-thumb { width: 44px; height: 56px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; flex-shrink: 0; overflow: hidden; }
.ex-thumb .mini-body { height: 50px; }
.ex-thumb.cardio .mini-zone { fill: #d9534f; }
.mini-zone.sec { fill: var(--accent); opacity: .35; }
.ex-info-btn { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); color: var(--accent); font: italic 700 16px Georgia, serif; cursor: pointer; }
.ex-detail { display: flex; flex-direction: column; gap: 10px; }
.ex-figure { display: flex; justify-content: center; gap: 24px; background: var(--surface-2); border-radius: 14px; padding: 14px; }
.ex-figure > div { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.ex-fig-svg { height: 180px; width: auto; }
.ex-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.custom-tag { color: var(--accent); background: var(--accent-soft); }
.ex-muscles { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.ex-dot { width: 12px; height: 12px; border-radius: 3px; background: var(--accent); }
.ex-dot.sec { opacity: .35; }
.ex-how { font-size: 15px; line-height: 1.6; background: var(--bg); border-radius: 10px; padding: 12px 14px; margin: 0; }
.log-meta { display: flex; align-items: center; gap: 8px; }
.log-meta .btn { margin-left: auto; }
.ex-thumb .mini-body { height: 56px; width: 44px; }

/* 운동 자세·동작 사진/영상 */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 10px; }
.media-grid.small { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 8px 0 4px; }
.media-item { position: relative; border-radius: 10px; overflow: hidden; background: #000; aspect-ratio: 3 / 4; }
.media-item img, .media-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-del { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border: 0; border-radius: 22px; background: rgba(0,0,0,.55); color: #fff; font-size: 16px; cursor: pointer; }
.ex-feedback { color: var(--accent, #e0702a); margin-top: 2px; }
.send-sheet .send-text { white-space: pre-wrap; font: inherit; background: rgba(0,0,0,.04); border-radius: 10px; padding: 12px; margin: 0; max-height: 40vh; overflow: auto; }
