@font-face { font-family: "Ilju Sans"; font-weight: 400; font-display: swap; src: url("fonts/IljuSans-Regular.8cba9770.woff2") format("woff2"); }
@font-face { font-family: "Ilju Sans"; font-weight: 700; font-display: swap; src: url("fonts/IljuSans-Bold.01cdb159.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 400; font-display: swap; src: url("fonts/Pretendard-Regular.woff2") format("woff2"); unicode-range: U+20-7E,U+A0-148,U+14A-1C3,U+1C5-31E,U+321-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3E1,U+3F0-49D,U+4A0-4FF,U+52F,U+E3F,U+1D43,U+1D47-1D49,U+1D4D,U+1D4F-1D50,U+1D52,U+1D56-1D58,U+1D5B,U+1D62-1D65,U+1D9C,U+1DA0,U+1DBB,U+1DBF-1DF5,U+1DFC-1F15,U+1F18-1F1D,U+1F20-1F45,U+1F48-1F4D,U+1F50-1F57,U+1F59,U+1F5B,U+1F5D,U+1F5F-1F7D,U+1F80-1FB4,U+1FB6-1FC4,U+1FC6-1FD3,U+1FD6-1FDB,U+1FDD-1FEF,U+1FF2-1FF4,U+1FF6-1FFE,U+2000-200D,U+2010-2027,U+202F-2060,U+2070-2071,U+2074-208E,U+2090-209C,U+20A0-20BF,U+20DB-20DE,U+20E8,U+20F0,U+2100-2101,U+2103,U+2105-2106,U+2109,U+2113,U+2116-2117,U+211E-2123,U+2126,U+212A-212B,U+212E,U+2132,U+213B,U+214D,U+214F,U+2153,U+215A-2188,U+2190-2199,U+21A9-21AA,U+21B0-21B1,U+21B3-21B5,U+21BA-21BB,U+21D0,U+21D2,U+21D4,U+21DE-21DF,U+21E4-21E5,U+21E7,U+21EA,U+2202,U+2205-2206,U+220F,U+2211-2212,U+221A,U+221E,U+222B,U+2248,U+2260,U+2264-2265,U+226A-226B,U+22EF,U+2303,U+2305,U+2318,U+2325-2327,U+2329-232B,U+2380,U+2387,U+238B,U+23CE-23CF,U+2423,U+2460-2473,U+24B6-24CF,U+24EA-24F4,U+24FF,U+25A0-25A2,U+25AA,U+25B2-25B3,U+25B6-25B7,U+25BA-25BD,U+25C0-25C1,U+25C4-25C7,U+25CA-25CB,U+25CF,U+25E6,U+25EF,U+2600,U+2605-2606,U+263C,U+2661,U+2665,U+266A,U+26A0,U+2713,U+2717,U+2756,U+2776-2789,U+27EF,U+27F5-27FA,U+2985-2986,U+2B06,U+2B12-2B13,U+2B1C,U+2C7C,U+2C7F,U+2DFF,U+2E18,U+3000-3003,U+3008-3011,U+3014-301F,U+3041-3094,U+3099-309E,U+30A1-30FE,U+3131-3164,U+318D,U+321C,U+3380-3384,U+3388-33CA,U+33CF-33D0,U+33D3,U+33D6,U+33D8,U+33DB-33DD,U+A69F,U+A7FF,U+A92E,U+AC00-D7A3,U+E000,U+E002-E05E,U+E06A-E080,U+E093-E096,U+E0A5-E0E6,U+E0F3-E11C,U+E11E-E12A,U+E131-E147,U+E14E-E164,U+EE01-EE05,U+F000-F057,U+F6C3,U+FE20-FE2D,U+FEFF,U+FF01-FF60,U+FFA1-FFBE,U+FFC2-FFC7,U+FFCA-FFCF,U+FFD2-FFD7,U+FFDA-FFDC,U+FFE0-FFE1,U+FFE5-FFE6,U+1F10B,U+1F12F-1F149,U+1F150-1F16B,U+1F170-1F189,U+1F850,U+1F852,U+F0000-F0002; }
@font-face { font-family: "Pretendard"; font-weight: 700; font-display: swap; src: url("fonts/Pretendard-Bold.woff2") format("woff2"); unicode-range: U+20-7E,U+A0-148,U+14A-1C3,U+1C5-31E,U+321-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3E1,U+3F0-49D,U+4A0-4FF,U+52F,U+E3F,U+1D43,U+1D47-1D49,U+1D4D,U+1D4F-1D50,U+1D52,U+1D56-1D58,U+1D5B,U+1D62-1D65,U+1D9C,U+1DA0,U+1DBB,U+1DBF-1DF5,U+1DFC-1F15,U+1F18-1F1D,U+1F20-1F45,U+1F48-1F4D,U+1F50-1F57,U+1F59,U+1F5B,U+1F5D,U+1F5F-1F7D,U+1F80-1FB4,U+1FB6-1FC4,U+1FC6-1FD3,U+1FD6-1FDB,U+1FDD-1FEF,U+1FF2-1FF4,U+1FF6-1FFE,U+2000-200D,U+2010-2027,U+202F-2060,U+2070-2071,U+2074-208E,U+2090-209C,U+20A0-20BF,U+20DB-20DE,U+20E8,U+20F0,U+2100-2101,U+2103,U+2105-2106,U+2109,U+2113,U+2116-2117,U+211E-2123,U+2126,U+212A-212B,U+212E,U+2132,U+213B,U+214D,U+214F,U+2153,U+215A-2188,U+2190-2199,U+21A9-21AA,U+21B0-21B1,U+21B3-21B5,U+21BA-21BB,U+21D0,U+21D2,U+21D4,U+21DE-21DF,U+21E4-21E5,U+21E7,U+21EA,U+2202,U+2205-2206,U+220F,U+2211-2212,U+221A,U+221E,U+222B,U+2248,U+2260,U+2264-2265,U+226A-226B,U+22EF,U+2303,U+2305,U+2318,U+2325-2327,U+2329-232B,U+2380,U+2387,U+238B,U+23CE-23CF,U+2423,U+2460-2473,U+24B6-24CF,U+24EA-24F4,U+24FF,U+25A0-25A2,U+25AA,U+25B2-25B3,U+25B6-25B7,U+25BA-25BD,U+25C0-25C1,U+25C4-25C7,U+25CA-25CB,U+25CF,U+25E6,U+25EF,U+2600,U+2605-2606,U+263C,U+2661,U+2665,U+266A,U+26A0,U+2713,U+2717,U+2756,U+2776-2789,U+27EF,U+27F5-27FA,U+2985-2986,U+2B06,U+2B12-2B13,U+2B1C,U+2C7C,U+2C7F,U+2DFF,U+2E18,U+3000-3003,U+3008-3011,U+3014-301F,U+3041-3094,U+3099-309E,U+30A1-30FE,U+3131-3164,U+318D,U+321C,U+3380-3384,U+3388-33CA,U+33CF-33D0,U+33D3,U+33D6,U+33D8,U+33DB-33DD,U+A69F,U+A7FF,U+A92E,U+AC00-D7A3,U+E000,U+E002-E05E,U+E06A-E080,U+E093-E096,U+E0A5-E0E6,U+E0F3-E11C,U+E11E-E12A,U+E131-E147,U+E14E-E164,U+EE01-EE05,U+F000-F057,U+F6C3,U+FE20-FE2D,U+FEFF,U+FF01-FF60,U+FFA1-FFBE,U+FFC2-FFC7,U+FFCA-FFCF,U+FFD2-FFD7,U+FFDA-FFDC,U+FFE0-FFE1,U+FFE5-FFE6,U+1F10B,U+1F12F-1F149,U+1F150-1F16B,U+1F170-1F189,U+1F850,U+1F852,U+F0000-F0002; }

:root {
  --bg: #FCEFD6;
  --paper: #FFFDF8;
  --ink: #3B1E19;
  --muted: #6D4C41;
  --line: #E9CFA9;
  --accent: #C62828;
  --on-accent: #fff;
  --warn-bg: #FFF3E0;
  --shadow: 0 6px 20px rgba(59, 30, 25, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1F1714; --paper: #2A201C; --ink: #F5E9DC; --muted: #CDB8A8; --line: #4A3A32; --accent: #EF7B6E; --on-accent: #1F1714; --warn-bg: #3A2A1E;
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  }
}
/* 화면 밝기 「어둡게」(규칙서 UX-5) — 위 시스템 다크와 같은 값. 「밝게」는 위 :not([data-theme="light"])가 막는다. */
:root[data-theme="dark"] {
  --bg: #1F1714; --paper: #2A201C; --ink: #F5E9DC; --muted: #CDB8A8; --line: #4A3A32; --accent: #EF7B6E; --on-accent: #1F1714; --warn-bg: #3A2A1E;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Ilju Sans", "Pretendard", system-ui, sans-serif; line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere; -webkit-text-size-adjust: 100%; }
main { max-width: 560px; margin: 0 auto; padding: 8px 16px 40px; }

/* 공통 상단: 사이트 이름 + 주요 이동 */
.site-head { max-width: 560px; min-height: 98px; margin: 0 auto; padding: 4px 16px 4px; display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start; justify-content: space-between; gap: 4px 8px; } /* min-height: 글자 크기·밝기 단추(둘째 줄, fontsize.js 가 나중에 붙임) 자리를 미리 잡아 본문이 밀리지 않게 */
.brand { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 18px; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand::before { content: "日"; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 7px; background: var(--accent); color: var(--on-accent); font-size: 14px; line-height: 1; }
.site-nav { display: flex; flex: 1 1 calc(100% - 160px); justify-content: flex-end; } /* 첫 줄의 남는 폭을 다 차지해 단추 묶음은 늘 둘째 줄에 */
.site-nav a { position: relative; isolation: isolate; display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--muted); text-decoration: none; white-space: nowrap; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current] { color: var(--ink); }
.site-nav a[aria-current]::before { content: ""; position: absolute; inset: 5px 0; z-index: -1; border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); } /* 누르는 자리는 44px, 보이는 알약은 34px 그대로 */
/* 좁은 화면: 글꼴이 늦게 와도(대체 글꼴이 더 넓다) 메뉴가 첫 줄에 들어가게 간격을 줄인다. 330px 미만은 메뉴가 둘째 줄이라 세 줄 자리를 잡는다 */
@media (max-width: 374px) { .site-nav a { padding: 0 5px; } }
@media (max-width: 329px) { .site-head { min-height: 146px; column-gap: 4px; } .site-head .font-pick button, .site-head .theme-pick button { min-width: 42px; padding: 0 4px; } }

/* 글 */
a { color: var(--accent); text-underline-offset: 3px; }
header h1, .doc h1 { margin: 10px 0 4px; font-size: 24px; line-height: 1.3; }
.sub, .hint, .muted { color: var(--muted); font-size: 14px; }
.sub { margin: 4px 0 0; font-size: 15px; }
main > header { margin-bottom: 14px; }
h2 { font-size: 20px; margin: 8px 0; line-height: 1.35; }
h3 { font-size: 17px; margin: 24px 0 8px; }
section { margin-top: 16px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* 입력 */
form { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 14px 14px 16px; box-shadow: var(--shadow); }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 12px 0; }
legend { font-weight: 700; padding: 0 4px; }
label { display: inline-flex; align-items: center; gap: 6px; margin: 4px 12px 4px 0; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; flex: none; }
#familiarity label { display: flex; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 10px 0; }
fieldset.row { border: 0; padding: 0; margin: 0 0 10px; gap: 6px; }
fieldset.row legend { padding: 0; margin-bottom: 6px; font-size: 14px; color: var(--muted); }
fieldset.row label { margin: 0; min-height: 44px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.date-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
.date-row label { margin: 0; min-width: 0; }
.date-row input, .date-row label:first-child input { width: 100%; min-width: 0; }
input:not([type]), input[inputmode], input[type="time"], input[type="email"], select { font: inherit; font-size: max(16px, 1em); /* 16px 미만이면 iOS 사파리가 포커스 때 확대한다(11/21 WebKit 점검) */ min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); max-width: 100%; }
input::placeholder { color: var(--muted); opacity: 0.6; }
input[readonly] { background: var(--bg); color: var(--muted); }

/* 단추: button과 a.button을 같은 모양으로 */
button, a.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; font: inherit; font-weight: 700; line-height: 1.3; text-align: center; text-decoration: none; padding: 11px 18px; border-radius: 14px; border: 1px solid transparent; background: var(--accent); color: var(--on-accent); cursor: pointer; }
button.secondary, a.button.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
button:hover, a.button:hover { filter: brightness(0.95); }
button:disabled { opacity: 0.55; cursor: not-allowed; filter: none; }
form > button[type="submit"] { width: 100%; min-height: 50px; margin-top: 8px; font-size: 17px; }
.buttons { display: flex; gap: 8px; margin: 12px 0; }
.buttons.wrap { flex-wrap: wrap; }
.error { color: var(--accent); font-weight: 700; }
.note { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.note.warn { background: var(--warn-bg); }
.consent { font-weight: 700; margin-top: 8px; min-height: 44px; }

/* 작은 글씨 고지(본문 아래) */
.fine, .note.fine { margin: 24px 0 0; padding: 0; background: transparent; border: 0; border-radius: 0; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.fine a { color: inherit; }

/* 첫 화면 머리 */
.hero { text-align: center; }
.hero-art { display: flex; justify-content: center; align-items: flex-end; height: 132px; margin-top: 4px; }
.hero-art img { display: block; width: 96px; height: 96px; border-radius: 22px; border: 3px solid var(--paper); box-shadow: var(--shadow); }
.hero-art img:nth-child(1) { transform: rotate(-7deg) translate(10px, -6px); }
.hero-art img:nth-child(2) { width: 124px; height: 124px; position: relative; z-index: 1; }
.hero-art img:nth-child(3) { transform: rotate(7deg) translate(-10px, -6px); }
.hero h1 { margin: 12px 0 0; font-size: 24px; line-height: 1.3; }
.hero .sub { margin: 4px 0 12px; }
/* 휴대폰 폭: 첫 화면 안에 생일 입력칸과 주 단추가 들어오게 그림·간격을 줄인다 */
@media (max-width: 480px) {
  .hero-art { height: 104px; margin-top: 0; }
  .hero-art img { width: 76px; height: 76px; border-radius: 18px; }
  .hero-art img:nth-child(2) { width: 98px; height: 98px; }
  .hero h1 { margin-top: 8px; }
  .hero .sub, .hero .points { margin-bottom: 8px; }
}
/* 키가 작은 휴대폰(360×740 등): 그림을 한 단계 더 줄여 주 단추가 첫 화면에 남게 */
@media (max-width: 480px) and (max-height: 760px) {
  .hero-art { height: 80px; }
  .hero-art img { width: 58px; height: 58px; border-radius: 14px; }
  .hero-art img:nth-child(2) { width: 76px; height: 76px; }
}
/* 주소줄이 보이는 휴대폰(보이는 높이 640 안팎, 360×640·375×667): 그림·소개 알약·폼 안 간격을 더 줄여 주 단추가 첫 화면에 남게. 글자는 13px 아래로, 누르는 자리는 44px 아래로 내리지 않는다 */
@media (max-width: 480px) and (max-height: 720px) {
  #step-input { margin-top: -8px; } /* main 위 여백 8px 을 이 화면에서만 지운다(다른 화면의 main 은 그대로) */
  .hero-art { height: 48px; }
  .hero-art img { width: 36px; height: 36px; border-radius: 10px; border-width: 2px; }
  .hero-art img:nth-child(2) { width: 48px; height: 48px; }
  .hero h1 { margin-top: 4px; font-size: 21px; }
  .hero .sub { margin: 2px 0 4px; font-size: 14px; }
  .hero .points { gap: 4px; margin-bottom: 4px; }
  .hero .points li { padding: 1px 10px; font-size: 13px; }
  #birth-form { padding: 10px 14px 12px; }
  #birth-form fieldset.row { margin-bottom: 6px; }
  #birth-form fieldset.row legend { margin-bottom: 4px; }
  #birth-form .row { margin: 6px 0; }
  #birth-form label.save-me { margin: 6px 0 2px; }
  #birth-form > button[type="submit"] { margin-top: 4px; }
}
/* 아주 낮은 화면(320×568 등): 그림을 빼고 소개 알약을 폼 아래로 내린다(글은 그대로 두고 자리만 바꾼다) */
@media (max-width: 480px) and (max-height: 600px) {
  #step-input { display: flex; flex-direction: column; }
  .hero { display: contents; }
  .hero-art { display: none; }
  .hero .points { order: 1; margin: 12px 0 0; }
  #birth-form ~ * { order: 2; }
}

/* 카드 */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 16px; position: relative; box-shadow: var(--shadow); }
.art { border-radius: 16px; overflow: hidden; }
.art img { display: block; width: 100%; height: auto; }
.placeholder { aspect-ratio: 1080 / 885; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.placeholder .animal { font-size: 40px; font-weight: 700; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 12px; }
.nametag { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.35; }
.my-mbti { margin: 0; color: var(--muted); }
.lines { margin: 8px 0 0; padding-left: 20px; }
.lines li { margin: 4px 0; }
.ai-mark { position: absolute; right: 16px; bottom: 6px; margin: 0; font-size: 12px; color: var(--muted); }

/* 결과 카드 아래: 공유 → 궁합 초대 → 계산 기준 */
.share, .topics, .basis { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; }
.share h3, .topics h3, .basis h3 { margin: 0 0 8px; }
.share-row { display: flex; align-items: flex-start; gap: 12px; }
.share-side { flex: 1; min-width: 0; }
.share-side .buttons { flex-wrap: wrap; margin: 0 0 6px; }
.share-side label { margin: 0 0 4px; font-size: 14px; }
.share .hint, .topics .hint { margin: 6px 0 0; font-size: 12.5px; }
canvas { width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--line); background: #FCEFD6; }
.share-row canvas { flex: none; width: 96px; border-radius: 10px; }
.topics { border-color: var(--accent); }
.topics p { margin: 0; }
.topics a.button { display: flex; width: 100%; min-height: 50px; font-size: 17px; }
.basis-now { font-weight: 700; margin: 0; }
.basis-choice { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.basis-choice label { margin: 0; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.basis-choice label.disabled { opacity: 0.66; }
.basis .hint { margin: 6px 0; }
table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 15px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 6px 4px; }
.limits { color: var(--muted); font-size: 13px; padding-left: 18px; margin: 8px 0 0; }
details.more { margin-top: 8px; }
details.more summary { display: inline-block; padding: 12px 0; font-size: 14px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
#again { width: 100%; margin-top: 16px; }

/* 검색 페이지(일주 소개·목록·2027·궁합) */
.grid { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid a { display: flex; flex-direction: column; align-items: center; height: 100%; padding: 6px 4px 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); color: var(--ink); text-align: center; text-decoration: none; line-height: 1.3; }
.grid a:hover { border-color: var(--accent); }
.grid img { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 11px; }
.grid b { margin-top: 6px; font-size: 15px; }
.grid .muted { font-size: 12.5px; }
@media (min-width: 500px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; } }
/* 여러 명 궁합 4명: 좁은 화면 3열이면 넷째 카드만 아랫줄에 홀로 남는다(11/18) → 2×2 */
@media (max-width: 499px) { .grid[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* 만난 캐릭터(F5): 만난 칸만 테두리·그림을 진하게 + 배지. 안 만난 칸은 그대로 */
.grid li.met a { position: relative; border: 2px solid var(--accent); padding: 5px 3px 9px; box-shadow: var(--shadow); }
.grid li.met img { filter: saturate(1.25) contrast(1.06); }
.met-badge { position: absolute; top: 4px; right: 4px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; line-height: 1.6; }
.met-count { margin: 10px 0 0; font-size: 17px; font-weight: 700; }
.met-count + .hint { margin: 2px 0 0; font-size: 12.5px; }
.met-line { margin: 10px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
/* 첫 화면 차별점 세 줄 */
.points { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0 0 12px; padding: 0; }
.points li { border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 13.5px; background: var(--paper); color: var(--ink); }
.topics p + p { margin-top: 8px; }
.links { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0; list-style: none; }
.person { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 8px; }
form > .person:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.person h2 { font-size: 17px; margin: 0 0 4px; }
.person > label { display: flex; flex-wrap: wrap; margin: 4px 0 10px; font-size: 14px; color: var(--muted); }
.person select { flex: 1 1 150px; color: var(--ink); }

/* 바닥 링크 */
.foot { margin-top: 32px; padding-top: 12px; border-top: 1px solid var(--line); }
.foot .links { margin: 0; gap: 2px 14px; font-size: 13.5px; }
.foot a { display: inline-block; padding: 12px 0; color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }

/* 카드 등수·링크 복사, 궁합 초대·결과(11/12) */
.ranks { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; }
.ranks li { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 14px; background: var(--bg); }
.share-link { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.share-link input { flex: 1 1 160px; min-width: 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.who { min-width: 0; text-align: center; }
.who .art { border: 1px solid var(--line); }
.who .nametag { font-size: 18px; margin-top: 8px; }
.who h3 { margin: 8px 0 0; font-size: 15px; line-height: 1.35; }
.who .placeholder .animal { font-size: 22px; padding: 0 6px; }
.rel-name { margin: 16px 0 0; font-size: 24px; text-align: center; }
#rel-text { text-align: center; }
#rel-text p { margin: 6px 0 0; }
.terms { margin-top: 16px; }
.term { padding: 10px 0; border-top: 1px dashed var(--line); }
.term p { margin: 0; font-weight: 700; }
.term .nametag { font-size: 18px; }
.term p.gloss, .gloss { margin: 2px 0 0; font-size: 13.5px; font-weight: 400; color: var(--muted); }
.terms > .hint { margin: 0; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12.5px; }
.cta { margin: 14px 0 0; }
.cta a.button { display: flex; width: 100%; min-height: 50px; font-size: 17px; }
.who-lines { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 10px; }
.who-lines h4 { margin: 0; font-size: 14px; color: var(--muted); }
.who-lines p { margin: 6px 0 0; font-size: 14px; }
.locks { list-style: none; margin: 8px 0; padding: 0; }
.lock { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); margin: 8px 0; overflow: hidden; }
.lock-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; text-align: left; background: transparent; color: var(--ink); border-radius: 0; padding: 14px 16px; }
.lock-state { flex: none; font-size: 13px; font-weight: 400; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; }
.lock[data-open="1"] .lock-head { cursor: default; }
.lock-body { padding: 0 16px 12px; }
.lock-body h4 { margin: 12px 0 4px; font-size: 15px; }
.lock-body p { margin: 6px 0; }
.lock-body p.hint { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--line); }
.paywall { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.55); }
.paywall-box { width: 100%; max-width: 420px; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 20px 16px; }
.paywall-box button { display: block; width: 100%; margin-top: 10px; }

[hidden] { display: none !important; }
.placeholder[data-color="푸른"] { background: #CFE6D8; color: #1F4D36; }
.placeholder[data-color="붉은"] { background: #F7D3CB; color: #7A1F12; }
.placeholder[data-color="노란"] { background: #F6E3A6; color: #6B4E0A; }
.placeholder[data-color="흰"] { background: #EFEDE6; color: #4A4640; }
.placeholder[data-color="검은"] { background: #34343C; color: #F2F0EA; }

/* 일주 쪽 — 한눈에(명리 사실) · 명리 근거 */
.summary { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; box-shadow: var(--shadow); }
.summary h2 { margin: 0 0 8px; font-size: 18px; }
.summary > .hint { margin: 10px 0 0; font-size: 12.5px; }
.facts { margin: 0; }
.facts div { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 8px; padding: 6px 0; border-top: 1px dashed var(--line); }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts .muted { display: block; font-size: 12.5px; }
.fun > .card { margin-top: 8px; }
.basis-ilju > .hint { margin: 6px 0; }
.fact { padding: 12px 0; border-top: 1px dashed var(--line); }
.fact h3 { margin: 0 0 4px; font-size: 16px; }
.fact p { margin: 4px 0; overflow-wrap: anywhere; }
/* 11/21 일주 펼친 단락(연애·배우자 자리 · 사람 사이) — 근거 .fact와 같은 모양 */
.love .rel, .people .rel { padding: 12px 0; border-top: 1px dashed var(--line); }
.love .rel h3, .people .rel h3 { margin: 0 0 4px; font-size: 16px; }
.love .rel p, .people .rel p { margin: 4px 0; overflow-wrap: anywhere; }

/* 11/18 F6 나를 채워 주는 색 (index.html) */
.fill-color { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; }
.fill-color h3 { margin: 0 0 8px; }
.fill-list { list-style: none; margin: 0; padding: 0; }
.fill-list li { padding: 10px 0; border-top: 1px dashed var(--line); }
.fill-list li:first-child { border-top: 0; padding-top: 0; }
.fill-head { display: flex; align-items: center; gap: 8px; margin: 0; }
.swatch { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); }
.swatch[data-el="목"] { background: #2F7D57; }
.swatch[data-el="화"] { background: #C0392B; }
.swatch[data-el="토"] { background: #D4A017; }
.swatch[data-el="금"] { background: #F4F1EA; }
.swatch[data-el="수"] { background: #1F2A44; }
.fill-why { margin: 4px 0 0; }
.fill-who { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
a.chip { display: inline-block; margin: 4px 2px 0 0; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink); font-weight: 700; text-decoration: none; }
/* 11/18 S9 상대 캐릭터 실루엣: 그림을 흑백·흐림으로 눌러 세부를 가리고 그 기운 색 한 가지로만 물들인다(color 혼합) → 형체와 색만 살짝.
   썸네일에 배경 장면이 함께 있어 몸만 따로 오려 내지는 못한다. 칩을 눌러 궁합을 열면 그림이 다 보인다. */
a.chip:has(.sil) { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; }
.sil { position: relative; flex: none; display: inline-block; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; isolation: isolate; background: #fff; }
.sil img { display: block; width: 100%; height: 100%; filter: grayscale(1) contrast(1.3) blur(0.8px); }
.sil::after { content: ""; position: absolute; inset: 0; mix-blend-mode: color; background: #7D786E; }
.sil[data-el="목"]::after { background: #2F7D57; }
.sil[data-el="화"]::after { background: #C0392B; }
.sil[data-el="토"]::after { background: #B8860B; }
.sil[data-el="금"]::after { background: #7D786E; }
.sil[data-el="수"]::after { background: #1F2A44; }
.fill-color .hint { margin: 6px 0 0; font-size: 12.5px; }
.pair-find { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; }
.pair-find h3 { margin: 0 0 8px; }
.pair-find .hint { margin: 6px 0 0; font-size: 12.5px; }

/* 11/18 무료 궁합 반응 단추 (gunghap.html) */
.reaction { padding: 10px 0; border-top: 1px dashed var(--line); }
.reaction-q { margin: 0; font-weight: 700; }
.reaction .buttons { flex-wrap: wrap; margin: 8px 0 0; }
.reaction button { flex: 1 1 0; min-width: 84px; }
.reaction button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: transparent; opacity: 1; }
.reaction p.hint { margin: 6px 0 0; }

/* 11/18 가독성 개편: 쉬운 말 용어(abbr.gl) · 결론 아래 칩 · 접기 · 정확도 줄 · 이 기기에 저장 */
abbr.gl { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
abbr.gl:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 2px; }
abbr.gl:focus::after { content: " (" attr(title) ")"; font-size: 13px; font-weight: 400; color: var(--muted); }
.rel-easy { margin: 6px 0 0; text-align: center; font-weight: 700; }
.lead { margin: 8px 0 0; font-weight: 700; }
ul.chips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 10px 0 0; padding: 0; }
ul.chips li { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 14px; background: var(--bg); color: var(--ink); }
details.fold { margin-top: 14px; border-top: 1px solid var(--line); }
details.fold > summary { padding: 12px 0; font-weight: 700; cursor: pointer; }
details.fold > summary > h2 { display: inline; margin: 0; font-size: 1.1em; }
#pair-body td:last-child a { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; } /* 여러 명 궁합 「두 사람 궁합」 링크: 누르는 자리 44px */
.how-sum ol { margin: 6px 0 0; padding-left: 20px; }
.how-sum li { margin: 4px 0; }
.accuracy { margin: 12px 0 0; font-size: 13.5px; color: var(--muted); }
.accuracy > p { margin: 0; }
.accuracy .hint { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; }
.saved { margin: 4px 0 8px; }
.saved > .hint { margin: 0 0 6px; font-size: 13px; }
.saved-list { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; padding: 0; }
.saved-list li { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--bg); }
.saved-list button { min-height: 44px; padding: 6px 12px; border: 0; border-radius: 0; background: transparent; color: var(--ink); font-weight: 400; }
.saved-list button.chip-del { padding: 6px 12px; color: var(--muted); border-left: 1px solid var(--line); }
button.clear-saved { min-height: 44px; padding: 6px 14px; font-size: 14px; font-weight: 400; }
label.save-me { display: flex; align-items: flex-start; gap: 8px; min-height: 44px; margin: 12px 0 4px; font-size: 14px; color: var(--muted); }
label.save-me input { margin-top: 2px; }
/* 저장 칸으로 입력 화면이 길어져 오류 줄이 화면 위로 나가면, 브라우저 스크롤 고정(anchoring)이 화면을 내려 버린다. 오류를 띄울 때 스크롤은 그대로 둔다. */
html:has(#g-form) { overflow-anchor: none; }
.today-head { display: flex; gap: 14px; align-items: center; margin: 8px 0; }
.today-head img { width: 144px; height: auto; border-radius: 12px; border: 1px solid var(--line); flex: none; }
.today-me { margin: 0; font-size: 18px; font-weight: 700; }
.today-head .hint { margin: 4px 0 0; }
.today-lines { display: grid; grid-template-columns: max-content 1fr; gap: 8px 12px; margin: 12px 0; }
.today-lines dt { font-weight: 700; }
.today-lines dd { margin: 0; line-height: 1.6; }
.days-list { margin: 8px 0 0; padding-left: 20px; font-size: 14.5px; }
.days-list li { margin: 4px 0; color: var(--muted); }
.days-list li.marked { color: var(--ink); }

/* 글자 크기(web/fontsize.js, localStorage "ilju.font"): 크기가 px 이라 화면 전체 배율로 바꾼다 */
html[data-font="s"] body { zoom: 0.9; }
html[data-font="l"] body { zoom: 1.18; }
.font-pick { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.font-pick button, .theme-pick button { position: relative; }
.font-pick button::after, .theme-pick button::after { content: ""; position: absolute; inset: -5px 0; } /* 보이는 크기는 36px, 누르는 자리는 위아래로 넓혀 44px 이상 */
.font-pick button { font: inherit; font-weight: 700; line-height: 1; min-width: 44px; min-height: 36px; padding: 0 6px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.font-pick button[data-font="s"] { font-size: 12px; }
.font-pick button[data-font="m"] { font-size: 15px; }
.font-pick button[data-font="l"] { font-size: 19px; }
.font-pick button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
/* 화면 밝기 고르기(web/fontsize.js, localStorage "ilju.theme") · 홈 화면 추가(web/pwa.js) · 읽어 주기(web/speak.js) · 카카오톡(web/kshare.js) — 규칙서 UX */
.theme-pick { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.theme-pick button { font: inherit; font-size: 13px; font-weight: 700; line-height: 1; min-width: 44px; min-height: 36px; padding: 0 8px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.theme-pick button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.a2hs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 8px 0 0; }
.a2hs .hint { margin: 0; }
.speak-box { display: block; margin: 4px 0 8px; }

/* 만세력 세운 10년·월운 12달(web/manse.html #ms-seun·#ms-wolun, 작업 unse): 390px에서 가로 스크롤 없이 접힌다 */
.ms-unse-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.ms-unse-table th, .ms-unse-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; word-break: keep-all; overflow-wrap: anywhere; }
.ms-unse-table th:nth-child(1), .ms-unse-table td:nth-child(1) { width: 22%; }
.ms-unse-table th:nth-child(2), .ms-unse-table td:nth-child(2) { width: 18%; }
.ms-unse-table th:nth-child(3), .ms-unse-table td:nth-child(3) { width: 22%; }
.ms-unse-table td:nth-child(2) strong { font-size: 17px; }
.ms-unse-table tr.now { background: var(--warn-bg); }
.ms-unse-table .badge { display: inline-block; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 12px; white-space: nowrap; }
.ms-unse-notes { margin: 8px 0 0; padding-left: 18px; }
.ms-unse-notes li { margin: 2px 0; }

/* 11/22 CAL 달력 격자(today.html #cal) — 기호 색은 달력 안에서만 쓰는 토큰 */
#cal { --cal-hap: #2E7D32; --cal-ban: #00796B; --cal-chung: #8D5A00; --cal-same: #5D4037; --cal-gan: #1565C0; --cal-pick: #FCE8C8; --cal-avoid: #EEE6DF; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #cal { --cal-hap: #81C784; --cal-ban: #4DB6AC; --cal-chung: #FFB74D; --cal-same: #D7CCC8; --cal-gan: #90CAF9; --cal-pick: #4A3418; --cal-avoid: #241B18; }
}
:root[data-theme="dark"] #cal { --cal-hap: #81C784; --cal-ban: #4DB6AC; --cal-chung: #FFB74D; --cal-same: #D7CCC8; --cal-gan: #90CAF9; --cal-pick: #4A3418; --cal-avoid: #241B18; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0; }
.cal-nav button { min-width: 44px; min-height: 44px; font-size: 20px; line-height: 1; }
.cal-nav button:disabled { opacity: 0.35; cursor: default; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 8px 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.cal-legend li[hidden] { display: none; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; width: 100%; max-width: 100%; }
.cal-dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.cal-day { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; min-height: 56px; padding: 3px 1px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font: inherit; line-height: 1.15; cursor: pointer; overflow: hidden; }
.cal-num { font-size: 13px; font-weight: 700; }
.cal-ij { font-size: 11px; color: var(--muted); white-space: nowrap; }
.cal-mk { min-height: 13px; font-size: 11px; font-weight: 700; letter-spacing: -1px; white-space: nowrap; }
#cal [data-k="육합"] { color: var(--cal-hap); }
#cal [data-k="반합"] { color: var(--cal-ban); }
#cal [data-k="충"] { color: var(--cal-chung); }
#cal [data-k="같은 글자"] { color: var(--cal-same); }
#cal [data-k="천간합"] { color: var(--cal-gan); }
.cal-day[aria-current="date"] { box-shadow: inset 0 0 0 2px var(--ink); }
.cal-day[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-day[data-tg="pick"] { background: var(--cal-pick); border: 2px solid var(--accent); }
.cal-day[data-tg="avoid"], .cal-day[data-tg="chung"] { background: var(--cal-avoid); border-style: dashed; }
.cal-day[data-past="1"] { opacity: 0.5; }
.cal-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.cal-sw[data-tg="pick"] { background: var(--cal-pick); border: 2px solid var(--accent); }
.cal-sw[data-tg="avoid"] { background: var(--cal-avoid); border: 1px dashed var(--muted); }
#cal h3 { margin: 14px 0 2px; font-size: 16px; }
#cal .days-list button.link-like { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 2px 0; margin: 0; min-height: 0; width: auto; text-align: left; font: inherit; font-weight: 400; color: inherit; cursor: pointer; text-decoration: underline dotted; }
/* 11/22 G4 설명 방식 고르기(만세력 AI 질문문·풀이 뒤 질문) */
.ms-ai-style, .chat-style { margin: 0; font-size: 14px; color: var(--muted); flex-wrap: wrap; max-width: 100%; }
.ms-ai-style select, .chat-style select { color: var(--ink); }
