/* 이름 붓방(작명) 화면: 토큰은 theme/palja/css/tokens.css 의 --pm-* 만 쓴다. 모바일(390px) 먼저. */
.nm { gap: 16px; }
.nm-card { box-sizing: border-box; min-width: 0; padding: 22px 20px; border-radius: var(--pm-r-panel-sm); background: var(--pm-card); box-shadow: var(--pm-shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 0; margin: 0; }
fieldset.nm-card { margin: 0; }
.nm-card > legend { float: left; width: 100%; padding: 0 0 12px; } /* 카드 안 제목: 위 테두리에 걸쳐 그려지지 않게 흐름 안으로 */
.nm-card > legend + * { clear: both; }
.nm-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.nm-err { margin: 6px 0 0; color: var(--pm-fire-deep); font-size: 14px; font-weight: 700; }
.nm [hidden] { display: none !important; }

.nm-eyebrow { display: inline-block; padding: 4px 12px; border-radius: var(--pm-r-pill); margin-bottom: 8px; background: var(--pm-soft); color: var(--pm-fire-deep); font-size: 13px; font-weight: 700; }
.nm-title { font-family: var(--pm-font-head); font-weight: 400; font-size: 26px; line-height: 1.25; margin: 0 0 8px; color: var(--pm-ink); }
.nm-title small { font-family: var(--pm-font-body); font-size: 16px; color: var(--pm-sub-text); }
.nm-lead { margin: 0 0 8px; color: var(--pm-sub-text); font-size: 15px; line-height: 1.7; word-break: keep-all; }
.nm-h2 { font-family: var(--pm-font-head); font-weight: 400; font-size: 20px; line-height: 1.3; margin: 0 0 12px; color: var(--pm-ink); }
.nm-h3 { font-family: var(--pm-font-head); font-weight: 400; font-size: 18px; margin: 0 0 10px; color: var(--pm-ink); }
.nm-h4 { font-size: 15px; margin: 0 0 8px; color: var(--pm-ink); }
.nm-legend2 { font-size: 14px; font-weight: 700; margin: 0 0 8px; padding: 0; color: var(--pm-ink); }
.nm-sub { margin: 6px 0; font-size: 13.5px; line-height: 1.6; color: var(--pm-sub-text); word-break: keep-all; }
.nm-help { margin: 6px 2px 0; font-size: 13px; line-height: 1.5; color: var(--pm-sub-text); word-break: keep-all; }
.nm-lead2 { margin: 4px 0 0; font-size: 14.5px; color: var(--pm-sub-text); }
.nm-link { color: var(--pm-fire-deep); text-decoration: underline; text-underline-offset: 3px; }
.nm-warnline { display: block; color: var(--pm-error); font-size: 13.5px; line-height: 1.6; }
.nm-flash { box-sizing: border-box; margin: 0; padding: 12px 16px; border-radius: var(--pm-r-card); background: var(--pm-info-bg); color: var(--pm-info-ink); font-size: 14.5px; line-height: 1.6; }
.nm-flash.is-bad { background: var(--pm-error-bg); color: var(--pm-error); }
.nm-beta { margin: 6px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--pm-ink); }
.nm-srcline { margin: 0; text-align: center; font-size: 13px; color: var(--pm-sub-text); }
.nm-srcline a { color: var(--pm-fire-deep); text-decoration: underline; text-underline-offset: 3px; }
.nm-again { text-align: center; }
.nm-pre { max-height: 320px; overflow: auto; margin: 8px 0 0; padding: 12px; border-radius: var(--pm-r-input); background: var(--pm-cream); font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

/* 배지 */
.nm-badge { display: inline-block; padding: 2px 10px; border-radius: var(--pm-r-pill); background: var(--pm-soft2); color: var(--pm-ink); font-size: 12.5px; font-weight: 700; line-height: 1.5; }
.nm-badge--beta { background: var(--pm-info-bg); color: var(--pm-info-ink); }
.nm-badge--saju { background: #e3f3dc; color: #2d5a1f; }
.nm-badge--warn { background: #fdecc8; color: #6b4a00; }
.nm-badge--ref { background: var(--pm-soft2); color: var(--pm-sub-text); }
.nm-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* 버튼 */
.nm-btn { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--pm-tap); padding: 10px 20px; border: 0; border-radius: var(--pm-r-input); background: var(--pm-fire); color: var(--pm-ink); font-family: var(--pm-font-head); font-size: 16px; line-height: 1.2; text-decoration: none; cursor: pointer; box-shadow: var(--pm-shadow-sm); transition: transform .15s, background .15s; }
.nm-btn:hover { background: var(--pm-fire-hover); transform: translateY(-1px); }
.nm-btn--sub { background: var(--pm-soft2); }
.nm-btn--sub:hover { background: var(--pm-soft); }
.nm-go { min-width: 200px; min-height: 48px; font-size: 18px; }
.nm-inline { display: inline-block; margin: 0; }
.nm-formacts, .nm-actrow, .nm-ctrl-row, .nm-cand-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.nm-actrow { margin-top: 0; }

/* 입구 */
.nm-start .nm-step { margin: 0; }
.nm-waylist { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0; padding: 0; list-style: none; }
.nm-way { display: flex; flex-direction: column; gap: 4px; height: 100%; text-decoration: none; color: var(--pm-ink); transition: transform .15s; }
.nm-way:hover { transform: translateY(-2px); }
.nm-way b { font-family: var(--pm-font-head); font-weight: 400; font-size: 19px; }
.nm-way span { font-size: 14px; line-height: 1.6; color: var(--pm-sub-text); word-break: keep-all; }
@media (min-width: 720px) { .nm-waylist { grid-template-columns: repeat(3, 1fr); } .nm-title { font-size: 30px; } .nm-card { padding: 28px 28px; } }

/* 폼 */
.nm-form { display: flex; flex-direction: column; gap: 16px; }
.nm-fieldset { border: 0; margin: 0 0 14px; padding: 0; min-width: 0; }
.nm-field { margin: 0 0 14px; }
.nm-field > label, .nm-label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--pm-ink); }
.nm-req { color: var(--pm-fire-deep); }
.nm input[type="text"], .nm input[type="date"], .nm input[type="time"], .nm select, .nm textarea { box-sizing: border-box; width: 100%; min-height: var(--pm-tap); padding: 10px 14px; border: 2px solid var(--pm-line); border-radius: var(--pm-r-input); background: var(--pm-cream); color: var(--pm-ink); font: inherit; font-size: 16px; }
.nm textarea { min-height: 64px; resize: vertical; }
.nm input:focus, .nm select:focus, .nm textarea:focus { border-color: var(--pm-water); box-shadow: 0 0 0 3px var(--pm-focus-ring); outline: 3px solid var(--pm-focus); outline-offset: 2px; }
.nm .is-error input, .nm .is-error select { border-color: var(--pm-error); }
.nm-err { margin: 6px 2px 0; font-size: 13.5px; font-weight: 700; color: var(--pm-error); }
.nm-errsum { padding: 14px 18px; border-radius: var(--pm-r-card); background: var(--pm-error-bg); color: var(--pm-error); font-size: 14.5px; }
.nm-errsum ul { margin: 6px 0 0; padding-left: 1.2em; }
.nm-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nm-radios { display: flex; flex-wrap: wrap; gap: 8px; }
.nm-radio, .nm-seg label, .nm-pick, .nm-ini { position: relative; cursor: pointer; }
.nm-radio input, .nm-seg input, .nm-pick input, .nm-ini input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nm-radio span, .nm-seg span, .nm-pick span, .nm-ini span { display: inline-flex; align-items: center; justify-content: center; min-height: var(--pm-tap); padding: 8px 16px; border: 2px solid var(--pm-line); border-radius: var(--pm-r-pill); background: var(--pm-cream); font-size: 15px; transition: .15s; }
.nm-radio input:checked + span, .nm-seg input:checked + span, .nm-pick input:checked + span, .nm-ini input:checked + span { background: var(--pm-wood); border-color: var(--pm-wood); font-weight: 700; }
.nm-radio input:focus-visible + span, .nm-seg input:focus-visible + span, .nm-pick input:focus-visible + span, .nm-ini input:focus-visible + span { outline: 3px solid var(--pm-focus); outline-offset: 2px; }
.nm-seg { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.nm-surhanja { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.nm-pick span { min-width: var(--pm-tap); padding: 8px 14px; font-size: 20px; }
.nm-inis { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.nm-ini span { min-width: var(--pm-tap); padding: 6px 10px; border-radius: var(--pm-r-input); }
.nm-check { position: relative; display: flex; align-items: flex-start; gap: 12px; min-height: var(--pm-tap); padding: 8px 4px; cursor: pointer; font-size: 15px; line-height: 1.5; }
.nm-check input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nm-box { flex: none; width: 28px; height: 28px; border: 2px solid var(--pm-line); border-radius: var(--pm-r-check); background: var(--pm-cream); display: inline-flex; align-items: center; justify-content: center; transition: .15s; }
.nm-check input:checked + .nm-box { background: var(--pm-wood); border-color: var(--pm-wood); }
.nm-check input:checked + .nm-box::after { content: ''; width: 7px; height: 13px; margin-top: -3px; border: solid var(--pm-ink); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.nm-check input:focus-visible + .nm-box { outline: 3px solid var(--pm-focus); outline-offset: 2px; }
.nm-check.is-error .nm-box { border-color: var(--pm-error); }
.nm-sajupanel { margin-top: 12px; padding: 12px 14px; border-radius: var(--pm-r-card); background: var(--pm-soft); }
.nm-slider { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.nm-slider input[type="range"] { flex: 1 1 auto; min-height: var(--pm-tap); accent-color: var(--pm-water); }
.nm-cmprow { display: grid; grid-template-columns: 28px 1fr 1.4fr; gap: 8px 10px; align-items: end; padding: 10px 0; border-top: 1px dashed var(--pm-line); }
.nm-cmprow:first-of-type { border-top: 0; }
.nm-cmprow-n { grid-row: 1 / span 2; align-self: center; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--pm-ink); color: var(--pm-cream); font-size: 13px; }
.nm-cmprow .nm-field { margin: 0; }
.nm-cmprow .nm-field:nth-of-type(3), .nm-cmprow .nm-field:nth-of-type(4) { grid-column: auto; }
@media (max-width: 520px) { .nm-cmprow { grid-template-columns: 28px 1fr 1fr; } }

/* 단계(JS 가 켜지면 .nm-wizard) */
.nm-steps { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.nm-steps li { flex: 1 1 0; height: 6px; border-radius: 3px; background: var(--pm-line); }
.nm-steps li.is-on { background: var(--pm-water); }
.nm-stepbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; }
.nm-stepcount { font-size: 14px; color: var(--pm-sub-text); }
.nm-wizard .nm-step[hidden] { display: none; }

/* 결과 카드 */
.nm-sum p { margin: 0 0 6px; }
.nm-cards { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 720px) { .nm-cards { grid-template-columns: 1fr 1fr; align-items: start; } }
.nm-cardwrap { min-width: 0; }
.nm-cand { box-sizing: border-box; border-radius: var(--pm-r-panel-sm); background: var(--pm-card); box-shadow: var(--pm-shadow); }
.nm-cand-sum { display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 14px; cursor: pointer; list-style: none; }
.nm-cand-sum::-webkit-details-marker { display: none; }
.nm-cand-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.nm-name { font-family: var(--pm-font-head); font-size: 24px; }
.nm-hanja { font-size: 19px; color: var(--pm-sub-text); }
.nm-hanja--none { font-size: 13px; }
.nm-hun { font-size: 13.5px; color: var(--pm-sub-text); line-height: 1.5; word-break: keep-all; }
.nm-open { align-self: flex-start; margin-top: 6px; padding: 4px 12px; border-radius: var(--pm-r-pill); background: var(--pm-soft); color: var(--pm-fire-deep); font-size: 13px; font-weight: 700; }
.nm-cand[open] .nm-open::after { content: ' (접기)'; }
.nm-cand-body { padding: 4px 14px 16px; }
.nm-cand-acts { margin: 0; padding: 0 18px 14px; }
.nm-cand-body .nm-card { box-shadow: none; padding: 16px 14px; background: var(--pm-cream); }
.nm-cand-body .nm-read { display: flex; flex-direction: column; gap: 12px; }
.nm-loading { margin: 0; color: var(--pm-sub-text); font-size: 14px; }

/* 점수 막대 */
.nm-panel { display: grid; width: 100%; box-sizing: border-box; grid-template-columns: 6.2em minmax(0, 1fr) 3.6em; align-items: center; gap: 8px; font-size: 13.5px; }
.nm-panel-k { color: var(--pm-sub-text); white-space: nowrap; }
.nm-bar { display: block; height: 10px; border-radius: 5px; background: var(--pm-line); overflow: hidden; }
.nm-bar i { display: block; height: 100%; border-radius: 5px; background: var(--pm-water); }
.nm-panel--trad .nm-bar i { background: var(--pm-earth); }
.nm-panel-v { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 3.6em; } /* 점수 "100.0" 이 줄바꿈되어 "100." / "0" 으로 깨지지 않게 자리를 확보한다 */
.nm-panelbox { margin-bottom: 14px; }

/* 풀이 */
.nm-read { display: flex; flex-direction: column; gap: 16px; }
.nm-bigname { font-family: var(--pm-font-head); font-weight: 400; font-size: 30px; line-height: 1.25; margin: 0 0 6px; }
.nm-legal.is-attn { box-shadow: 0 0 0 3px #fdecc8, var(--pm-shadow); }
.nm-legal-scope { margin: 0 0 8px; line-height: 1.8; }
.nm-list { margin: 0 0 8px; padding-left: 1.2em; line-height: 1.7; word-break: keep-all; }
.nm-list--small { font-size: 13.5px; color: var(--pm-sub-text); }
.nm-items { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.nm-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 0; border-top: 1px dashed var(--pm-line); }
.nm-item:first-child { border-top: 0; }
.nm-item-k { font-weight: 700; }
.nm-item-v { font-size: 13.5px; color: var(--pm-sub-text); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nm-item-v--na { color: var(--pm-error); }
.nm-item-r { grid-column: 1 / -1; font-size: 13.5px; line-height: 1.6; color: var(--pm-sub-text); word-break: keep-all; }
.nm-formula { margin-top: 8px; }
.nm-formula summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.nm-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.nm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.nm-table th, .nm-table td { padding: 10px 8px; text-align: left; vertical-align: top; border-top: 1px solid var(--pm-line); line-height: 1.6; }
.nm-table thead th { border-top: 0; font-size: 13px; color: var(--pm-sub-text); }
.nm-table tr.is-ref td, .nm-table tr.is-ref th { background: rgba(251, 239, 226, .55); }
@media (max-width: 640px) {
  .nm-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .nm-table, .nm-table tbody, .nm-table tr, .nm-table th, .nm-table td { display: block; width: 100%; box-sizing: border-box; }
  .nm-table tr { padding: 8px 0; border-top: 2px solid var(--pm-line); }
  .nm-table th, .nm-table td { border-top: 0; padding: 4px 4px; }
  .nm-table td[data-label]::before, .nm-table th[data-label]::before { content: attr(data-label) ' · '; font-size: 12px; color: var(--pm-sub-text); }
}
.nm-toggle { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.nm-chip { display: inline-flex; align-items: center; min-height: var(--pm-tap); padding: 6px 16px; border: 2px solid var(--pm-line); border-radius: var(--pm-r-pill); background: var(--pm-cream); color: var(--pm-ink); font-size: 14px; text-decoration: none; }
.nm-chip.is-cur { background: var(--pm-wood); border-color: var(--pm-wood); font-weight: 700; }
.nm-rings { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 720px) { .nm-rings { grid-template-columns: 1fr 1fr; } }
.nm-ringbox { min-width: 0; }
.nm-ring { display: block; width: 100%; max-width: 260px; height: auto; margin: 0 auto 8px; }
.nm-ring-edge { stroke: var(--pm-line); stroke-width: 2; }
.nm-ring-flow { stroke: var(--pm-ink); stroke-width: 2; stroke-dasharray: 4 3; }
.nm-node { stroke: var(--pm-ink); stroke-width: 1.5; fill: var(--pm-cream); }
.nm-node.nm-el-wood { fill: var(--pm-wood); }
.nm-node.nm-el-fire { fill: var(--pm-fire); }
.nm-node.nm-el-earth { fill: var(--pm-earth); }
.nm-node.nm-el-metal { fill: var(--pm-metal); }
.nm-node.nm-el-water { fill: var(--pm-water); }
.nm-node.is-help { stroke: #b88700; stroke-width: 4; }
.nm-node-t { font-size: 15px; font-weight: 700; fill: var(--pm-ink); }
.nm-chbadge { fill: var(--pm-ink); }
.nm-chbadge-t { font-size: 11px; fill: var(--pm-cream); font-weight: 700; }
.nm-legend { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; }
.nm-legend--help { border: 3px solid #b88700; }
.nm-pairs { margin: 0; padding-left: 1.3em; font-size: 13.5px; line-height: 1.7; color: var(--pm-sub-text); }
.nm-charlist { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0 0 10px; padding: 0; list-style: none; }
@media (min-width: 720px) { .nm-charlist { grid-template-columns: 1fr 1fr 1fr; } }
.nm-char { display: flex; gap: 12px; padding: 12px; border-radius: var(--pm-r-card); background: var(--pm-cream); }
.nm-char-big { flex: none; display: flex; align-items: center; justify-content: center; width: 56px; font-size: 40px; line-height: 1; }
.nm-char-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14px; line-height: 1.5; }
.nm-char-body small { color: var(--pm-sub-text); font-size: 12.5px; }
.nm-methods { margin: 0; padding-left: 1.2em; line-height: 1.7; }
.nm-note-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0 0 0 1.1em; line-height: 1.7; font-size: 14px; word-break: keep-all; }
.nm-note-list a { color: var(--pm-fire-deep); text-decoration: underline; text-underline-offset: 3px; }
.nm-nodata { background: var(--pm-info-bg); color: var(--pm-info-ink); }
.nm-invalid { background: var(--pm-error-bg); color: var(--pm-error); }
.nm-ctrl { display: flex; flex-direction: column; gap: 14px; }
.nm-slideform { display: flex; flex-direction: column; gap: 6px; }
.nm-slideform label { font-weight: 700; font-size: 14px; }
.nm-dl--wide dt { margin-top: 8px; }

/* 비교: 모바일 가로 스와이프 */
.nm-cmp { display: flex; gap: 12px; margin: 12px 0 0; padding: 4px 2px 12px; list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.nm-cmp:focus-visible { outline: 3px solid var(--pm-focus); outline-offset: 2px; }
.nm-cmp-col { flex: 0 0 82%; max-width: 320px; scroll-snap-align: start; box-sizing: border-box; padding: 16px; border-radius: var(--pm-r-card); background: var(--pm-cream); box-shadow: var(--pm-shadow-sm); }
@media (min-width: 900px) { .nm-cmp-col { flex: 1 1 0; max-width: none; } .nm-cmp { overflow-x: visible; } }
.nm-cmp-name { font-family: var(--pm-font-head); font-weight: 400; font-size: 21px; margin: 0 0 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.nm-cmp-dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 10px 0; font-size: 14px; }
.nm-cmp-dl dt { color: var(--pm-sub-text); }
.nm-cmp-dl dd { margin: 0; }
.nm-cmp-hun { margin: 6px 0; font-size: 13.5px; line-height: 1.6; color: var(--pm-sub-text); }

/* 보관함·공유 */
.nm-boxlist { display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 0; list-style: none; }
.nm-boxitem { display: flex; flex-direction: column; gap: 10px; }
.nm-memo { display: flex; flex-direction: column; gap: 6px; }
.nm-memo label { font-size: 14px; font-weight: 700; }
.nm-sharenew { padding: 12px 14px; border-radius: var(--pm-r-card); background: var(--pm-info-bg); color: var(--pm-info-ink); display: flex; flex-direction: column; gap: 8px; }
.nm-shareurl { font-size: 13px !important; }
.nm-sharelist { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.nm-sharelist li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }

@media (prefers-reduced-motion: reduce) { .nm-btn, .nm-way, .nm-radio span, .nm-box { transition: none; } .nm-btn:hover, .nm-way:hover { transform: none; } }
