:root {
  --paper: #f4f0e7;
  --paper-deep: #e8e0d2;
  --ink: #17382f;
  --muted: #66766f;
  --sage: #b9c9ad;
  --leaf: #285d4b;
  --accent: #df6d4f;
  --white: #fffdf8;
  --line: rgba(23, 56, 47, .14);
  --shadow: 0 20px 60px rgba(34, 61, 51, .12);
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 5%, rgba(185, 201, 173, .6), transparent 32rem),
    radial-gradient(circle at -10% 92%, rgba(223, 109, 79, .12), transparent 28rem),
    var(--paper);
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  word-break: keep-all;
}

button, input, textarea { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.grain { position: fixed; inset: 0; pointer-events: none; opacity: .22; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.14'/%3E%3C/svg%3E"); }
.shell { width: min(100%, 520px); min-height: 100svh; margin: auto; padding: max(28px, env(safe-area-inset-top)) 22px max(32px, env(safe-area-inset-bottom)); position: relative; }

.brand-mark { display: flex; gap: 5px; align-items: end; height: 38px; margin-bottom: 42px; }
.brand-mark span { display: block; width: 22px; height: 34px; border-radius: 20px 20px 4px 20px; background: var(--leaf); transform: rotate(-24deg); transform-origin: bottom; }
.brand-mark span:last-child { height: 26px; background: var(--accent); border-radius: 20px 20px 20px 4px; transform: rotate(31deg); }
.eyebrow { margin: 0 0 15px; color: var(--leaf); font-size: 13px; font-weight: 800; letter-spacing: .08em; }
.welcome h1 { margin: 0; font-family: "Iropke Batang", "AppleMyungjo", serif; font-size: clamp(43px, 12vw, 64px); line-height: 1.13; letter-spacing: -.065em; font-weight: 600; }
.welcome h1 em { color: var(--accent); font-style: normal; position: relative; }
.welcome h1 em::after { content: ""; position: absolute; height: 8px; left: 1px; right: -4px; bottom: 0; z-index: -1; background: rgba(223, 109, 79, .2); border-radius: 100%; transform: rotate(-1deg); }
.lead { margin: 28px 0; color: var(--muted); font-size: 16px; line-height: 1.8; }
.notice-list { display: grid; grid-template-columns: repeat(3, 1fr); padding: 18px 0; border-block: 1px solid var(--line); }
.notice-list div { display: flex; flex-direction: column; gap: 5px; padding: 0 11px; border-right: 1px solid var(--line); }
.notice-list div:first-child { padding-left: 0; }
.notice-list div:last-child { border: 0; }
.notice-list b { font-family: "AppleMyungjo", serif; font-size: 17px; }
.notice-list span { font-size: 11px; color: var(--muted); }
.privacy-note { display: flex; gap: 11px; align-items: flex-start; margin: 22px 0 25px; padding: 15px; border-radius: 14px; background: rgba(255, 253, 248, .58); color: var(--muted); font-size: 12px; line-height: 1.65; }
.lock { flex: 0 0 15px; height: 13px; border: 2px solid var(--leaf); border-radius: 3px; margin-top: 5px; position: relative; }
.lock::before { content: ""; position: absolute; width: 7px; height: 7px; left: 2px; top: -8px; border: 2px solid var(--leaf); border-bottom: 0; border-radius: 7px 7px 0 0; }
.primary { width: 100%; min-height: 58px; border: 0; border-radius: 18px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; background: var(--ink); color: var(--white); font-weight: 800; box-shadow: 0 12px 30px rgba(23, 56, 47, .2); cursor: pointer; }
.primary span { font-size: 20px; }
.primary:disabled { opacity: .55; cursor: wait; }

.survey { min-height: calc(100svh - 60px); display: flex; flex-direction: column; }
.survey-header { display: flex; gap: 15px; align-items: center; position: sticky; top: 0; z-index: 3; padding: 8px 0 18px; background: linear-gradient(var(--paper) 72%, transparent); }
.icon-button { flex: 0 0 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.4); font-size: 20px; cursor: pointer; }
.icon-button:disabled { opacity: .25; }
.progress-wrap { flex: 1; }
.progress-meta { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 700; }
.progress-track { height: 4px; overflow: hidden; border-radius: 5px; background: var(--paper-deep); }
.progress-track div { height: 100%; border-radius: inherit; background: var(--accent); transition: width .35s ease; }
.question-card { flex: 1; padding: 22px 2px 35px; }
.section-intro { margin: 0 0 36px; padding: 20px; border: 1px solid rgba(40, 93, 75, .15); border-radius: 4px 22px 22px 22px; background: rgba(185, 201, 173, .26); }
.section-intro.urgent { background: rgba(223, 109, 79, .10); border-color: rgba(223, 109, 79, .25); }
.section-intro b { display: block; margin-bottom: 8px; font-family: "AppleMyungjo", serif; font-size: 18px; }
.section-intro p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.question-count { margin: 0 0 14px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .05em; }
.question-card h2 { margin: 0 0 28px; font-family: "Iropke Batang", "AppleMyungjo", serif; font-size: clamp(25px, 7vw, 32px); line-height: 1.48; letter-spacing: -.035em; }
.choices { display: grid; gap: 10px; }
.choice { width: 100%; min-height: 58px; display: flex; gap: 13px; align-items: center; text-align: left; padding: 15px 17px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 253, 248, .72); cursor: pointer; transition: .18s ease; }
.choice.selected { border-color: var(--leaf); background: var(--ink); color: var(--white); transform: translateX(4px); box-shadow: var(--shadow); }
.choice-dot { flex: 0 0 19px; height: 19px; border: 1.5px solid currentColor; border-radius: 50%; position: relative; opacity: .65; }
.choice.selected .choice-dot::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--accent); }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 16px; outline: 0; padding: 17px; background: rgba(255, 253, 248, .8); color: var(--ink); font-size: 16px; transition: .2s; }
input { min-height: 59px; }
textarea { resize: vertical; line-height: 1.65; }
input:focus, textarea:focus { border-color: var(--leaf); box-shadow: 0 0 0 4px rgba(40, 93, 75, .09); background: var(--white); }
.detail-label { display: block; margin: 24px 0 9px; font-size: 13px; font-weight: 700; }
.detail-label span { color: var(--muted); font-weight: 400; }
.survey-footer { padding-top: 12px; }
.error { min-height: 20px; margin: 0 0 8px; color: #a3382f; font-size: 13px; }

.done { padding-top: 10vh; text-align: center; }
.completion-ring { width: 82px; height: 82px; display: grid; place-items: center; margin: 0 auto 32px; border: 1px solid var(--leaf); border-radius: 50% 50% 48% 52%; box-shadow: inset 0 0 0 8px rgba(185, 201, 173, .4); transform: rotate(-4deg); }
.completion-ring span { font-size: 32px; transform: rotate(4deg); }
.done h2 { margin: 0 0 20px; font-family: "Iropke Batang", "AppleMyungjo", serif; font-size: 42px; line-height: 1.25; letter-spacing: -.05em; }
.done > p { color: var(--muted); line-height: 1.7; }
.review-alert { margin-top: 28px; padding: 20px; border: 1px solid rgba(163,56,47,.25); border-radius: 18px; background: rgba(223,109,79,.1); text-align: left; color: #6f3028; font-size: 13px; line-height: 1.65; }
.review-alert b { display: block; margin-bottom: 7px; font-size: 15px; }
.receipt { margin-top: 24px; font-family: ui-monospace, monospace; font-size: 11px; }
.result-shell h1 { font-family: "Iropke Batang", "AppleMyungjo", serif; font-size: 38px; line-height: 1.35; letter-spacing: -.05em; }
.result-domains { display: grid; gap: 12px; margin: 28px 0; }
.domain-card { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,253,248,.75); }
.domain-card > div { display:flex; justify-content:space-between; gap:14px; align-items:center; }.domain-card b { font-size:16px; }.domain-card span { font-size:11px; font-weight:800; color:var(--leaf); padding:5px 8px; background:rgba(185,201,173,.35); border-radius:99px; }.domain-card.review span { color:#943e31; background:rgba(223,109,79,.13); }.domain-card p { margin:11px 0 0; color:var(--muted); font-size:13px; line-height:1.65; }.result-footnote { color:var(--muted); font-size:12px; line-height:1.6; text-align:center; margin:20px 8px; }

.page-enter { animation: rise .7s cubic-bezier(.2,.8,.2,1) both; }
.card-enter { animation: questionIn .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes questionIn { from { opacity: 0; transform: translateX(10px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Admin */
.admin-shell { width: min(1120px, calc(100% - 32px)); margin: auto; padding: 42px 0; }
.admin-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 28px; }
.admin-head h1 { margin: 0; font-family: "AppleMyungjo", serif; font-size: 38px; }
.admin-head p { margin: 7px 0 0; color: var(--muted); }
.admin-actions { display: flex; gap: 10px; }
.small-button { min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); cursor: pointer; font-weight: 700; }
.login-card { max-width: 430px; margin: 13vh auto; padding: 30px; border-radius: 26px; background: var(--white); box-shadow: var(--shadow); }
.login-card h1 { font-family: "AppleMyungjo", serif; }
.login-card .primary { margin-top: 13px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.summary-box { padding: 18px; border-radius: 18px; background: rgba(255,253,248,.75); border: 1px solid var(--line); }
.summary-box b { display: block; font-family: "AppleMyungjo", serif; font-size: 30px; }
.summary-box span { color: var(--muted); font-size: 12px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,253,248,.75); }
table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
th, td { padding: 14px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 11px; }
tr:last-child td { border: 0; }
.flag { display: inline-block; padding: 4px 8px; border-radius: 20px; background: rgba(223,109,79,.13); color: #943e31; font-size: 11px; font-weight: 800; }
.ok { background: rgba(185,201,173,.35); color: var(--leaf); }
@media (max-width: 700px) { .admin-head { align-items: flex-start; flex-direction: column; } .summary-grid { grid-template-columns: 1fr; } }
