/* ─────────────────────────────────────────────────────────────
   결혼공작소 회원 앱 — 부티크 톤
   크림 아이보리 · 딥 네이비 · 샴페인 로즈골드
   ───────────────────────────────────────────────────────────── */
@font-face {
  font-family: "PL Serif";
  src: url("./assets/pl-serif.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --cream: #FAF8F5;
  --cream-2: #F4EEE6;
  --ivory: #FFFDFA;
  --navy: #243242;
  --navy-2: #1B2734;
  --gold: #B8967D;
  --gold-2: #8F6F57;
  --gold-wash: #F3E8DC;
  --ink: #2C2A27;
  --ink-2: #55504A;
  --muted: #8C857B;
  --muted-2: #ADA69B;
  --line: #EDE5D9;
  --line-soft: #F2ECE2;
  --green: #5E7A64;
  --green-bg: #EEF2EC;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow-soft: 0 1px 2px rgba(120, 100, 80, .04);
  --shadow: 0 10px 30px rgba(120, 100, 80, .07);
  --tabbar-h: 66px;
  --font: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo",
          "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --serif: "PL Serif", "Nanum Myeongjo", "AppleMyungjo", "Noto Serif KR", serif;
  --mono: "SF Mono", ui-monospace, "Menlo", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #EFE9E1;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  font-size: 15px;
  line-height: 1.62;
  word-break: keep-all;
  overflow-wrap: break-word;
}

button { font-family: inherit; font-size: inherit; color: inherit; cursor: pointer; }
button:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
svg { width: 22px; height: 22px; display: block; }

/* 사진 저장·복사 방지 */
.protected {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
.protected img { pointer-events: none; -webkit-user-drag: none; user-drag: none; }

.app {
  position: relative;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background:
    radial-gradient(120% 60% at 50% -8%, #FFFCF7 0%, rgba(255, 252, 247, 0) 62%),
    var(--cream);
  padding-bottom: calc(var(--tabbar-h) + 34px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

/* ── 상단 바 ─────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px 13px;
  background: rgba(250, 248, 245, .9);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid rgba(237, 229, 217, .7);
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand-name {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: .01em;
  color: var(--navy);
}
.brand-sub {
  font-size: 8.5px;
  letter-spacing: .2em;
  color: var(--gold);
  font-weight: 600;
  transform: translateY(-1px);
}

.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 6px 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 250, .9);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: border-color .18s, color .18s;
}
.mode-toggle[aria-pressed="true"] { color: var(--navy); border-color: var(--gold); }
.switch {
  position: relative;
  width: 30px;
  height: 18px;
  border-radius: 999px;
  background: #E6DED2;
  transition: background .2s;
}
.knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(90, 70, 50, .22);
  transition: transform .2s;
}
.mode-toggle[aria-pressed="true"] .switch { background: var(--gold); }
.mode-toggle[aria-pressed="true"] .knob { transform: translateX(12px); }

/* ── 레이아웃 ────────────────────────────── */
.main { padding: 0 22px; }
.view { animation: fade .28s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.view-head { padding: 26px 0 18px; }
.eyebrow {
  margin: 0 0 9px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--gold);
  text-transform: uppercase;
}
.h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.42;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--navy);
}
.sub { margin: 9px 0 0; font-size: 13.5px; line-height: 1.7; color: var(--muted); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 32px 0 12px;
}
.section-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--ink);
}
.section-note { font-size: 11.5px; color: var(--muted-2); letter-spacing: .02em; }
.link {
  border: 0;
  background: none;
  padding: 2px 0;
  font-size: 11.5px;
  color: var(--gold-2);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(184, 150, 125, .45);
}
.footnote {
  margin: 26px 0 4px;
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--muted-2);
}

.stack { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: var(--ivory);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 22px;
}
.card.list { padding: 6px 20px; }

/* ── 상태 요약 ───────────────────────────── */
.status-card {
  background: linear-gradient(168deg, #FFFEFB 0%, #FBF7F0 100%);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 20px 22px 18px;
}
.status-grid { display: flex; gap: 16px; align-items: flex-end; }
.status-cell { flex: 1; }
.status-k { margin: 0 0 4px; font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.status-v { margin: 0; font-family: var(--serif); font-size: 20px; font-weight: 400; color: var(--navy); }
.status-v small { font-family: var(--font); font-size: 11.5px; color: var(--muted-2); }
.status-cta { align-self: center; }
.status-cta .btn { width: auto; white-space: nowrap; }
.status-track {
  margin-top: 16px;
  height: 3px;
  border-radius: 99px;
  background: #EFE7DA;
  overflow: hidden;
}
.status-track > span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold) 0%, #C9A98F 100%);
  transition: width .5s ease;
}

/* ── 매칭 카드 ───────────────────────────── */
.match-card {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  background: var(--ivory);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 20px 20px 17px;
  transition: transform .18s ease, box-shadow .2s ease;
}
.match-card:active { transform: scale(.994); }
.mc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.mc-rate { font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.mc-rate b { font-family: var(--serif); color: var(--gold-2); font-size: 15px; font-weight: 400; }
.mc-code {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: .04em;
  color: var(--navy);
}
.mc-meta { margin: 0; font-size: 12.5px; line-height: 1.65; color: var(--ink-2); }
.mc-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.mc-tags span {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--cream-2);
  font-size: 11px;
  color: var(--ink-2);
}
.mc-verified {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 13px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 11px;
  color: var(--green);
  letter-spacing: .01em;
}
.mc-verified svg { width: 13px; height: 13px; }
.mc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}
.mc-hint { font-size: 11px; color: var(--muted-2); letter-spacing: .01em; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
}
.pill-pending { background: var(--gold-wash); color: var(--gold-2); }
.pill-accepted { background: var(--green-bg); color: var(--green); }
.pill-declined { background: #F3EFE8; color: #9A9288; }
.pill-brass { background: rgba(184, 150, 125, .14); color: var(--gold-2); }
.pill-light { background: rgba(255, 255, 255, .14); color: #F4EEE4; }
.pill-glass {
  background: rgba(28, 34, 40, .42);
  color: #FDF9F2;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ── 매칭 상세 ───────────────────────────── */
.subhead { padding: 14px 0 0; }
.back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: -8px;
  padding: 6px 8px;
  border: 0;
  background: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.back svg { width: 18px; height: 18px; }

.match-hero {
  margin-top: 8px;
  padding: 26px 22px 22px;
  border-radius: var(--radius);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(184, 150, 125, .22) 0%, rgba(184, 150, 125, 0) 58%),
    linear-gradient(160deg, #2B3A4B 0%, #1D2937 100%);
  color: #FDFAF4;
  box-shadow: 0 14px 32px rgba(36, 50, 66, .16);
}
.match-hero .hero-eyebrow {
  margin: 0 0 6px;
  font-size: 9.5px;
  letter-spacing: .16em;
  color: rgba(244, 236, 224, .55);
}
.match-hero .hero-code {
  margin: 0 0 7px;
  font-family: var(--serif);
  font-size: 33px;
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: .05em;
}
.match-hero .hero-meta { margin: 0 0 16px; font-size: 12.5px; color: rgba(244, 236, 224, .76); }
.match-hero .hero-badges { display: flex; flex-wrap: wrap; gap: 6px; }

/* 실물 인증 사진 */
.photo-card {
  position: relative;
  margin: 14px 0 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--navy);
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 5;
  isolation: isolate;
}
.photo-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.97) contrast(1.01);
  z-index: 0;
}
.photo-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(to bottom, rgba(22, 26, 31, .46) 0%, rgba(22, 26, 31, 0) 26%),
    linear-gradient(to top, rgba(18, 22, 27, .78) 0%, rgba(22, 26, 31, 0) 34%);
  pointer-events: none;
}
.photo-top, .photo-bottom {
  position: absolute;
  left: 14px; right: 14px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.photo-top { top: 14px; }
.photo-bottom { bottom: 14px; }
.photo-reader {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(18, 24, 30, .58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(5px);
  font-size: 9.5px;
  letter-spacing: .02em;
  color: rgba(255, 252, 246, .9);
}
.countdown {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(28, 34, 40, .45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .03em;
  color: #F7EEDF;
  white-space: nowrap;
}
.countdown svg { width: 12px; height: 12px; opacity: .8; }
.countdown.is-low { color: #F3C9B4; }
.photo-zoom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border: 1px solid rgba(255, 252, 246, .35);
  border-radius: 50%;
  background: rgba(28, 34, 40, .32);
  color: #FDF9F2;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.photo-zoom svg { width: 13px; height: 13px; }

/* 열람자 워터마크 */
.wm {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}
.wm-inner {
  position: absolute;
  left: -30%;
  top: -32%;
  width: 165%;
  height: 170%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: center;
  gap: 46px 14px;
  transform: rotate(-24deg);
}
.wm span {
  font-family: var(--font);
  font-size: 9px;
  line-height: 1;
  letter-spacing: .01em;
  color: #FFFFFF;
  opacity: .24;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(20, 24, 28, .28);
}

/* 열람 만료 */
.locked {
  margin: 14px 0 0;
  padding: 40px 24px 34px;
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  background:
    radial-gradient(120% 80% at 50% 0%, #FFFDF9 0%, #F7F2EA 100%);
  text-align: center;
  box-shadow: var(--shadow-soft);
}
.locked-icon {
  width: 52px; height: 52px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(184, 150, 125, .14);
  color: var(--gold-2);
}
.locked-icon svg { width: 22px; height: 22px; }
.locked-title {
  margin: 0 0 9px;
  font-family: var(--serif);
  font-size: 17.5px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--navy);
}
.locked-body {
  margin: 0 auto;
  max-width: 268px;
  font-size: 12px;
  line-height: 1.75;
  color: var(--muted);
}
.locked .btn { margin-top: 20px; width: auto; padding: 0 22px; }

.detail-section { margin-top: 26px; }
.detail-section > h3 {
  margin: 0 0 11px;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -.01em;
  color: var(--navy);
}
.trait { margin-bottom: 14px; }
.trait:last-child { margin-bottom: 0; }
.trait-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.trait-name { font-size: 12.5px; color: var(--ink-2); }
.trait-val { font-family: var(--serif); font-size: 13px; color: var(--gold-2); }
.trait-track { height: 3px; border-radius: 99px; background: #F1EADF; overflow: hidden; }
.trait-track > span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #C9A98F 0%, var(--gold) 100%);
}
.trait-note { margin: 14px 0 0; font-size: 11.5px; line-height: 1.8; color: var(--muted); }

.spec-list { display: grid; gap: 12px; }
.spec-row { display: flex; gap: 14px; font-size: 12.5px; line-height: 1.6; }
.spec-k { flex: 0 0 56px; color: var(--muted-2); letter-spacing: .02em; }
.spec-v { flex: 1; color: var(--ink); }

.doc-badges { display: flex; flex-wrap: wrap; gap: 6px; }

.notice {
  margin-top: 22px;
  padding: 16px 17px;
  border-radius: var(--radius-sm);
  background: linear-gradient(170deg, #FBF6EE 0%, #F7F1E7 100%);
  border: 1px solid #F0E7D9;
  font-size: 11.5px;
  line-height: 1.85;
  color: var(--ink-2);
}

.detail-actions {
  position: sticky;
  bottom: calc(var(--tabbar-h) + 8px);
  z-index: 5;
  display: flex;
  gap: 9px;
  margin: 26px 0 84px;
  padding: 11px;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: var(--cream);
  box-shadow: 0 -10px 24px rgba(250, 248, 245, .92), 0 8px 20px rgba(120, 100, 80, .07);
}
.detail-actions .btn { flex: 1; }

/* ── 버튼 ───────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 50px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -.01em;
  border: 1px solid transparent;
  transition: transform .16s, background .16s, border-color .16s;
}
.btn:active { transform: scale(.988); }
.btn-primary {
  background: linear-gradient(160deg, #2B3A4B 0%, #1F2C3B 100%);
  color: #FBF7EF;
  box-shadow: 0 8px 18px rgba(36, 50, 66, .14);
}
.btn-ghost { background: var(--ivory); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-2); }
.btn-quiet { background: rgba(184, 150, 125, .12); color: var(--gold-2); }
.btn-sm { min-height: 42px; font-size: 12px; padding: 0 16px; border-radius: 12px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ── 상태 결과 ───────────────────────────── */
.result-card {
  margin-top: 22px;
  padding: 24px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  background: var(--ivory);
  box-shadow: var(--shadow-soft);
}
.result-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 400;
  color: var(--navy);
}
.result-title svg { width: 17px; height: 17px; color: var(--green); }
.result-body { margin: 0; font-size: 12px; line-height: 1.85; color: var(--ink-2); }
.log-line {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--line-soft);
  font-size: 10.5px;
  color: var(--muted);
}
.log-line b { color: var(--ink-2); font-weight: 600; }

/* ── 프로필 ─────────────────────────────── */
.profile-rows { display: grid; gap: 13px; }
.profile-row { display: flex; justify-content: space-between; gap: 14px; font-size: 12.5px; }
.profile-row span:first-child { color: var(--muted-2); letter-spacing: .02em; }
.profile-row span:last-child { color: var(--ink); text-align: right; }

.doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft);
}
.doc-item:last-child { border-bottom: 0; }
.doc-main { flex: 1; min-width: 0; }
.doc-name { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.doc-desc { margin: 2px 0 0; font-size: 11px; color: var(--muted-2); }
.doc-file {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 7px 0 0;
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--gold-2);
  word-break: break-all;
}
.doc-side { display: grid; gap: 7px; justify-items: end; flex: 0 0 auto; }
.doc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--ivory);
  font-size: 10px;
  font-weight: 600;
  color: var(--gold-2);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .16s, background .16s;
}
.doc-btn:hover { border-color: var(--gold); }
.doc-btn.is-off { color: var(--muted-2); border-style: dashed; cursor: default; }
.doc-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.doc-badge {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
}
.doc-done { background: var(--green-bg); color: var(--green); }
.doc-review { background: var(--gold-wash); color: var(--gold-2); }
.doc-missing { background: #F3EFE8; color: #9A9288; }

.mug-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.mug-thumb {
  flex: 0 0 auto;
  width: 62px;
  height: 80px;
  border-radius: 12px;
  background: #F4EEE4 center/cover no-repeat;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--muted-2);
}
.mug-thumb svg { width: 22px; height: 22px; }
.mug-title { margin: 0 0 5px; font-family: var(--serif); font-size: 16px; font-weight: 400; line-height: 1.5; color: var(--navy); }
.mug-desc { margin: 0; font-size: 11.5px; line-height: 1.75; color: var(--muted); }
.mug-actions { margin-top: 18px; }

/* ── 매니저 ─────────────────────────────── */
.mgr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mgr-cell .k { margin: 0 0 3px; font-size: 9.5px; letter-spacing: .06em; color: var(--muted-2); }
.mgr-cell .v { margin: 0; font-size: 12px; font-weight: 600; color: var(--ink); }

.form { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field-label { font-size: 11.5px; font-weight: 600; color: var(--ink-2); letter-spacing: .01em; }
.field-label .dim { font-weight: 400; color: var(--muted-2); }
select, textarea {
  width: 100%;
  padding: 13px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #FBF7F0;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  resize: vertical;
}
select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%238C857B' stroke-width='1.4' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }

.log-empty { font-size: 12px; line-height: 1.8; color: var(--muted-2); }
.log-item + .log-item { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.log-status { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.log-status .ok { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.log-status b { font-size: 12px; color: var(--ink); font-weight: 600; }
.log-status .t { font-size: 10px; color: var(--muted-2); margin-left: auto; }
.code-block {
  margin: 8px 0 0;
  padding: 12px 13px;
  border-radius: 11px;
  background: #F7F2EA;
  border: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.65;
  color: #4A443C;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
}
.code-label { font-size: 9.5px; letter-spacing: .08em; color: var(--muted-2); margin-top: 11px; }

.member-item { display: flex; align-items: center; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.member-item:last-child { border-bottom: 0; }
.member-item .nm { flex: 1; min-width: 0; }
.member-item .nm p { margin: 0; font-size: 12.5px; font-weight: 600; }
.member-item .nm span { font-size: 10px; color: var(--muted-2); }
.member-item .st { font-size: 10px; color: var(--muted); text-align: right; line-height: 1.55; }

.test-panel { display: grid; gap: 10px; }
.test-panel .row { display: flex; gap: 8px; }
.test-panel .row .btn { flex: 1; }
.test-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #FBF7F0;
  border: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--ink-2);
}
.test-state b { font-family: var(--mono); color: var(--gold-2); }

/* ── 탭바 ───────────────────────────────── */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  z-index: 40;
  display: flex;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(253, 250, 245, .95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  background: none;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: color .16s;
}
.tab svg { width: 21px; height: 21px; }
.tab.is-active { color: var(--navy); }
.tab.is-active::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  margin-left: -11px;
  width: 22px; height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--gold);
}

/* ── 시트 ───────────────────────────────── */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-wrap[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(28, 32, 38, .34); animation: fade .2s ease; }
.sheet {
  position: relative;
  width: 100%;
  max-width: 430px;
  background: var(--ivory);
  border-radius: 24px 24px 0 0;
  padding: 12px 22px calc(22px + env(safe-area-inset-bottom));
  animation: rise .26s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 -10px 40px rgba(60, 45, 30, .12);
}
@keyframes rise { from { transform: translateY(20px); opacity: .5; } to { transform: none; opacity: 1; } }
.sheet-grip { width: 34px; height: 3px; border-radius: 99px; background: #E8DFD2; margin: 0 auto 18px; }
.sheet-title {
  margin: 0 0 9px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -.01em;
  color: var(--navy);
}
.sheet-body { margin: 0 0 20px; font-size: 12px; line-height: 1.85; color: var(--ink-2); }
.sheet-actions { display: flex; gap: 9px; }
.sheet-actions .btn { flex: 1; }

/* ── 카메라 오버레이 ─────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--cream);
  overflow-y: auto;
  animation: fade .22s ease;
}
.overlay[hidden] { display: none; }
.overlay-head {
  max-width: 430px;
  margin: 0 auto;
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  background: rgba(250, 248, 245, .93);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.overlay-eyebrow { margin: 0 0 3px; font-size: 9.5px; letter-spacing: .16em; color: var(--gold); }
.overlay-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: -.01em;
  color: var(--navy);
}
.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--ivory);
  color: var(--ink-2);
}
.icon-btn svg { width: 15px; height: 15px; }
.overlay-body { padding: 0 22px 36px; max-width: 430px; margin: 0 auto; }
.overlay-lead { margin: 4px 0 16px; font-size: 12px; line-height: 1.8; color: var(--muted); }

.camera-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  overflow: hidden;
  background: #1C232B;
  box-shadow: 0 18px 40px rgba(36, 50, 66, .16);
}
.camera-stage video,
.camera-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.camera-stage video { transform: scaleX(-1); opacity: 0; transition: opacity .3s; }
.camera-stage.is-live video { opacity: 1; }
.camera-stage img[hidden] { display: none; }

.frame-guides { position: absolute; inset: 28px; pointer-events: none; opacity: .45; }
.frame-guides i { position: absolute; width: 20px; height: 20px; border: 1.5px solid rgba(253, 249, 242, .85); }
.frame-guides i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.frame-guides i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.frame-guides i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.frame-guides i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }

.cam-badge {
  position: absolute;
  top: 15px; left: 15px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(20, 26, 33, .62);
  color: #F8F3EA;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .07em;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.cam-badge .dot { width: 5px; height: 5px; border-radius: 50%; background: #D98B72; }
.cam-badge.is-off .dot { background: #8A9098; }
.cam-time {
  position: absolute;
  left: 15px; bottom: 13px;
  z-index: 3;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .02em;
  color: rgba(253, 249, 242, .85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}
.cam-status {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 28px;
  text-align: center;
  background: linear-gradient(170deg, #232B34 0%, #1A222A 100%);
  color: #E8E2D8;
}
.cam-status[hidden] { display: none; }
.cam-status p { margin: 0; font-size: 11.5px; line-height: 1.8; color: #B9BCC0; }
.cam-status b { color: #FDF9F2; font-weight: 600; }
.cam-status .status-icon { width: 32px; height: 32px; color: rgba(253, 249, 242, .35); }
.cam-status .btn { width: auto; min-height: 44px; background: #FDF9F2; color: var(--navy); font-size: 12px; border-radius: 12px; }
.cam-status .capture-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.cam-status .cam-small { font-size: 10px; line-height: 1.7; color: #7E848B; margin-top: -3px; }

.shot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 13px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--ivory);
  border: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-2);
}
.shot-meta[hidden] { display: none; }

.cam-notes { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.cam-notes li {
  position: relative;
  padding-left: 14px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}
.cam-notes li::before {
  content: "";
  position: absolute;
  left: 0; top: 7px;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--gold);
}

.cam-actions { margin-top: 24px; }
#shutterWrap { display: grid; justify-items: center; gap: 11px; }
.shutter {
  width: 70px; height: 70px;
  border-radius: 50%;
  border: 1.5px solid rgba(36, 50, 66, .6);
  background: transparent;
  padding: 5px;
  transition: transform .12s;
}
.shutter span {
  display: block;
  width: 100%; height: 100%;
  border-radius: 50%;
  background: linear-gradient(160deg, #2B3A4B 0%, #1F2C3B 100%);
}
.shutter:active { transform: scale(.94); }
.shutter[disabled] { opacity: .35; border-color: var(--muted-2); }
.shutter[disabled] span { background: var(--muted-2); }
.shutter-hint { margin: 0; font-size: 10.5px; color: var(--muted-2); text-align: center; }
.shot-actions { display: flex; gap: 9px; }
.shot-actions[hidden], #shutterWrap[hidden] { display: none; }
.shot-actions .btn { flex: 1; }

/* ── 사진 뷰어 ──────────────────────────── */
.photo-viewer { background: #14191F; }
.photo-viewer .overlay-head {
  background: rgba(20, 25, 31, .86);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.photo-viewer .overlay-eyebrow { color: #C9A98F; }
.photo-viewer .overlay-title { color: #F7F1E7; }
.photo-viewer .icon-btn { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .14); color: #F7F1E7; }
.pv-body {
  padding: 18px 22px 40px;
  max-width: 430px;
  margin: 0 auto;
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.pv-stage {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0F1318;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .4);
}
.pv-stage img { display: block; width: 100%; height: auto; }
.pv-stage .wm span { font-size: 12px; opacity: .22; }
.pv-stage .wm-inner { gap: 62px 18px; }
.pv-count {
  position: absolute;
  right: 14px; top: 14px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(20, 24, 30, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: var(--mono);
  font-size: 11px;
  color: #F7EEDF;
}
.pv-count svg { width: 12px; height: 12px; opacity: .8; }
.pv-note {
  margin: 18px 0 0;
  font-size: 10.5px;
  line-height: 1.85;
  color: rgba(233, 227, 217, .5);
  text-align: center;
}
.pv-reader {
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: .02em;
  color: rgba(233, 227, 217, .34);
  text-align: center;
}

/* ── 토스트 ─────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 26px);
  transform: translateX(-50%) translateY(8px);
  z-index: 80;
  max-width: 330px;
  padding: 13px 18px;
  border-radius: 14px;
  background: rgba(30, 38, 47, .94);
  color: #FBF7EF;
  font-size: 11.5px;
  line-height: 1.6;
  text-align: center;
  opacity: 0;
  transition: opacity .22s, transform .22s;
  pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast[hidden] { display: none; }

/* ── 1단계 스텝 · 2단계 잠금 ───────────────── */
/* 첫 화면은 인증 항목이 한눈에 들어오도록 위쪽 여백을 줄입니다 */
.view[data-view="verify"] .view-head { padding: 20px 0 14px; }
.view[data-view="verify"] .h1 { font-size: 25px; line-height: 1.4; }
.view[data-view="verify"] .sub { margin-top: 7px; font-size: 12.5px; line-height: 1.65; }
.view[data-view="verify"] .section-head { margin: 26px 0 12px; }

.flow {
  list-style: none;
  margin: 4px 0 0;
  padding: 15px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--ivory);
  box-shadow: var(--shadow-soft);
}
.flow-step { display: flex; align-items: center; gap: 11px; padding: 2px 0; }
.flow-track + .flow-step, .flow-step + .flow-track { margin-top: 6px; }
.flow-no {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--cream-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
}
.flow-no svg { width: 14px; height: 14px; }
.flow-body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.flow-label { font-size: 11.5px; font-weight: 600; letter-spacing: .01em; color: var(--ink); }
.flow-sub { font-size: 10.5px; line-height: 1.5; color: var(--muted-2); }
.flow-state { flex: 0 0 auto; font-size: 10px; font-weight: 600; color: var(--muted-2); letter-spacing: .02em; }
.flow-track { display: flex; align-items: center; gap: 9px; margin: 7px 0 0 37px; }
.flow-bar { flex: 1; height: 3px; border-radius: 999px; background: var(--cream-2); overflow: hidden; }
.flow-bar i { display: block; height: 100%; border-radius: 999px; background: var(--gold); }
.flow-pct { flex: 0 0 auto; font-size: 10px; font-weight: 600; color: var(--gold-2); letter-spacing: .02em; }
.flow-note {
  margin: 8px 0 12px 37px;
  font-size: 10.5px;
  line-height: 1.65;
  color: var(--muted);
}
.flow-step.is-current .flow-no { background: var(--navy); border-color: var(--navy); color: #FFFDF8; }
.flow-step.is-current .flow-state { color: var(--gold-2); }
.flow-step.is-done .flow-no { background: var(--green-bg); border-color: rgba(94, 122, 100, .3); color: var(--green); }
.flow-step.is-done .flow-state { color: var(--green); }
.flow-step.is-locked .flow-no { background: #F3EFE8; border-style: dashed; color: var(--muted-2); }
.flow-step.is-locked .flow-label { color: var(--muted); }

.verify-pct { font-family: var(--serif); font-size: 17px; color: var(--gold-2); }

.lock-panel { margin-top: 16px; }
.lock-actions { display: grid; gap: 10px; margin-top: 22px; }
.locked .lock-actions .btn-quiet { border-color: rgba(184, 150, 125, .5); background: #FBF5EC; }
.locked .lock-actions .btn { margin: 0; width: 100%; }

.next-card {
  border-color: rgba(184, 150, 125, .38);
  background: linear-gradient(180deg, #FFFDF9 0%, #FAF4EC 100%);
}
.next-actions { display: flex; gap: 8px; margin-top: 18px; }
.next-actions .btn { flex: 1; }

.demo-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px dashed rgba(184, 150, 125, .55);
  border-radius: 12px;
  background: rgba(243, 232, 220, .5);
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--gold-2);
}
.demo-note .link { font-size: 10.5px; white-space: nowrap; }

@media (min-width: 431px) {
  .app { box-shadow: 0 0 0 1px rgba(0, 0, 0, .03), 0 34px 70px rgba(90, 70, 50, .08); }
}

/* ── 실DB 모드 로그인 게이트 (Supabase 연결 시에만 표시) ────── */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-2) 100%);
}
.auth-gate[hidden] { display: none; }
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 22px 22px;
}
.auth-kicker {
  margin: 0 0 10px;
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-2);
}
.auth-title {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 23px;
  color: var(--navy);
}
.auth-desc {
  margin: 0 0 20px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-2);
}
.auth-field { display: block; margin-bottom: 14px; }
.auth-field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}
.auth-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.auth-field input:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--ivory);
}
.auth-gate .btn { width: 100%; margin-top: 6px; }
.auth-note {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.auth-note.is-error { color: #A8543F; }
