/* 2026-11-13: 바탕·판·글 색은 공용 learn.css(body.lx-study)가 무대 값으로 덮는다 — 여기 품사 색은 어두운 판 기준(md/learn-design.md).
   say — 말하기 문장(md/say-spec.md 6절). word·koen 과 한 식구인 레트로 픽셀: 단단한 2~3px 오프셋 그림자만, 흐림·무한 움직임 없음. */
:root {
  --bg: #eef1f7; --card: #fffef8; --text: #222034; --muted: #5d5a6b; --border: #222034; --accent: #306082; --ok: #2f8f4e;
  --en: #306082; --ko: #8a3b2a; --rt: #6b6880; --stress: #c2410c; --sh: 3px 3px 0 #222034; --on: #ffe9a8;
}
body.sx { background: var(--bg); color: var(--text); margin: 0; font-family: var(--sans, "Pretendard", system-ui, sans-serif); }
.sx-wrap { max-width: 860px; margin: 0 auto; padding: 16px 14px 48px; }
.sx-crumb { font-size: .9rem; display: flex; gap: 6px; flex-wrap: wrap; color: var(--muted); }
.sx-crumb a { color: var(--accent); text-decoration: none; font-weight: 700; }
.sx-brand { margin: 8px 0 0; font-weight: 900; letter-spacing: .08em; color: var(--accent); font-size: .85rem; }
.sx-h1 { font-size: clamp(1.6rem, 5vw, 2.3rem); margin: 10px 0 8px; }
.sx-h1 small { font-size: .5em; background: var(--text); color: #fff; padding: 2px 8px; vertical-align: middle; border-radius: 2px; }
.sx-h2 { font-size: 1.2rem; margin: 26px 0 10px; border-bottom: 3px solid var(--text); padding-bottom: 4px; }
.sx-lead, .sx-how, .sx-about p { line-height: 1.7; color: var(--muted); }
.sx-lead a, .sx-about a { color: var(--accent); font-weight: 700; }
.sx-src { font-size: .85rem; }
.sx-note { background: var(--note, #fff4c7); border: 2px dashed var(--stress); padding: 8px 10px; line-height: 1.55; }

/* 단추 */
.sx-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.sx-bar button, .sx-say, .sx-known {
  font: inherit; font-weight: 700; border: 2px solid var(--border); background: var(--card); color: var(--text);
  box-shadow: 2px 2px 0 var(--border); border-radius: 3px; padding: 6px 10px; cursor: pointer; min-height: 36px; }
.sx-bar button[aria-pressed="true"] { background: var(--text); color: #fff; }
.sx-known[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
#sxPlay.on { background: var(--stress); color: #fff; }
button:active { transform: translate(2px, 2px); box-shadow: none; }
.sx-ex { font: inherit; background: none; border: 0; padding: 2px 4px; cursor: pointer; color: inherit; text-align: left; border-radius: 3px; }
.sx-ex:hover { background: var(--on); }
@media (pointer: coarse) {
  .sx-bar button, .sx-say, .sx-known, .sx-play, .sx-ex, .sx-words a, .sx-pn a { min-height: 44px; min-width: 44px; }
  .wd { min-height: 44px; }
}

/* 묶음 목록 */
.sx-sets { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.sx-set { display: grid; gap: 3px; padding: 12px; background: var(--card); border: 3px solid var(--border); box-shadow: var(--sh); text-decoration: none; color: var(--text); min-height: 44px; }
.sx-set b { font-size: 1.15rem; }
.sx-set span { color: var(--en); font-size: .9rem; }
.sx-set small { color: var(--muted); }
.sx-set small i { font-style: normal; font-weight: 800; color: var(--ok); }
.sx-prog { display: block; height: 6px; background: var(--line, #d9deea); margin-top: 4px; }
.sx-prog::after { content: ""; display: block; height: 100%; width: var(--p, 0%); background: var(--ok); }

/* 훅·이번 묶음 단어 */
.sx-hook { background: var(--card); border: 3px solid var(--border); box-shadow: var(--sh); padding: 8px 12px; margin: 10px 0; }
.sx-words { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sx-words > a { font-weight: 800; color: var(--accent); text-decoration: none; display: inline-flex; align-items: center; padding: 0 8px; border: 2px solid var(--accent); background: var(--card); min-height: 36px; }
.sx-words > span { font-size: .85rem; background: var(--card); border: 1px solid var(--line, #c9c6b8); padding: 2px 6px; }
.sx-words b { color: var(--en); }
.sx-words span span { color: var(--ko); }

/* 문장 카드: 질문+답은 한 카드(A/B) */
.sx-cards { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 14px; }
.sx-card { background: var(--card); border: 3px solid var(--border); box-shadow: var(--sh); padding: 8px 12px; display: grid; gap: 4px; }
.sx-card.qa .sx-line + .sx-line { border-top: 2px dashed var(--line, #d6d3c4); padding-top: 8px; }
.sx-line { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 4px 0; min-width: 0; }
.sx-line.on { background: var(--on); }
.sx-line.got .sx-pair { opacity: .8; }
.sx-tag { font-size: .72rem; font-weight: 800; color: var(--muted); border: 2px solid var(--muted); padding: 0 5px; }
.sx-tag.k-q { color: var(--accent); border-color: var(--accent); }
.sx-tag.k-a { color: var(--ok); border-color: var(--ok); }
/* 좌우 대응(bible 대역 보기): 넓은 화면 = 왼쪽 한국어 · 오른쪽 영어, 같은 문장끼리 한 줄(높이 맞춤) / 폰 = 위 한국어 · 아래 영어 */
.sx-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; width: 100%; align-items: start; }
.sx-side { min-width: 0; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 2px 4px; }
.sx-side.sx-en { border-left: 2px dashed var(--line, #d6d3c4); padding-left: 14px; }
@media (max-width: 720px) { .sx-pair { grid-template-columns: 1fr; } .sx-side.sx-en { border-left: 0; padding-left: 0; border-top: 1px dashed var(--line, #d6d3c4); padding-top: 4px; } }
.sx-play { font: inherit; font-size: .9rem; background: none; border: 0; cursor: pointer; padding: 2px 4px; align-self: center; }
.sx-lit, .sx-nt, .sx-new { font-size: .85rem; color: var(--muted); line-height: 1.5; }
.sx-new b { color: var(--en); }
.sx-foot { display: flex; gap: 8px; align-self: flex-end; }
.sx-foot .sx-known, .sx-foot .sx-say { font-size: .8rem; padding: 4px 8px; }
.sx-whole { list-style: none; padding: 0; display: grid; gap: 6px; }
.sx-whole li { background: var(--card); border: 2px solid var(--border); padding: 4px 10px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.sx-whole b { color: var(--en); }
.sx-pn { display: flex; justify-content: space-between; gap: 10px; margin-top: 24px; }
.sx-pn a { color: var(--accent); font-weight: 800; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }

/* 두 말 나란히 + 발음(6절): bi = 한 줄에 한국어 · 영어, bp = 문단(한국어 문단 위, 영어 문단 아래) */
.bi { display: inline; }
.bi-en { color: var(--en); }
.bi-ko + .bi-en::before { content: "· "; color: var(--muted); }
.bp-ko, .bp-en { display: block; line-height: 1.3; margin: 2px 0; }
.bp-en { color: var(--muted); margin-top: 2px; }
.sx-lead .bp-ko, .sx-how .bp-ko { color: var(--text); }
.sx-subt { margin: 0 0 6px; font-weight: 700; font-size: 1.05rem; line-height: 2.2; }
.sx-h1, .sx-h2 { line-height: 2.1; }
.sx-brand { line-height: 2.2; }
.sx-no { font-size: .7em; background: var(--text); color: #fff; padding: 2px 8px; border-radius: 2px; vertical-align: middle; }
.sx-set b { line-height: 2.2; }
.sx-wl { font-size: .85rem; color: var(--muted); font-weight: 700; }
.sx-mv { position: relative; aspect-ratio: 16 / 9; border: 3px solid var(--border); box-shadow: var(--sh); margin: 10px 0; background: #000; }
.sx-mv iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* 두 말 함께(갈래 없음, md/say-spec.md 1절): 영어 위 한글 발음 + 한국어 위 알파벳 발음을 늘 보인다 */
/* 낱말 하나 = 세로 덩어리: 위 발음(영어 위 한글, 한국어 위 알파벳) · 낱말 · 아래 품사(영어는 영어로, 한국어는 한국어로) */
.wd { font: inherit; background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 3px; padding: 1px 2px 0; margin: 0;
  display: inline-flex; flex-direction: column; align-items: center; cursor: pointer; color: inherit; vertical-align: bottom; line-height: 1.15; }
span.wd { cursor: inherit; }
.wd > b { font-weight: 800; white-space: nowrap; }
.wd > .wp { font-style: normal; font-size: .55em; font-weight: 600; color: var(--rt); white-space: nowrap; min-height: 1.15em; }
.wd > .wp i { font-style: normal; }
.wd > .wp i.a, .wd > .wp i.b { color: var(--stress); font-weight: 900; }
.wd > .wp i.s { font-weight: 800; }
.wd > .wp i.r { opacity: .75; }
.wd > .wp i.e, .wd > .wp i.c { opacity: .55; font-size: .82em; }
.wd > .wp i.f { opacity: .6; }
.wd > .wt { font-style: normal; font-size: .5em; font-weight: 700; letter-spacing: .01em; white-space: nowrap; opacity: .85; min-height: 1.1em; }
.lite .wd > .wt { display: none; }
.lite .wd > b { font-weight: inherit; }
.wd:hover, .wd:focus-visible, .wd.hl { background: var(--on); }
.wd.hl { border-bottom-color: var(--stress); }
.wd.cur > b { text-decoration: underline 3px var(--stress); text-underline-offset: 3px; }
.sx-side.sx-en .wd { font-size: 1.4rem; color: var(--en); }
.sx-side.sx-ko .wd { font-size: 1.3rem; color: var(--ko); }
/* 품사 색 — 양쪽 같은 품사는 같은 색(어순 차이가 보이게). 색만으로 가르지 않고 아래 품사 글자가 함께 있다 */
.wd.p-n > .wt { color: #8fc1ff; } .wd.p-pr > .wt { color: #c9b3ff; } .wd.p-v > .wt { color: #ff9d9d; } .wd.p-a > .wt { color: #ffd27a; }
.wd.p-ad > .wt { color: #7fe0a8; } .wd.p-p > .wt, .wd.p-e > .wt { color: #aab3c5; } .wd.p-d > .wt, .wd.p-c > .wt, .wd.p-i > .wt, .wd.p-x > .wt { color: var(--muted); }
.sx-pair .wd.p-n { border-bottom-color: #3f6fa8; } .sx-pair .wd.p-pr { border-bottom-color: #6b55b0; } .sx-pair .wd.p-v { border-bottom-color: #a84a4a; }
.sx-pair .wd.p-a { border-bottom-color: #a07f2c; } .sx-pair .wd.p-ad { border-bottom-color: #2f8a57; }
.sx-pair .wd.hl { border-bottom-color: var(--stress); }

/* 낱말 풍선(bible.na.to .gl-pop 과 같은 자리 잡기) */
.sx-pop { position: absolute; z-index: 2147483602; max-width: min(320px, calc(100vw - 24px)); padding: 10px 12px; background: var(--card); color: var(--text);
  border: 3px solid var(--border); box-shadow: var(--sh); font-size: .88rem; line-height: 1.5; }
.sx-pop .h { font-size: 1.15rem; font-weight: 800; }
.sx-pop .h[lang="en"] { color: var(--en); } .sx-pop .h[lang="ko"] { color: var(--ko); }
.sx-pop .pr { color: var(--rt); font-weight: 700; margin-left: 8px; }
.sx-pop .pl { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); }
.sx-pop .m { display: block; margin-top: 4px; }
.sx-pop .ctx { display: block; margin-top: 4px; font-weight: 700; }
.sx-pop .pt { display: block; margin-top: 4px; font-size: .8rem; color: var(--muted); }
.sx-pop .src { display: block; margin-top: 6px; font-size: .72rem; color: var(--muted); }

.sx-alt { font-weight: 600; color: var(--muted); font-size: .8em; }
.sx-hk { color: var(--ko); font-size: .85rem; }
.sx-nt[lang="en"] { color: var(--muted); font-style: italic; }

/* 가리기: 가린 쪽은 자리만 남기고, 문장을 누르면(open) 다시 보인다 */
.hide-en .sx-line:not(.open) .sx-side.sx-en, .hide-en .sx-line:not(.open) .sx-lit { visibility: hidden; }
.hide-ko .sx-line:not(.open) .sx-side.sx-ko, .hide-ko .sx-line:not(.open) .sx-lit { visibility: hidden; }
.hide-en .sx-line:not(.open), .hide-ko .sx-line:not(.open) { cursor: pointer; }

/* 철자 ↔ 소리 어긋남(6-4, word 와 같은 표지): s 소리 안 나는 글자 흐리게 · c 한국어에 없는 소리 · t 소리가 바뀌는 글자 · x(한국어) 쓰기와 소리가 다른 음절 */
.wd b i { font-style: normal; }
.wd b i.sp-s { opacity: .35; }
.wd b i.sp-c { text-decoration: underline 2px; text-underline-offset: 3px; }   /* word.css 와 같은 표시 */
.wd b i.sp-t { color: var(--stress); text-decoration: underline wavy 1px; text-underline-offset: 3px; }
.wd b i.sp-x { text-decoration: underline dotted 2px #c9b3ff; text-underline-offset: 3px; }

/* 주의 문장(6-5): 접어 둔다 */
.sx-caution > summary { cursor: pointer; font-size: .85rem; font-weight: 700; color: var(--muted); padding: 10px 0; min-height: 44px; }
.sx-credit { margin-top: 28px; font-size: .75rem; color: var(--muted); line-height: 1.6; }
.sx-credit a { color: inherit; }
/* 곡 뮤직비디오 쪽(6-7) */
.sx-go { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; font-weight: 800; color: var(--text); background: var(--card);
  border: 2px solid var(--border); box-shadow: 2px 2px 0 var(--border); text-decoration: none; }
.sx-go.off { color: var(--muted); box-shadow: none; border-style: dashed; }
.sx-soon { display: grid; gap: 6px; place-items: center; text-align: center; aspect-ratio: 16 / 9; max-height: 360px; padding: 16px; margin: 10px 0;
  background: var(--card); border: 3px dashed var(--border); color: var(--muted); line-height: 1.6; }
.sx-soon b { font-size: 1.3rem; color: var(--text); }
.sx-soon-sm { aspect-ratio: auto; max-height: none; padding: 14px; }
/* 발음 읽는 법(책과 같은 글) — 접힌 상자, 글자 처음부터 링크 */
.sx-howto { background: var(--card); border: 2px solid var(--border); margin: 10px 0; }
.sx-howto > summary { cursor: pointer; font-weight: 800; padding: 8px 12px; min-height: 44px; display: flex; align-items: center; gap: 6px; }
.sx-howto ul { margin: 0; padding: 4px 14px 12px 30px; display: grid; gap: 4px; }
.sx-start { margin: 6px 0; }
.sx-start a { color: var(--accent); font-weight: 800; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }

/* ── rule 만의 것 (md/rule-spec.md 5절): 규칙 칸 = 꼴 머리 → 한국어 규칙 | 영어 규칙 (좌우) → 풀이 → 외침 → 예문 ── */
.rx-rule { background: var(--card); border: 3px solid var(--border); box-shadow: var(--sh); padding: 12px 14px; margin: 18px 0; }
.rx-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin: 0 0 8px; font-size: 1.05rem; }
.rx-head .rx-n { font-size: .78rem; font-weight: 800; color: var(--muted); border: 2px solid var(--muted); padding: 0 6px; }
.rx-rules.sx-pair { padding: 8px 0; border-top: 2px solid var(--border); border-bottom: 1px dashed var(--line, #d6d3c4); }
.rx-cap { display: block; width: 100%; font-size: .72rem; font-weight: 800; color: var(--muted); margin-bottom: 2px; }
.rx-x { display: flex; flex-wrap: wrap; gap: 2px 4px; margin-top: 6px; font-size: .9em; opacity: .85; }
.rx-x .wd { font-size: 1rem !important; }
.rx-chant { margin: 10px 0 4px; }
.rx-chant .sx-tag { color: var(--accent); border-color: var(--accent); }
.rx-ex { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.rx-ex .sx-line { padding-top: 6px; border-top: 1px dashed var(--line, #e4e1d4); }
.rx-say { font-size: .78rem; color: var(--muted); text-decoration: none; }
.rx-say:hover { text-decoration: underline; }
.rx-pats { list-style: none; padding: 0; margin: 2px 0 0; font-size: .8rem; color: var(--muted); }
@media (pointer: coarse) { .rx-say { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; } }
