:root {
  --ink: #12201e;
  --ink-2: #4b5d5a;
  --ink-3: #5f716d;
  --line: #e2ebe9;
  --bg: #f4f8f7;
  --card: #ffffff;
  --teal: #0f766e;
  --teal-2: #14b8a6;
  --teal-soft: #e6f6f3;
  --ok: #15803d;
  --ok-soft: #e9f7ee;
  --warn: #b45309;
  --warn-soft: #fff4e5;
  --bad: #c2410c;
  --bad-soft: #fdecea;
  --ai: #2f5aa8;
  --ai-soft: #eaf1ff;
  --r: 16px;
  --tab-h: 64px;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100dvh; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
body { word-break: keep-all; overflow-wrap: anywhere; line-height: 1.5; }
h1, h2, h3 { text-wrap: balance; }
p, .hint { text-wrap: pretty; }
a { color: var(--teal); }
button, input, select, textarea { font: inherit; color: inherit; }
#app { max-width: 520px; margin: 0 auto; }

/* ── 부팅 ── */
.boot { min-height: 70dvh; display: grid; place-content: center; text-align: center; gap: 12px; padding: 24px; color: var(--ink-2); }
.boot-mark { justify-self: center; color: var(--teal); animation: bob 1.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.err { white-space: pre-wrap; font-size: 12px; color: var(--bad); text-align: left; }

/* ── 상단 막대 ── */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  height: 52px; padding: 0 12px; padding-top: env(safe-area-inset-top);
  background: var(--bg); border-bottom: 1px solid var(--line); }
.bar h1 { font-size: 17px; margin: 0; font-weight: 700; }
.bar-back { display: grid; place-items: center; width: 44px; height: 44px; margin-left: -8px; color: var(--ink); border-radius: 12px; }
.bar-back .ico { width: 24px; height: 24px; }
.bar-logo { display: grid; place-items: center; width: 32px; color: var(--teal); }
.bar-logo .ico { width: 22px; height: 22px; }

.page { padding: 16px 16px 32px; display: flex; flex-direction: column; gap: 14px; }

/* ── 하단 탭 ── */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: flex; background: #fff; border-top: 1px solid var(--line); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; color: var(--ink-3); text-decoration: none; }
.tabs a { min-height: 48px; }
.tabs a span { display: grid; place-items: center; line-height: 1; }
.tabs .ico { width: 22px; height: 22px; }
.tabs a.on { color: var(--teal); font-weight: 700; }
.tabs .tab-cam span { width: 44px; height: 44px; margin-top: -18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--teal); color: #fff; box-shadow: 0 6px 16px rgba(15, 118, 110, .35); }
.tabs .tab-cam .ico { width: 22px; height: 22px; }

/* ── 홈 ── */
.hero { padding: 6px 4px 4px; }
.brand { display: flex; align-items: center; gap: 6px; padding: 14px 4px 0; font-size: 15px; font-weight: 700; color: var(--teal); }
.brand .ico { width: 20px; height: 20px; }
.hero h1 { margin: 0; font-size: 24px; line-height: 1.35; letter-spacing: -.02em; }
.hero-sub { margin: 8px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card-h { margin: 0 0 10px; font-size: 16px; line-height: 1.4; }
.card-h small { font-weight: 400; color: var(--ink-3); font-size: 12px; margin-left: 4px; }
.card-h.ok { color: var(--ok); } .card-h.warn { color: var(--warn); } .card-h.bad { color: var(--bad); }
.card.ok { border-color: #bfe5cc; } .card.warn { border-color: #f5d5a8; } .card.bad { border-color: #f4c0b5; background: #fffaf8; }

.pet-row { display: flex; gap: 12px; align-items: center; }
.pet-ava { display: grid; place-items: center; flex: none; color: var(--ink-2); }
.pet-ava .ico { width: 32px; height: 32px; stroke-width: 1.6; }
.pet-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pet-info span { font-size: 13px; color: var(--ink-2); }
.pet-empty p { color: var(--ink-2); font-size: 14px; line-height: 1.5; margin: 6px 0 12px; }

.cta { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--r); text-decoration: none;
  background: var(--teal); color: #fff; }
.cta b { display: block; font-size: 18px; }
.cta small { display: block; opacity: .85; font-size: 13px; margin-top: 2px; }
.cta-ico { display: grid; place-items: center; flex: none; }
.cta-ico .ico { width: 28px; height: 28px; }
.cta.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.cta.ghost .cta-ico { color: var(--teal); }
.cta.ghost small { color: var(--ink-2); }

.sec { font-size: 15px; margin: 8px 0 -4px; }
.list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.list li + li { border-top: 1px solid var(--line); }
.list a { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
.list a b { font-size: 15px; font-weight: 600; }
.list a span { font-size: 12px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.list .empty { padding: 18px 14px; color: var(--ink-3); font-size: 14px; }

.plus-banner { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; row-gap: 2px; align-items: center; padding: 14px 16px; border-radius: var(--r); text-decoration: none;
  background: #10231f; color: #d8f3ee; }
.plus-banner b { color: #5eead4; font-size: 14px; }
.plus-banner b, .plus-banner span { grid-column: 1; }
.plus-banner span { font-size: 13px; }
.plus-banner .pb-go { grid-column: 2; grid-row: 1 / span 2; width: 20px; height: 20px; color: #5eead4; }

.foot { color: var(--ink-3); font-size: 11px; line-height: 1.6; text-align: center; padding-top: 8px; }
.foot p { margin: 0; }

/* ── 공통 조각 ── */
.ico { width: 1em; height: 1em; flex: none; display: inline-block; vertical-align: -.125em; }
.ext { width: 13px; height: 13px; margin-left: 2px; }
.seg .ico { width: 20px; height: 20px; }
a, button, label { -webkit-tap-highlight-color: transparent; }
.btn, .cta, .plus-banner, .gl, .cand, .opt, .tick span, .seg span, .list a, .fills a { transition: background-color .15s, border-color .15s, opacity .15s; }
.btn:active, .cta:active, .plus-banner:active, .gl:active, .list a:active, .fills a:active { opacity: .82; }
a:focus-visible, button:focus-visible, select:focus-visible { outline: 2px solid var(--teal-2); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 20px;
  border-radius: 12px; border: 0; background: var(--teal); color: #fff; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; }
.btn:disabled { background: #b9cbc8; cursor: not-allowed; }
.btn.wide { width: 100%; }
.btn.small { min-height: 38px; font-size: 14px; padding: 0 14px; }
.btn.ghost { background: #fff; color: var(--teal); border: 1px solid #bfe0da; }
.btn.danger { color: var(--bad); border-color: #f4c0b5; }
.link { font-size: 13px; text-decoration: none; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.row-btns .btn { flex: 1; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--teal-soft); color: var(--teal); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.mute { background: #eef2f1; color: var(--ink-2); }
.chip.kind { background: #10231f; color: #ccfbf1; }
.chip.ai { background: var(--ai-soft); color: var(--ai); }
.chip.db { background: var(--teal-soft); color: var(--teal); }
.chip.me { background: var(--warn-soft); color: var(--warn); }

.hint { margin: 6px 0 0; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.fine { margin: 4px 2px; font-size: 12px; line-height: 1.6; color: var(--ink-3); }
.warn { color: var(--warn); font-size: 14px; margin: 0; }
.alert { padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); color: #7c3a06; font-size: 14px; line-height: 1.5; }
.alert.soft { background: var(--ai-soft); color: #1e3a8a; }
.alert.vet { background: #fdf2f8; color: #831843; }
.alert.vet p { margin: 4px 0 0; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: #10231f; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none;
  transition: .25s; z-index: 50; max-width: calc(100% - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ── 폼 ── */
.form { display: flex; flex-wrap: wrap; gap: 14px 10px; }
.f { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.f.half { width: calc(50% - 5px); }
.f > span { font-size: 14px; font-weight: 600; }
.f em { font-style: normal; font-weight: 400; color: var(--ink-3); font-size: 12px; margin-left: 4px; }
.f input, .f select, .f textarea, .search { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #cfdcd9; border-radius: 12px; background: #fff; font-size: 16px; }
.f textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.f input:focus, .f select:focus, .f textarea:focus, .search:focus { outline: 2px solid var(--teal-2); outline-offset: -1px; border-color: transparent; }
.seg { display: flex; gap: 8px; }
.seg label { flex: 1; }
.seg input, .tick input { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; opacity: 0; pointer-events: none; }
.seg span { display: flex; justify-content: center; align-items: center; gap: 6px; min-height: 48px; border: 1px solid #cfdcd9; border-radius: 12px; background: #fff; font-weight: 600; }
.seg input:checked + span { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); }
.ticks { display: flex; flex-wrap: wrap; gap: 8px; }
.tick { display: inline-flex; }
.tick span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid #cfdcd9; background: #fff; font-size: 14px; }
.tick input:checked + span { background: var(--teal); border-color: var(--teal); color: #fff; }
.tick.solo span { border-radius: 12px; }
.tick.solo span { gap: 8px; }
.tick.solo span::before { content: ''; width: 18px; height: 18px; border: 2px solid #9fb3af; border-radius: 5px; background: #fff center / 14px no-repeat; flex: none; }
.tick.solo input:checked + span::before { border-color: #fff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f766e' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.seg input:focus-visible + span, .tick input:focus-visible + span { outline: 2px solid var(--teal-2); outline-offset: 2px; }
.sub { width: 100%; margin: 6px 0 -4px; font-size: 15px; }
.sub small { font-weight: 400; font-size: 12px; color: var(--ink-3); margin-left: 4px; }
.legend { width: 100%; display: flex; gap: 6px; flex-wrap: wrap; }

.nums { width: 100%; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.n { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 12px; border: 1px solid #cfdcd9; background: #fff; }
.n span { font-size: 12px; color: var(--ink-2); }
.n em { font-style: normal; color: var(--ink-3); margin-left: 3px; }
.n input { border: 0; padding: 0; min-height: 30px; font-size: 20px; font-weight: 700; width: 100%; background: transparent; }
.n input:focus { outline: none; }
.n:focus-within { border-color: var(--teal-2); box-shadow: 0 0 0 1px var(--teal-2); }
.n.ai { border-color: #bcd3fb; background: #f7faff; }
.n.db { border-color: #b7e3db; background: #f5fcfa; }
.n.me { border-color: #f5d5a8; background: #fffaf2; }
.n.empty { border-style: dashed; }

/* ── 촬영 ── */
.shots { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }
.shot { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r); overflow: hidden; background: #fff; border: 2px dashed #b9d6d1; }
.shot.on { border-style: solid; border-color: var(--teal); }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot-drop { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 12px; text-align: center; cursor: pointer; }
.shot-drop b { font-size: 15px; }
.shot-ico { width: 30px; height: 30px; color: var(--teal); margin-bottom: 2px; }
.shot-drop span { font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.shot-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.shot-x { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.shot-x .ico { width: 20px; height: 20px; }
.tips { margin: 0; padding: 12px 14px 12px 30px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); font-size: 13px; line-height: 1.7; color: var(--ink-2); }
.progress { display: flex; flex-direction: column; gap: 8px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.step { font-size: 14px; color: var(--ink-3); padding-left: 26px; position: relative; }
.step::before { content: ''; position: absolute; left: 4px; top: 3px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #cfdcd9; }
.step.done { color: var(--ink-2); } .step.done::before { background: var(--teal); border-color: var(--teal); }
.step.now { color: var(--ink); font-weight: 700; }
.step.now::before { border-color: var(--teal); border-top-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 확인 ── */
.cands { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.cand { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.cand.on { border-color: var(--teal); background: var(--teal-soft); }
.cand input { accent-color: var(--teal); width: 18px; height: 18px; flex: none; }
.cand-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cand-body b { font-size: 14px; font-weight: 600; }
.cand-body small { font-size: 12px; color: var(--ink-2); }

/* ── 결과 ── */
.glance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gl { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 92px; padding: 12px 10px; border-radius: 14px;
  border: 1px solid var(--line); background: #fff; text-align: left; cursor: pointer; }
.gl-ico { width: 20px; height: 20px; }
.gl-k { font-size: 12px; color: var(--ink-2); }
.gl-v { font-size: 14px; line-height: 1.35; word-break: keep-all; }
.gl.ok { border-color: #bfe5cc; } .gl.ok .gl-ico { color: var(--ok); }
.gl.warn { border-color: #f5d5a8; background: #fffaf2; } .gl.warn .gl-ico { color: var(--warn); }
.gl.bad { border-color: #f4c0b5; background: var(--bad-soft); } .gl.bad .gl-ico, .gl.bad .gl-v { color: var(--bad); }
.gl.mute .gl-ico { color: var(--ink-3); } .gl.mute .gl-v { color: var(--ink-2); font-weight: 600; }
.card[id] { scroll-margin-top: 64px; }
.card:focus { outline: none; }

.r-title h1 { margin: 8px 0 2px; font-size: 21px; line-height: 1.35; letter-spacing: -.01em; }
.r-title p { margin: 0; color: var(--ink-2); font-size: 14px; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.checks li { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 10px; background: var(--ok-soft); font-size: 14px; }
.checks li.under { background: var(--warn-soft); }
.checks li.unknown { background: #eef2f1; }
.checks small { font-weight: 400; color: var(--ink-2); }

.dm-how { margin: 0 0 6px; }
.num, .big, .kv b, .dm-l b, .checks b { font-variant-numeric: tabular-nums; }

.dm-row { padding: 8px 0; border-top: 1px solid var(--line); }
.dm-l { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.dm-row small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.meter { position: relative; height: 8px; border-radius: 99px; background: #e6efed; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--teal-2); }
.meter-mark { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--ink); border-radius: 1px; }

.kv { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.kv span { color: var(--ink-2); }
.kv b { text-align: right; }
.big { font-size: 38px; font-weight: 800; letter-spacing: -.02em; color: var(--teal); margin: 2px 0 8px; }
.big small { font-size: 15px; font-weight: 600; color: var(--ink-2); margin-left: 4px; }

.allergy { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.allergy li { display: flex; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #f3f6f5; }
.allergy li i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #dfe7e5; }
.allergy li i .ico { width: 14px; height: 14px; stroke-width: 2.6; }
.allergy li div { display: flex; flex-direction: column; gap: 2px; }
.allergy li b { font-size: 14px; }
.allergy li span { font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.allergy li.has { background: var(--bad-soft); } .allergy li.has i { background: var(--bad); color: #fff; }
.allergy li.checked { background: var(--ok-soft); } .allergy li.checked i { background: var(--ok); color: #fff; }

.dots { margin: 6px 0 0; padding-left: 18px; font-size: 14px; line-height: 1.7; }
.gap { padding: 10px 0; border-top: 1px solid var(--line); }
.gap:first-of-type { border-top: 0; padding-top: 0; }
.gap b { font-size: 14px; }
.gap p { margin: 4px 0 0; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.fills { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.fills small { font-size: 12px; color: var(--ink-3); }
.fills a { display: flex; flex-direction: column; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); }
.fills a b { font-size: 13px; font-weight: 600; } .fills a span { font-size: 12px; color: var(--ink-2); }
.recs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.recs li { padding: 10px 12px; border-radius: 12px; background: #f7f9f9; font-size: 13px; }
.recs li p { margin: 6px 0; line-height: 1.5; }
.recs small { color: var(--ink-3); }
.vet-card { background: #f5fbfa; }

/* ── 플러스 ── */
.plan { background: #10231f; color: #e6fffa; border: 0; }
.plan-k { margin: 0; color: #5eead4; font-weight: 700; font-size: 13px; }
.plan-price { font-size: 30px; font-weight: 800; margin: 4px 0 10px; }
.feat { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.feat li { display: flex; flex-direction: column; gap: 2px; padding-left: 22px; position: relative; }
.feat-ico { position: absolute; left: 0; top: 2px; width: 16px; height: 16px; color: #5eead4; stroke-width: 3; }
.feat b { font-size: 14px; } .feat span { font-size: 12px; color: #a7c4be; line-height: 1.5; }
.plan .hint { color: #a7c4be; margin-top: 12px; }
.opts { display: flex; flex-direction: column; gap: 6px; }
.opt { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid #cfdcd9; background: #fff; font-size: 15px; cursor: pointer; }
.opt input { accent-color: var(--teal); width: 18px; height: 18px; }
.opt.on { border-color: var(--teal); background: var(--teal-soft); }

.empty-state { text-align: center; padding: 40px 0; color: var(--ink-2); }
.search { font-size: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
