/* 백자와 청화 — 흰 바탕에 청화 푸름, 붉은 도장은 한 곳에만 */
:root {
  --bg: #F4F3EF;
  --surface: #FFFFFF;
  --surface-2: #FAFAF8;
  --ink: #16181D;
  --ink-2: #3A4049;
  --muted: #5C6370;
  --line: #E1E0DA;
  --line-strong: #C9CCD2;
  --accent: #24406E;
  --accent-soft: #EDF1F7;
  --accent-line: #C9D2E0;
  --seal: #9E3B2E;
  --good: #2E7D5B;
  --good-soft: #EAF3EE;
  --warn: #8A6A14;
  --warn-soft: #FDF8EE;
  --bad: #B33A2B;
  --bad-soft: #FBEEEC;
  --mok: #2E7D5B;
  --hwa: #B33A2B;
  --to: #A97A21;
  --geum: #6A7180;
  --su: #24406E;
  --mok-soft: #EAF3EE;
  --hwa-soft: #FBEEEC;
  --to-soft: #FAF3E4;
  --geum-soft: #F0F1F3;
  --su-soft: #EDF1F7;
  --chart-line: #24406E;
  --chart-grid: #E1E0DA;
  --display: "Noto Serif KR", "Apple SD Gothic Neo", "Malgun Gothic", serif;
  --body: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --r: 4px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161A; --surface: #1B1E24; --surface-2: #21252C;
    --ink: #ECEAE4; --ink-2: #C8CCD4; --muted: #99A1AE;
    --line: #2A2F38; --line-strong: #3C424D;
    --accent: #8FB0DE; --accent-soft: #1D2735; --accent-line: #33435C;
    --seal: #C4584A;
    --good: #7CC19A; --good-soft: #17281F;
    --warn: #D6AE5C; --warn-soft: #2B2417;
    --bad: #E08476; --bad-soft: #2E1D1A;
    --mok: #7CC19A; --hwa: #E08476; --to: #D6AE5C; --geum: #A7AEBA; --su: #8FB0DE;
    --mok-soft: #17281F; --hwa-soft: #2E1D1A; --to-soft: #2B2417; --geum-soft: #23272E; --su-soft: #1D2735;
    --chart-line: #8FB0DE; --chart-grid: #2A2F38;
  }
}
:root[data-theme="dark"] {
  --bg: #14161A; --surface: #1B1E24; --surface-2: #21252C;
  --ink: #ECEAE4; --ink-2: #C8CCD4; --muted: #99A1AE;
  --line: #2A2F38; --line-strong: #3C424D;
  --accent: #8FB0DE; --accent-soft: #1D2735; --accent-line: #33435C;
  --seal: #C4584A;
  --good: #7CC19A; --good-soft: #17281F;
  --warn: #D6AE5C; --warn-soft: #2B2417;
  --bad: #E08476; --bad-soft: #2E1D1A;
  --mok: #7CC19A; --hwa: #E08476; --to: #D6AE5C; --geum: #A7AEBA; --su: #8FB0DE;
  --mok-soft: #17281F; --hwa-soft: #2E1D1A; --to-soft: #2B2417; --geum-soft: #23272E; --su-soft: #1D2735;
  --chart-line: #8FB0DE; --chart-grid: #2A2F38;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { max-width: 100%; overflow-x: hidden; }
img, svg, table { max-width: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 15px; line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3, h4, .han { font-family: var(--display); }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; letter-spacing: -0.015em; }
p { margin: 0; }
a { color: var(--accent); }

.wrap { max-width: 1240px; margin: 0 auto; padding-inline: 18px; padding-block: 0 72px; }

/* 머리말 */
.masthead {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px;
  padding-block: 28px 16px; border-bottom: 1px solid var(--line);
}
.seal {
  width: 30px; height: 30px; flex: none; background: var(--seal);
  color: #FFFFFF; font-family: var(--display); font-size: 17px; font-weight: 900;
  display: grid; place-items: center;
}
.masthead h1 { font-size: clamp(21px, 3.6vw, 27px); font-weight: 700; line-height: 1.3; }
.masthead p { margin-top: 5px; color: var(--muted); font-size: 13px; max-width: 58ch; line-height: 1.75; }
.masthead .right { margin-left: auto; display: flex; gap: 8px; }

.cols { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 32px; align-items: start; margin-top: 26px; }
@media (max-width: 980px) { .cols { grid-template-columns: 1fr; gap: 22px; } }

.rail {
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + 14px);
  max-height: calc(100vh - env(safe-area-inset-top, 0px) - 28px);
  overflow-y: auto; overscroll-behavior: contain;
  display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line);
}
@media (max-width: 980px) { .rail { position: static; max-height: none; overflow: visible; } }

.panel { background: var(--surface); padding: 20px; }
.panel > h2 {
  font-family: var(--display); font-size: 15px; font-weight: 700; color: var(--ink);
  margin-bottom: 16px; letter-spacing: -0.01em;
}
.stack { display: grid; gap: 14px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

label.field { display: grid; gap: 6px; font-size: 11.5px; color: var(--muted); font-weight: 400; }
input[type="text"], input[type="date"], input[type="time"], input[type="search"], input[type="number"], select {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--bg);
  border: 0; border-bottom: 1.5px solid var(--accent-line); border-radius: 0;
  padding: 9px 2px; appearance: none; min-height: 40px;
}
input:hover, select:hover { border-bottom-color: var(--accent); }
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 12px) 52%, calc(100% - 7px) 52%; background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat; padding-right: 24px;
}
input:focus-visible, select:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.seg { display: flex; border: 1px solid var(--line-strong); }
.seg button { flex: 1; font: inherit; font-size: 13.5px; padding: 9px 4px; border: 0; cursor: pointer; background: var(--surface); color: var(--muted); min-height: 40px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: #FFFFFF; font-weight: 700; }
.btn {
  font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; border: 1px solid var(--accent-line);
  background: var(--surface); color: var(--accent); border-radius: var(--r); padding: 9px 14px; min-height: 40px;
}
.btn:hover { background: var(--accent-soft); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; min-height: 34px; }
.hanja-pick { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 10px; align-items: end; }
.hint { font-size: 11.5px; color: var(--muted); line-height: 1.7; }

/* 기준 설명 */
.tip { position: relative; display: inline-flex; }
.tip > .tip-btn {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted);
  width: 17px; height: 17px; border-radius: 50%; font-size: 10px; line-height: 1; cursor: help;
  display: grid; place-items: center; padding: 0; font-family: var(--body); font-weight: 700;
}
.tip > .tip-body {
  position: absolute; z-index: 20; left: 0; top: calc(100% + 7px);
  width: min(300px, calc(100vw - 48px)); max-width: calc(100vw - 48px);
  background: var(--ink); color: var(--bg); font-size: 12px; line-height: 1.7; font-weight: 400;
  padding: 12px 14px; border-radius: var(--r);
  opacity: 0; visibility: hidden; transition: opacity .12s ease;
}
.tip:hover > .tip-body, .tip:focus-within > .tip-body { opacity: 1; visibility: visible; }
.tip-body b { color: #E8B4A8; }
.usage { display: grid; gap: 5px; margin-top: 9px; }
.usage-row { display: grid; grid-template-columns: 74px 1fr; gap: 8px; align-items: center; font-size: 11px; }
.usage-bar { height: 5px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.usage-bar > i { display: block; height: 100%; background: currentColor; }

/* 결과 */
.results { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.card { background: var(--surface); }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 18px 22px 0; }
.card-head h2 { font-size: 17px; font-weight: 700; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-head .spacer { margin-left: auto; }
.card-body { padding: 16px 22px 24px; }

/* 이름 머리 */
.headline { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 20px; }
.headline .full-han { font-family: var(--display); font-size: clamp(34px, 7vw, 46px); font-weight: 900; letter-spacing: 0.07em; line-height: 1.15; color: var(--accent); }
.headline .full-kor { font-size: 15px; color: var(--muted); letter-spacing: 0.12em; margin-top: 8px; }
.scores { margin-left: auto; display: flex; gap: 10px; }
.score { width: 62px; height: 62px; display: grid; place-content: center; text-align: center; gap: 2px; border: 1px solid var(--line); }
.score b { font-family: var(--display); font-size: 21px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.score span { font-size: 9px; letter-spacing: 0.1em; color: var(--muted); }
.scores .score:first-child { background: var(--seal); border-color: var(--seal); }
.scores .score:first-child b, .scores .score:first-child span { color: #FFFFFF; }

.saju-line {
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line);
  font-family: var(--display); font-size: clamp(17px, 3.2vw, 21px); font-weight: 700; letter-spacing: 0.02em;
}
.saju-line small { display: block; font-family: var(--body); font-size: 11.5px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-top: 6px; line-height: 1.7; }

/* 사주 표 (만세력) */
.pillars { width: 100%; border-collapse: collapse; margin-top: 16px; table-layout: fixed; }
.pillars th {
  font-family: var(--body); font-size: 10.5px; font-weight: 400; letter-spacing: 0.1em;
  color: var(--muted); text-align: center; border: 1px solid var(--line); padding: 7px 0; background: var(--surface-2);
}
.pillars td { border: 1px solid var(--line); text-align: center; padding: 0; white-space: normal; }
.pillars .gan {
  font-family: var(--display); font-size: clamp(22px, 5vw, 28px); font-weight: 700; line-height: 1.2; padding: 9px 0 6px;
}
.pillars .gan small { display: block; font-family: var(--body); font-size: 9.5px; font-weight: 400; letter-spacing: 0.03em; opacity: .85; padding-bottom: 3px; }
.pillars .hidden-row td { font-size: 9.5px; color: var(--muted); padding: 5px 2px; background: var(--surface-2); line-height: 1.5; }
.pillars .root-row td { font-size: 9.5px; color: var(--muted); padding: 5px 2px; line-height: 1.5; }
.pillars .root-row .no-root { color: var(--bad); }

/* 오행 한 줄 막대 */
.element-bar { display: flex; gap: 2px; height: 38px; margin-top: 18px; }
.element-bar > div {
  display: grid; place-content: center; text-align: center; color: #FFFFFF;
  font-family: var(--display); font-size: 13px; font-weight: 700; min-width: 0; overflow: hidden;
}
.element-bar .none { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--line-strong); }
.element-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.element-legend b { font-family: var(--display); font-weight: 700; }
.element-legend .season { color: var(--accent); font-weight: 700; }
.bg-목 { background: var(--mok); } .bg-화 { background: var(--hwa); }
.bg-토 { background: var(--to); } .bg-금 { background: var(--geum); } .bg-수 { background: var(--su); }
.el-목 { color: var(--mok); } .el-화 { color: var(--hwa); } .el-토 { color: var(--to); }
.el-금 { color: var(--geum); } .el-수 { color: var(--su); }
.chip { padding: 2px 8px; font-family: var(--display); font-weight: 700; border: 1px solid currentColor; }

/* 풀이 */
.advice { display: grid; gap: 18px; }
.advice-item { padding-left: 16px; border-left: 2px solid var(--accent); }
.advice-item h3 { font-size: 15px; margin-bottom: 6px; }
.advice-item p { font-size: 13.5px; color: var(--ink-2); line-height: 1.85; }
.flow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; font-family: var(--display); font-weight: 700; font-size: 14px; }
.flow .node { padding: 4px 12px; border: 1px solid currentColor; }
.flow .arrow { color: var(--muted); font-family: var(--body); font-size: 11.5px; font-weight: 400; }

/* 여섯 가지 검사 */
.checks { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 620px) { .checks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.check { background: var(--surface); padding: 14px 16px; display: grid; gap: 8px; align-content: start; }
.check-top { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.check-top h3 { font-family: var(--body); font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.pill { font-size: 11px; font-weight: 700; padding: 3px 9px; white-space: nowrap; border: 1px solid currentColor; }
.pill.good { color: var(--good); background: var(--good-soft); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }
.pill.bad { color: var(--bad); background: var(--bad-soft); }
.chain { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.chain b { font-family: var(--display); font-size: 14px; }
.chain .rel { font-size: 11px; color: var(--muted); }
.chain .rel.x { color: var(--bad); font-weight: 700; }
.check p { font-size: 12.5px; color: var(--muted); line-height: 1.75; }

/* 사격 풀이 */
.suri-list { display: grid; }
.suri-item { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.suri-item:last-child { border-bottom: 0; padding-bottom: 0; }
.suri-num { text-align: center; }
.suri-num b { display: block; font-family: var(--display); font-size: 32px; font-weight: 900; line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.suri-num span { font-size: 10.5px; color: var(--muted); line-height: 1.6; display: block; margin-top: 4px; }
.suri-main h3 { font-size: 15.5px; display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.suri-main p { font-size: 13.5px; color: var(--ink-2); margin-top: 7px; line-height: 1.85; }
@media (max-width: 560px) {
  .suri-item { grid-template-columns: 1fr; gap: 8px; }
  .suri-num { text-align: left; display: flex; align-items: baseline; gap: 10px; }
  .suri-num span { margin-top: 0; }
}

/* 표 */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 10.5px; letter-spacing: 0.08em; color: var(--muted); font-weight: 400; background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; }
.han-sm { font-family: var(--display); font-weight: 700; font-size: 15px; }
tr.is-current { background: var(--accent-soft); }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--surface-2); }
.mini { font-size: 11px; color: var(--muted); line-height: 1.6; }

.opts { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 16px; }
.opts label { display: flex; gap: 7px; align-items: center; font-size: 12.5px; color: var(--ink-2); cursor: pointer; min-height: 30px; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.empty { color: var(--muted); font-size: 13px; padding: 14px 0; line-height: 1.75; }

/* 인기 순위 */
.rank-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px; }
.rank-hero { border-left: 2px solid var(--seal); padding-left: 16px; }
.rank-hero .lab { font-size: 11px; letter-spacing: 0.1em; color: var(--muted); }
.rank-hero b { font-family: var(--display); font-size: 32px; font-weight: 900; line-height: 1.25; display: block; font-variant-numeric: tabular-nums; }
.rank-hero p { font-size: 12.5px; color: var(--muted); margin-top: 5px; line-height: 1.7; }
.chart-figure { margin: 0; }
.chart-figure figcaption { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.chart-figure svg { width: 100%; height: auto; display: block; overflow: visible; }
.rank-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 24px; margin-top: 24px; }
.rank-list h4 { font-size: 13.5px; font-family: var(--body); font-weight: 700; margin-bottom: 10px; }
.rank-row { display: grid; grid-template-columns: 24px 1fr 52px; gap: 10px; align-items: center; font-size: 13px; padding: 4px 0; }
.rank-row .r { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; }
.rank-row .n { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rank-row .n i { display: block; height: 6px; background: var(--accent); opacity: .35; }
.rank-row.me .n b { color: var(--seal); }
.rank-row.me .n i { background: var(--seal); opacity: .6; }
.rank-row .c { text-align: right; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 한자 찾아보기 */
.explorer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); max-height: 430px; overflow-y: auto; }
.hanja-card {
  background: var(--surface); padding: 10px 12px; display: grid; grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px; align-items: center; cursor: pointer; text-align: left; font: inherit; color: inherit; border: 0; min-height: 52px;
}
.hanja-card:hover { background: var(--accent-soft); }
.hanja-card .c { font-family: var(--display); font-size: 24px; font-weight: 700; text-align: center; }
.hanja-card .m { font-size: 11.5px; line-height: 1.5; min-width: 0; }
.hanja-card .m b { display: block; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hanja-card .m span { color: var(--muted); font-size: 10.5px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 16px; }
.filters label.field { width: 116px; }


/* 이름 뜻 */
.blessing { padding-left: 18px; border-left: 2px solid var(--seal); margin-bottom: 22px; }
.blessing h3 { font-family: var(--display); font-size: clamp(20px, 4vw, 26px); font-weight: 700; line-height: 1.5; }
.blessing p { margin-top: 8px; font-size: 14px; color: var(--ink-2); line-height: 1.85; }
.reading-parts { display: grid; gap: 12px; }
.reading-part { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 14px; align-items: start; }
.reading-part .han-sm { font-size: 26px; text-align: center; line-height: 1.2; }
.reading-part p { font-size: 13.5px; color: var(--ink-2); line-height: 1.8; }
.reading-sum { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-family: var(--display); font-size: 15px; line-height: 1.8; }
.ask-wrap { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 10px; justify-items: start; }
.ask-out { font-size: 13.5px; line-height: 1.9; color: var(--ink-2); white-space: pre-wrap; background: var(--surface-2); padding: 16px 18px; width: 100%; border-left: 2px solid var(--accent-line); }

.bless { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-family: var(--display); font-size: 15px; line-height: 1.8; color: var(--ink-2); }

.footnote { margin-top: 26px; padding: 18px 20px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; color: var(--muted); line-height: 1.8; }
.footnote b { color: var(--ink-2); }
.footnote ul { margin: 10px 0 0; padding-left: 18px; }
.footnote li { margin-bottom: 5px; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
  background: var(--ink); color: var(--bg); font-size: 13px; padding: 10px 18px; border-radius: var(--r); z-index: 40;
}
[hidden] { display: none !important; }
@media (prefers-reduced-motion: no-preference) {
  .element-bar > div { transition: flex-basis .35s ease; }
}


/* 폭이 좁은 화면에서 요소가 화면 밖으로 밀려나지 않게 */
.wrap, .cols, .rail, .panel, .results, .card, .card-body, .check, .suri-main,
.rank-top, .rank-list, .reading-part, .headline > div { min-width: 0; }

@media (max-width: 480px) {
  .wrap { padding-inline: 14px; }
  .masthead { padding-block: 20px 14px; gap: 10px 14px; }
  .masthead h1 { font-size: 21px; }
  .masthead p { font-size: 12.5px; }
  .masthead .right { margin-left: 0; width: 100%; }
  .masthead .right .btn { flex: 1; }
  .card-head { padding: 16px 16px 0; }
  .card-body { padding: 14px 16px 20px; }
  .panel { padding: 16px; }
  .headline { gap: 12px; }
  .headline .full-han { font-size: 36px; }
  .scores { margin-left: 0; }
  .filters label.field { width: calc(50% - 6px); }
  .filters .btn { flex: 1; }
  .pillars .gan { font-size: 22px; }
  .rank-lists { gap: 20px; }
}

/* 인쇄와 PDF 저장 — 한 장짜리 작명 기록 */
#printSheet { display: none; }
#sheetBar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--ink); color: var(--bg); font-size: 12.5px;
}
#sheetBar b { color: #F0B8A8; }
#sheetBar span { flex-grow: 1; min-width: 160px; line-height: 1.6; }
#sheetBar .btn { flex: none; }
@media (max-width: 560px) {
  #sheetBar { gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); }
  #sheetBar span { width: 100%; flex-basis: 100%; font-size: 12px; }
  #sheetBar .btn { flex: 1 1 0; min-width: 0; padding: 10px 6px; font-size: 12.5px; }
}
#sheetBar .btn { background: transparent; color: var(--bg); border-color: var(--bg); }
#sheetBar .btn:disabled { opacity: 0.45; cursor: progress; }

/* 다운로드가 막힌 곳에서 길게 눌러 저장하는 미리보기 */
#sheetPreview {
  position: fixed; inset: 0; z-index: 80; overflow-y: auto;
  background: rgba(10, 10, 12, 0.92); color: #FFFFFF;
  padding: 14px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}
#sheetPreview .pv-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
#sheetPreview .pv-head p { flex: 1 1 100%; margin: 0; font-size: 13.5px; line-height: 1.6; }
#sheetPreview .pv-head .btn { background: transparent; color: #FFFFFF; border-color: #FFFFFF; text-decoration: none; }
#sheetPreview img {
  display: block; width: 100%; max-width: 720px; height: auto; margin: 0 auto;
  background: #FFFFFF; -webkit-touch-callout: default; user-select: auto;
}

body.sheet-view { background: #2E3036; }
body.sheet-view > .wrap { display: none; }

/* ---------- 명명서 (화면·그림·PDF 공통) ---------- */
body.sheet-view #printSheet {
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  padding: 22px 0 150px;
}
#printSheet .sp {
  zoom: var(--sz, 1);
  position: relative; flex: none; width: 720px; height: 1018px; overflow: hidden;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; line-height: 1.6;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .45);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
#printSheet :where(h2, h3, p) { margin: 0; }
#printSheet th, #printSheet td { letter-spacing: 0; white-space: normal; }
#printSheet .serif { font-family: "Noto Serif KR", serif; }

/* 1쪽 표지 */
.sp-cover { background: linear-gradient(165deg, #2C3862 0%, #1D2446 52%, #141A33 100%); color: #EADFC3; }
.cv-frame {
  position: absolute; inset: 34px; border: 1.5px solid #C9A96A;
  display: flex; flex-direction: column; align-items: center; text-align: center; padding: 84px 56px 44px;
}
.cv-frame::before { content: ""; position: absolute; inset: 9px; border: 1px solid rgba(201, 169, 106, .45); pointer-events: none; }
.cv-corner { position: absolute; width: 16px; height: 16px; background: #1D2446; border: 1.5px solid #C9A96A; transform: rotate(45deg); }
.cv-corner.c1 { top: -9px; left: -9px; } .cv-corner.c2 { top: -9px; right: -9px; }
.cv-corner.c3 { bottom: -9px; left: -9px; } .cv-corner.c4 { bottom: -9px; right: -9px; }
.cv-kicker { font-size: 13px; letter-spacing: .35em; color: #C9A96A; }
.cv-title { font-family: "Noto Serif KR", serif; font-weight: 900; font-size: 56px; letter-spacing: .4em; padding-left: .4em; margin-top: 22px; color: #E6CF98; line-height: 1.2; }
.cv-knot { display: flex; align-items: center; gap: 10px; margin-top: 22px; }
.cv-knot i { display: block; width: 88px; height: 1.5px; background: #C9A96A; }
.cv-knot b { display: block; width: 11px; height: 11px; border: 1.5px solid #C9A96A; transform: rotate(45deg); }
.cv-han { font-family: "Noto Serif KR", serif; font-weight: 900; font-size: 108px; letter-spacing: .1em; padding-left: .1em; line-height: 1.15; color: #FFFFFF; margin-top: 74px; text-shadow: 0 4px 24px rgba(0, 0, 0, .35); }
.cv-han.long { font-size: 78px; }
.cv-han.kor-only { font-size: 88px; }
.cv-kor { font-size: 21px; letter-spacing: .75em; padding-left: .75em; color: #EADFC3; margin-top: 16px; }
.cv-bless { font-family: "Noto Serif KR", serif; font-weight: 700; font-size: 22px; line-height: 1.6; color: #F4E8CB; margin-top: 58px; max-width: 470px; }
.cv-birth { font-size: 13.5px; color: rgba(234, 223, 195, .72); margin-top: 14px; letter-spacing: .04em; }
.cv-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 12.5px; color: rgba(234, 223, 195, .75); letter-spacing: .08em; }
.cv-seal {
  width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  background: #A8372B; color: #FFF6EA; border: 2px solid #C85445; border-radius: 6px;
  font-family: "Noto Serif KR", serif; font-weight: 900; font-size: 31px; transform: rotate(-4deg); margin-bottom: 6px;
}
.cv-site { font-size: 11.5px; color: rgba(201, 169, 106, .9); }

/* 2·3쪽 종이 */
.sp-paper { background: linear-gradient(180deg, #FCF9F2 0%, #F7F1E4 100%); color: #2A2A2E; }
.pp-frame { position: absolute; inset: 30px; border: 1px solid #CDBB92; padding: 30px 40px 26px; display: flex; flex-direction: column; }
.pp-frame::before { content: ""; position: absolute; inset: 6px; border: 1px solid #E8DDC4; pointer-events: none; }
.pp-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1.5px solid #283154; padding-bottom: 10px; font-family: "Noto Serif KR", serif; font-weight: 700; font-size: 16px; letter-spacing: .3em; color: #283154; }
.pp-no { font-size: 22px; letter-spacing: 0; color: #A8372B; }

.pp-name { text-align: center; margin-top: 30px; }
.pp-han { font-family: "Noto Serif KR", serif; font-weight: 900; font-size: 64px; letter-spacing: .12em; padding-left: .12em; line-height: 1.2; color: #1E2645; }
.pp-kor { font-size: 15px; letter-spacing: .6em; padding-left: .6em; color: #7A6E57; margin-top: 4px; }
.pp-bless { margin-top: 24px; text-align: center; padding: 18px 28px; background: #F1E9D8; border-top: 1px solid #DCCBA5; border-bottom: 1px solid #DCCBA5; }
.pp-bless h3 { font-family: "Noto Serif KR", serif; font-weight: 700; font-size: 22px; line-height: 1.5; color: #1E2645; }
.pp-bless p { font-size: 14px; color: #4A4336; line-height: 1.8; margin-top: 8px; }
.pp-chars { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; }
.pp-char { display: flex; gap: 20px; align-items: center; padding-bottom: 14px; border-bottom: 1px dashed #D9CBAA; }
.pp-char:last-child { border-bottom: 0; padding-bottom: 0; }
.pp-tile { position: relative; flex: none; width: 84px; height: 84px; display: flex; align-items: center; justify-content: center; background: #FFFFFF; border: 1.5px solid #A8372B; font-family: "Noto Serif KR", serif; font-weight: 700; font-size: 50px; color: #1E2645; }
.pp-tile small { position: absolute; top: -9px; left: 8px; padding: 0 5px; background: #FBF7EE; font-family: "Noto Sans KR", sans-serif; font-size: 10.5px; font-weight: 700; color: #A8372B; line-height: 1.5; }
.pp-info { flex: 1; min-width: 0; }
.pp-info b { font-family: "Noto Serif KR", serif; font-size: 18px; color: #1E2645; }
.pp-info b span { font-family: "Noto Sans KR", sans-serif; font-size: 13px; font-weight: 500; color: #7A6E57; margin-left: 6px; }
.pp-info p { font-size: 13.5px; color: #4A4336; line-height: 1.7; margin-top: 3px; }
.pp-meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 5px; }
.pp-meta span { font-size: 11px; padding: 1px 9px; border: 1px solid #D9CBAA; border-radius: 999px; color: #6B6252; background: #FFFFFF; }
.pp-empty { text-align: center; font-size: 14px; color: #7A6E57; padding: 30px 0; }
.pp-sum { margin-top: 20px; padding-top: 16px; border-top: 1px solid #D9CBAA; text-align: center; font-family: "Noto Serif KR", serif; font-size: 16px; color: #1E2645; line-height: 1.7; }
.pp-letter { margin-top: auto; }
.pp-letter b { display: block; font-size: 12.5px; letter-spacing: .25em; color: #8A7B5C; margin-bottom: 2px; }
.pp-letter i { display: block; height: 34px; border-bottom: 1px solid #D9CBAA; }

.pp-sub { display: flex; align-items: center; gap: 8px; margin: 20px 0 10px; font-family: "Noto Serif KR", serif; font-weight: 700; font-size: 15.5px; color: #1E2645; }
.pp-sub::before { content: ""; width: 7px; height: 7px; background: #A8372B; transform: rotate(45deg); flex: none; }
.pp-sub small { font-family: "Noto Sans KR", sans-serif; font-size: 11.5px; font-weight: 500; color: #8A7B5C; }
.pp-saju { width: 100%; border-collapse: collapse; table-layout: fixed; background: #FFFFFF; }
.pp-saju th { border: 1px solid #D9CBAA; background: #F1E9D8; font-size: 12px; font-weight: 500; color: #6B6252; padding: 5px 0; text-align: center; }
.pp-saju td { border: 1px solid #D9CBAA; text-align: center; padding: 6px 0 5px; }
.pp-saju .gan { font-family: "Noto Serif KR", serif; font-weight: 700; font-size: 28px; line-height: 1.2; }
.pp-saju .gan small { display: block; font-family: "Noto Sans KR", sans-serif; font-weight: 400; font-size: 11px; color: #7A6E57; }
.pp-saju .hid td { font-size: 11px; color: #7A6E57; background: #FAF6EC; padding: 3px 0; }
.pp-els { display: flex; gap: 6px; margin-top: 10px; }
.pp-els span { flex: 1; text-align: center; font-size: 12.5px; padding: 5px 0; border-radius: 3px; background: #FFFFFF; border: 1px solid #E3D7BD; color: #6B6252; }
.pp-els span b { font-family: "Noto Serif KR", serif; font-size: 15px; margin-right: 4px; }
.pp-els span.need { border-color: #A8372B; color: #A8372B; font-weight: 700; }
.pp-note { font-size: 11.5px; color: #7A6E57; margin-top: 8px; line-height: 1.6; }
.pp-checks { width: 100%; border-collapse: collapse; }
.pp-checks th { background: transparent; text-align: left; font-size: 13px; font-weight: 700; color: #1E2645; padding: 6px 10px 6px 0; border-bottom: 1px solid #E3D7BD; white-space: nowrap; width: 76px; }
.pp-checks td { font-size: 12.5px; color: #4A4336; padding: 6px 0; border-bottom: 1px solid #E3D7BD; }
.pp-checks td.v { width: 150px; text-align: right; white-space: nowrap; }
.pp-mt { display: inline-flex; gap: 2px; vertical-align: middle; margin-right: 8px; }
.pp-mt i { display: block; width: 14px; height: 6px; border-radius: 1px; background: #E6DCC6; }
.pp-lv { display: inline-block; min-width: 52px; text-align: left; font-size: 12px; font-weight: 700; }
.pp-g0 { --gc: #B33A2B; } .pp-g1 { --gc: #C2692A; } .pp-g2 { --gc: #9C8419; } .pp-g3 { --gc: #5B9446; } .pp-g4 { --gc: #2E7D5B; }
.pp-mt i.on { background: var(--gc); }
.pp-lv { color: var(--gc); }
.pp-suri { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pp-suri > div { display: flex; gap: 12px; align-items: center; padding: 9px 12px; background: #FFFFFF; border: 1px solid #E3D7BD; }
.pp-suri .n { flex: none; width: 44px; text-align: center; font-family: "Noto Serif KR", serif; font-weight: 900; font-size: 26px; color: #1E2645; line-height: 1.1; }
.pp-suri .t { min-width: 0; font-size: 11.5px; color: #7A6E57; line-height: 1.5; }
.pp-suri .t b { display: block; font-size: 13px; color: #2A2A2E; }
.pp-suri .t em { font-style: normal; font-weight: 700; margin-left: 4px; }
.pp-suri .t em.good { color: #2E7D5B; } .pp-suri .t em.half { color: #9C8419; } .pp-suri .t em.bad { color: #B33A2B; }
.pp-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid #CDBB92; font-size: 11px; color: #8A7B5C; line-height: 1.65; }
.pp-foot span { display: block; }
#printSheet .e-목 { color: #2E7D5B; } #printSheet .e-화 { color: #B33A2B; } #printSheet .e-토 { color: #A97A21; }
#printSheet .e-금 { color: #6A7180; } #printSheet .e-수 { color: #24406E; }

@media print {
  @page { size: A4; margin: 0; }
  html, body { background: #FFFFFF !important; overflow: visible; }
  body > *:not(#printSheet) { display: none !important; }
  #sheetBar { display: none !important; }
  #printSheet { display: block !important; padding: 0 !important; }
  #printSheet .sp { zoom: 1.1024; box-shadow: none; break-after: page; page-break-after: always; }
  #printSheet .sp:last-child { break-after: auto; page-break-after: auto; }
}

/* ---------- 이름 입력 칸 — 어디를 눌러 쓰는지 한눈에 ---------- */
.name-entry { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 12px; padding: 14px 14px 12px; }
.name-entry-title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.name-entry-title span { display: block; font-weight: 400; font-size: 12px; color: var(--accent); margin-top: 2px; }
.name-boxes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.name-boxes:has(#n2Box[hidden]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.name-box { display: grid; gap: 6px; justify-items: center; cursor: text; }
.name-box > span { font-size: 12px; color: var(--muted); font-weight: 500; }
.name-box input[type="text"] {
  width: 100%; max-width: 84px; aspect-ratio: 1; min-height: 64px; padding: 0;
  text-align: center; font-family: var(--display); font-size: 30px; font-weight: 700; color: var(--ink);
  background: var(--surface); border: 2px dashed var(--accent); border-radius: 12px;
}
.name-box input[type="text"]::placeholder { color: var(--line-strong); font-weight: 500; }
.name-box input[type="text"]:not(:placeholder-shown) { border-style: solid; }
.name-box input[type="text"]:focus { border-style: solid; outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .name-box input[type="text"]:placeholder-shown:not(:focus) { animation: name-nudge 2.4s ease-in-out infinite; }
}
@keyframes name-nudge { 50% { box-shadow: 0 0 0 5px var(--accent-line); } }

/* ---------- 한자 고르기 — 추천을 색으로 ---------- */
.han-slot { display: grid; gap: 8px; }
.han-slot-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 8px; font-size: 13.5px; }
.han-slot-head span { font-size: 11.5px; color: var(--muted); }
.han-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: 300px; overflow-y: auto; padding: 3px; }
.chips-empty { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 14px; text-align: center; }
.han-chip {
  position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 8px; align-items: center;
  text-align: left; font: inherit; color: var(--ink); background: var(--surface-2);
  border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; min-height: 60px; cursor: pointer;
}
.han-chip .hc-c { grid-row: 1 / span 3; font-family: var(--display); font-size: 25px; font-weight: 700; text-align: center; line-height: 1.1; }
.han-chip .hc-m { display: grid; min-width: 0; line-height: 1.4; }
.han-chip .hc-m b { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.han-chip .hc-m small { font-size: 10.5px; color: var(--muted); }
.han-chip .hc-r { font-size: 10.5px; font-weight: 700; line-height: 1.4; }
.han-chip:hover { border-color: var(--accent); }
.han-chip.is-on { outline: 3px solid var(--ink); outline-offset: 1px; }
.han-chip.is-on::after {
  content: "선택"; position: absolute; top: -8px; right: 6px; font-size: 10px; font-weight: 700;
  background: var(--ink); color: var(--bg); padding: 1px 7px; border-radius: 999px;
}
.r-best { background: var(--good-soft); border-color: var(--good); }
.r-best .hc-c, .r-best .hc-r { color: var(--good); }
.r-good { background: var(--accent-soft); border-color: var(--accent); }
.r-good .hc-c, .r-good .hc-r { color: var(--accent); }
.r-fair { background: var(--warn-soft); border-color: var(--warn-soft); }
.r-fair .hc-r { color: var(--warn); }
.r-bad .hc-r { color: var(--bad); }
.han-chip.r-bad { opacity: .5; }
.han-chip.r-bad.is-on { opacity: 1; }
.han-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.han-legend > span { font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 999px; border: 1.5px solid var(--line); }
.han-legend .r-best { color: var(--good); }
.han-legend .r-good { color: var(--accent); }
.han-legend .r-fair { color: var(--warn); border-color: var(--warn); }
.han-legend .r-bad { color: var(--bad); background: var(--bad-soft); border-color: var(--bad-soft); }
.han-legend p { flex-basis: 100%; font-size: 11.5px; color: var(--muted); line-height: 1.7; margin-top: 2px; }
.han-legend p b { color: var(--ink-2); }

/* ---------- 칸마다 번호와 구분선 ---------- */
.rail, .results { gap: 14px; background: transparent; border: 0; }
.panel, .card { border: 1px solid var(--line); border-top: 3px solid var(--accent); }
.rail { counter-reset: step; }
.panel > h2 { display: flex; align-items: center; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.panel > h2::before {
  counter-increment: step; content: "STEP " counter(step);
  font-family: var(--body); font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  color: var(--accent); border: 1px solid var(--accent-line); padding: 1px 8px; border-radius: 999px;
}
.results { counter-reset: sec; }
.card-head { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.card-head h2::before {
  counter-increment: sec; content: counter(sec);
  display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 8px; vertical-align: 2px;
  border-radius: 50%; background: var(--accent); color: var(--surface);
  font-family: var(--body); font-size: 12.5px; font-weight: 700; letter-spacing: 0;
}
.card-head h2 small { font-family: var(--body); font-size: 12.5px; font-weight: 500; color: var(--muted); }
@media (max-width: 980px) { .rail, .results { gap: 18px; } }

/* 한자 목록 접기 */
.han-chips.is-folded { max-height: none; overflow: visible; }
.chips-toggle {
  font: inherit; font-size: 13px; font-weight: 700; color: var(--accent); cursor: pointer;
  background: var(--surface); border: 1.5px dashed var(--accent); border-radius: 10px;
  min-height: 60px; padding: 8px 10px; display: grid; place-content: center; gap: 2px; text-align: center;
}
.chips-toggle small { font-size: 10.5px; font-weight: 400; color: var(--muted); }
.chips-toggle:hover { background: var(--accent-soft); }
.han-chips:not(.is-folded) > .chips-toggle { grid-column: 1 / -1; min-height: 40px; position: sticky; top: 0; z-index: 1; border-style: solid; }

/* 이름 검사 5단계 */
:root { --g0: #B33A2B; --g1: #C2692A; --g2: #9C8419; --g3: #5B9446; --g4: #2E7D5B; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --g0: #E08476; --g1: #E3A06A; --g2: #D6C35C; --g3: #A6CF7E; --g4: #7CC19A; }
}
:root[data-theme="dark"] { --g0: #E08476; --g1: #E3A06A; --g2: #D6C35C; --g3: #A6CF7E; --g4: #7CC19A; }
.g0 { --gc: var(--g0); } .g1 { --gc: var(--g1); } .g2 { --gc: var(--g2); } .g3 { --gc: var(--g3); } .g4 { --gc: var(--g4); }
.grade-pill { font-size: 11.5px; font-weight: 700; white-space: nowrap; padding: 3px 10px; border-radius: 999px; color: var(--gc); border: 1.5px solid var(--gc); }
.grade-meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.grade-meter i { height: 7px; border-radius: 2px; background: var(--line); }
.grade-meter i.on { background: var(--gc); }
.check p.grade-why { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }

/* 작명 가이드로 가는 길 */
.guide-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 18px;
  padding: 12px 16px; border: 1px solid var(--accent-line); border-left: 4px solid var(--seal);
  background: var(--surface); color: var(--ink); text-decoration: none; border-radius: 4px;
}
.guide-banner:hover { background: var(--accent-soft); }
.maker-note {
  position: relative; display: flex; align-items: flex-start; gap: 14px; margin-top: 18px; padding: 14px 44px 14px 16px;
  border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: 4px;
  animation: mn-in .5s ease-out both;
}
.maker-note[hidden] { display: none; }
.mn-body { flex: 1; min-width: 0; }
.maker-note p { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
.maker-note p + p { margin-top: 4px; }
.maker-note .mn-lead { font-size: 14.5px; color: var(--ink); }
.maker-note .mn-lead strong { color: var(--seal); }
.mn-count { font-size: 1.25em; font-variant-numeric: tabular-nums; }
.maker-note .mn-mail { font-size: 12.5px; color: var(--muted); }
.maker-note a { color: var(--accent); font-weight: 600; word-break: break-all; }
.mn-stamp {
  flex: none; width: 46px; height: 46px; margin-top: 2px; position: relative;
  display: grid; grid-template-rows: 1fr 1fr; place-items: center; padding: 3px 0;
  background: var(--seal); color: #FFFFFF; border-radius: 3px;
  box-shadow: inset 0 0 0 2px var(--seal), inset 0 0 0 3.5px rgba(255,255,255,.85);
  font-size: 17px; font-weight: 900; line-height: 1;
  transform: rotate(-6deg); animation: mn-stamp .5s cubic-bezier(.3,1.4,.5,1) .35s both;
}
.mn-stamp::after {
  content: ""; position: absolute; inset: -4px; border: 2px solid var(--seal); border-radius: 6px;
  opacity: 0; animation: mn-ring .6s ease-out .62s;
}
.mn-close {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer;
}
.mn-close:hover { background: var(--surface); color: var(--ink); }
@keyframes mn-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes mn-stamp {
  0% { opacity: 0; transform: rotate(-6deg) scale(1.8); }
  60% { opacity: 1; transform: rotate(-6deg) scale(.92); }
  100% { opacity: 1; transform: rotate(-6deg) scale(1); }
}
@keyframes mn-ring { from { opacity: .5; transform: scale(.9); } to { opacity: 0; transform: scale(1.35); } }
@media (max-width: 520px) { .mn-stamp { width: 38px; height: 38px; font-size: 14px; } .maker-note { gap: 10px; } }
@media (prefers-reduced-motion: reduce) {
  .maker-note, .mn-stamp, .mn-stamp::after { animation: none; }
}
.gb-tag { font-size: 11.5px; font-weight: 700; color: var(--seal); border: 1px solid var(--seal); padding: 1px 8px; border-radius: 999px; flex: none; }
.gb-text { font-size: 13.5px; color: var(--ink-2); flex: 1 1 220px; line-height: 1.6; }
.gb-go { font-size: 13px; font-weight: 700; color: var(--accent); flex: none; }
.guide-links { display: grid; gap: 4px; }
.guide-links a, .guide-link { color: var(--accent); font-weight: 500; text-decoration: none; }
.guide-link { font-size: 12.5px; justify-self: start; }
.guide-links a:hover, .guide-link:hover { text-decoration: underline; }
.howto-steps { margin: 0; padding: 0; list-style: none; counter-reset: hs; display: grid; gap: 10px; }
.howto-steps li { counter-increment: hs; position: relative; padding-left: 34px; font-size: 13.5px; color: var(--ink-2); line-height: 1.75; }
.howto-steps li::before {
  content: counter(hs); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent);
}
.howto-steps b { display: block; color: var(--ink); font-size: 14px; }
.howto-more { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* 다음 단계 추천 카드 (크로스 프로모션) */
.yn-xpromo { border-color: var(--accent-line); }
.xp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .xp-grid { grid-template-columns: 1fr; } }
.xp { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--accent-soft); color: var(--ink); text-decoration: none;
  transition: border-color .15s, transform .15s; }
.xp:hover { border-color: var(--accent); transform: translateY(-1px); }
.xp-e { grid-row: 1 / span 2; font-size: 26px; line-height: 1; }
.xp b { font-size: 15px; color: var(--accent); }
.xp span:not(.xp-e) { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* 가족 투표 후보 · 투표 카드 */
.btn-main { background: var(--accent); border-color: var(--accent); color: var(--surface); font-weight: 700; }
.btn-main:hover { background: var(--accent); filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.pick-btn { margin-top: 12px; }
.pick-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); font-weight: 700; }
.picks-card h2 small { margin-left: 6px; font-variant-numeric: tabular-nums; }
.pick-list { margin: 0 0 14px; padding: 0; list-style: none; display: grid; gap: 8px; }
.pick { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.pick.is-empty { border-style: dashed; padding: 12px 14px; gap: 12px; align-items: center; }
.pk-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: none; border: 0;
  font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 10px; }
.pk-main:hover { background: var(--accent-soft); }
.pk-no { font-size: 18px; color: var(--accent); flex: none; }
.pk-name { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pk-name b { font-family: var(--display); font-size: 17px; color: var(--ink); }
.pk-name .han { font-size: 14px; color: var(--accent); }
.pk-name small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-score { font-family: var(--display); font-size: 20px; font-weight: 900; color: var(--ink); flex: none; font-variant-numeric: tabular-nums; }
.pk-score small, .vc-score small { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 1px; }
.pk-del { flex: none; width: 40px; border: 0; border-left: 1px solid var(--line); background: none; color: var(--muted);
  font-size: 18px; cursor: pointer; border-radius: 0 10px 10px 0; }
.pk-del:hover { color: var(--bad); background: var(--bad-soft); }
.vote-open { width: 100%; min-height: 46px; font-size: 15px; }
.pick-mini { border: 0; background: none; color: var(--seal); font-size: 17px; line-height: 1; cursor: pointer; padding: 6px 8px; }

.vote-dlg { border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(420px, calc(100vw - 32px));
  background: var(--surface); color: var(--ink); }
.vote-dlg::backdrop { background: rgba(10, 12, 16, .55); }
.vd-in { position: relative; display: grid; gap: 14px; padding: 24px 22px 20px; }
.vd-in h2 { font-family: var(--display); font-size: 19px; }
.vd-lead { font-size: 13.5px; color: var(--ink-2); line-height: 1.7; margin: 0; }
.vd-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vd-acts .btn { min-height: 46px; }
.vd-close { position: absolute; top: 10px; right: 12px; border: 0; background: none; color: var(--muted); font-size: 22px; cursor: pointer; padding: 4px 8px; }

.vote-card { position: relative; max-width: 520px; margin: 18px auto 26px; padding: 34px 22px 26px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.vote-card::before { content: ""; position: absolute; inset: 8px; border: 1.5px solid var(--accent-line); border-radius: 14px; pointer-events: none; }
.vc-orn { font-size: 13px; letter-spacing: .3em; color: var(--seal); margin: 0 0 10px; }
.vc-title { font-family: var(--display); font-size: clamp(24px, 6vw, 30px); line-height: 1.35; margin: 0 0 10px; }
.vc-title em { font-style: normal; color: var(--accent); }
.vc-sub { font-size: 13.5px; color: var(--muted); line-height: 1.7; margin: 0 0 20px; }
.vc-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; text-align: left; }
.vc-item { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); transition: border-color .15s, background .15s; }
.vc-item.is-voted { border-color: var(--seal); background: var(--hwa-soft); }
.vc-no { font-size: 22px; color: var(--accent); }
.vc-name { display: grid; gap: 2px; min-width: 0; }
.vc-name b { font-family: var(--display); font-size: 22px; color: var(--ink); }
.vc-name .han { font-family: var(--display); font-size: 15px; color: var(--accent); letter-spacing: .08em; }
.vc-name small { font-size: 12.5px; color: var(--muted); }
.vc-score { font-family: var(--display); font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.vc-acts { grid-column: 1 / -1; display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; margin-top: 8px; }
.vc-acts .btn { min-height: 42px; text-align: center; text-decoration: none; display: grid; place-items: center; }
.vc-note { font-size: 11.5px; color: var(--muted); margin: 16px 0 14px; line-height: 1.6; }
.vc-mine { display: inline-grid; place-items: center; min-height: 44px; padding: 0 20px; text-decoration: none; }
.vc-foot { font-size: 11.5px; color: var(--muted); margin: 16px 0 0; }
@media (max-width: 420px) { .vote-card { padding: 30px 16px 22px; margin-top: 10px; } .vc-item { padding: 14px 12px; } }
/* 후보함은 번호 매기는 카드가 아니라서 ♥ 로 — 아래 카드 번호가 밀리지 않게 */
.picks-card { border-color: var(--accent-line); }
.picks-card .card-head h2::before { counter-increment: none; content: "♥"; background: var(--seal); color: #FFFFFF; font-size: 12px; }
.vd-kakao { min-height: 48px; background: #FEE500; border-color: #FEE500; color: #191919; font-weight: 700; font-size: 15px; }
.vd-kakao:hover { background: #FEE500; filter: brightness(.96); }
