:root {
  --bg: #f4f5f7;
  --surface: #fff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #2563eb;
  --brand-ink: #fff;
  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;
  --radius: 14px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120; --surface: #151d2e; --text: #e2e8f0; --muted: #94a3b8; --line: #243047;
    --brand: #3b82f6;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; }
body.dark { background: #000; }
#app { max-width: 520px; margin: 0 auto; min-height: 100%; position: relative; background: var(--bg); }
body.dark #app { background: #000; }
#view { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 16px); }
body.fullscreen #view { padding-bottom: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- 상단 ---------- */
.top { display: flex; align-items: center; gap: 10px; padding: 18px 16px 10px; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.top h1 { font-size: 22px; margin: 0; flex: 1; letter-spacing: -0.02em; }
.back { font-size: 30px; line-height: 1; padding: 0 6px 4px 0; }

/* ---------- 버튼 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 50px; padding: 0 20px; border-radius: 12px; border: 0; font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.ghost, .ghost { background: var(--surface); border: 1px solid var(--line); }
.btn.text { background: none; color: var(--muted); }
.btn.danger { color: var(--err); }
.ghost.sm { height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13px; cursor: pointer; }

/* ---------- 탭바 ---------- */
#tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); display: flex; align-items: center; justify-content: space-around; background: var(--surface); border-top: 1px solid var(--line); z-index: 20; }
#tabbar[hidden] { display: none; }
#tabbar a { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--muted); position: relative; min-width: 64px; }
#tabbar a.on { color: var(--brand); font-weight: 600; }
#tabbar .ico { font-size: 20px; line-height: 1.2; }
#tabbar .shoot { width: 60px; height: 60px; margin-top: -26px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(37, 99, 235, .4); min-width: 0; }
.shutter-mini { width: 24px; height: 24px; border-radius: 50%; border: 3px solid #fff; }
#queueBadge { position: absolute; top: -4px; right: 12px; background: var(--err); color: #fff; font-size: 10px; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; }
#queueBadge[hidden] { display: none; }

/* ---------- 문서함 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 4px 16px; }
.stats div { background: var(--surface); border-radius: 12px; padding: 12px 6px; text-align: center; }
.stats b { display: block; font-size: 20px; }
.stats span { font-size: 12px; color: var(--muted); }
.sum { padding: 4px 18px; margin: 6px 0; font-size: 13px; color: var(--muted); }
.sum b { color: var(--text); }
.doclist { list-style: none; margin: 0; padding: 0 16px; display: grid; gap: 10px; }
.doclist a { display: flex; gap: 12px; background: var(--surface); border-radius: var(--radius); padding: 10px; }
.doclist img { width: 64px; height: 80px; object-fit: cover; border-radius: 8px; background: var(--line); flex: none; }
.meta { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.row1 { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.row1 b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row2 { font-size: 12px; color: var(--muted); }
.row3 { font-weight: 700; font-size: 16px; display: flex; justify-content: space-between; align-items: baseline; }
.conf { font-size: 11px; font-weight: 400; color: var(--muted); }
.badge { font-size: 11px; padding: 3px 8px; border-radius: 99px; white-space: nowrap; font-weight: 600; }
.st-proc { background: #e0e7ff; color: #3730a3; }
.st-retake { background: #fee2e2; color: #b91c1c; }
.st-review { background: #fef3c7; color: #92400e; }
.st-ok { background: #dcfce7; color: #166534; }
.empty { text-align: center; padding: 60px 24px; color: var(--muted); }
.empty-ico { font-size: 44px; }

/* ---------- 카메라 ---------- */
.camera { position: fixed; inset: 0; max-width: 520px; margin: 0 auto; background: #000; color: #fff; overflow: hidden; }
.camera video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera.flash::after { content: ""; position: absolute; inset: 0; background: #fff; animation: flash .35s ease-out forwards; }
@keyframes flash { to { opacity: 0; } }
.frame { position: absolute; left: 7%; right: 7%; top: 15%; bottom: 30%; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); border-radius: 8px; }
.frame i { position: absolute; width: 32px; height: 32px; border: 4px solid #fff; }
.frame i:nth-child(1) { left: -2px; top: -2px; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.frame i:nth-child(2) { right: -2px; top: -2px; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.frame i:nth-child(3) { left: -2px; bottom: -2px; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.frame i:nth-child(4) { right: -2px; bottom: -2px; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.cam-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 12px; }
.cam-title { font-weight: 600; }
.icon-btn { min-width: 40px; height: 40px; padding: 0 10px; border-radius: 20px; display: grid; place-items: center; background: rgba(255, 255, 255, .15); border: 0; color: #fff; cursor: pointer; font-size: 14px; }
.icon-btn.lg { width: 52px; height: 52px; border-radius: 50%; font-size: 22px; padding: 0; }
.cam-hint { position: absolute; top: 9%; left: 0; right: 0; text-align: center; font-size: 13px; opacity: .9; padding: 0 20px; }
.cam-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 0 calc(var(--safe-b) + 22px); }
.types { display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 18px; scrollbar-width: none; }
.types button { flex: none; background: rgba(255, 255, 255, .12); border: 0; color: #fff; padding: 8px 14px; border-radius: 99px; font-size: 13px; cursor: pointer; }
.types button.on { background: #fff; color: #000; font-weight: 700; }
.controls { display: flex; align-items: center; justify-content: space-around; }
.shutter { width: 76px; height: 76px; border-radius: 50%; background: #fff; border: 5px solid rgba(255, 255, 255, .4); background-clip: padding-box; cursor: pointer; }
.shutter:active { transform: scale(.94); }
.shutter:disabled { opacity: .35; }
.sample-sheet { position: absolute; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 12px); background: var(--surface); color: var(--text); border-radius: 18px; padding: 16px; display: grid; gap: 8px; z-index: 3; }
.sample-sheet[hidden] { display: none; }
.sample-sheet p { margin: 0 0 4px; font-weight: 600; }
.sample-sheet button { height: 48px; border-radius: 12px; border: 0; background: var(--brand); color: #fff; font-weight: 600; cursor: pointer; }
.sample-sheet button.ghost { background: var(--bg); color: var(--text); }

/* ---------- 처리 ---------- */
.process { padding: 32px 24px; display: grid; gap: 24px; justify-items: center; min-height: 100vh; align-content: center; }
.scan { position: relative; width: 62%; max-width: 260px; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .15); }
.scan img { display: block; width: 100%; }
.beam { position: absolute; left: 0; right: 0; height: 3px; background: var(--brand); box-shadow: 0 0 18px 6px rgba(37, 99, 235, .5); animation: beam 1.8s ease-in-out infinite alternate; }
@keyframes beam { from { top: 0; } to { top: 100%; } }
.steps { list-style: none; padding: 0; margin: 0; width: 100%; max-width: 320px; display: grid; gap: 10px; }
.steps li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.steps li em { margin-left: auto; font-style: normal; font-size: 12px; }
.steps .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.steps .active { color: var(--text); font-weight: 600; }
.steps .active .dot { border-color: var(--brand); border-top-color: transparent; animation: spin .8s linear infinite; }
.steps .done { color: var(--text); }
.steps .done .dot { background: var(--ok); border-color: var(--ok); }
.steps .warn .dot { background: var(--warn); border-color: var(--warn); }
.steps .warn { color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { width: 100%; max-width: 320px; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar div { height: 100%; width: 0; background: var(--brand); transition: width .3s; }

/* ---------- 재촬영 ---------- */
.retake { padding: 0 16px 24px; display: grid; gap: 14px; }
.retake > img { width: 100%; max-height: 300px; object-fit: contain; background: var(--surface); border-radius: var(--radius); }
.alert { border-radius: 12px; padding: 14px; }
.alert p { margin: 6px 0 0; font-size: 13px; }
.alert.error { background: #fee2e2; color: #7f1d1d; }
.tips { margin: 0; padding: 14px 14px 14px 32px; background: var(--surface); border-radius: 12px; color: var(--muted); font-size: 14px; display: grid; gap: 4px; }
.actions { display: grid; gap: 8px; }

/* ---------- 검수 ---------- */
.review { padding: 0 16px 100px; display: grid; gap: 12px; }
.top .badge { font-size: 12px; }
.doc-img { position: relative; background: var(--surface); border-radius: var(--radius); overflow: hidden; height: 200px; cursor: zoom-in; }
.doc-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.doc-img span { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 99px; }
.zoom { position: fixed; inset: 0; background: rgba(0, 0, 0, .92); z-index: 50; overflow: auto; display: grid; place-items: center; cursor: zoom-out; }
.zoom[hidden] { display: none; }
.zoom img { width: 100%; max-width: 900px; }
.score { display: flex; gap: 14px; align-items: center; background: var(--surface); border-radius: var(--radius); padding: 14px; }
.score p { margin: 2px 0 0; }
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center; grid-auto-flow: column; align-content: center;
  background: radial-gradient(closest-side, var(--surface) 78%, transparent 80%), conic-gradient(var(--brand) calc(var(--p) * 1%), var(--line) 0); }
.ring b { font-size: 20px; } .ring small { font-size: 11px; color: var(--muted); }
.card { background: var(--surface); border-radius: var(--radius); padding: 14px; }
.card-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.card h2 { font-size: 15px; margin: 0; }
.card select { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 0 10px; }
.card summary { font-weight: 600; cursor: pointer; }
.card pre { white-space: pre-wrap; font-size: 12px; color: var(--muted); max-height: 260px; overflow: auto; margin: 10px 0 0; }
#fieldsForm { display: grid; gap: 12px; }
.field { display: grid; gap: 4px; }
.field .lbl { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.field input { height: 46px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--bg); font-size: 16px; width: 100%; }
.field input:focus { outline: none; border-color: var(--brand); }
.field.warn input { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--bg)); }
.field.error input, .field.empty input { border-color: var(--err); background: color-mix(in srgb, var(--err) 6%, var(--bg)); }
.field small { font-size: 12px; color: var(--warn); }
.field.error small { color: var(--err); }
.cd { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.cd.hi { background: var(--ok); } .cd.mid { background: var(--warn); } .cd.lo { background: var(--err); } .cd.none { background: var(--line); }
.item { border-top: 1px solid var(--line); padding: 10px 0; display: grid; gap: 6px; }
.item:first-child { border-top: 0; padding-top: 0; }
.item input { height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; background: var(--bg); min-width: 0; font-size: 15px; }
.item .name { width: 100%; font-weight: 600; }
.nums { display: grid; grid-template-columns: 1fr auto 1.6fr auto 1.8fr auto; gap: 4px; align-items: center; color: var(--muted); }
.nums input { text-align: right; }
.item.bad .nums input { border-color: var(--err); }
.x { border: 0; background: none; color: var(--muted); width: 28px; height: 38px; cursor: pointer; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.checks li { display: flex; gap: 8px; align-items: flex-start; }
.checks i { width: 18px; height: 18px; border-radius: 50%; flex: none; margin-top: 1px; display: grid; place-items: center; font-style: normal; color: #fff; font-size: 11px; }
.checks .ok i { background: var(--ok); } .checks .ok i::after { content: "✓"; }
.checks .warn i { background: var(--warn); } .checks .warn i::after { content: "!"; }
.checks .error i { background: var(--err); } .checks .error i::after { content: "✕"; }
.logs { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; font-size: 13px; }
.logs li { display: grid; }
.logs s { color: var(--muted); }
.logs small { color: var(--muted); font-size: 11px; }
.sticky-actions { position: fixed; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; bottom: calc(var(--tab-h) + var(--safe-b)); display: grid; grid-template-columns: 1fr 2fr; gap: 8px; padding: 10px 16px; background: linear-gradient(transparent, var(--bg) 30%); z-index: 10; }

/* ---------- 토스트 ---------- */
#toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 90px); transform: translate(-50%, 20px); background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 99px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; white-space: nowrap; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 521px) {
  #app { box-shadow: 0 0 0 1px var(--line); }
}

/* ---------- 배포(PWA) 추가: 안전 영역, 로그인, 내 정보, 설치 ---------- */
.top { padding-top: calc(env(safe-area-inset-top, 0px) + 18px); }
.btn.block { width: 100%; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.avatar.lg { width: 52px; height: 52px; font-size: 20px; }
.install-banner { display: flex; align-items: center; gap: 12px; margin: 0 16px 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: 20px; color: var(--muted); }
.install-banner img { width: 40px; height: 40px; border-radius: 10px; }
.install-banner span { flex: 1; display: grid; font-size: 14px; color: var(--text); }
.install-banner small { color: var(--muted); font-size: 12px; }
.profile { display: flex; align-items: center; gap: 14px; }
.profile p { margin: 2px 0 0; }
.ios-steps { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.share-ico { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.auth { min-height: 100vh; padding: calc(env(safe-area-inset-top, 0px) + 48px) 24px 32px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.auth-logo { width: 76px; height: 76px; border-radius: 20px; box-shadow: 0 8px 24px rgba(37, 99, 235, .3); }
.auth h1 { margin: 16px 0 4px; font-size: 26px; letter-spacing: -0.02em; }
.auth > .muted { margin: 0 0 24px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; max-width: 380px; background: var(--line); border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.seg a { padding: 10px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.seg a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.auth-form { width: 100%; max-width: 380px; display: grid; gap: 14px; text-align: left; }
.auth-form .btn { margin-top: 6px; }
.form-err { margin: 0; color: var(--err); font-size: 14px; }
.form-err[hidden] { display: none; }

/* ---------- 업장·재고·중복·영역 보정 ---------- */
#tabbar a { min-width: 56px; }
.top h1 small.wp { display: block; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: 2px; }
.dup-tag { color: var(--warn); font-weight: 600; }
.code-msg { color: var(--muted) !important; }
.code-msg.ok { color: var(--ok) !important; }
.code-msg.bad { color: var(--err) !important; }
.with-btn { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.with-btn .btn { height: 46px; padding: 0 14px; font-size: 14px; white-space: nowrap; }
.with-btn .btn:disabled, .field input:disabled { opacity: .55; }
.field[hidden] { display: none; }

/* 확인 창 */
.modal { position: fixed; inset: 0; z-index: 80; background: rgba(15, 23, 42, .55); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 520px; max-height: 88vh; overflow: auto; background: var(--surface); color: var(--text); border-radius: 20px 20px 0 0; padding: 20px 16px calc(var(--safe-b) + 16px); animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet h2 { margin: 0 0 8px; font-size: 18px; }
.sheet-body p { margin: 6px 0; font-size: 14px; }
.sheet-actions { display: grid; gap: 8px; margin-top: 14px; }
.btn.danger-fill { background: var(--err); color: #fff; }
.dup-list { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.dup-list li { display: flex; gap: 10px; padding: 10px; border-radius: 12px; border: 1.5px solid var(--line); }
.dup-list li.exact { border-color: var(--err); background: color-mix(in srgb, var(--err) 6%, var(--surface)); }
.dup-list li.possible { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 6%, var(--surface)); }
.dup-list img { width: 52px; height: 66px; object-fit: cover; border-radius: 6px; flex: none; background: var(--line); }
.dup-list div { display: grid; gap: 2px; min-width: 0; }
.dup-list small { color: var(--muted); font-size: 12px; }
.dup-level { font-size: 11px; font-weight: 700; color: var(--warn); }
.dup-list li.exact .dup-level { color: var(--err); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.chips em { font-style: normal; font-size: 11px; padding: 2px 7px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); }
.del-list { margin: 8px 0; padding-left: 20px; font-size: 14px; display: grid; gap: 3px; }
.del-list .warn { color: var(--warn); font-weight: 600; }

/* 검수 화면 */
.del-btn { border: 0; background: none; color: var(--err); font-weight: 600; cursor: pointer; padding: 6px 4px; }
.name-row { display: grid; grid-template-columns: 1fr 76px; gap: 6px; }
.item .unit { text-align: center; }
.dup-card { border: 1.5px solid var(--warn); }
.dup-card p { margin: 0 0 8px; font-size: 14px; }
.inv-moves { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 2px; }
.inv-moves li, .inv-moves li > a, .inv-moves li > span { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.inv-moves li { padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.inv-moves li:first-child { border-top: 0; }
.inv-moves li > a, .inv-moves li > span { flex: 1; }
.inv-moves li a > span, .inv-moves li > span > span { display: grid; min-width: 0; }
.inv-moves small { color: var(--muted); font-size: 12px; }
.inv-moves .plus, .inv-moves li > b { color: var(--ok); white-space: nowrap; }

/* 재고 */
.inv-note { margin: 0; }
.search { height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; background: var(--surface); font-size: 15px; width: 100%; }
.inv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.inv-list li[hidden] { display: none; }
.inv-list a { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface); border-radius: var(--radius); padding: 14px; }
.inv-list a div { display: grid; min-width: 0; }
.inv-list b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-list small { color: var(--muted); font-size: 12px; }
.qty { font-size: 20px; font-weight: 700; white-space: nowrap; }
.qty em, .inv-head em { font-style: normal; font-size: 13px; color: var(--muted); margin-left: 3px; font-weight: 500; }
.inv-head { display: flex; justify-content: space-between; align-items: baseline; }
.inv-head b { font-size: 28px; }

/* 내 정보: 업장·코드·학습 */
.wp-name { margin: 0 0 4px; }
.members { margin-top: 10px; }
.members summary { font-size: 14px; cursor: pointer; color: var(--brand); }
.members ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-size: 14px; }
.members small { color: var(--muted); }
.wp-form { display: grid; gap: 10px; margin-top: 10px; }
.code-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.code-form .btn { grid-column: 1 / -1; height: 44px; }
.code-form select { height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 0 8px; }
.codes { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.codes li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.codes code { font-size: 17px; font-weight: 700; letter-spacing: .06em; }
.codes li.off code { color: var(--muted); text-decoration: line-through; }
.codes span { flex: 1; display: grid; font-size: 12px; }
.codes em { font-style: normal; font-weight: 600; color: var(--ok); }
.codes li.off em { color: var(--muted); }
.codes small { color: var(--muted); }
.ghost.sm.danger-text { color: var(--err); }

/* 개인정보: 동의·처리방침·접속기록·탈퇴 */
.consent { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 14px; }
.check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--brand); }
.consent details summary, .card details > summary { font-size: 13px; color: var(--brand); cursor: pointer; }
.policy-link { font-size: 13px; color: var(--muted); text-decoration: underline; justify-self: start; }
.auth-form > .policy-link { justify-self: center; margin-top: 4px; }
.policy-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 8px 0; text-align: left; }
.policy-table th, .policy-table td { border: 1px solid var(--line); padding: 6px 8px; vertical-align: top; }
.policy-table th { width: 30%; background: var(--bg); font-weight: 600; white-space: nowrap; }
.policy h2 { font-size: 15px; margin: 18px 0 6px; }
.policy p { font-size: 14px; margin: 6px 0; }
.consent-page .auth-form { gap: 12px; }
.members li.member { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card .check { margin: 10px 0; }
.card .btn.block + .btn.block { margin-top: 8px; }
.logs-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; font-size: 13px; max-height: 360px; overflow: auto; }
.logs-list li { display: grid; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.logs-list li.fail b { color: var(--err); }
.logs-list small { color: var(--muted); font-size: 11px; }
.pending-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.pending-list li { display: flex; align-items: center; gap: 6px; padding: 8px 0; border-top: 1px solid var(--line); }
.pending-list li:first-child { border-top: 0; }
.pending-list li > span { flex: 1; display: grid; min-width: 0; font-size: 14px; }
.pending-list small { color: var(--muted); font-size: 12px; }
.account-links { display: flex; justify-content: space-between; align-items: center; }
.account-links a { font-size: 14px; }
.account-links .btn { height: auto; padding: 4px 0; }

/* 촬영 화면: 샘플(예시 이미지) 보기 */
.sample-view { position: absolute; inset: 0; z-index: 4; background: #000; display: flex; flex-direction: column; }
.sample-view[hidden] { display: none; }
.sample-view-top { display: flex; align-items: center; justify-content: space-between; padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 10px; font-weight: 600; }
.sample-view-img { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 0 12px; }
.sample-view-img img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; background: #fff; cursor: zoom-in; }
.sample-view.zoomed .sample-view-img { display: block; }
.sample-view.zoomed .sample-view-img img { max-width: none; max-height: none; width: 220%; cursor: zoom-out; }
.sample-view-hint { text-align: center; font-size: 12px; opacity: .75; margin: 10px 16px calc(var(--safe-b) + 16px); }

/* 카메라: 문서 윤곽·안내·줌 */
.camera .viewport { position: absolute; inset: 0; overflow: hidden; }
.camera video { transform-origin: 50% 50%; transition: transform .15s; }
.frame { right: auto; bottom: auto; transition: opacity .2s; }
.frame.dim { opacity: .25; }
.doc-outline { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.doc-outline polygon { fill: rgba(37, 99, 235, .12); stroke: #fff; stroke-width: 3; stroke-linejoin: round; display: none; transition: stroke .2s; }
.doc-outline[data-state="good"] polygon { display: block; stroke: #22c55e; fill: rgba(34, 197, 94, .14); }
.doc-outline[data-state="near"] polygon, .doc-outline[data-state="far"] polygon { display: block; stroke: #f59e0b; fill: rgba(245, 158, 11, .1); }
.cam-hint { top: calc(env(safe-area-inset-top, 0px) + 64px); }
.cam-hint.good { color: #4ade80; font-weight: 700; }
.zoom-ctl { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 0 auto 12px; }
.zoom-ctl[hidden] { display: none; }
.zoom-ctl button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .15); color: #fff; font-size: 18px; cursor: pointer; }
.zoom-ctl span { min-width: 46px; text-align: center; font-size: 13px; font-weight: 600; }
.zoom-ctl .zoom-auto { width: auto; padding: 0 12px; border-radius: 17px; font-size: 12px; }
.zoom-ctl .zoom-auto.on { background: #fff; color: #000; font-weight: 700; }

/* 영역 조정(크롭) */
.cropper { position: fixed; inset: 0; z-index: 70; background: #000; color: #fff; display: flex; flex-direction: column; max-width: 520px; margin: 0 auto; }
.crop-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 10px; font-size: 14px; }
.crop-stage { position: relative; flex: 1; margin: 0 16px; touch-action: none; }
.crop-stage img { position: absolute; user-select: none; -webkit-user-drag: none; }
.crop-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.crop-stage polygon { fill: rgba(37, 99, 235, .18); stroke: #3b82f6; stroke-width: 2.5; }
.crop-stage .h { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: rgba(59, 130, 246, .35); border: 3px solid #fff; touch-action: none; cursor: grab; }
.crop-stage .h::after { content: ""; position: absolute; inset: -12px; } /* 손가락으로 잡기 쉽게 */
.crop-hint { text-align: center; font-size: 13px; opacity: .85; margin: 10px 16px; }
.crop-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; padding: 0 16px calc(var(--safe-b) + 16px); }
.crop-actions .btn.ghost { background: rgba(255, 255, 255, .12); border: 0; color: #fff; }
