:root {
  --bg: #F7F6F3;
  --surface: #FFFFFF;
  --text: #1A1A1A;
  --muted: #6B6B6B;
  --accent: #3D6B4F;
  --accent-soft: #E7F0EA;
  --warn: #C4842A;
  --warn-soft: #F8EEDD;
  --danger: #B42318;
  --line: #E8E6E1;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 8px 24px rgba(26, 26, 26, 0.06);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; display: block; }

.app {
  min-height: 100%;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
  background: var(--bg);
}

.screen {
  min-height: 100dvh;
  padding: 20px 20px calc(var(--nav-h) + var(--safe-b) + 24px);
}
.screen.no-nav { padding-bottom: 28px; }
.screen.camera {
  padding: 0;
  background: #111;
  min-height: 100dvh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.brand-mark { width: 28px; height: 28px; }
.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.chip {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.chip.on { background: var(--accent); color: #fff; }
.chip.warn { background: var(--warn-soft); color: var(--warn); }

.h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; margin: 0 0 8px; }
.h2 { font-size: 21px; font-weight: 700; letter-spacing: -0.03em; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 20px; font-size: 16px; }
.caption { font-size: 13px; color: var(--muted); }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 12px; }

.hero-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 64px;
  border-radius: var(--radius-lg);
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  margin: 8px 0 10px;
}
.hero-btn.ghost {
  background: transparent;
  color: var(--accent);
  min-height: 44px;
  font-weight: 600;
  font-size: 16px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  width: 100%;
}
.btn.secondary { background: var(--accent-soft); color: var(--accent); }
.btn.warn { background: var(--warn); color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn[disabled] { opacity: .45; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}
.tag-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
}
.tag.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.empty { text-align: center; padding: 36px 12px; color: var(--muted); }
.empty .illus {
  width: 88px;
  height: 88px;
  margin: 0 auto 12px;
  border-radius: 24px;
  background: var(--accent-soft);
}

.h-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 8px;
}
.mini-card {
  flex: 0 0 140px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.mini-card .ph { height: 88px; background: var(--accent-soft); }
.mini-card .body { padding: 10px 12px 12px; }
.mini-card .name { font-weight: 700; font-size: 14px; }
.mini-card .line { font-size: 12px; color: var(--muted); margin-top: 4px; }

.list { display: flex; flex-direction: column; gap: 10px; }
.row-card {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow);
}
.thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: var(--accent-soft);
  object-fit: cover;
  flex: 0 0 64px;
}
.row-card .grow { flex: 1; min-width: 0; }
.row-card .name { font-weight: 700; }
.swipe-del {
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
  min-height: 44px;
  padding: 0 8px;
}

.nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 430px;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 20;
}
.nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
  min-height: var(--nav-h);
}
.nav button.on { color: var(--accent); font-weight: 700; }
.nav svg { width: 22px; height: 22px; }

.fab {
  position: fixed;
  right: calc(50% - 215px + 20px);
  bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(61, 107, 79, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 21;
}
@media (max-width: 430px) {
  .fab { right: 20px; }
}

.disclaimer {
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-b) + 80px);
  transform: translateX(-50%);
  background: #1A1A1A;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 40;
  max-width: 80%;
}

.skeleton {
  background: linear-gradient(90deg, #eee, #f6f6f6, #eee);
  background-size: 200% 100%;
  animation: sk 1.2s infinite;
  height: 14px;
  border-radius: 8px;
  margin: 10px 0;
}
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.dots { display: flex; gap: 6px; justify-content: center; margin: 18px 0; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: #d5d2cc; display: block; }
.dots i.on { background: var(--accent); width: 18px; border-radius: 8px; }

.onboard-art {
  height: 240px;
  border-radius: 24px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0 24px;
  font-size: 64px;
}

.social { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.social .btn.kakao { background: #FEE500; color: #191919; }
.social .btn.naver { background: #03C75A; color: #fff; }
.social .btn.google { background: #fff; color: #1A1A1A; border: 1px solid var(--line); }

.cam-frame { position: relative; height: 100dvh; overflow: hidden; }
.cam-frame video, .cam-frame canvas { width: 100%; height: 100%; object-fit: cover; }
.guide {
  position: absolute;
  inset: 18% 12% 28%;
  border: 2px solid rgba(255,255,255,.85);
  border-radius: 16px;
  pointer-events: none;
}
.cam-copy {
  position: absolute;
  top: calc(18% - 36px);
  left: 0; right: 0;
  text-align: center;
  color: #fff;
  font-weight: 600;
}
.cam-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 16px 20px calc(20px + var(--safe-b));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
  color: #fff;
}
.shutter {
  width: 72px; height: 72px; border-radius: 50%;
  background: #fff; border: 6px solid rgba(255,255,255,.4);
}
.cam-bar button { color: #fff; font-weight: 700; min-height: 44px; }

.result-head { font-size: 22px; font-weight: 700; margin: 8px 0 12px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12px;
  font-weight: 700;
}
.badge.ok { background: var(--accent-soft); color: var(--accent); }
.detail { margin-top: 10px; color: var(--muted); font-size: 14px; }
.evidence {
  display: inline-block;
  margin: 4px 6px 0 0;
  padding: 2px 8px;
  border-radius: 8px;
  background: #f1f1ee;
  font-size: 11px;
  color: var(--muted);
}
.bottom-bar {
  position: sticky;
  bottom: calc(var(--nav-h) + var(--safe-b));
  display: flex;
  gap: 8px;
  padding-top: 12px;
  background: linear-gradient(transparent, var(--bg) 30%);
}
.bottom-bar .btn { font-size: 15px; }

.legal { font-size: 14px; color: var(--text); }
.legal h2 { font-size: 18px; margin: 20px 0 8px; }
.legal p { color: var(--muted); }

.slot-card { position: relative; }
.slot-card .remove {
  position: absolute;
  top: 10px; right: 10px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}
