:root {
  --bg: #FFF8EA;
  --panel: #FFFFFF;
  --ink: #3B2A1E;
  --sub: #6F5C4B;
  --line: #E6D8BF;
  --accent: #E8853A;
  --accent-ink: #4A2406;
  --error: #B3341C;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  word-break: keep-all;
}
.wrap { max-width: 480px; margin: 0 auto; padding: 24px 16px 40px; }
h1, h2, legend, .score, .primary { font-family: "Jua", "Malgun Gothic", sans-serif; font-weight: 400; }

.hero { text-align: center; margin-bottom: 20px; }
.hero img { display: block; margin: 0 auto 4px; width: 120px; height: auto; }
.hero h1 { margin: 0; font-size: 38px; line-height: 1.2; }
.hero p { margin: 4px 0 0; color: var(--sub); }

.shared-label { margin: 0 0 14px; font-weight: 700; color: var(--sub); }

.person { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 0 0 14px; }
.person legend { font-size: 22px; padding: 0 6px; }
.field { display: block; margin-bottom: 12px; font-size: 16px; }
.field small { color: var(--sub); font-size: 14px; }
input:not([type]), input[inputmode], .field input, .field select {
  display: block; width: 100%; margin-top: 4px; padding: 12px;
  font: inherit; color: var(--ink); background: #FFFDF8;
  border: 1.5px solid var(--line); border-radius: 10px; min-height: 48px;
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.row { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: block; padding: 9px 18px; min-height: 44px; line-height: 26px; cursor: pointer; }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.seg input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: -3px; }
.leap { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.leap[hidden] { display: none; }
.leap input { width: 20px; height: 20px; }

button { font: inherit; cursor: pointer; border-radius: 12px; min-height: 52px; width: 100%; }
.primary { background: var(--accent); color: var(--accent-ink); border: 0; font-size: 22px; }
.primary:active { transform: translateY(1px); }
.secondary { background: var(--panel); color: var(--ink); border: 1.5px solid var(--line); font-weight: 600; }
.ghost { background: none; border: 0; color: var(--sub); text-decoration: underline; }
.error { color: var(--error); font-weight: 600; margin: 0 0 10px; }
.note { font-size: 14px; color: var(--sub); text-align: center; margin: 10px 0 0; }

.result { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px 16px; text-align: center; }
.couple { display: flex; justify-content: center; gap: 10px; }
.couple figure { margin: 0; flex: 1; max-width: 150px; }
.circle { aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.circle img { width: 74%; height: 74%; object-fit: contain; }
figcaption { font-size: 15px; font-weight: 700; margin-top: 6px; line-height: 1.35; }
figcaption small { display: block; font-weight: 400; color: var(--sub); font-size: 14px; }
.score { margin: 12px 0 0; color: var(--accent-ink); line-height: 1; }
.score strong { font-weight: 400; font-size: 76px; }
.score span { font-size: 28px; margin-left: 2px; }
.result h2 { font-size: 28px; margin: 8px 0 8px; line-height: 1.3; }
.desc { margin: 0 0 18px; }

.bars { margin: 0 0 18px; text-align: left; }
.bars > div { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 8px; margin-bottom: 8px; }
.bars dt { font-size: 15px; font-weight: 600; }
.bars dd { margin: 0; }
.bar { display: block; height: 12px; background: #F3E9D6; border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 6px; transition: width .6s ease; }

.tip { background: #FFF4DF; border-radius: 12px; padding: 12px 14px; text-align: left; margin: 0 0 18px; }
.tip b { display: block; font-size: 15px; color: var(--sub); }
.share { display: grid; gap: 10px; }
.toast { margin: 10px 0 0; font-weight: 600; }
.foot { margin-top: 28px; text-align: center; font-size: 14px; color: var(--sub); }
.foot p { margin: 4px 0; }
.foot a { color: inherit; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { .bar i { transition: none; } }
.kakao { background: #FEE500; color: #191919; border: 0; font-family: "Jua", "Malgun Gothic", sans-serif; font-size: 22px; }

.detail { text-align: left; margin-bottom: 18px; }
.detail section { border-top: 1px solid var(--line); padding: 16px 0 4px; }
.detail h3 { font-family: "Jua", "Malgun Gothic", sans-serif; font-weight: 400; font-size: 21px; margin: 0 0 6px; }
.detail h3 small { font-family: inherit; font-size: 14px; color: var(--sub); margin-left: 4px; }
.detail p { margin: 0 0 12px; }
.person-card { margin-bottom: 14px; }
.person-card b { display: block; font-size: 16px; }
.person-card em { display: block; font-style: normal; color: var(--sub); font-size: 15px; margin-bottom: 2px; }
.ohaeng { width: 100%; border-collapse: collapse; margin: 4px 0 14px; font-size: 15px; text-align: center; }
.ohaeng th, .ohaeng td { border: 1px solid var(--line); padding: 6px 2px; font-weight: 400; }
.ohaeng thead th { background: #FFF4DF; }
.ohaeng tbody th { font-weight: 700; word-break: break-all; }
