/* 레인 D 공통 UI 키트 v2 (2026-10-14). 외부 프레임워크·외부 글꼴 없음(Pretendard 서브셋을 직접 제공).
   사이트별 3색(--brand, --brand-soft, --accent)과 다크 모드 값은 각 사이트의 assets/site.css에서 정한다. */

@font-face {
  font-family: "LaneD Sans";
  src: url("/assets/fonts/LaneDSans.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

/* 글꼴 교체 때 줄바꿈이 크게 달라지지 않도록, 맑은 고딕을 Pretendard 폭에 맞춰 줄인 대체 글꼴(측정: 한글 문단 폭 약 0.86배). */
@font-face {
  font-family: "LaneD Fallback";
  src: local("Malgun Gothic"), local("맑은 고딕");
  size-adjust: 85.8%;
}

:root {
  --font: "LaneD Sans", "LaneD Fallback", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  --bg: #fbfaf9;
  --surface: #ffffff;
  --surface-2: #f3f1ef;
  --text: #1d1b1c;
  --muted: #5c575b;
  --line: #e2dde0;
  --brand: #9b3352;
  --brand-ink: #ffffff;
  --brand-soft: #fbe8ee;
  --accent: #8a6a32;
  --ok: #1d6b45;
  --ok-soft: #e2f3ea;
  --edit: #7a4a00;
  --edit-soft: #fbf0dc;
  --none: #5c575b;
  --none-soft: #ececec;
  --alert: #a4262c;
  --focus: #1f5fbf;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.06);
  --sh-2: 0 8px 22px rgba(0, 0, 0, 0.08);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121213;
    --surface: #1b1b1d;
    --surface-2: #242427;
    --text: #f1eeef;
    --muted: #bdb7bb;
    --line: #36343a;
    --ok: #7fd6a6;
    --ok-soft: #173325;
    --edit: #f0c77a;
    --edit-soft: #3a2d12;
    --none: #bdb7bb;
    --none-soft: #2a2a2d;
    --alert: #ff9b9f;
    --focus: #8ab4ff;
    --sh-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --sh-2: 0 8px 22px rgba(0, 0, 0, 0.45);
  }
}
:root[data-theme="dark"] {
  --bg: #121213;
  --surface: #1b1b1d;
  --surface-2: #242427;
  --text: #f1eeef;
  --muted: #bdb7bb;
  --line: #36343a;
  --ok: #7fd6a6;
  --ok-soft: #173325;
  --edit: #f0c77a;
  --edit-soft: #3a2d12;
  --none: #bdb7bb;
  --none-soft: #2a2a2d;
  --alert: #ff9b9f;
  --focus: #8ab4ff;
  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sh-2: 0 8px 22px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
[id] { scroll-margin-top: 72px; }
html { -webkit-text-size-adjust: 85.8%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.3; letter-spacing: -0.01em; }
h1 { font-size: 26px; margin: var(--s6) 0 var(--s3); }
h2 { font-size: 19px; margin: var(--s6) 0 var(--s2); }
h3 { font-size: 16px; margin: var(--s4) 0 var(--s2); }
p { margin: 0 0 var(--s3); }
ul, ol { padding-left: 1.25em; }
.num, .tabular, td, th, .big-num, .hero-num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.skip {
  position: absolute; left: 8px; top: -48px; background: var(--surface); color: var(--text);
  padding: 8px 12px; border-radius: var(--r-sm); z-index: 10; box-shadow: var(--sh-2);
}
.skip:focus { top: 8px; }

/* 헤더·메뉴 (모바일은 CSS만으로 접힘) */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: 12px; flex-wrap: wrap; }
.brand { color: var(--brand); font-weight: 800; font-size: 19px; text-decoration: none; letter-spacing: -0.02em; }
.brand small { color: var(--muted); font-weight: 500; font-size: 12px; margin-left: 4px; }
.mtog { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.mtog:focus-visible + .mlabel { outline: 3px solid var(--focus); outline-offset: 2px; }
.mlabel {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: var(--r-sm); cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text);
}
.menu { display: none; width: 100%; flex-direction: column; gap: 2px; padding: 0 0 12px; }
.mtog:checked ~ .menu { display: flex; }
.menu a { display: block; padding: 12px; border-radius: var(--r-sm); color: var(--text); text-decoration: none; font-weight: 600; }
.menu a:hover { background: var(--brand-soft); }
@media (min-width: 760px) {
  .mtog { display: none; }
  .mlabel { display: none; }
  .menu { display: flex; flex-direction: row; width: auto; padding: 0; gap: 4px; }
  .menu a { padding: 8px 12px; font-size: 15px; }
}

.crumbs { font-size: 13px; color: var(--muted); padding-top: var(--s4); }
.crumbs a { color: var(--muted); }

/* 제목·본문 */
.lead { font-size: 17px; color: var(--muted); margin-bottom: var(--s5); }
.prose { max-width: 40em; }
.prose h2 { margin-top: var(--s8); }
.note, .small { font-size: 13px; color: var(--muted); }
.hero { padding: var(--s6) 0 var(--s4); }
.hero h1 { font-size: 27px; margin-top: var(--s3); }
.hero p { color: var(--muted); max-width: 36em; }
@media (min-width: 760px) {
  h1 { font-size: 34px; }
  .hero h1 { font-size: 36px; }
  h2 { font-size: 22px; }
}

/* 버튼·링크 */
.actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px;
  border-radius: 10px; background: var(--brand); color: var(--brand-ink); font-weight: 700; text-decoration: none;
  border: 1px solid var(--brand); font: inherit; cursor: pointer;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn[disabled] { opacity: 0.5; cursor: default; }

/* 카드 격자 */
.cards { display: grid; grid-template-columns: 1fr; gap: var(--s3); margin: var(--s5) 0; }
.card {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s4); text-decoration: none; color: var(--text); box-shadow: var(--sh-1);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.card:hover { box-shadow: var(--sh-2); transform: translateY(-1px); text-decoration: none; }
.card h2 { font-size: 17px; margin: 0 0 var(--s1); color: var(--brand); }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .cards { grid-template-columns: repeat(3, 1fr); } }

/* 입력 도구 카드 */
.tool {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s4); box-shadow: var(--sh-1); margin: var(--s4) 0;
}
.tool label, .up-field label { display: block; font-weight: 700; font-size: 14px; margin: var(--s3) 0 var(--s1); color: var(--muted); }
.tool label:first-child { margin-top: 0; }
.tool input, .tool select, .up-field input, .up-field select {
  width: 100%; min-height: 48px; padding: 10px 12px; font: inherit; font-size: 18px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.tool input:focus, .tool select:focus, .up-field input:focus, .up-field select:focus { border-color: var(--brand); outline: 3px solid var(--focus); outline-offset: 0; }
.tool h2 { margin-top: var(--s5); font-size: 17px; }

/* 결과 */
.result { margin-top: var(--s4); }
.result .row {
  display: grid; grid-template-columns: 1fr auto; gap: var(--s2); padding: 10px 0;
  border-bottom: 1px solid var(--line); align-items: baseline;
}
.result .row b { font-weight: 600; color: var(--muted); font-size: 14px; }
.result .row span { font-weight: 700; text-align: right; }
.result-hero {
  background: var(--brand-soft); border-radius: var(--r-lg); padding: var(--s5); margin-top: var(--s4);
  border: 1px solid transparent;
}
.result-hero .kicker { font-size: 13px; color: var(--muted); font-weight: 600; }
.hero-num { font-size: clamp(34px, 9vw, 52px); font-weight: 800; color: var(--brand); line-height: 1.1; margin: var(--s1) 0; word-break: break-all; }
.hero-num small { font-size: 0.45em; margin-left: 6px; color: var(--text); font-weight: 700; }
.unit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin-top: var(--s3); padding: 0; list-style: none; }
.unit-grid li {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px;
}
.unit-grid .u-name { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.unit-grid .u-val { display: block; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; word-break: break-all; }
@media (min-width: 640px) { .unit-grid { grid-template-columns: repeat(3, 1fr); } }

/* 배지·칩 */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.6; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.edit { background: var(--edit-soft); color: var(--edit); }
.badge.none { background: var(--none-soft); color: var(--none); }
.badge.best { background: var(--brand); color: var(--brand-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: var(--s2) 0; }
.chips a {
  display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600;
}
.chips a:hover { border-color: var(--brand); color: var(--brand); }

/* 사실(요약) 카드 */
.facts { display: grid; grid-template-columns: 1fr; gap: var(--s2); margin: var(--s4) 0; padding: 0; }
.facts > div {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3) var(--s4);
}
.facts span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.facts strong { font-size: 18px; font-variant-numeric: tabular-nums; word-break: break-all; }
@media (min-width: 640px) { .facts { grid-template-columns: repeat(3, 1fr); } }

/* 표 */
.table-wrap, .ref { display: block; width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--surface); }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--surface-2); font-size: 13px; color: var(--muted); }

/* 달력 (wemarry) */
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13px; color: var(--muted); margin: var(--s3) 0; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.lg-cand { background: var(--brand); }
.lg-son { background: var(--accent); }
.lg-hol { background: var(--alert); }
.lg-wknd { background: var(--surface-2); border: 1px solid var(--line); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: var(--s2) 0 var(--s4); }
.cal .dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal .dow.sun, .cal .dow.hol { color: var(--alert); }
.cal .cell {
  min-height: 56px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 5px; display: flex; flex-direction: column; justify-content: space-between; font-size: 14px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cal .cell.is-wknd { background: var(--surface-2); }
.cal .cell.is-cand { background: var(--brand-soft); border-color: var(--brand); }
.cal .cell.is-empty { background: transparent; border-color: transparent; }
.cal .cell .lunar { font-size: 11px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.cal .cell .marks { display: flex; gap: 3px; }
.cal .cell .marks i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.cal .cell .marks .m-son { background: var(--accent); }
.cal .cell .marks .m-hol { background: var(--alert); }
.cal .cell .marks .m-cand { background: var(--brand); }
.cal .cell.is-hol { color: var(--alert); }
@media (max-width: 480px) { .cal .cell { min-height: 50px; padding: 3px; font-size: 13px; } .cal .cell .lunar { font-size: 10px; } }
.cand-cards { display: grid; grid-template-columns: 1fr; gap: var(--s2); padding: 0; list-style: none; }
.cand-cards li {
  background: var(--surface); border: 1px solid var(--brand); border-left-width: 5px; border-radius: var(--r-md);
  padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.cand-cards .c-date { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.cand-cards .c-meta { font-size: 13px; color: var(--muted); }
@media (min-width: 640px) { .cand-cards { grid-template-columns: repeat(2, 1fr); } }

/* 기념일 타임라인 (wemarry) */
.timeline { list-style: none; padding: 0 0 0 4px; margin: var(--s4) 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 23px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline > li { position: relative; padding: 0 0 var(--s3) 52px; }
.timeline .tl-ic {
  position: absolute; left: 2px; top: 6px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); border: 2px solid var(--brand);
}
.timeline .tl-ic .ic { width: 20px; height: 20px; }
.timeline a {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 10px 14px; text-decoration: none; color: var(--text);
}
.timeline a:hover { border-color: var(--brand); }
.timeline strong { color: var(--brand); font-variant-numeric: tabular-nums; }
.timeline .mat { display: block; font-size: 14px; color: var(--muted); }
.hanja { color: var(--muted); font-size: 0.9em; font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; }

/* D-day 카드 (wemarry) */
.dday-list { display: grid; grid-template-columns: 1fr; gap: var(--s2); padding: 0; list-style: none; margin: var(--s3) 0; }
.dday-list li, .dday-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 14px;
  display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap;
}
.dday-card.is-next { border-color: var(--brand); box-shadow: var(--sh-2); }
.dday-card .d-year { font-weight: 800; }
.dday-card .d-date { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dday-card .d-tags { font-size: 12px; color: var(--muted); display: block; }
.dday-chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dday-card.is-next .dday-chip { background: var(--brand); color: var(--brand-ink); }

/* 체크리스트 (wemarry, 저장 안 함) */
.progress-wrap { margin: var(--s3) 0 var(--s5); }
.progress { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress > span { display: block; height: 100%; width: 0; background: var(--brand); transition: width 0.2s ease; }
.progress-text { font-size: 14px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.steps .chk {
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; margin-top: var(--s2);
  min-height: 44px; cursor: pointer;
}
.steps .chk input { width: 20px; height: 20px; accent-color: var(--brand); }
.steps li.done h2 { text-decoration: line-through; color: var(--muted); }

/* 단계 리스트 (wemarry guide) */
.steps { list-style: none; padding: 0; counter-reset: st; }
.steps > li {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3) var(--s4);
  margin-bottom: var(--s2);
}
.steps .label { display: inline-block; font-size: 12px; font-weight: 800; color: var(--brand); background: var(--brand-soft); padding: 2px 8px; border-radius: 999px; }
.steps h2 { font-size: 17px; margin: var(--s1) 0; }
.steps p { margin: 0; }

/* 월 목록 카드 (wemarry) */
.monthlist { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr; gap: var(--s2); }
.monthlist a {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s2); flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; text-decoration: none; color: var(--text);
}
.monthlist a:hover { border-color: var(--brand); }
.monthlist span { font-size: 13px; color: var(--muted); }
@media (min-width: 640px) { .monthlist { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .monthlist { grid-template-columns: repeat(3, 1fr); } }

/* 숫자 통계 칩 */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2); margin: var(--s4) 0; padding: 0; }
.stats > div { background: var(--surface-2); border-radius: var(--r-md); padding: 10px 12px; }
.stats span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.stats strong { font-size: 22px; font-variant-numeric: tabular-nums; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }

/* 단위 목록·세는 말 타일 */
.unitlist { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr; gap: var(--s2); }
.unitlist li { margin: 0; }
.unitlist a {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px 14px; text-decoration: none; color: var(--text); height: 100%;
}
.unitlist a:hover { border-color: var(--brand); }
.unitlist strong { font-size: 17px; }
.unitlist span { font-size: 14px; color: var(--muted); }
@media (min-width: 640px) { .unitlist { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .unitlist { grid-template-columns: repeat(3, 1fr); } }
.tiles { grid-template-columns: repeat(2, 1fr); }
.tiles a { align-items: flex-start; }
.tiles strong { font-size: 26px; color: var(--brand); line-height: 1.2; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .tiles { grid-template-columns: repeat(4, 1fr); } }

/* 검색 입력 */
.search { margin: var(--s3) 0; }
.search label { font-weight: 700; font-size: 14px; color: var(--muted); display: block; margin-bottom: 4px; }
.search input {
  width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; font-size: 17px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
}
.search input:focus { border-color: var(--brand); outline: 3px solid var(--focus); outline-offset: 0; }
.search .count { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* 단위가격 막대 */
.hbar { display: block; height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 6px 0 2px; }
.hbar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.up-rank-group > strong { display: block; margin-top: var(--s2); }
.up-rank-item { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.up-rank-item .line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; align-items: baseline; }
.up-rank-item.is-best .hbar > span { background: var(--brand); }
.up-rank-item .who { font-weight: 700; }
.up-rank-item .val { font-weight: 800; font-variant-numeric: tabular-nums; }

/* 단위가격 입력 */
.up-app { margin: var(--s4) 0; display: grid; grid-template-columns: 1fr; gap: var(--s4); }
.up-form, .up-result { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--sh-1); }
.up-row { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3); margin: 0 0 var(--s3); min-width: 0; }
.up-row legend { font-weight: 800; padding: 0 6px; color: var(--brand); }
.up-grid { display: grid; grid-template-columns: 1fr; gap: var(--s2); }
.up-custom { margin-top: var(--s2); }
.up-hint, .up-muted { font-size: 13px; color: var(--muted); display: block; margin-top: 4px; }
.up-err { color: var(--alert); font-weight: 700; font-size: 14px; margin: var(--s2) 0 0; }
.up-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.up-dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: var(--s2) 0 0; }
.up-dl dt { color: var(--muted); font-size: 14px; }
.up-dl dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.up-summary { font-size: 15px; }
.up-ranking { padding-left: 0; list-style: none; }
.up-rules { padding-left: 1.2em; }
@media (min-width: 900px) {
  .up-app { grid-template-columns: 1.15fr 0.85fr; align-items: start; }
  .up-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 푸터·페이저 */
.pager { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); margin: var(--s8) 0 var(--s4); flex-wrap: wrap; font-size: 15px; }
.pager a { font-weight: 700; }
.foot { border-top: 1px solid var(--line); margin-top: var(--s8); padding: var(--s6) 0; background: var(--surface); color: var(--muted); font-size: 14px; }
.foot nav { margin-bottom: var(--s2); }
.foot .small { margin: var(--s2) 0 0; }

/* 공유·복사 */
.copy-status { font-size: 13px; color: var(--muted); min-height: 1.4em; }
.up-actions .btn, .tool .btn { margin-top: var(--s2); }

/* ===== v2 (2026-10-14) ===== */

/* 아이콘: 직접 그린 선 도형(선 굵기 1.75 고정). 장식이라 글자 옆에서만 쓴다. */
.ic { width: 1.25em; height: 1.25em; flex: none; display: inline-block; vertical-align: -0.22em; }
.ic-badge {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--brand-soft); color: var(--brand); margin-bottom: var(--s2);
}
.ic-badge .ic { width: 24px; height: 24px; vertical-align: 0; }
.card .ic-badge { display: grid; }
.menu a { display: flex; align-items: center; gap: 8px; }
.menu a .ic { width: 20px; height: 20px; color: var(--brand); }
@media (min-width: 760px) { .menu a .ic { width: 18px; height: 18px; } }
.facts > .has-ic { display: flex; align-items: center; gap: var(--s3); }
.facts > .has-ic .ic-badge { margin: 0; flex: none; }

/* 홈 첫 화면: 모바일은 제목 → 도구 → 소개, 넓은 화면은 왼쪽 제목·소개 + 오른쪽 도구 */
.home-hero {
  display: grid; gap: var(--s3) var(--s8); padding: var(--s4) 0 var(--s2); position: relative;
  grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "tool" "intro";
}
.hh-title { grid-area: title; position: relative; }
.hh-title h1 { font-size: 22px; margin: var(--s2) 0 0; }
.hh-title .deco-flower { width: 28px; height: 28px; }
.hh-tool, .home-hero > .tool, .home-hero > .hero-tool { grid-area: tool; margin: 0; min-width: 0; }
.hh-intro { grid-area: intro; }
.hh-intro p { color: var(--muted); max-width: 36em; }
@media (min-width: 900px) {
  .home-hero { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-areas: "title tool" "intro tool" "rest tool"; grid-template-rows: auto auto 1fr; align-items: start; padding-top: var(--s8); }
  .hh-title h1 { font-size: 34px; }
  .home-hero.is-wide { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
  .home-hero.is-wide .cal-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
}

/* 월 선택 줄(가로로 밀어 보는 칩) */
.month-strip { display: flex; gap: 6px; list-style: none; padding: 2px 2px 8px; margin: var(--s2) 0 0; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.month-strip li { flex: none; scroll-snap-align: start; }
.month-strip a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.month-strip a:hover { border-color: var(--brand); color: var(--brand); }
.month-strip a[aria-current="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
@media (min-width: 900px) { .month-strip { flex-wrap: wrap; overflow: visible; } }

/* 홈 달력 도구 */
.cal-tool { padding: var(--s3); }
.cal-tool h2 { font-size: 16px; margin: 0; }
.cal-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); margin-top: var(--s2); }
/* 모바일: 후보 카드를 달력 위로 올려 첫 화면에 같이 보이게 한다(DOM 순서는 그대로, 화면 순서만 바꾼다). */
@media (max-width: 899px) {
  .cal-col, .cal-side { display: contents; }
  .cal-nav { order: 1; }
  .cal-cands { order: 2; }
  .cal-tool .legend { order: 3; }
  .cal-tool .cal { order: 4; }
  .cal-side .stats { order: 5; }
  .cal-side .note { order: 6; }
  .cal-more { order: 7; }
  .cal-tool .cand-cards { grid-template-columns: 1fr 1fr; }
  .cal-tool .cand-cards li { padding: 6px 10px; }
  .cal-tool .cand-cards .c-meta { display: block; font-size: 12px; }
  .cal-tool .cal .cell { min-height: 42px; }
  .cal-nav { min-height: 40px; }
  .cal-step { width: 40px; height: 40px; }
}
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 44px; }
.cal-nav strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.cal-step {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text);
}
.cal-step[hidden] { display: none; }
.cal-step:hover { border-color: var(--brand); color: var(--brand); }
.cal-tool .legend { margin: 2px 0 6px; }
.cal-tool .cal { margin: 0; }
.cal-tool .cal .cell { min-height: 44px; padding: 3px 4px; font-size: 13px; }
.cal-tool .cal .cell .lunar { font-size: 10px; }
.cal .cell.is-today { outline: 2px solid var(--focus); outline-offset: -2px; }
.cal-side .note { margin: 0 0 var(--s2); }
.cal-cands h3 { margin: 0 0 var(--s2); font-size: 14px; }
@media (min-width: 900px) { .cal-cands h3 { margin-top: var(--s3); font-size: 15px; } }
.stats.is-compact { grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0; }
.stats.is-compact > div { padding: 6px 8px; }
.stats.is-compact span { font-size: 11px; }
.stats.is-compact strong { font-size: 16px; }
.cal-tool .cand-cards { gap: 6px; }
.cal-tool .cand-cards li { padding: 8px 12px; }
.cal-more { margin: var(--s2) 0 0; font-size: 14px; }
@media (min-width: 900px) {
  .cal-tool { padding: var(--s5); }
  .cal-tool h2 { font-size: 17px; }
  .cal-main { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--s6); }
  .cal-tool .cal .cell { min-height: 52px; font-size: 14px; padding: 4px 6px; }
  .cal-tool .cal .cell .lunar { font-size: 11px; }
  .cal-side .stats.is-compact { grid-template-columns: repeat(2, 1fr); }
  .cal-tool .cand-cards { grid-template-columns: 1fr; }
}

/* 빠른 선택 칩(버튼) */
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--s3); padding: 0; list-style: none; }
.quick button {
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.quick button:hover { border-color: var(--brand); color: var(--brand); }
.quick button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.quick-label { font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 0 4px; }
.tool-row { display: grid; grid-template-columns: 1fr; gap: var(--s2); }
@media (min-width: 560px) { .tool-row { grid-template-columns: 1fr 1fr; gap: var(--s3); } }

/* 세는 말 타일: 아이콘 + 글자 */
.tiles a { position: relative; }
.tiles .tile-ic {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; margin-bottom: var(--s2);
  background: var(--brand-soft); color: var(--brand);
}
.tiles .tile-ic .ic { width: 22px; height: 22px; vertical-align: 0; }
.cat-ic { display: inline-flex; align-items: center; gap: 8px; }
.cat-ic .ic { color: var(--brand); }

/* 모바일 하단 고정 결과 바: 375px 전후에서만. 바닥 여백은 항상 잡아 둬 나타나도 화면이 밀리지 않는다. */
.rbar { display: none; }
.rbar[hidden] { display: none !important; }
@media (max-width: 640px) {
  .has-rbar .foot { padding-bottom: 96px; }
  .rbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; align-items: center; gap: 10px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--surface);
    border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.10);
  }
  .rbar-label { font-size: 12px; font-weight: 700; color: var(--muted); flex: none; }
  .rbar-val { flex: 1 1 auto; min-width: 0; font-size: 17px; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.3; }
  .rbar-go {
    flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 10px;
    background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 14px; text-decoration: none;
  }
}

/* 장식 마스크 공통: 색은 사이트 토큰을 따라 라이트·다크에서 같이 바뀐다. 모양은 각 site.css 가 정한다. */
.deco { display: block; pointer-events: none; background: var(--accent); }

/* 홈 달력 모바일 조정(앞선 규칙보다 뒤에 둔다) */
@media (max-width: 899px) {
  .cal-tool .cal .cell { min-height: 40px; padding: 2px 3px; }
  .cal-tool .cand-cards .badge { display: none; }
}
