/* 닥터원 체대입시. Dr.Won 색을 따른다. 디자인은 나중에 이 파일만 고치면 바뀐다. */

:root {
  --navy: #243447;
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --surface-alt: #EDF0F4;
  --line: #E3E7EC;
  --text: #1A2230;
  --muted: #6B7684;
  --a: #2563EB;
  --b: #F97316;
  --guide: #FACC15;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(36, 52, 71, .06), 0 1px 8px rgba(36, 52, 71, .04);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 "Pretendard", "Malgun Gothic", -apple-system, system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}
body.no-scroll { overflow: hidden; }

h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 6px; }
.sub, .hint, .muted { color: var(--muted); }
.sub { margin: 0 0 14px; }
.hint { font-size: 13px; margin: 6px 0 0; }
.center { text-align: center; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--navy); color: #fff;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
}
.brand { font-weight: 700; font-size: 17px; }
.brand small { font-weight: 400; opacity: .7; margin-left: 6px; }
.who { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.btn-link { background: none; border: 0; color: #fff; text-decoration: underline; font: inherit; cursor: pointer; }

.wrap { max-width: 900px; margin: 0 auto; padding: 14px; }
.wrap.narrow { max-width: 440px; }
.wrap.wide { max-width: 1400px; }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface-alt); color: var(--text);
  border-radius: 8px; padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer;
}
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.line { background: var(--surface); }
.btn.sm { padding: 5px 10px; font-size: 14px; }
.btn.big { padding: 12px 22px; font-size: 16px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }

label { display: block; font-weight: 600; margin: 10px 0; }
label small { font-weight: 400; color: var(--muted); margin-left: 6px; }
label input:not([type=checkbox]):not([type=range]) {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff;
}
label.inline { display: flex; align-items: center; gap: 8px; }
label.inline input { display: inline-block; width: 120px; margin: 0; }
label.inline.full input { flex: 1; width: auto; }
label.check { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-weight: 500; }
select { font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }

.msg { color: #9B2C2C; min-height: 1.2em; margin: 6px 0; }
.notice { background: var(--surface-alt); border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.auth-actions { margin-top: 10px; }

.tabs { display: inline-flex; background: var(--surface-alt); border-radius: 8px; padding: 3px; gap: 2px; }
.tabs button {
  border: 0; background: none; padding: 6px 12px; border-radius: 6px; font: inherit; cursor: pointer; color: var(--muted);
}
.tabs button.on { background: #fff; color: var(--text); font-weight: 700; box-shadow: var(--shadow); }
#authTabs { display: flex; margin-bottom: 6px; }
#authTabs button { flex: 1; }

.guide summary { font-weight: 700; cursor: pointer; }
.guide ol { margin: 8px 0 0; padding-left: 20px; }

.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .slots { grid-template-columns: 1fr; } }
.slot { margin: 0; }
.slot-head { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 10px; }
.slot-head .name { margin-left: auto; width: 120px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.chip { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 14px; }
.chip.a { background: var(--a); }
.chip.b { background: var(--b); }
.slot-empty { display: flex; gap: 8px; flex-wrap: wrap; padding: 24px 0; justify-content: center; }
.slot-ready canvas { width: 100%; border-radius: 6px; background: #000; display: block; }
.slot-info { margin: 8px 0; font-weight: 600; }
.row { display: flex; gap: 6px; flex-wrap: wrap; }

.actions { display: flex; gap: 10px; justify-content: center; margin: 14px 0 4px; flex-wrap: wrap; }

.stage { position: relative; width: 100%; background: #000; border-radius: 8px; overflow: hidden; touch-action: none; }
.stage video { width: 100%; height: 100%; display: block; }
.mat-line {
  position: absolute; top: 0; bottom: 0; width: 44px; margin-left: -22px; cursor: ew-resize; touch-action: none;
}
.mat-line::before {
  content: ""; position: absolute; left: 20px; top: 0; bottom: 0; width: 4px;
  background: repeating-linear-gradient(var(--guide) 0 12px, transparent 12px 20px);
}
.mat-line span {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--guide); color: #000; font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
}

/* 비교 */
.cmp-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.legend { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; font-weight: 600; }
.legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; }
.legend i.a { background: var(--a); }
.legend i.b { background: var(--b); margin-left: 8px; }
#cmpCanvas { width: 100%; max-height: 72vh; object-fit: contain; background: #000; border-radius: 8px; display: block; }

.timeline { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 8px 0 12px; }
.seek-wrap { position: relative; padding-bottom: 10px; }
#seek { width: 100%; margin: 0; }
#ticks { position: absolute; left: 8px; right: 8px; bottom: 0; height: 8px; pointer-events: none; }
#ticks i { position: absolute; width: 3px; height: 8px; margin-left: -1px; border-radius: 1px; }
#ticks i.a { background: var(--a); }
#ticks i.b { background: var(--b); top: 0; opacity: .85; }
.controls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th.a { color: var(--a); }
th.b { color: var(--b); }
tr.grp td { background: var(--surface-alt); font-weight: 700; text-align: left; }

/* 촬영 화면: 전체 화면 */
#camera { position: fixed; inset: 0; background: #000; z-index: 50; }
#camVideo, #camOverlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cam-msg {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  padding: 6px 14px; border-radius: 20px; font-weight: 700; font-size: 15px; white-space: nowrap;
}
.cam-msg.ok { background: rgba(34, 197, 94, .9); color: #fff; }
.cam-msg.warn { background: rgba(0, 0, 0, .7); color: var(--guide); }
.cam-msg.rec { background: rgba(220, 38, 38, .9); color: #fff; }
.cam-close {
  position: absolute; top: max(12px, env(safe-area-inset-top)); left: 12px;
  background: rgba(0, 0, 0, .55); color: #fff; border: 0; border-radius: 18px; padding: 6px 14px; font: inherit;
}
.cam-rec {
  position: absolute; right: max(18px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%);
  width: 72px; height: 72px; border-radius: 50%; border: 5px solid #fff; background: #DC2626; cursor: pointer;
}
.cam-rec:disabled { background: #666; opacity: .7; }
.cam-rec.recording { border-radius: 18px; background: #DC2626; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }

.overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: grid; place-items: center; z-index: 60; }
.overlay .box { background: #fff; border-radius: 12px; padding: 20px 24px; width: min(360px, 90vw); text-align: center; }
.overlay progress { width: 100%; }

/* 캔버스에 그릴 원본 영상을 두는 자리. 안드로이드 크롬은 화면 밖이나 1px 짜리 영상은
   장면을 새로 그리지 않아(배터리 절약), 비교 화면에 첫 장면만 멈춰 보였다(2026-09-30).
   그래서 화면 안에 제 크기로 두고 거의 투명하게만 한다. */
#videoPool {
  position: fixed; left: 0; top: 0; z-index: -1;
  opacity: .01; pointer-events: none;
}
#videoPool video { width: 160px; height: 90px; display: block; }

/* ---- 닥터원 체대입시(옛 pidu academy) ---- */
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; min-width: 0; }
.brand img { height: 30px; display: block; }
.brand span { font-size: 17px; font-weight: 800; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 흰 바탕 위 앱 브랜드(로그인 카드) */
.app-brand { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.app-brand img { height: 40px; display: block; }
.app-brand b { font-size: 19px; font-weight: 800; color: #1F3A4F; letter-spacing: -.3px; }
.app-brand b small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.home-title { margin: 8px 4px 14px; }
.feature-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.feature-card {
  display: flex; flex-direction: column; gap: 6px; padding: 22px 18px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.feature-card b { font-size: 19px; color: var(--navy); }
.feature-card span { color: var(--muted); font-size: 14px; }
.feature-card:active { transform: scale(.99); }
.guide-list { padding-left: 20px; margin: 6px 0 12px; }
.field-row { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.field-row label.inline input { width: 190px; }

/* 체형분석 촬영: 전체 화면 */
#pcScreen { position: fixed; inset: 0; background: #000; z-index: 50; }
#pcVideo, #pcOverlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
#pcScreen.mirror #pcVideo, #pcScreen.mirror #pcOverlay { transform: scaleX(-1); }
.pc-step {
  position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px;
  background: rgba(0, 0, 0, .6); color: #fff; border-radius: 16px; padding: 5px 12px; font-weight: 700;
}
.pc-count {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
  font-size: 110px; font-weight: 800; color: #fff; text-shadow: 0 2px 16px rgba(0, 0, 0, .6); pointer-events: none;
}
.pc-count.rec { color: #FCA5A5; font-size: 72px; }

/* 결과 */
.result-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.score-big { text-align: right; }
.score-big b { font-size: 48px; color: var(--navy); line-height: 1; }
.score-big span { font-size: 18px; margin-left: 2px; }
.score-big small { display: block; color: var(--muted); }
.region-row { display: grid; grid-template-columns: 70px 1fr 36px; align-items: center; gap: 10px; margin: 6px 0; }
.region-row .bar { height: 10px; background: var(--surface-alt); border-radius: 5px; overflow: hidden; }
.region-row .bar i { display: block; height: 100%; background: var(--navy); border-radius: 5px; }
.region-row b { text-align: right; }
.view-head { display: flex; justify-content: space-between; align-items: center; }
.view-body { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 14px; align-items: start; margin-top: 8px; }
@media (max-width: 640px) { .view-body { grid-template-columns: 1fr; } }
.shot { width: 100%; border-radius: 8px; background: #000; }
.lv, .q { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 13px; font-weight: 700; }
.lv.keep { background: #DCF0E3; color: #1B6B3A; }
.lv.watch { background: #FBEFD3; color: #8A6100; }
.lv.risk { background: #F9DEDE; color: #9B2C2C; }
.q.good { background: #DCF0E3; color: #1B6B3A; }
.q.fair { background: #FBEFD3; color: #8A6100; }
.q.poor, .q.invalid { background: #F9DEDE; color: #9B2C2C; }
.issues { margin: 10px 0 0; padding-left: 18px; font-size: 14px; }
table.items td:last-child { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.gauge { position: relative; width: 90px; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, #86EFAC 0 33.3%, #FDE68A 33.3% 66.6%, #FCA5A5 66.6%); }
.gauge i { position: absolute; top: -3px; width: 3px; height: 14px; margin-left: -1px; background: #1A2230; border-radius: 1px; }
.notice-card { background: #FFFBEB; border-color: #FDE68A; }
@media (max-width: 480px) {
  table.items .gauge { display: none; }
  table.items th, table.items td { padding: 6px 6px; }
}
.feature-card, .feature-card:visited { text-decoration: none; color: inherit; }

/* 관리 */
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 2px 12px; flex-wrap: wrap; }
.admin-head h1 { margin: 0; }
.admin-card { border: 1px dashed var(--navy); background: #F7F9FC; }
.org-top { display: flex; gap: 12px; align-items: center; }
.org-main { flex: 1; min-width: 0; }
.swatch { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; overflow: hidden; flex: none; }
.swatch img { max-width: 40px; max-height: 40px; }
.small { font-size: 13px; }
.bad { color: #9B2C2C; font-weight: 700; }
.link-row { display: flex; gap: 6px; margin-top: 10px; }
.link-row input { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 13px; background: var(--surface-alt); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.grid2 input[type=color] { height: 42px; padding: 2px; }
.check-line { display: flex; align-items: center; gap: 6px; }
.feat-row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 8px 0; }
.feat-row > span { font-weight: 600; }
.person { display: grid; grid-template-columns: 1fr minmax(0, 360px); gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .person { grid-template-columns: 1fr; } }
.person.pending { background: #FFFBEB; margin: 0 -16px; padding: 12px 16px; }
.person-ctl select { margin: 0 6px 6px 0; }
.st.pending { color: #8A6100; font-weight: 700; }
.st.approved { color: #1B6B3A; font-weight: 700; }
.st.suspended { color: #9B2C2C; font-weight: 700; }
.exp { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 10px; background: #DCF0E3; color: #1B6B3A; margin-left: 4px; }
.exp.soon { background: #FBEFD3; color: #8A6100; }
.exp.over { background: #F9DEDE; color: #9B2C2C; }
.exp.none { background: var(--surface-alt); color: var(--muted); }
.date-row { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.date-row input { flex: 1; margin: 0 !important; }
.acct-box { margin-top: 10px; padding: 12px; background: var(--surface-alt); border-radius: 8px; }
.acct-result { width: min(440px, 92vw) !important; text-align: left !important; }
.acct-result dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; margin: 10px 0; }
.acct-result dt { color: var(--muted); }
.acct-result dd { margin: 0; word-break: break-all; }
.acct-result .pw { font-family: ui-monospace, Consolas, monospace; font-size: 18px; letter-spacing: 1px; }
.manual-link { color: var(--navy); font-weight: 700; }
.save-card h2 { margin-bottom: 4px; }
.save-form select, .save-form input { display: block; width: 100%; margin-top: 4px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
.ok-msg { color: #1B6B3A; font-weight: 700; }
.search { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; min-width: 180px; }
.subject-row, .rec-open { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 12px 4px; font: inherit; cursor: pointer; color: inherit; flex-wrap: wrap; }
.subject-row:first-child { border-top: 0; }
.rec-row { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); }
.rec-row .rec-open { border-top: 0; flex: 1; }
.rec-score { font-weight: 800; color: var(--navy); }
.trend { width: 100%; height: auto; }
.trend .grid { stroke: var(--line); }
.trend .line { fill: none; stroke: var(--navy); stroke-width: 2.5; }
.trend circle { fill: var(--navy); }
.trend text { font-size: 11px; fill: var(--muted); }
.trend text.v { fill: var(--navy); font-weight: 700; font-size: 12px; }
.brand img.org-logo { background: #fff; padding: 3px 8px; border-radius: 6px; height: 34px; max-width: 170px; object-fit: contain; }
.logo-row { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.logo-row input[type=file] { flex: 1; min-width: 0; font-size: 13px; }
.logo-preview { width: 120px; height: 48px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: grid; place-items: center; flex: none; overflow: hidden; }
.logo-preview img { max-width: 110px; max-height: 42px; object-fit: contain; }
.notice-text { width: 100%; height: 300px; font: 13px/1.5 inherit; padding: 8px; border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; }
.trial-card { border: 2px solid var(--navy); }

/* 근육 지도·소견 */
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; margin: 6px 0 10px; }
.map-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }
.map-legend i.dash { border: 2px dashed #888; background: none; }
.map-wrap { position: relative; }
.map-wrap canvas { width: 100%; height: auto; display: block; }
.map-labels { display: flex; justify-content: space-around; font-weight: 700; color: var(--muted); margin-top: 2px; }
.pin { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid; background: #fff; font-size: 13px; }
.pin.tight, .todo.tight, .dose.tight, .lab.tight { color: #D93A3A; border-color: #D93A3A; }
.pin.weak, .todo.weak, .dose.weak, .lab.weak { color: #2F6FDB; border-color: #2F6FDB; }
.todo { font-weight: 800; font-size: 13px; }
.muscle-table td { text-align: left; vertical-align: top; white-space: normal; }
.finding { border-left: 4px solid #CBD2DB; background: #F7F8F9; border-radius: 6px; padding: 12px; margin: 10px 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 12px; }
.finding.watch { border-left-color: #E0A21A; }
.finding.risk { border-left-color: #D93A3A; }
@media (max-width: 700px) { .finding { grid-template-columns: 1fr; } }
.finding-title { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.gauge.wide { width: 180px; margin: 8px 0; }
.why { font-size: 14px; margin: 6px 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 4px 0; }
.lab { font-size: 12px; font-weight: 800; margin-right: 4px; border: 0 !important; }
.chip-m { font-size: 12px; font-weight: 700; border: 1.5px solid; border-radius: 12px; padding: 1px 8px; background: #fff; }
.chip-m.tight { color: #D93A3A; border-color: #D93A3A; }
.chip-m.weak { color: #2F6FDB; border-color: #2F6FDB; }
.ex-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ex { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: 13px; }
.ex-img { display: flex; align-items: center; gap: 2px; height: 96px; }
.ex-img img { flex: 1; min-width: 0; height: 100%; object-fit: contain; }
.ex-img span { color: var(--muted); }
.dose { font-weight: 800; margin: 2px 0; }
.print-head { display: none; }

/* A4 보고서 인쇄 */
@media print {
  @page { size: A4 portrait; margin: 12mm; }
  body { background: #fff; font-size: 12px; }
  .topbar, .no-print, .save-card, [data-retake], #busy { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; page-break-inside: avoid; }
  .page-break { break-before: page; page-break-before: always; }
  .finding { break-inside: avoid; page-break-inside: avoid; }
  .print-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-weight: 700; color: #444; }
  .print-head img { height: 28px; }
  .view-body { grid-template-columns: 220px 1fr; }
  .notice-card { background: #fff; }
}
.finding > * { min-width: 0; }
.ex-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.todo { white-space: nowrap; }
.muscle-table th { text-align: left; }
.muscle-table td:nth-child(3) { white-space: nowrap; }
.finding-title b { overflow-wrap: anywhere; }
.finding { grid-template-columns: 1fr; }
/* 세 방향을 넓은 화면·인쇄에서 나란히 */
@media (min-width: 1000px) {
  #postureResult.wrap { max-width: 1200px; }
  .views { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .views .view-body { grid-template-columns: 1fr; }
  .views .card { margin: 0; }
}
@media print {
  .views { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; break-inside: avoid; page-break-inside: avoid; margin-bottom: 8px; }
  .views .card { margin: 0; padding: 8px; }
  .views .view-body { grid-template-columns: 1fr !important; gap: 6px; }
  .views .shot { max-height: 330px; object-fit: contain; }
  .views table { font-size: 10px; }
  .views th, .views td { padding: 3px 4px; }
  .views h2 { font-size: 13px; }
  .views .issues { font-size: 10px; }
  .result-head, .region-row { break-inside: avoid; }
  .result-head h1 { font-size: 18px; }
  .score-big b { font-size: 36px; }
}
@media print { .views .lv, .views .q { font-size: 9px; padding: 0 5px; } .views .table-wrap { overflow: visible; } }

/* ---- 첫 화면·학원생(09-30 개편) ----
   모서리: 카드 14px, 단추·입력 10px, 아바타 둥글게. 강조색은 업체 색(--navy) 하나. */
:root { --radius: 14px; --accent-soft: color-mix(in srgb, var(--navy) 8%, #fff); --good: #15803D; --bad: #C2410C; }
body { font-family: "Pretendard Variable", "Pretendard", "Malgun Gothic", -apple-system, system-ui, sans-serif; letter-spacing: -0.01em; }
.btn { border-radius: 10px; transition: transform .12s ease, background-color .12s ease; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn .ph { font-size: 1.15em; }
.card { border-color: #E6E9EE; box-shadow: 0 1px 2px rgba(36, 52, 71, .04), 0 8px 24px -16px rgba(36, 52, 71, .18); }
.eyebrow { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: 6px; }
.card-head h2 .ph { color: var(--navy); }
.tag { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: var(--surface-alt); color: var(--muted); font-size: 11px; font-weight: 600; vertical-align: 2px; }
.nowrap { white-space: nowrap; }

.home { padding-top: 18px; }
.home-hero { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 16px; margin: 4px 4px 18px; }
.home-hero h1 { font-size: 24px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.3; margin: 0; }
.home-hero h1 b { font-weight: 800; color: var(--navy); }
.hero-stats { display: flex; gap: 8px; }
.hero-stats > div { min-width: 78px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid #E6E9EE; text-align: center; }
.hero-stats b { display: block; font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); }
.hero-stats span { font-size: 12px; color: var(--muted); }
@media (max-width: 560px) { .home-hero { grid-template-columns: 1fr; } .hero-stats > div { flex: 1; } }

.searchbox { position: relative; display: block; margin: 0 0 6px; font-weight: 400; }
.searchbox .ph { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; }
.searchbox input { display: block; width: 100%; margin: 0 !important; padding: 12px 12px 12px 40px !important; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font: inherit; font-size: 16px; }
.searchbox input:focus { outline: 2px solid color-mix(in srgb, var(--navy) 35%, transparent); background: #fff; }

.stu-list, .recent-list, .rec-list { display: flex; flex-direction: column; }
.stu-row, .recent-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding: 11px 4px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.stu-row:first-child, .recent-row:first-child { border-top: 0; }
.stu-row:hover, .recent-row:hover { background: var(--accent-soft); border-radius: 10px; }
.stu-row > .ph { color: #A0A8B3; }
.stu-main, .rec-main { display: flex; flex-direction: column; min-width: 0; }
.stu-main b, .rec-main b { font-size: 16px; }
.stu-main small, .rec-main small { color: var(--muted); font-size: 13px; }
.stu-last { font-size: 12px; color: var(--muted); white-space: nowrap; }
.avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-alt); color: var(--text); font-weight: 700; flex: none; }
.avatar.m { background: #E3ECF8; color: #1E4E8C; }
.avatar.f { background: #F8E6EC; color: #9D2B53; }
.avatar.big { width: 60px; height: 60px; font-size: 24px; }
.more-link { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 10px; margin-top: 4px; border-top: 1px solid var(--line); color: var(--navy); font-weight: 600; text-decoration: none; }

.section-title { margin: 22px 4px 10px; font-size: 16px; }
.section-title small { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 6px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-bottom: 14px; }
.quick-tile { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid #E6E9EE; color: inherit; text-decoration: none; transition: transform .12s ease, border-color .12s ease; }
.quick-tile:hover { border-color: color-mix(in srgb, var(--navy) 40%, #fff); }
.quick-tile:active { transform: scale(.99); }
.quick-tile b { display: block; font-size: 17px; }
.quick-tile small { color: var(--muted); font-size: 13px; }
.qi { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--navy); color: #fff; font-size: 26px; }
.quick-tile .go { color: var(--navy); font-size: 20px; }

/* 첫 화면 그림 카드: 위에 사진, 아래에 이름·설명. 폰에서는 한 줄에 하나, 넓으면 두세 개 */
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 14px; }
.feat-card { position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; overflow: hidden; border-radius: 16px; background: var(--surface); border: 1px solid #E6E9EE; color: inherit; text-decoration: none; box-shadow: 0 6px 18px -12px rgba(36, 52, 71, .35); transition: transform .14s ease, box-shadow .14s ease; }
.feat-card:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -14px rgba(36, 52, 71, .45); }
.feat-card:active { transform: scale(.99); }
button.feat-card { width: 100%; padding: 0; font: inherit; text-align: left; cursor: pointer; }
.feat-card .art { grid-column: 1 / -1; aspect-ratio: 16 / 9; background: var(--navy) center 22% / cover no-repeat; }
.feat-card[data-feat=jump] .art, .feat-card[data-feat=throw] .art, .feat-card[data-start=jump] .art, .feat-card[data-start=throw] .art { background-position: center; } /* 16:9로 잘라 둔 그림 */
.feat-card .txt { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 3px; }
.feat-card .txt b { font-size: 19px; letter-spacing: -0.02em; }
.feat-card .txt small { color: var(--muted); font-size: 13px; line-height: 1.45; }
.feat-card .go { align-self: center; margin-right: 16px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: #fff; font-size: 18px; }
.feat-card.manage { grid-template-columns: minmax(120px, 38%) 1fr auto; grid-template-rows: auto; margin: 6px 0 22px; }
.feat-card.manage .art { grid-column: auto; aspect-ratio: auto; min-height: 120px; }
.feat-card.manage .txt { justify-content: center; }
@media (max-width: 420px) { .feat-card.manage { grid-template-columns: 1fr auto; } .feat-card.manage .art { grid-column: 1 / -1; aspect-ratio: 16 / 7; } }
/* 운영 센터(메인 관리자만): 그림 대신 짙은 남색 바탕에 건물 아이콘 */
.feat-card.ops { margin-top: -8px; border-color: color-mix(in srgb, var(--navy) 30%, #fff); }
.feat-card.ops .art { display: grid; place-items: center; background: linear-gradient(135deg, #243447, #3B5372); color: #fff; font-size: 44px; }
@media (max-width: 420px) { .feat-card.ops .art { aspect-ratio: 16 / 5; } }

.recent-row .kind, .rec-open .kind { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--navy); font-size: 20px; }
.recent-row { grid-template-columns: auto 1fr auto; }
.rec-score { font-weight: 800; font-size: 18px; color: var(--navy); font-variant-numeric: tabular-nums; }
.rec-score small { font-size: 12px; font-weight: 600; margin-left: 1px; color: var(--muted); }

.admin-strip { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px dashed color-mix(in srgb, var(--navy) 45%, #fff); color: inherit; text-decoration: none; margin-bottom: 20px; }
.admin-strip > .ph:first-child { font-size: 24px; color: var(--navy); }
.admin-strip small { display: block; color: var(--muted); font-size: 13px; }

.empty { text-align: center; padding: 22px 10px; color: var(--muted); }
.empty .ph { font-size: 36px; color: #B7BEC8; }
.empty p { margin: 6px 0 10px; }
.empty.small { padding: 12px 6px; }
.skeleton-row, .skeleton-page > div { height: 54px; margin: 6px 0; border-radius: 10px; background: linear-gradient(90deg, #EEF1F4 0%, #F6F8FA 50%, #EEF1F4 100%); background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; }
.skeleton-page > div:first-child { height: 120px; }
.skeleton-page > div:nth-child(2) { height: 90px; }
.skeleton-page > div:nth-child(3) { height: 220px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton-row, .skeleton-page > div { animation: none; } }

/* 학원생 목록·화면 */
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin: 4px 4px 12px; }
.page-head h1 { margin: 0; font-size: 24px; }
.page-head .count { font-size: 15px; color: var(--muted); font-weight: 500; }
.back-link { display: inline-flex; align-items: center; gap: 2px; margin: 4px 0 8px; color: var(--muted); font-size: 14px; text-decoration: none; }
.stu-hero { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; }
.stu-hero h1 { margin: 0; font-size: 22px; }
.stu-hero .sub { margin: 0; }
.stu-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); padding-top: 12px; text-align: center; }
.stu-stats b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.stu-stats span { font-size: 12px; color: var(--muted); }
.start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 12px; }
.start-tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; padding: 16px; border: 0; border-radius: 14px; background: var(--navy); color: #fff; font: inherit; cursor: pointer; transition: transform .12s ease, filter .12s ease; }
.start-tile .ph { grid-row: 1 / 3; font-size: 32px; }
.start-tile b { font-size: 17px; }
.start-tile small { opacity: .8; font-size: 13px; }
.start-tile:hover { filter: brightness(1.08); }
.start-tile:active { transform: scale(.99); }
.rec-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 6px; border-top: 1px solid var(--line); }
.rec-row:first-child { border-top: 0; }
.rec-row .pick { width: 18px; height: 18px; accent-color: var(--navy); }
.rec-open { display: grid !important; grid-template-columns: auto 1fr auto; gap: 12px; border-top: 0 !important; padding: 10px 4px !important; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: #A0A8B3; font-size: 18px; cursor: pointer; }
.icon-btn:hover { background: #FDECEC; color: var(--bad); }
.btn-text { background: none; border: 0; font: inherit; font-size: 13px; color: var(--muted); text-decoration: underline; cursor: pointer; }
.btn-text.danger:hover { color: var(--bad); }

/* 등록 창 */
.overlay .box.sheet { width: min(460px, 94vw); text-align: left; padding: 22px; }
.sheet h2 { margin-bottom: 4px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid3 label { margin: 6px 0; }
.sheet select, .save-form select { display: block; width: 100%; margin-top: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 600; flex-wrap: wrap; }
label.check input { width: 18px; height: 18px; accent-color: var(--navy); }

/* 체형분석 준비: 측정할 학원생 */
.who-banner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; margin: 10px 0 12px; border-radius: 12px; background: var(--accent-soft); }
.who-banner small { display: block; font-size: 12px; color: var(--muted); }
.who-banner b { font-size: 17px; }
.save-card h2 .ph, .ok-msg + * .ph { color: var(--navy); }

/* 전후 비교 보고서 */
.cmp-head { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; }
.cmp-head h1 { font-size: 24px; margin: 0; }
.cmp-head .sub { margin: 2px 0 0; }
.cmp-score { display: flex; align-items: center; gap: 10px; }
.cmp-score > div { text-align: center; }
.cmp-score small { display: block; font-size: 12px; color: var(--muted); }
.cmp-score b { font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; color: #9AA3AE; }
.cmp-score .after b { color: var(--navy); }
.cmp-score > .ph { color: #9AA3AE; font-size: 20px; }
.cmp-summary { margin: -4px 4px 12px; color: var(--muted); }
.delta { display: inline-flex; align-items: center; gap: 2px; padding: 1px 8px; border-radius: 999px; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta.up { background: #E7F6EC; color: var(--good); }
.delta.down { background: #FDEDE4; color: var(--bad); }
.delta.flat { background: var(--surface-alt); color: var(--muted); }
.cmp-score .delta { font-size: 15px; padding: 3px 10px; }
.cmp-table { width: 100%; }
.cmp-table td:not(:first-child), .cmp-table th:not(:first-child) { text-align: center; }
.cmp-table.items td, .cmp-table.items th { padding: 7px 4px; }
.jump-clip, .jump-sheet { display: block; width: 100%; border-radius: 10px; background: #000; }
.jump-sheet { background: none; }
/* 내려받기 권한이 없을 때: 길게 눌러 저장하는 메뉴를 막는다(화면 캡처까지 막을 수는 없다) */
/* 반투명 보기: B 진하기 */
.ghost-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex-basis: 100%; padding: 8px 10px; border-radius: 10px; background: #FFF7ED; border: 1px solid #FDBA74; }
.ghost-lab { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: #9A3412; }
.ghost-lab .b-dot { width: 12px; height: 12px; border-radius: 50%; background: #F97316; display: inline-block; }
.seg-btns { display: inline-flex; border: 1px solid #FDBA74; border-radius: 10px; overflow: hidden; }
.seg-btns button { border: 0; background: #fff; padding: 7px 12px; font: inherit; font-weight: 600; color: #9A3412; cursor: pointer; }
.seg-btns button + button { border-left: 1px solid #FDBA74; }
.seg-btns button.on { background: #F97316; color: #fff; }
.ghost-ctl input[type=range] { width: 140px; accent-color: #F97316; }
.ghost-ctl #ghostVal { min-width: 40px; color: #9A3412; }
.danger-zone { margin-top: 14px; padding: 12px; border: 1px solid #FCA5A5; border-radius: 10px; background: #FEF2F2; }
.danger-zone b { color: #B91C1C; }
.danger-zone .hint { margin: 4px 0 8px; }
.btn.danger { background: #DC2626; border-color: #DC2626; color: #fff; }
.inapp-bar { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; background: #FEF3C7; color: #78350F; font-size: 14px; font-weight: 600; }
.inapp-bar .btn { background: #78350F; border-color: #78350F; color: #fff; text-decoration: none; }
.inapp-bar small { font-weight: 500; }

/* 앱 설치 안내: 안드로이드 아래 띠, 아이폰 아래 팝업(공유 단추를 가리키는 화살표) */
.install-bar { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 60; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: 16px; background: #fff; border: 1px solid #E3E7EC; box-shadow: 0 12px 30px -12px rgba(16, 40, 50, .45); transform: translateY(140%); transition: transform .25s ease; max-width: 560px; margin: 0 auto; }
.install-bar.show { transform: none; }
.install-bar img { width: 44px; height: 44px; border-radius: 11px; }
.install-bar b { display: block; font-size: 15px; }
.install-bar small { color: var(--muted); font-size: 12px; }
.install-ios { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; background: rgba(10, 20, 30, .35); opacity: 0; transition: opacity .25s ease; padding: 0 12px calc(4px + env(safe-area-inset-bottom)); }
.install-ios.show { opacity: 1; }
.install-ios .sheet { position: relative; width: 100%; max-width: 420px; background: #fff; border-radius: 20px; padding: 18px 16px 14px; box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .4); }
.install-ios .x { position: absolute; right: 8px; top: 8px; }
.install-ios .head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.install-ios .head img { width: 52px; height: 52px; border-radius: 13px; }
.install-ios .head b { display: block; font-size: 17px; }
.install-ios .head small { color: var(--muted); font-size: 13px; }
.install-ios ol { list-style: none; padding: 0; margin: 4px 0 12px; display: flex; flex-direction: column; gap: 9px; font-size: 15px; }
.install-ios li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.install-ios .n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 13px; font-weight: 800; flex: none; }
.install-ios .share { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #EEF2F6; color: #007AFF; font-size: 19px; }
.install-ios .arrow { color: #fff; font-size: 34px; line-height: 1; margin-top: 4px; animation: pea-bob 1.1s ease-in-out infinite; text-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
@keyframes pea-bob { 50% { transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .install-ios .arrow { animation: none; } }
.no-save { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
video[controlslist~="nodownload"] { -webkit-touch-callout: none; }
.save-form .progress { font-weight: 600; color: var(--navy); margin: 6px 0; }
.jsave-row { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.jsave-row:first-of-type { border-top: 0; }
.jsave-row .chip { margin-top: 2px; }
.jsave-main b { display: block; }
.jsave-main small { color: var(--muted); }
.jsave-main label { margin: 4px 0 0; font-weight: 500; font-size: 13px; color: var(--muted); }
.ok-list { margin: 6px 0; padding-left: 20px; }
.clip-picker { width: min(520px, 94vw) !important; max-height: 86vh; overflow: auto; }
.clip-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.clip-item { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: left; font: inherit; cursor: pointer; }
.clip-item:hover { border-color: var(--navy); }
.clip-item img, .clip-item .no-thumb { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: var(--surface-alt); display: block; }
.clip-item b { display: block; }
.clip-item small { color: var(--muted); font-size: 12px; }
.clip-stats { margin-top: 12px; }
.clip-stats .rec-big b { color: var(--navy); font-size: 28px; }
.rec-edit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.rec-edit label, .slot-rec, .jsave-rec { margin: 6px 0 0; font-weight: 600; }
.rec-edit input, .slot-rec input, .jsave-rec input { width: 96px !important; display: inline-block !important; margin: 0 4px !important; padding: 6px 8px !important; }
.rec-edit .msg { color: var(--bad); font-size: 13px; }
.clip-stats small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 1px; }
@media (max-width: 520px) {
  .cmp-table.items { font-size: 13px; }
  .cmp-table.items td:nth-child(4), .cmp-table.items th:nth-child(4) { display: none; }
  .cmp-head { grid-template-columns: 1fr; }
}
.cmp-views { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-bottom: 12px; }
.cmp-views .card { margin: 0; }
.cmp-view .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cmp-view figure { margin: 0; }
.cmp-view .shot { width: 100%; height: auto; border-radius: 10px; display: block; }
.cmp-view figcaption { text-align: center; font-size: 12px; color: var(--muted); margin-top: 4px; }
.cmp-view figure:last-child figcaption { color: var(--navy); font-weight: 700; }
.no-shot { display: grid; place-items: center; aspect-ratio: 9 / 16; border-radius: 10px; background: var(--surface-alt); color: var(--muted); font-size: 13px; }
@media print {
  .cmp-views { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; break-inside: avoid; }
  .cmp-view { padding: 8px !important; }
  .cmp-view h2 { font-size: 13px; margin-bottom: 4px; }
  .cmp-view .shot { max-height: 280px; object-fit: contain; }
  .cmp-score b { font-size: 28px; }
  .delta { border: 1px solid currentColor; }
  .back-link, .skeleton-page { display: none !important; }
  #records:not([hidden]) { display: block !important; }
}
