/* /how/ 원리 페이지 (2026-10-08). app.css 변수 재사용 */
body.how-body { background: var(--bg); color: var(--text); font-family: var(--font); margin: 0; }
.hw { max-width: 760px; margin: 0 auto; padding: 18px 16px 56px; }
.hw-back { display: inline-block; font-size: 13px; color: var(--text-2); text-decoration: none; margin-bottom: 14px; }
.hw-back:hover { color: var(--text); }
.hw h1 { font-size: 26px; line-height: 1.25; font-weight: 800; letter-spacing: -.025em; margin: 0 0 10px; }
.hw-sum { font-size: 15.5px; line-height: 1.6; color: var(--text); margin: 0 0 6px; }
.hw-sum b { color: var(--accent); font-weight: 700; }
.hw-note { font-size: 12.5px; color: var(--text-3); margin: 0 0 18px; line-height: 1.5; }

.hw-tabs { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 6px; margin: 0 -4px 18px;
  background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 14px; }
.hw-tab { font: inherit; font-size: 14px; font-weight: 700; color: var(--text-2); background: transparent; border: 0; border-radius: 10px; padding: 9px 4px; cursor: pointer; }
.hw-tab[aria-selected="true"] { background: var(--panel-3); color: var(--text); }
.hw-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* 수준별 문단: body[data-lv] 로 하나만 보인다 */
[data-lv] { display: none; }
body[data-level="kid"] [data-lv~="kid"], body[data-level="gen"] [data-lv~="gen"], body[data-level="sci"] [data-lv~="sci"] { display: block; }
body[data-level="kid"] li[data-lv~="kid"], body[data-level="gen"] li[data-lv~="gen"], body[data-level="sci"] li[data-lv~="sci"] { display: list-item; }
/* 언어: html[data-lang] 로 ko/en 형제 중 하나만 보인다 (how.js 가 정함). JS 전에는 한국어 */
html:not([data-lang="en"]) [data-l="en"], html[data-lang="en"] [data-l="ko"] { display: none !important; }

.hw-step { display: grid; gap: 10px; padding: 18px 0 22px; border-top: 1px solid var(--line); }
.hw-step > * { min-width: 0; } /* 수식(nowrap)이 칸을 넓히지 않게 */
.hw-step-h { display: flex; align-items: baseline; gap: 10px; }
.hw-step-n { font-size: 12px; font-weight: 800; color: var(--k, var(--accent)); letter-spacing: .05em; font-variant-numeric: tabular-nums; }
.hw-step h2 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; margin: 0; line-height: 1.35; }
.hw-fig { position: relative; background: var(--scope); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.hw-fig canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.hw-fig figcaption { padding: 2px 10px 8px; font-size: 11px; color: rgba(233, 237, 242, .62); letter-spacing: .01em; } /* 그림 아래에 두어 그림 속 글자와 겹치지 않게 */
.hw-txt { font-size: 14.5px; line-height: 1.7; color: var(--text-2); }
.hw-txt p { margin: 0 0 8px; }
.hw-txt b { color: var(--text); font-weight: 700; }
.hw-tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); margin-right: 4px; }
.hw-tag.warn { color: var(--amber); border-color: rgba(255, 181, 71, .35); background: var(--amber-soft); }
.hw-eq { font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: 13px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); padding: 10px 12px; line-height: 1.8; overflow-x: auto; white-space: nowrap; }
.hw-eq sub { font-size: 10px; }

.hw-sec { padding: 22px 0 8px; border-top: 1px solid var(--line); }
.hw-sec > h2 { font-size: 19px; font-weight: 800; margin: 0 0 10px; letter-spacing: -.02em; }
.hw-list { margin: 0 0 12px; padding-left: 18px; color: var(--text-2); font-size: 14.5px; line-height: 1.7; }
.hw-list b { color: var(--text); }

.hw-bars { display: grid; gap: 8px; margin: 12px 0 6px; }
.hw-bar { display: grid; grid-template-columns: 118px 1fr 44px; gap: 8px; align-items: center; font-size: 12.5px; line-height: 1.3; color: var(--text-2); }
.hw-bar .tr { height: 12px; background: var(--panel-2); border-radius: 6px; overflow: hidden; }
.hw-bar .fi { height: 100%; width: 0; border-radius: 6px; background: var(--text-3); transition: width 1s var(--ease); }
.hw-bar.me .fi { background: var(--accent); }
.hw-bar.eng .fi { background: var(--amber); }
.hw-bar b { font-variant-numeric: tabular-nums; color: var(--text); text-align: right; font-weight: 700; }
.hw-small { font-size: 12px; color: var(--text-3); line-height: 1.55; margin: 6px 0 0; }

.hw-fuse { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.hw-fuse div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px; }
.hw-fuse b { display: block; font-size: 14px; margin-bottom: 2px; }
.hw-fuse span { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.hw-fuse i { font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--k); }

.hw-src { font-size: 12.5px; color: var(--text-2); line-height: 1.7; }
.hw-src a { color: var(--accent); }
.hw-foot { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); line-height: 1.7; }
.hw-foot a { color: var(--text-2); }
.hw-cta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.hw-cta a { font-size: 14px; font-weight: 700; text-decoration: none; padding: 10px 14px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); }
.hw-cta a.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-2); }

/* 약관 초안 */
.tm h1 { font-size: 22px; }
.tm .draft { display: inline-block; font-size: 12px; font-weight: 800; color: var(--amber); border: 1px solid rgba(255, 181, 71, .4); background: var(--amber-soft); padding: 3px 9px; border-radius: 999px; margin-bottom: 10px; }
.tm ol { padding-left: 20px; color: var(--text-2); font-size: 14px; line-height: 1.75; }
.tm ol b { color: var(--text); }

@media (max-width: 420px) {
  .hw h1 { font-size: 23px; }
  .hw-bar { grid-template-columns: 112px 1fr 40px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .hw-bar .fi { transition: none; } }

/* 탭별 첫 패널 (2026-10-08) */
.hw-panel { margin: 0 0 28px; }
.hw-panel h2 { font-size: 19px; margin: 22px 0 12px; letter-spacing: -.02em; }
.hw-panel h2:first-child { margin-top: 4px; }
.hw-kid-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: k; }
@media (min-width: 720px) { .hw-kid-list { grid-template-columns: 1fr 1fr; } }
.hw-kid-list li { counter-increment: k; background: var(--panel, #1B2027); border: 1px solid var(--line, rgba(255,255,255,.08)); border-radius: 18px; padding: 10px 10px 14px; }
.hw-kid-list .hw-fig { margin: 0 0 10px; }
.hw-kid-list p { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.45; padding: 0 4px; }
.hw-kid-list p::before { content: counter(k); display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 8px; border-radius: 50%; background: var(--accent, #2EE6C5); color: #062A24; font-size: 14px; font-weight: 800; vertical-align: 2px; }
.hw-kid-last { font-size: 18px; font-weight: 700; margin: 16px 4px; }
.hw-rv { display: grid; gap: 12px; }
@media (min-width: 720px) { .hw-rv { grid-template-columns: 1fr 1fr; } }
.hw-rv-c { border-radius: 16px; padding: 14px 16px; background: var(--panel, #1B2027); border: 1px solid var(--line, rgba(255,255,255,.08)); }
.hw-rv-c > b { display: inline-block; font-size: 13px; font-weight: 800; padding: 3px 10px; border-radius: 999px; margin-bottom: 6px; }
.hw-rv-c.real > b { background: rgba(46,230,197,.16); color: var(--accent, #2EE6C5); }
.hw-rv-c.pic > b { background: rgba(255,181,71,.16); color: var(--amber, #FFB547); }
.hw-rv-c ul { margin: 0; padding-left: 18px; }
.hw-rv-c li { margin: 6px 0; line-height: 1.55; font-size: 15px; }
.hw-who { display: grid; gap: 10px; }
@media (min-width: 720px) { .hw-who { grid-template-columns: repeat(3, 1fr); } }
.hw-who > div { border-radius: 16px; padding: 14px 16px; background: var(--panel, #1B2027); border: 1px solid var(--line, rgba(255,255,255,.08)); border-top: 3px solid var(--k); }
.hw-who b { display: block; font-size: 17px; margin-bottom: 4px; color: var(--k); }
.hw-who span { font-size: 15px; line-height: 1.55; color: var(--text-2, #A7B0BD); }
.hw-facts { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.55; }
.hw-facts th, .hw-facts td { text-align: left; vertical-align: top; padding: 10px 8px; border-bottom: 1px solid var(--line, rgba(255,255,255,.08)); }
.hw-facts th { width: 6.5em; color: var(--accent, #2EE6C5); font-weight: 800; white-space: nowrap; }
@media (max-width: 480px) { .hw-facts th, .hw-facts td { display: block; width: auto; padding: 4px 2px; } .hw-facts th { padding-top: 12px; border: 0; } }
