/* =========================================================
   인명용 한자 사전 · 한자 이름 풀이  (/ko/hanja · /ko/hanja/{…} · /ko/hanja_name)
   home.css(머리말 · 테마) · time.css(입력 칸) · name-number.css(성 · 이름 칸) 위에 얹습니다.
   ========================================================= */

.hj-main { width: min(100%, 760px); margin: 0 auto; }
.hj-main [lang="ko"] { font-family: "Noto Serif KR", "Noto Serif CJK KR", "Nanum Myeongjo", "Batang", serif; }

.hj-h { margin: 0 0 12px; font-size: 16px; font-weight: 900; letter-spacing: -.01em; }
.hj-h small { margin-left: 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.hj-sub { margin: 14px 0 8px; font-size: 12.5px; font-weight: 800; }
.hj-sub small { margin-left: 6px; font-weight: 600; color: var(--muted); }
.hj-p { margin: 10px 0 0; font-size: 13px; line-height: 1.8; color: var(--muted); word-break: keep-all; }
.hj-more { margin: 12px 0 0; font-size: 12.5px; font-weight: 700; }
.hj-more a, .hj-crumb a { color: var(--primary-ink); text-decoration: none; }
.hj-more a:hover, .hj-crumb a:hover { text-decoration: underline; }
.hj-none { color: var(--muted); font-weight: 700; }

.hj-crumb { margin: 4px 2px 10px; font-size: 12px; font-weight: 700; color: var(--muted); }
.hj-crumb span { margin: 0 3px; opacity: .6; }
.hj-crumb b { color: var(--text); }

/* ---------- 오행 색 ---------- */
.hj-oh { font-style: normal; font-weight: 900; }
.hj-oh[data-oh="木"] { color: #3f9a5f; }
.hj-oh[data-oh="火"] { color: #d6604d; }
.hj-oh[data-oh="土"] { color: #b3873a; }
.hj-oh[data-oh="金"] { color: #8a8f98; }
.hj-oh[data-oh="水"] { color: #3f84c8; }
html[data-theme="dark"] .hj-oh[data-oh="木"] { color: #7ed69b; }
html[data-theme="dark"] .hj-oh[data-oh="火"] { color: #f08f7e; }
html[data-theme="dark"] .hj-oh[data-oh="土"] { color: #dcb877; }
html[data-theme="dark"] .hj-oh[data-oh="金"] { color: #c3c8d0; }
html[data-theme="dark"] .hj-oh[data-oh="水"] { color: #7fb6ea; }

/* ---------- 카드 · 안내 ---------- */
.hj-card, .hj-about, .hj-eums {
    margin: 16px 0 0;
    padding: 18px 16px;
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.hj-about ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 13px; line-height: 1.8; color: var(--muted); word-break: keep-all; }
.hj-about li b { color: var(--text); }
.hj-src { width: min(100%, 760px); margin: 18px auto 0; padding: 0 6px; font-size: 11px; line-height: 1.8; color: var(--muted); text-align: center; word-break: keep-all; }

.hj-cta {
    display: flex; flex-direction: column; gap: 3px;
    margin: 16px 0 0; padding: 15px 16px;
    border-radius: 18px;
    background: linear-gradient(150deg, rgba(82,183,136,.18), rgba(90,200,189,.08)), var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--text); text-decoration: none;
    transition: transform .12s ease;
}
.hj-cta:hover { transform: translateY(-1px); }
.hj-cta b { font-size: 15px; font-weight: 900; }
.hj-cta span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.hj-cta-in { box-shadow: none; margin-top: 14px; }

/* ---------- 찾기 ---------- */
.hj-search { width: min(100%, 360px); margin-left: auto; margin-right: auto; }
.hj-search-input { text-align: center; font-size: 18px; letter-spacing: .1em; }

/* ---------- 음 격자 ---------- */
.hj-cho { display: grid; grid-template-columns: 30px 1fr; gap: 6px 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.hj-cho:first-of-type { border-top: 0; padding-top: 0; }
.hj-cho h3 { margin: 4px 0 0; font-size: 15px; font-weight: 900; color: var(--primary-ink); text-align: center; }
.hj-cho ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.hj-cho a {
    display: inline-flex; align-items: baseline; gap: 3px;
    padding: 5px 9px; border-radius: 10px;
    background: var(--soft); color: var(--text); text-decoration: none;
    font-size: 14px; font-weight: 800;
}
.hj-cho a:hover { background: var(--primary); color: #fff; }
.hj-cho a small { font-size: 10px; font-weight: 700; opacity: .6; }

/* ---------- 음별 글자 목록 ---------- */
.hj-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.hj-list a {
    display: grid; grid-template-columns: auto 1fr; grid-template-areas: "c h" "c m"; column-gap: 10px; align-items: center;
    padding: 10px 12px; border-radius: 16px;
    background: var(--surface); box-shadow: var(--shadow-sm);
    color: var(--text); text-decoration: none;
}
.hj-list a:hover { outline: 2px solid var(--primary); }
.hj-char { grid-area: c; font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--text); text-decoration: none; }
.hj-hun { grid-area: h; font-size: 12.5px; font-weight: 800; line-height: 1.4; word-break: keep-all; }
.hj-meta { grid-area: m; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.hj-meta i { padding: 1px 6px; border-radius: 7px; background: var(--soft); font-size: 10.5px; font-style: normal; font-weight: 800; color: var(--muted); }
.hj-meta i.hj-oh { background: var(--soft); }

/* ---------- 글자 상세 ---------- */
.hj-hero { display: flex; align-items: center; gap: 16px; margin: 6px 0 0; padding: 18px 16px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-sm); }
.hj-big {
    flex: 0 0 auto; width: 112px; height: 112px; display: grid; place-items: center;
    border-radius: 20px; background: var(--soft);
    font-size: 74px; font-weight: 700; line-height: 1;
}
.hj-hero h1 { margin: 0; font-size: clamp(19px, 5vw, 25px); line-height: 1.45; letter-spacing: -.01em; word-break: keep-all; }
.hj-badges { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 0; }
.hj-badges i { padding: 3px 9px; border-radius: 999px; background: var(--soft); font-size: 11.5px; font-style: normal; font-weight: 800; color: var(--muted); }
.hj-badges .hj-ok { background: rgba(82,183,136,.18); color: var(--primary-ink); }
.hj-huns { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.hj-huns li { padding: 6px 11px; border-radius: 12px; background: var(--soft); font-size: 14px; }
.hj-huns a, .hj-eum { color: var(--primary-ink); font-weight: 900; text-decoration: none; }
.hj-eum { display: inline-block; margin-right: 6px; padding: 2px 9px; border-radius: 9px; background: var(--soft); }
.hj-facts { margin: 0; display: grid; gap: 0; }
.hj-facts > div { display: grid; grid-template-columns: 118px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.hj-facts > div:first-child { border-top: 0; }
.hj-facts dt { font-weight: 700; color: var(--muted); }
.hj-facts dd { margin: 0; font-weight: 800; word-break: keep-all; }
.hj-facts dd small { margin-left: 5px; font-size: 11px; font-weight: 600; color: var(--muted); }
.hj-near { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.hj-near a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; background: var(--soft); color: var(--text); text-decoration: none; }
.hj-near a:hover { outline: 2px solid var(--primary); }
.hj-near b { font-size: 24px; font-weight: 700; line-height: 1.1; }
.hj-near small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 700; color: var(--muted); }

/* ---------- 이름 풀이: 한자 고르기 ---------- */
.hj-picks { margin: 18px 0 0; }
.hj-pick { margin: 0 0 12px; padding: 14px 12px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-sm); }
.hj-pick h3 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 10px; }
.hj-pick h3 b { font-size: 20px; font-weight: 900; }
.hj-pick h3 small { font-size: 11px; font-weight: 700; color: var(--muted); }
.hj-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; }
.hj-chip {
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 8px 4px 7px; border: 1.6px solid var(--line); border-radius: 14px;
    background: var(--bg); color: var(--text); font: inherit; cursor: pointer;
}
.hj-chip b { font-size: 26px; font-weight: 700; line-height: 1.15; }
.hj-chip span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 800; }
.hj-chip small { font-size: 10px; font-weight: 700; color: var(--muted); }
.hj-chip:hover { border-color: var(--primary); }
.hj-chip.is-on { border-color: var(--primary); background: rgba(82,183,136,.16); box-shadow: 0 0 0 2px rgba(82,183,136,.25); }
.hj-chip-more { grid-column: 1 / -1; padding: 9px 4px; justify-content: center; font-size: 11.5px; font-weight: 800; color: var(--primary-ink); border-style: dashed; }

/* ---------- 이름 풀이: 결과 ---------- */
.hj-result { margin: 22px 0 0; scroll-margin-top: 12px; }
.hj-name { margin: 0; text-align: center; font-size: 34px; font-weight: 700; letter-spacing: .12em; line-height: 1.3; }
.hj-name b { color: var(--primary); font-weight: 700; }
.hj-name small { display: block; margin-top: 2px; font-size: 13px; font-weight: 800; letter-spacing: .3em; color: var(--muted); }
.hj-letters { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hj-letters li { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "c h" "c m"; column-gap: 12px; align-items: center; padding: 8px 10px; border-radius: 14px; background: var(--soft); }
.hj-letters .hj-meta i { background: var(--surface); }

.hj-four { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hj-suri { padding: 13px 13px 12px; border-radius: 16px; background: var(--soft); border-left: 4px solid var(--line); }
.hj-suri header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hj-suri-key { font-size: 12.5px; font-weight: 900; }
.hj-suri-key i { margin-left: 2px; font-style: normal; font-weight: 700; color: var(--muted); }
.hj-luck { padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 900; background: var(--surface); }
.hj-suri-num { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 0; }
.hj-suri-num b { font-size: 30px; font-weight: 900; line-height: 1.1; }
.hj-suri-num span { font-size: 13.5px; font-weight: 900; }
.hj-suri-when { margin: 2px 0 0; font-size: 11px; font-weight: 700; color: var(--muted); }
.hj-suri-text { margin: 8px 0 0; font-size: 12.5px; line-height: 1.75; word-break: keep-all; }
.hj-suri-how { margin: 8px 0 0; font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.hj-suri.is-good { border-left-color: #52b788; } .hj-suri.is-good .hj-luck, .hj-suri.is-good .hj-suri-num b { color: #3b8e67; }
.hj-suri.is-mid  { border-left-color: #d9b45a; } .hj-suri.is-mid  .hj-luck, .hj-suri.is-mid  .hj-suri-num b { color: #a8842c; }
.hj-suri.is-care { border-left-color: #d98a7a; } .hj-suri.is-care .hj-luck, .hj-suri.is-care .hj-suri-num b { color: #b9614f; }
html[data-theme="dark"] .hj-suri.is-good .hj-luck, html[data-theme="dark"] .hj-suri.is-good .hj-suri-num b { color: #8fe2ba; }
html[data-theme="dark"] .hj-suri.is-mid  .hj-luck, html[data-theme="dark"] .hj-suri.is-mid  .hj-suri-num b { color: #ecd08a; }
html[data-theme="dark"] .hj-suri.is-care .hj-luck, html[data-theme="dark"] .hj-suri.is-care .hj-suri-num b { color: #f0a797; }

.hj-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hj-flow-item { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 62px; padding: 8px 10px; border-radius: 14px; background: var(--soft); font-size: 15px; }
.hj-flow-item small { font-size: 11.5px; font-weight: 800; color: var(--muted); }
.hj-rel { padding: 2px 7px; border-radius: 999px; font-size: 10.5px; font-style: normal; font-weight: 900; background: var(--soft); color: var(--muted); }
.hj-rel.is-gen { background: rgba(82,183,136,.18); color: var(--primary-ink); }
.hj-rel.is-kill { background: rgba(217,138,122,.2); color: #b9614f; }
html[data-theme="dark"] .hj-rel.is-kill { color: #f0a797; }
.hj-yy { font-weight: 900; }
.hj-yy.is-yang { color: #d6604d; } .hj-yy.is-eum { color: #3f84c8; }
html[data-theme="dark"] .hj-yy.is-yang { color: #f08f7e; } html[data-theme="dark"] .hj-yy.is-eum { color: #7fb6ea; }
.hj-counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; font-size: 12.5px; font-weight: 800; }
.hj-count { padding: 3px 9px; border-radius: 999px; background: var(--soft); }
.hj-count.is-zero { opacity: .45; }

.hj-actions { display: flex; justify-content: center; margin: 16px 0 0; }
.hj-btn { padding: 11px 20px; border: 0; border-radius: 14px; background: var(--primary); color: #fff; font: inherit; font-size: 13.5px; font-weight: 900; cursor: pointer; box-shadow: 0 4px 0 var(--primary-deep); }
.hj-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--primary-deep); }

.hj-toast {
    position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 12px); z-index: 50;
    max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 999px;
    background: var(--text); color: var(--bg); font-size: 12.5px; font-weight: 800;
    opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
.hj-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 520px) {
    .hj-four { grid-template-columns: 1fr; }
    .hj-big { width: 88px; height: 88px; font-size: 58px; }
    .hj-facts > div { grid-template-columns: 96px 1fr; }
    .hj-chips { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
}
