:root {
  --bg: #F8F6F2;
  --surface: #FFFFFF;
  --ink: #171516;
  --muted: #78706C;
  --line: #ECE6DC;
  --gold: #B69D69;
  --gold-soft: #F7F2E8;
  --before: #A6687A;
  --after: #1F7E73;
  --warn: #C4832A;
  --bad: #C43E3E;
  --display: "Cormorant Garamond", "Noto Serif KR", Georgia, serif;
  --body: system-ui, -apple-system, "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: #ECE7DF;
  color: var(--ink);
  font: 15px/1.5 var(--body);
  -webkit-text-size-adjust: 100%;
}

.shell {
  max-width: 520px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 48px rgba(23, 21, 22, 0.09);
  position: relative;
}

/* Luxury Frosted Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(182, 157, 105, 0.28);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 18px 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.topbar-logo {
  height: 36px;
  width: auto;
  display: block;
}

.topbar-sub {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--gold);
  border-left: 1px solid var(--line);
  padding-left: 10px;
}

.topbar-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid rgba(182, 157, 105, 0.35);
  color: var(--ink);
}

.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--after);
  display: inline-block;
}

.app-main {
  flex: 1;
  padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 104px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Luxury Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: end;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(env(safe-area-inset-bottom, 0px) + 8px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.nav-svg {
  width: 21px;
  height: 21px;
}

.nav-item.active {
  color: var(--ink);
}
.nav-item.active .nav-svg {
  color: var(--gold);
}

.nav-center {
  margin-top: -18px;
}
.nav-shutter {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--gold);
  color: #FAF7F2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(23, 21, 22, 0.22);
}
.nav-center.active .nav-shutter {
  background: var(--after);
  border-color: #FFFFFF;
}

h1 { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: 16px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
h3 { font-size: 14px; font-weight: 700; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 2px 10px rgba(23, 21, 22, 0.025);
}

/* Luxury Brand Hero Banner */
.hero-brand-card {
  background: radial-gradient(circle at top right, #2A2527 0%, #171516 70%);
  color: #FAF7F2;
  border: 1px solid rgba(182, 157, 105, 0.48);
  border-radius: 20px;
  padding: 20px 18px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  box-shadow: 0 12px 28px rgba(23, 21, 22, 0.16);
}

.hero-logo {
  height: 64px;
  width: auto;
  display: block;
}

.hero-tagline {
  font-size: 13px;
  color: #D9D1C7;
  max-width: 340px;
  line-height: 1.5;
}

.hero-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 2px;
}

/* 3-Step Workflow Strip */
.steps-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.step-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.step-num {
  font: 700 13px/1 var(--display);
  letter-spacing: 0.12em;
  color: var(--gold);
}

.step-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.step-desc {
  font-size: 11px;
  color: var(--muted);
}

.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1 1 130px; min-width: 0; }

button, .btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: transform 0.08s ease, opacity 0.15s ease, border-color 0.15s ease;
}
button:active, .btn:active { transform: scale(0.98); }
button.primary, .btn.primary { background: var(--ink); border-color: var(--ink); color: #FAF7F2; }
button.teal, .btn.teal { background: var(--after); border-color: var(--after); color: #FFFFFF; }
button.rose, .btn.rose { background: var(--before); border-color: var(--before); color: #FFFFFF; }
button.gold, .btn.gold { background: var(--gold); border-color: var(--gold); color: #171516; font-weight: 700; }
button.ghost-light { background: rgba(255, 255, 255, 0.1); border-color: rgba(182, 157, 105, 0.45); color: #FAF7F2; }
button.danger { color: var(--bad); border-color: #F0D4D4; background: #FFF8F8; }
button.sm { padding: 7px 11px; font-size: 12px; border-radius: 10px; }
button.xs { padding: 5px 9px; font-size: 11px; border-radius: 8px; }
button:disabled { opacity: 0.42; cursor: default; }

input[type=text], input[type=tel], select, textarea {
  font: inherit;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #FCFBF9;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: transparent; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--muted);
}
.pill.before { background: var(--before); }
.pill.after { background: var(--after); }
.pill.angle { background: #F2EDE6; color: var(--ink); font-weight: 600; }
.pill.ok { background: #E6F4F1; color: var(--after); }
.pill.warn { background: #FDF3E7; color: var(--warn); }

.client-list { display: flex; flex-direction: column; gap: 10px; }
.client-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.client-card:hover { border-color: var(--gold); }
.client-thumb {
  width: 56px;
  height: 70px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--gold-soft);
  border: 1px solid var(--line);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 20px/1 var(--display);
  color: var(--gold);
}
.client-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.client-name { font-size: 16px; font-weight: 700; }

/* Segmented controls */
.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: #EFEAE1;
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}
.seg button {
  border: 0;
  background: transparent;
  padding: 8px 6px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--muted);
}
.seg button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(23, 21, 22, 0.08);
}

/* Angle Slot Pills inside Session Card */
.angle-slots {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.slot-pill {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px dashed var(--gold);
  background: var(--gold-soft);
  color: var(--ink);
}
.slot-pill.done {
  border-style: solid;
  border-color: var(--after);
  background: #E8F5F2;
  color: var(--after);
}

/* Shot grid inside sessions */
.shots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.shot-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}
.shot-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid transparent;
  background: #EDE7EB;
}
.shot-card input[type=checkbox] {
  position: absolute;
  top: 7px;
  left: 7px;
  width: 20px;
  height: 20px;
  accent-color: var(--after);
}
.shot-card input:checked + img { border-color: var(--after); }
.shot-info { display: flex; align-items: center; justify-content: space-between; gap: 4px; font-size: 11px; }

/* Capture stage & Native Camera Dock */
.stage {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #141213;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(182, 157, 105, 0.35);
}
.stage canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.stage.mirror canvas { transform: scaleX(-1); }

.camera-dock {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
}
.shutter-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 0;
  border: 4px solid var(--gold);
  background: var(--ink);
  color: #FAF7F2;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(23, 21, 22, 0.22);
}
.shutter-btn:disabled {
  opacity: 0.4;
}

.checks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.chk {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
}
.chk b { font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.chk.ok { border-color: var(--after); background: #F2FAF8; }
.chk.ok b { color: var(--after); }
.chk.no { border-color: #EBCFA2; background: #FFFBF5; }
.chk.no b { color: var(--warn); }

.status-banner {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 13px;
  text-align: center;
}

/* Compare viewers */
.compare-box {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #141213;
  touch-action: pan-y;
  user-select: none;
}
.compare-box canvas { display: block; width: 100%; height: auto; }
.compare-box canvas.overlay { position: absolute; inset: 0; }
.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #FFFFFF;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}
.compare-handle::after {
  content: '↔';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #FFFFFF;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.cap {
  position: absolute;
  top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.cap.l { left: 10px; background: var(--before); }
.cap.r { right: 10px; background: var(--after); }

.side-by-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.side-pane {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #141213;
}
.side-pane canvas { display: block; width: 100%; height: auto; }

input[type=range] {
  width: 100%;
  accent-color: var(--ink);
}

.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 16px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }

.hero-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.hero-num { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.delta-badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 15px;
  background: #E6F4F1;
  color: var(--after);
}
.delta-badge.neg { background: #FCEEF2; color: var(--before); }

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.kpi-card {
  background: #FCFBF9;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-label { font-size: 11px; font-weight: 600; color: var(--muted); }
.kpi-val { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.kpi-delta { font-size: 12px; font-weight: 700; color: var(--after); }
.kpi-delta.keep { color: var(--muted); }

.chart-svg { width: 100%; height: auto; display: block; }

.metric-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.metric-table th, .metric-table td {
  padding: 9px 6px;
  border-top: 1px solid var(--line);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.metric-table th:first-child, .metric-table td:first-child { text-align: left; }
.metric-table thead th { border-top: 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.metric-hint { display: block; font-size: 11px; color: var(--muted); }
.badge-imp { color: var(--after); font-weight: 700; }
.badge-keep { color: var(--muted); }

.toggle-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.toggle-chip {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}
.toggle-chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #FAF7F2;
}

.summary-card {
  background: linear-gradient(135deg, #FFFDF9 0%, #F7F2E8 100%);
  border: 1px solid rgba(182, 157, 105, 0.55);
}
.summary-headline {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.48;
  color: var(--ink);
}
.summary-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #544954;
}

/* KakaoTalk In-App Banner & Modals */
.kakao-banner {
  background: linear-gradient(135deg, #FFFBF3 0%, #F7F0E2 100%);
  border: 1px solid rgba(182, 157, 105, 0.55);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kakao-banner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.kakao-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(23, 21, 22, 0.62);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal-card {
  width: 100%;
  max-width: 420px;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid rgba(182, 157, 105, 0.55);
  border-radius: 22px;
  padding: 22px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 20px 44px rgba(23, 21, 22, 0.28);
}
.modal-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--gold-soft);
  border: 1.5px solid var(--gold);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-title {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}
.modal-desc {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.perm-steps {
  background: #FCFBF9;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--ink);
}
.perm-step {
  display: flex;
  align-items: center;
  gap: 8px;
}
.perm-num {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--ink);
  color: #FAF7F2;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.perm-privacy {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--after);
  background: #EDF7F5;
  border-radius: 10px;
  padding: 7px 10px;
}
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.report-preview-img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  display: block;
}

[hidden] { display: none !important; }
