:root { --pa-build-app: "515a90350783b955"; } /* 배포본 표시 — npm run build:manifest가 씀 (고치지 말 것) */
/* 화면 모양: 토스풍 시안 A · 명료한 단계형 (2026-10-25 앱 적용 — 소개 사이트 website/DESIGN.txt와 같은 토큰).
   회색 바탕 위 흰 둥근 카드, 파랑 강조색 하나. 점 확인 캔버스(draw.js)·리포트/비교 이미지(report.js)는 이 파일과 무관하게 그대로 그림 */

/* IBM Plex Sans KR (OFL — vendor/fonts/…/OFL.txt): 「korean」 부분 글꼴(KS X 1001 한글 2,350자 + 영문·숫자) 400·600·700.
   앱 안에 두어 실행 중 외부 요청 없음(서비스워커가 미리 받아 둠). 이 글꼴에 없는 글자는 아래 시스템 글꼴로 */
@font-face { font-family: "IBM Plex Sans KR"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fonts/ibm-plex-sans-kr-5.2.5/ibm-plex-sans-kr-korean-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans KR"; font-style: normal; font-weight: 600; font-display: swap; src: url("../vendor/fonts/ibm-plex-sans-kr-5.2.5/ibm-plex-sans-kr-korean-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans KR"; font-style: normal; font-weight: 700; font-display: swap; src: url("../vendor/fonts/ibm-plex-sans-kr-5.2.5/ibm-plex-sans-kr-korean-700-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --bg: #F2F4F6;          /* 화면 바탕 */
  --card: #FFFFFF;
  --fill: #F2F4F6;        /* 카드 안 채움: 입력 칸·보조 버튼 */
  --fill-2: #E5E8EB;      /* 분절 버튼 바탕·눌림 */
  --band: #F7F8FA;        /* 표 머리 */
  --ink: #191F28;
  --ink-2: #4E5968;
  --muted: #66707C;       /* 흐린 글자: 흰 바탕 5.0:1 · 회색 바탕 4.6:1 */
  --line: #E5E8EB;
  --line-soft: #EEF0F2;
  --line-strong: #D1D6DB;
  --brand: #3166F5;       /* 흰 글자 4.8:1 */
  --brand-hover: #1F4FD6;
  --brand-text: #2450C8;  /* 작은 파랑 글자 */
  --brand-soft: #E8EFFE;
  --brand-ink: #FFFFFF;
  /* 판정 색 (글자/바탕 쌍은 모두 4.5:1 이상) */
  --good: #0A7A50; --good-soft: #E3F6EC;
  --warn: #A15C00; --warn-soft: #FFF1DC;
  --bad: #C4321C;  --bad-soft: #FFEBE6;
  --est: #8A6100;  --est-soft: #FFF6CC;
  --auto: #0369A1; --auto-soft: #E0F2FE;  /* 스티커 자동 배정(확인 전) — 그림의 하늘색 테두리와 같은 계열 */
  --r-lg: 24px; --r-md: 16px; --r-sm: 12px;
  --radius: var(--r-lg);
  --font: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --top-h: 56px;          /* 위 막대 높이 (점 순서 안내 막대가 그 아래에 붙음) */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 15px/1.55 var(--font);
  font-variant-numeric: tabular-nums;
  word-break: keep-all; overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--brand-soft); color: var(--ink); }
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.screen { display: none; min-height: 100dvh; padding-bottom: calc(132px + var(--safe-b)); }
.screen.active { display: block; }
#screen-home { padding-bottom: calc(40px + var(--safe-b)); }
#screen-editor { padding-bottom: 24px; background: var(--card); }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) 12px 0;
  background: var(--bg);
}
/* 뒤로 · 제목 · 오른쪽 칸: 제목을 가운데에 */
.topbar:has(> .title) { display: grid; grid-template-columns: 1fr auto 1fr; }
.topbar:has(> .title) > :first-child { justify-self: start; }
.topbar:has(> .title) > :last-child { justify-self: end; }
.topbar .title { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; text-align: center; }
#screen-editor .topbar { background: var(--card); border-bottom: 1px solid var(--line-soft); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; padding-left: 4px; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
/* 센터 이름이 길어(「이롭게 필라테스 재활운동센터」) 좁은 화면에서는 띄어쓰기에서 두 줄로 — 말줄임으로 이름이 잘리지 않게 */
#brand-name { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; word-break: keep-all; line-height: 1.25; }
@media (max-width: 480px) { .brand { font-size: 15px; } }
.logo { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.logo svg { display: block; }
.actions { display: flex; gap: 2px; flex: none; }
.icon-btn {
  min-width: 44px; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--ink-2); font-weight: 600; font-size: 15px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  transition: background-color .15s;
}
.icon-btn:hover { background: rgb(25 31 40 / .06); }
.icon-btn:active { background: rgb(25 31 40 / .1); }
.icon-btn.strong { color: var(--brand-text); font-weight: 700; font-size: 16px; }
#btn-new { color: var(--brand-text); }

.wrap { max-width: 720px; margin: 0 auto; padding: 8px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--card); border-radius: var(--radius); padding: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.field label { font-size: 13px; color: var(--ink-2); }
.field-row { display: flex; gap: 10px; margin-top: 12px; }
input[type=text], input[type=number], input[type=date], input[type=search], input[type=password], select {
  width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--r-sm);
  background: var(--fill); color: var(--ink);
  font-size: 16px; /* iOS 확대 방지 */
}
input::placeholder { color: var(--muted); opacity: 1; }
input:focus, select:focus { border-color: var(--brand); background: var(--card); }
input:focus-visible, select:focus-visible { outline: 2px solid var(--brand); outline-offset: 0; }
input[type=date] { padding-right: 10px; }
.wrap > input[type=search] { background: var(--card); }
.hint { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.g { color: var(--good); font-weight: 700; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 16px; border-radius: var(--r-sm); border: 0; background: var(--fill); color: var(--ink);
  cursor: pointer; font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: background-color .15s, transform .1s;
}
.btn:hover:not(:disabled) { background: var(--fill-2); }
.btn.primary { background: var(--brand); color: var(--brand-ink); font-weight: 700; }
.btn.primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.block { width: 100%; }
.btn.lg { min-height: 56px; border-radius: var(--r-md); font-size: 17px; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.danger { color: var(--bad); background: var(--bad-soft); }
.btn.danger:hover:not(:disabled) { background: #FFDCD3; }
/* 회색 바탕에 바로 놓인 보조 버튼은 흰 바탕 */
.wrap > .row-btns .btn:not(.primary), .banner .btn:not(.primary) { background: var(--card); }
.wrap > .row-btns .btn:not(.primary):hover, .banner .btn:not(.primary):hover { background: var(--fill-2); }

/* 홈: 촬영 사진 — 진행 막대는 지금 찍은 사진(정면·측면·후면·아담)을 보여 주기만 함 (단계·순서 아님) */
.shoot { display: flex; flex-direction: column; gap: 12px; }
.shoot-head { display: flex; flex-direction: column; gap: 10px; padding: 8px 4px 0; }
.shoot-head b { font-size: 16px; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.step { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.step i { height: 4px; border-radius: 2px; background: var(--line-strong); }
.shoot:has(.shot[data-kind=front] .thumb.has) .step[data-step=front],
.shoot:has(.shot[data-kind=side] .thumb.has) .step[data-step=side],
.shoot:has(.shot[data-kind=back] .thumb.has) .step[data-step=back],
.shoot:has(.shot[data-kind=adam] .thumb.has) .step[data-step=adam] { color: var(--ink); font-weight: 600; }
.shoot:has(.shot[data-kind=front] .thumb.has) .step[data-step=front] i,
.shoot:has(.shot[data-kind=side] .thumb.has) .step[data-step=side] i,
.shoot:has(.shot[data-kind=back] .thumb.has) .step[data-step=back] i,
.shoot:has(.shot[data-kind=adam] .thumb.has) .step[data-step=adam] i { background: var(--brand); }

.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.shot { padding: 10px; display: flex; flex-direction: column; gap: 10px; border-radius: var(--r-md); }
.shot-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 2px 4px 0; }
.shot-head b { font-size: 15px; }
.badge { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--fill); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--good-soft); color: var(--good); }
.badge.err { background: var(--bad-soft); color: var(--bad); }
.badge.est { background: var(--est-soft); color: var(--est); }
.thumb {
  aspect-ratio: 3 / 4; border-radius: var(--r-sm); background: var(--fill) center / contain no-repeat;
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px;
  border: 1.5px dashed var(--line-strong); cursor: pointer; overflow: hidden;
}
.thumb.has { border: 0; background-color: #191F28; }
.thumb.has span { display: none; }
.shot-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.shot-btns .btn { min-height: 44px; padding: 0 4px; font-size: 14px; }
/* 참고 사진 칸 (측면 전굴 — 점·수치 없음): 눌러도 편집 화면이 없음 */
.ref-shot .thumb { cursor: default; }
.ref-shot .thumb span { text-align: center; padding: 0 8px; word-break: keep-all; }
.r-refs h3 .lv { vertical-align: 2px; }

.mode { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px; }
.mode-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mode-head b { font-size: 16px; }
.mode-head .hint { margin: 0; text-align: right; }
.seg { display: grid; grid-template-columns: 1fr 1fr 1fr; background: var(--fill-2); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; min-height: 44px; padding: 0 6px; border-radius: 10px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: background-color .15s; }
.seg button[aria-pressed=true] { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.banner { background: var(--warn-soft); border-radius: var(--r-md); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.banner p { margin: 0; font-size: 14px; }
.suggest-wrap { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--card); border-radius: var(--r-sm); box-shadow: 0 0 0 1px rgb(25 31 40 / .06), 0 12px 32px -8px rgb(25 31 40 / .24); display: flex; flex-direction: column; overflow: hidden; }
.suggest button { text-align: left; border: 0; background: none; min-height: 48px; padding: 8px 14px; font-size: 15px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.suggest button:hover { background: var(--fill); }
.suggest button:last-child { border-bottom: 0; }
.suggest button.new { color: var(--brand-text); font-weight: 700; }
.consent { margin-top: 14px; border-top: 1px solid var(--line-soft); padding-top: 2px; }
.consent summary { cursor: pointer; font-weight: 700; font-size: 14px; padding: 12px 0; }
.consent summary.warn { color: var(--warn); }
#consent-body { display: flex; flex-direction: column; gap: 0; margin-top: 0; }
#consent-body select { width: auto; min-height: 44px; padding: 0 8px; font-size: 13px; margin-left: 6px; }
#consent-body .field-row { margin: 4px 0 8px; }
.flags summary { cursor: pointer; font-weight: 700; font-size: 14px; padding: 12px 0; }
.flags { display: flex; flex-direction: column; gap: 0; }
.prio { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.notice { background: var(--card); border-radius: var(--r-md); padding: 14px 16px; font-size: 14px; color: var(--ink-2); margin: 0; }
.metric[data-sticker], .metric[data-confirm-auto] { cursor: pointer; }
.m-go { color: var(--est); font-weight: 700; }
.m-go.auto { color: var(--auto); }
.lv.auto { background: var(--auto-soft); color: var(--auto); }
.chip-btn.auto { background: var(--auto-soft); box-shadow: inset 0 0 0 1px #7dd3fc; color: #075985; font-weight: 700; }
.stats-sub { font-size: 15px; margin: 18px 0 8px; }
.convert-list { display: flex; flex-direction: column; gap: 6px; }
.convert-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; background: var(--card); border-radius: var(--r-sm); font-size: 14px; }
.convert-item .btn { min-height: 44px; padding: 0 14px; font-size: 14px; flex: none; }
#r-lock-note:empty { display: none; }
#r-lock-note { display: flex; flex-direction: column; gap: 8px; }
.ro-banner { margin: 0 0 12px; padding: 12px 16px; border-radius: var(--r-md); background: var(--brand-soft); color: var(--brand-text); font-size: 14px; font-weight: 600; }
.rev-list { display: flex; flex-direction: column; gap: 10px; }
.rev-item { padding: 16px 20px; }
.rev-item .rev-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; }
.rev-item .rev-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.rev-item .rev-out { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.rev-item .btn { min-height: 44px; padding: 0 14px; font-size: 14px; flex: none; }
.share-note { flex-basis: 100%; font-size: 12px; color: var(--muted); text-align: center; }
.bottom-bar { flex-wrap: wrap; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; min-height: 44px; padding: 10px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--brand); }
.seq-bar {
  position: sticky; top: calc(var(--top-h) + var(--safe-t)); z-index: 9; display: flex; flex-direction: column; gap: 6px;
  padding: 10px 16px; background: var(--brand-soft); border-bottom: 1px solid #D3E0FD;
}
/* 단계마다 글 길이가 달라도 높이가 그대로여야 사진이 손가락 아래에서 움직이지 않음 */
.seq-txt { display: flex; flex-direction: column; font-size: 14px; min-height: 92px; }
.seq-txt b { font-size: 12px; color: var(--brand-text); }
.seq-txt span { font-weight: 700; font-size: 17px; line-height: 1.35; min-height: 2.7em; letter-spacing: -0.01em; }
.seq-txt small { font-size: 13px; color: var(--ink-2); min-height: 1.4em; }
.seq-btns { display: flex; gap: 6px; justify-content: flex-end; }
.seq-btns .chip-btn { background: var(--card); }
.lv.info { background: var(--fill); color: var(--ink-2); }
.lv.est { background: var(--est-soft); color: var(--est); }
.guide summary { font-weight: 700; cursor: pointer; padding: 11px 0; }
.guide { padding-top: 6px; padding-bottom: 6px; }
.guide[open] { padding-bottom: 20px; }
.guide ol { padding-left: 20px; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--ink-2); }
.guide ol b { color: var(--ink); }

/* editor */
.editor-stage { position: relative; background: #1E2329; display: flex; justify-content: center; touch-action: none; }
#editor-canvas { display: block; max-width: 100%; touch-action: none; }
/* 점 찍는 사진: 길게 누르거나 손바닥이 닿으면 iOS가 글자·사진을 선택(파란 표시)하거나 끌어 놓기·메뉴를 시작해 손가락을 가로챔 → 막음 (2026-10-26 아이패드 실사용) */
.editor-stage, .editor-stage * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-user-drag: none; }
.stage-msg {
  position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 10px 14px; border-radius: var(--r-sm);
  background: rgb(196 50 28 / .94); color: #fff; font-size: 14px; font-weight: 600;
  pointer-events: none; /* 사진 아래쪽(발목 자리)을 덮어도 탭이 사진에 닿게 — 인식 실패 사진은 점을 모두 찍어야 해서 (2026-10-14) */
}
.editor-tools { background: var(--card); padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.q-bar { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.q-item { font-size: 13px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--warn); }
.q-item.info { background: var(--fill); color: var(--ink-2); }
.tool-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tool-row + .tool-row { margin-top: 8px; }
.tool-row.rot label { font-size: 13px; color: var(--ink-2); }
.tool-row.rot input { flex: 1; min-width: 120px; min-height: 44px; margin: 0; accent-color: var(--brand); }
.tool-row.rot output { width: 46px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--ink-2); }
.chip-btn {
  min-height: 44px; border: 0; background: var(--fill); color: var(--ink); border-radius: 99px; padding: 0 14px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: background-color .15s;
}
.chip-btn:hover:not(:disabled) { background: var(--fill-2); }
.chip-btn.sm { padding: 0 14px; font-size: 13.5px; }
.chip-btn[aria-pressed=true] { background: var(--ink); color: #fff; }
#screen-editor:not(.side) .side-only { display: none; }
#editor-hint { color: var(--ink-2); }

/* metrics: 흰 카드 하나에 줄로 나눠 (리포트 화면). 판정은 오른쪽 위 작은 색 꼬리표 */
.metrics { display: flex; flex-direction: column; background: var(--card); border-radius: var(--r-lg); padding: 2px 20px; }
.metric {
  padding: 14px 0; display: grid;
  grid-template-columns: 1fr auto; gap: 4px 12px; border-bottom: 1px solid var(--line-soft);
}
.metric:last-child { border-bottom: 0; }
.metric[role=button]:hover .m-label { color: var(--brand-text); }
.metric .m-label { font-weight: 600; font-size: 15px; }
.metric .m-val { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; text-align: right; }
.metric .m-detail { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); }
.metrics > .hint { margin: 12px 0; }
#screen-editor .metrics { padding: 0; border-radius: 0; }
.lv { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; margin-left: 6px; vertical-align: 1px; line-height: 1.5; }
.lv.good { background: var(--good-soft); color: var(--good); }
.lv.warn { background: var(--warn-soft); color: var(--warn); }
.lv.bad { background: var(--bad-soft); color: var(--bad); }

/* report */
.r-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.r-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.02em; line-height: 1.35; }
.r-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.score { text-align: right; flex: none; }
.score b { display: block; font-size: 44px; font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; color: var(--ink); }
.score span { font-size: 13px; color: var(--ink-2); }
.r-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.r-imgs figure { margin: 0; background: #191F28; border-radius: var(--r-md); overflow: hidden; }
.r-imgs img { display: block; width: 100%; }
.r-imgs figcaption { color: #fff; font-size: 13px; font-weight: 600; padding: 8px 12px; background: #191F28; }
.r-sec h3 { margin: 8px 4px 10px; font-size: 17px; letter-spacing: -0.01em; }
.card.r-sec h3 { margin: 0 0 12px; }
.tips { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.disclaimer { font-size: 12px; line-height: 1.5; color: var(--muted); text-align: center; margin: 4px 8px; }

.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; gap: 8px; align-items: center; justify-content: flex-end;
  padding: 12px 16px calc(12px + var(--safe-b)); background: var(--card); border-top: 1px solid var(--line-soft);
}
.bottom-bar .btn { flex: 1; min-height: 52px; border-radius: var(--r-md); }
.bottom-bar .btn.primary { flex: 1.3; font-size: 16px; }
#h-compare-bar span { flex: 1; color: var(--ink-2); font-size: 14px; }

/* history */
#history-list { display: flex; flex-direction: column; gap: 10px; }
.h-item {
  display: grid; grid-template-columns: auto 56px minmax(0, 1fr); grid-template-areas: "cb img info" "acts acts acts";
  gap: 10px 12px; align-items: center; padding: 14px 16px; border-radius: var(--r-md);
}
.h-item > input[type=checkbox] { grid-area: cb; }
.h-item > img { grid-area: img; }
.h-item > div:not(.h-acts) { grid-area: info; min-width: 0; }
.h-item img { width: 56px; height: 72px; object-fit: cover; border-radius: 10px; background: #191F28; }
.h-item .h-name, .due-item .h-name { font-weight: 700; font-size: 16px; }
.h-item .h-sub, .due-item .h-sub { font-size: 13px; color: var(--muted); }
.h-item input[type=checkbox] { width: 24px; height: 24px; margin: 0 2px; accent-color: var(--brand); cursor: pointer; }
.h-acts { grid-area: acts; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.h-acts .btn { flex: 1 1 auto; min-height: 44px; padding: 0 12px; font-size: 14px; }
.row-btns { display: flex; gap: 8px; }
.row-btns .btn { flex: 1; }
.empty { text-align: center; color: var(--muted); padding: 32px 0; }

/* compare */
.cmp-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card); border-radius: var(--r-md); overflow: hidden; }
.cmp-table th, .cmp-table td { padding: 12px 10px; border-bottom: 1px solid var(--line-soft); text-align: right; }
.cmp-table tbody tr:last-child td { border-bottom: 0; }
.cmp-table th:first-child, .cmp-table td:first-child { text-align: left; padding-left: 16px; }
.cmp-table th:last-child, .cmp-table td:last-child { padding-right: 16px; }
.cmp-table thead th { background: var(--band); font-size: 13px; color: var(--ink-2); font-weight: 600; }
/* 변화 칸 색은 비교 이미지(report.js TREND_COLOR)와 같아야 함 — 회원에게 가는 이미지와 화면 표가 같은 색 (test/consent-first.mjs) */
.cmp-table td.delta { color: #111827; }
.cmp-table td.delta.better { color: #16a34a; font-weight: 700; }
.cmp-table td.delta.worse { color: #dc2626; font-weight: 700; }
.cmp-table td.delta.na { color: #6b7280; }
#stats-by { grid-template-columns: 1fr 1fr 1fr; }
#stats-by button { font-size: 14px; line-height: 1.3; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--card); border-radius: var(--r-md); overflow: hidden; }
.stats-table th, .stats-table td { padding: 10px 8px; border-bottom: 1px solid var(--line-soft); text-align: right; white-space: nowrap; }
.stats-table tbody tr:last-child td { border-bottom: 0; }
.stats-table th:first-child, .stats-table td:first-child { text-align: left; white-space: normal; padding-left: 14px; }
.stats-table th:last-child, .stats-table td:last-child { padding-right: 14px; }
.stats-table thead th { background: var(--band); color: var(--ink-2); font-weight: 600; }
.stats-table .pass { color: var(--good); font-weight: 700; }
.stats-table .fail { color: var(--bad); font-weight: 700; }
.stats-scroll { overflow-x: auto; border-radius: var(--r-md); }

/* camera */
.camera { position: fixed; inset: 0; z-index: 100; background: #000; }
.camera video, .camera canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.camera video.mirror { transform: scaleX(-1); }
.cam-top, .cam-bottom {
  position: absolute; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px;
}
.cam-top { top: var(--safe-t); }
.cam-bottom { bottom: calc(12px + var(--safe-b)); }
.cam-btn {
  background: rgb(0 0 0 / .5); color: #fff; border: 0; border-radius: 99px; min-width: 44px; height: 44px; font-size: 18px; cursor: pointer;
}
.cam-btn.wide { font-size: 14px; font-weight: 600; padding: 0 16px; }
.cam-kind { color: #fff; background: rgb(0 0 0 / .5); padding: 8px 14px; border-radius: 99px; font-size: 14px; font-weight: 600; min-width: 88px; text-align: center; }
.shutter { width: 72px; height: 72px; border-radius: 50%; border: 5px solid #fff; background: rgb(255 255 255 / .35); cursor: pointer; }
.shutter:active { background: #fff; }
.level { color: #fff; background: rgb(0 0 0 / .55); padding: 8px 14px; border-radius: 99px; font-size: 14px; font-weight: 700; }
.level.ok { background: rgb(10 122 80 / .92); }
.level.off { background: rgb(196 50 28 / .9); }
.cam-res { color: #fff; background: rgb(0 0 0 / .45); padding: 6px 10px; border-radius: 99px; font-size: 12px; font-variant-numeric: tabular-nums; }
.cam-res:empty { display: none; }
.cam-count {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 120px; font-weight: 700; color: #fff; text-shadow: 0 4px 24px rgb(0 0 0 / .6); pointer-events: none;
}

/* dialogs (설정·선택 창·비밀번호) */
dialog { border: 0; border-radius: var(--r-lg); padding: 0; width: min(92vw, 440px); color: var(--ink); background: var(--card); box-shadow: 0 24px 48px -16px rgb(25 31 40 / .35); }
dialog::backdrop { background: rgb(25 31 40 / .45); }
.settings { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.choice-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.choice-btns .btn { width: 100%; min-height: 52px; white-space: normal; text-align: center; padding: 10px 16px; border-radius: var(--r-md); }
#choice-msg { font-size: 15px; color: var(--ink-2); margin: 0; white-space: pre-line; } /* 여러 줄 안내(촬영 확인 경고·설정 차이 등)를 줄마다 */
.settings h3 { margin: 0; font-size: 20px; letter-spacing: -0.02em; line-height: 1.35; }
.settings .check { padding: 8px 0; }
.about { border-top: 1px solid var(--line-soft); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.about-head { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.about-lines { color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.5; white-space: pre-line; }

.loading {
  position: fixed; inset: 0; z-index: 200; background: rgb(255 255 255 / .9);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
#loading-txt { white-space: pre-line; text-align: center; margin: 0; font-weight: 600; color: var(--ink); }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--brand-soft); border-top-color: var(--brand); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; bottom: calc(140px + var(--safe-b)); transform: translateX(-50%); z-index: 300;
  background: rgb(25 31 40 / .94); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 600;
  max-width: min(90vw, 480px); text-align: center;
  pointer-events: none; /* 안내 문구가 사진·버튼 위에 떠 있어도 탭을 막지 않게 */
}

@media (min-width: 760px) {
  .r-imgs { gap: 14px; }
}

/* 사진 카드에 파일을 끌어 올렸을 때 */
.shot.drop { outline: 3px dashed var(--brand); outline-offset: -3px; background: var(--brand-soft); }
.pc-only { display: none !important; }

/* 사진 크게 보기 (PC) */
.viewer { position: fixed; inset: 0; z-index: 250; background: rgb(0 0 0 / .94); display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.viewer img { max-width: calc(100vw - 160px); max-height: calc(100dvh - 120px); margin-top: 36px; object-fit: contain; }
.viewer-cap { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); color: #fff; font-weight: 700; font-size: 18px; background: rgb(0 0 0 / .5); padding: 6px 16px; border-radius: 99px; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 56px; height: 96px; border: 0; border-radius: var(--r-sm); background: rgb(255 255 255 / .12); color: #fff; font-size: 44px; line-height: 1; cursor: pointer; }
.viewer-nav:hover { background: rgb(255 255 255 / .24); }
.viewer-nav.prev { left: 24px; }
.viewer-nav.next { right: 24px; }
.viewer-hint { position: absolute; bottom: 10px; left: 0; right: 0; margin: 0; text-align: center; color: rgb(255 255 255 / .7); font-size: 13px; }

/* ───────── PC 배치: 넓은 가로 화면 (main.js의 PC_MQ와 같은 조건) ─────────
   상담은 PC 모니터로 회원과 함께 보며 진행 → 사진은 화면 높이에 맞춰 크게, 설명은 오른쪽 패널.
   아이폰·세로 화면에는 적용되지 않음 */
@media (min-width: 1024px) and (min-aspect-ratio: 5/4) {
  .pc-only { display: inline-flex !important; }
  .topbar { padding-left: 20px; padding-right: 20px; }

  /* 홈: 왼쪽 회원 정보·방식·리포트 버튼 / 오른쪽 사진 4장 한 줄 */
  #screen-home .wrap {
    max-width: 1440px; padding: 12px 24px 24px; display: grid; gap: 16px 24px; align-items: start;
    grid-template-columns: minmax(380px, 440px) minmax(0, 1fr);
    grid-template-areas: "update update" "banner banner" "align align" "member shots" "mode shots" "report shots" "guide shots";
    grid-template-rows: auto auto auto auto auto auto 1fr;
  }
  #backup-banner { grid-area: banner; }
  #update-banner { grid-area: update; }
  #screen-home .member { grid-area: member; }
  #screen-home .mode { grid-area: mode; }
  #btn-report { grid-area: report; }
  #screen-home .guide { grid-area: guide; }
  #screen-home .shoot { grid-area: shots; }
  #screen-home .shoot-head { padding-top: 0; }
  #screen-home .shots { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  #screen-home .shot { padding: 12px; }
  #screen-home .shot-head b { font-size: 16px; }
  #screen-home .member .field-row { display: grid; grid-template-columns: 1fr 0.8fr 1.35fr; }
  #screen-home .shot .thumb span::after { content: "파일을 여기로 끌어 놓아도 됩니다"; display: block; margin-top: 4px; font-size: 12px; }
  #screen-home .shot .thumb span { text-align: center; padding: 0 12px; word-break: keep-all; }

  /* 점 수정: 왼쪽 사진(화면 높이) / 오른쪽 순서 안내·도구·지표 */
  #screen-editor.active {
    display: grid; height: 100dvh; padding-bottom: 0; overflow: hidden;
    grid-template-columns: minmax(0, 1fr) 460px; grid-template-rows: auto auto auto minmax(0, 1fr);
  }
  #screen-editor .topbar { grid-column: 1 / -1; grid-row: 1; }
  #screen-editor .editor-stage { grid-column: 1; grid-row: 2 / 5; align-items: center; min-height: 0; overflow: hidden; }
  #screen-editor .seq-bar { grid-column: 2; grid-row: 2; position: static; border-left: 1px solid var(--line-soft); }
  #screen-editor .editor-tools { grid-column: 2; grid-row: 3; border-left: 1px solid var(--line-soft); }
  #screen-editor .wrap { grid-column: 2; grid-row: 4; max-width: none; margin: 0; padding: 4px 20px 20px; overflow-y: auto; border-left: 1px solid var(--line-soft); }
  #screen-editor .tool-row.rot input { min-width: 0; }

  /* 리포트·비교 버튼: 화면 아래 바 → 위쪽 오른쪽 (상담 중 사진을 가리지 않게) */
  #screen-report .bottom-bar, #screen-compare .bottom-bar {
    top: 0; bottom: auto; left: auto; right: 0; z-index: 20; height: var(--top-h);
    padding: 0 20px; background: none; border: 0; flex-wrap: nowrap;
  }
  #screen-report .topbar, #screen-compare .topbar { display: flex; justify-content: flex-start; gap: 20px; }
  #screen-report .bottom-bar .btn, #screen-compare .bottom-bar .btn { flex: none; min-height: 44px; padding: 0 18px; border-radius: var(--r-sm); font-size: 15px; }
  #screen-report .bottom-bar .btn:not(.primary), #screen-compare .bottom-bar .btn:not(.primary) { background: var(--card); }
  #screen-report .bottom-bar .btn:not(.primary):hover, #screen-compare .bottom-bar .btn:not(.primary):hover { background: var(--fill-2); }
  #screen-report .share-note { flex-basis: auto; margin-right: 6px; }
  #screen-report, #screen-compare { padding-bottom: 32px; }

  /* 리포트: 왼쪽 사진(화면 높이에 맞춰 고정) / 오른쪽 설명 패널(스크롤) */
  #report-body {
    max-width: none; padding: 12px 24px 20px; display: grid; align-items: start;
    grid-template-columns: minmax(0, 1fr) minmax(400px, 34%); column-gap: 24px; row-gap: 0;
  }
  #report-body > * { grid-column: 2; margin: 0 0 14px; }
  #report-body > .r-imgs {
    grid-column: 1; grid-row: 1 / span 20; margin: 0; position: sticky; top: calc(var(--top-h) + 12px);
    max-height: calc(100dvh - var(--top-h) - 32px); overflow-y: auto; gap: 12px; align-content: start;
  }
  /* 사진이 3장 이상이면 사진 칸만 따로 스크롤하지 않고 화면 전체가 함께 스크롤 */
  #report-body > .r-imgs[data-n="3"], #report-body > .r-imgs[data-n="4"] { position: static; max-height: none; overflow: visible; }
  .r-imgs figure { display: flex; flex-direction: column; cursor: zoom-in; }
  .r-imgs figcaption { font-size: 15px; font-weight: 700; padding: 8px 14px; }
  #report-body .r-imgs img, #compare-body .r-imgs img {
    width: auto; max-width: 100%; max-height: calc(100dvh - 135px); margin: 0 auto;
  }
  /* 회원이 1~1.5m 떨어져 보는 화면이라 글자를 키움 (PC만) */
  #report-body .r-head h2 { font-size: 26px; }
  #report-body .score b { font-size: 52px; }
  #report-body .metric .m-label { font-size: 17px; }
  #report-body .metric .m-val { font-size: 22px; }
  #report-body .metric .m-detail { font-size: 14.5px; }
  #report-body .lv { font-size: 13px; }
  #report-body .r-sec h3 { font-size: 19px; }
  #report-body .prio, #report-body .tips { font-size: 16px; }
  #report-body .hint, #report-body .notice { font-size: 14px; }
  #report-body .disclaimer { font-size: 13px; }

  /* 전/후 비교: 이전·현재 사진을 화면 높이에 맞춰 나란히 */
  #compare-body { max-width: 1400px; padding: 12px 24px 20px; }
  #compare-body .r-imgs { gap: 16px; }
  #compare-body .r-imgs img { max-height: calc(100dvh - 270px); } /* 위 회원 카드·안내 높이를 빼서 발끝까지 첫 화면에 */
  #compare-body .r-imgs { max-width: 1100px; margin: 0 auto; }
  #compare-body .cmp-table { font-size: 15px; max-width: 1100px; margin: 0 auto; }
  #compare-body > .r-head, #compare-body > .notice, #compare-body > .disclaimer { width: 100%; max-width: 1100px; margin-left: auto; margin-right: auto; }

  /* 기록·반복성 분석: 넓게 */
  #screen-history .wrap, #screen-stats .wrap { max-width: 1040px; padding: 12px 24px 20px; }
  .h-item { grid-template-columns: auto 56px minmax(0, 1fr) auto; grid-template-areas: "cb img info acts"; padding: 12px 16px; }
  .h-acts { flex-wrap: nowrap; padding-top: 0; border-top: 0; }
  .h-acts .btn { flex: none; }
}

/* 인쇄 (PC 리포트의 「인쇄」 또는 Ctrl+P): 버튼·안내를 빼고 A4 세로에 맞춤 */
@media print {
  @page { size: A4; margin: 12mm; }
  .topbar, .bottom-bar, .toast, .viewer, .loading, .no-print { display: none !important; }
  .screen { padding: 0; min-height: 0; }
  html, body, .card, .metric, .metrics { background: #fff !important; }
  .card, .metric { box-shadow: none; border: 1px solid #e5e7eb; border-radius: 10px; break-inside: avoid; }
  #report-body { display: block !important; max-width: none; padding: 0; }
  #report-body > * { margin: 0 0 8px !important; }
  #report-body > .r-imgs { position: static !important; max-height: none !important; overflow: visible !important; break-inside: avoid; }
  #report-body .r-imgs img { width: auto; max-width: 100%; max-height: 120mm; margin: 0 auto; }
  #report-body .metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0; border-radius: 0; }
  #report-body .metric { padding: 6px 10px; font-size: 12px; }
  #report-body .metric .m-detail { font-size: 11px; }
  #report-body .score b { font-size: 34px; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* 촬영존 점검 (A6) */
.align-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink-2); padding: 6px 8px 6px 16px; background: var(--card); border-radius: var(--r-md); }
.align-line.warn { color: var(--warn); background: var(--warn-soft); }
.align-line.ok { color: var(--good); }
.sec-title { margin: 0 0 6px; font-size: 17px; letter-spacing: -0.01em; }
.align-result { margin-top: 12px; padding: 12px 14px; border-radius: var(--r-sm); font-size: 14px; background: var(--fill); }
.align-result.ok { background: var(--good-soft); color: #0A5C3C; }
.align-result.bad { background: var(--bad-soft); color: #9A2A16; }
.setup-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.setup-list .check { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.setup-list .check.done { background: var(--good-soft); border-color: #BFE6D2; }
.row-btns + .align-result, .card > .row-btns { margin-top: 12px; }
@media (min-width: 1024px) and (min-aspect-ratio: 5/4) {
  #align-line { grid-area: align; }
  #screen-setup .wrap { max-width: 900px; padding: 12px 24px 20px; }
}

/* 재측정 대상 · 새 버전 알림 */
.due-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.due-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.due-item .btn { min-height: 44px; padding: 0 14px; font-size: 14px; flex: none; }
.r-next { background: var(--good-soft); color: var(--good); }
.settings .field-row { margin-top: 0; }

/* 실험 모드 (Phase 1 검증용): 홈 「실험」 카드 · 반복성 화면 실험 종류 필터·조건 표시 */
.exp-card { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px; box-shadow: inset 0 0 0 1.5px #C9D8FC; }
.exp-card .mode-head b { color: var(--brand-text); }
.exp-card .field-row { margin-top: 0; }
.exp-card .field:first-child { flex: 1.35; } /* 「같은 사진 재탭」이 잘리지 않게 */
.exp-card .exp-trial { flex: 0 0 76px; }
.exp-card .hint { margin: 0; }
.exp-card input:disabled { color: var(--muted); opacity: .7; }
.stats-filter { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.stats-filter select { width: auto; flex: 1; max-width: 280px; background: var(--card); }
.stats-table .cond { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
@media (min-width: 1024px) and (min-aspect-ratio: 5/4) {
  /* 실험 카드가 보일 때만 회원 정보 아래에 한 칸을 만든다 (꺼져 있으면 기존 배치 그대로) */
  #screen-home .exp-card { grid-area: exp; }
  #screen-home .wrap:has(> .exp-card:not([hidden])) {
    grid-template-areas: "update update" "banner banner" "align align" "member shots" "exp shots" "mode shots" "report shots" "guide shots";
    grid-template-rows: auto auto auto auto auto auto auto 1fr;
  }
}

/* 움직임 줄이기: 눌림·전환 효과 없이, 불러오는 표시는 천천히 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
  .btn:active:not(:disabled) { transform: none; }
  .spinner { animation-duration: 2.4s; }
}
