:root {
  --bg: #f6f7f4;
  --panel: #ffffff;
  --line: #e2e5df;
  --text: #17201b;
  --muted: #66706a;
  --brand: #0f3d2e;
  --accent: #f5c542;
  --l4: #e5372b;
  --l3: #f08a00;
  --l2: #e0b400;
  --l1: #2f9e5b;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1311; --panel: #161d1a; --line: #27312c; --text: #e7ece9; --muted: #95a19a; --brand: #7fd3a8; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); word-break: keep-all; overflow-wrap: anywhere;
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }
.muted { color: var(--muted); }
main { max-width: 760px; margin: 0 auto; padding: 0 16px; }

.top { display: flex; align-items: center; justify-content: space-between; max-width: 760px; margin: 0 auto; padding: 12px 16px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; text-decoration: none; color: var(--text); }
.logo { width: 22px; height: 22px; border-radius: 6px; background: #0f3d2e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 7l8 3.5v5.5c0 4.5-3.4 8-8 10-4.6-2-8-5.5-8-10v-5.5z' fill='%23f5c542'/%3E%3C/svg%3E") center/cover; }
.toplink { font-size: 14px; font-weight: 700; text-decoration: none; padding: 6px 12px; border-radius: 999px; background: var(--accent); color: #1d1a00; }

.crumb { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.crumb a { color: var(--muted); }
.hero { padding: 14px 0 6px; }
.hero h1 { font-size: 28px; letter-spacing: -.02em; }
.hero.home h1 { font-size: 30px; }
.lead { font-size: 17px; margin: 0 0 8px; }
.meta { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.share { font: inherit; font-size: 13px; font-weight: 700; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 999px; padding: 4px 12px; cursor: pointer; }

.answer { background: var(--panel); border: 2px solid var(--brand); border-radius: var(--radius); padding: 18px; margin: 14px 0 6px; }
.answer h2 { font-size: 21px; }
.answer h3 { font-size: 17px; margin-top: 14px; }
.sec { margin: 30px 0; }
.sec h2 { font-size: 21px; }
ol.big { padding-left: 1.4em; margin: 0; }
ol.big li { margin: 0 0 8px; font-size: 17px; }
.tip { background: rgba(245,197,66,.18); border-radius: 10px; padding: 10px 12px; margin: 12px 0 0; font-size: 15px; }
.steps { padding-left: 1.4em; } .steps li { margin-bottom: 8px; }
ul.check, ul.dont { list-style: none; padding: 0; margin: 0; }
ul.check li, ul.dont li { position: relative; padding: 0 0 8px 26px; }
ul.check li::before { content: "✓"; position: absolute; left: 0; color: var(--l1); font-weight: 900; }
ul.dont li::before { content: "✕"; position: absolute; left: 0; color: var(--l4); font-weight: 900; }

.places { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.place, .box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.place h3, .box h3 { font-size: 16px; } .place p, .box p { margin: 0; font-size: 15px; }
.two { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
a.box { text-decoration: none; color: var(--text); display: block; }
.box.l4 { border-left: 6px solid var(--l4); } .box.l2 { border-left: 6px solid var(--l2); }
.box small { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 6px; }

.tbl { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; background: var(--panel); border-radius: 10px; overflow: hidden; }
th, td { border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: top; }
thead th { background: var(--brand); color: #fff; font-size: 13px; }
@media (prefers-color-scheme: dark) { thead th { color: #0e1311; } }
.lv { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.lv.l4 { background: var(--l4); } .lv.l3 { background: var(--l3); } .lv.l2 { background: var(--l2); } .lv.l1 { background: var(--l1); }

.btn { display: inline-block; font: inherit; font-weight: 700; font-size: 15px; border: 0; border-radius: 12px; padding: 11px 16px; background: var(--brand); color: #fff; text-decoration: none; cursor: pointer; }
@media (prefers-color-scheme: dark) { .btn { color: #0e1311; } }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.wide { width: 100%; margin-top: 12px; padding: 14px; font-size: 17px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.gcards { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.gcard { display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-decoration: none; color: var(--text); }
.gcard b { font-size: 15px; } .gcard .muted { font-size: 13px; } .gi { font-size: 22px; }

/* 체크리스트 */
.prog { position: sticky; top: 0; z-index: 2; background: var(--panel); padding: 8px 0; }
.prog p { margin: 4px 0 0; font-size: 14px; }
.bar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--l1); transition: width .25s; }
.grp { border: 0; padding: 0; margin: 14px 0 0; }
.grp legend { font-weight: 800; font-size: 16px; margin-bottom: 4px; }
.ck { display: flex; gap: 10px; align-items: flex-start; padding: 9px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.ck input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--l1); flex: none; }
.ck span { display: flex; flex-direction: column; }
.ck small { color: var(--muted); font-size: 13px; }
.ck input:checked + span b { text-decoration: line-through; color: var(--muted); }

/* 퀴즈 */
.qs { list-style: none; padding: 0; margin: 12px 0 0; }
.q { padding: 10px 0; border-bottom: 1px solid var(--line); }
.q p { margin: 0 0 6px; font-weight: 600; }
.q.miss p { color: var(--l4); }
.opts { display: flex; gap: 6px; }
.opts label { flex: 1; }
.opts input { position: absolute; opacity: 0; }
.opts span { display: block; text-align: center; padding: 8px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; font-size: 15px; }
.opts input:checked + span { background: var(--brand); color: #fff; border-color: var(--brand); }
@media (prefers-color-scheme: dark) { .opts input:checked + span { color: #0e1311; } }
.result { text-align: center; padding: 10px 0 0; }
.result .big { font-size: 64px; font-weight: 900; color: var(--brand); line-height: 1; }
.result ul { text-align: left; }

/* 가족 카드 */
.fam { display: grid; gap: 8px; }
.fam .people { display: grid; gap: 6px; }
.fam .p { display: grid; grid-template-columns: 1fr 1.3fr; gap: 6px; }
.fam label { display: grid; gap: 4px; font-size: 14px; font-weight: 700; }
.fam input { font: inherit; font-size: 16px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); width: 100%; min-width: 0; }
#famcard { width: 100%; max-width: 420px; height: auto; display: block; margin: 14px auto 0; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,.12); }

.qa { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.qa summary { font-weight: 700; cursor: pointer; }
.qa p { margin: 8px 0 0; }
.src ul { padding-left: 1.2em; font-size: 14px; } .src p { font-size: 13px; }

.foot { max-width: 760px; margin: 40px auto 0; padding: 20px 16px 40px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 10px; }
.foot-nav a { color: var(--text); text-decoration: none; font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #17201b; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 9; }

@media print {
  .top, .foot, .share, .row, .crumb, .sec:not(#maker):not(.print), .meta, .prog .muted { display: none !important; }
  .answer { border: 0; padding: 0; }
  body { background: #fff; }
}
