/* =========================================================
   내 본문 (passage.js) — 목록 · 편집 · 읽기 · 암기 훈련 · AI 분석 · 변형 문제
   app.css 토큰만 사용 (라이트/다크 자동)
   ========================================================= */

.psg { --psg-en: 17.5px; }
.psg [lang="en"] { hyphens: manual; }
.psg .iconbtn { width: 44px; height: 44px; }
.psg-h2 { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.psg-h2 small, .psg-h3 small { font-family: var(--font-sans); font-size: 13.5px; font-weight: 600; color: var(--ink-3); margin-left: 4px; }
.psg-h3 { font-size: 15px; font-weight: 750; color: var(--ink-2); margin: 22px 0 10px; }
.psg-muted { color: var(--ink-3); font-size: 14.5px; }
.psg-meta { color: var(--ink-3); font-size: 13px; line-height: 1.6; }
.psg-lead { color: var(--ink-2); font-size: 15px; margin-bottom: 16px; }
.psg-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--amber-soft); color: var(--amber-ink); font-family: var(--font-sans); font-size: 12.5px; font-weight: 700; vertical-align: middle; }
.psg-danger { background: var(--red); color: white; }
@media (hover: hover) and (pointer: fine) { .psg-danger:hover:not(:disabled) { background: var(--red-ink); } }
.psg-danger-link { color: var(--red-ink); }
.psg .linkbtn { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; }
.psg .linkbtn .ico { width: 16px; height: 16px; }

.psg-box { background: var(--paper); border-radius: 14px; padding: 20px; box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); margin-bottom: 16px; }
.psg-boxhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }

.psg-note { display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--pen-soft); color: var(--ink-2); font-size: 14.5px; line-height: 1.65; margin: 0 0 16px; }
.psg-note > .ico { flex: none; width: 18px; height: 18px; margin-top: 3px; color: var(--pen); }
.psg-note .linkbtn { display: inline; min-height: 0; text-decoration: underline; text-underline-offset: 3px; }
.psg-note--warn { background: var(--amber-soft); }
.psg-note--warn > .ico { color: var(--amber-ink); }

.psg-confirm { margin-top: 10px; padding: 14px; border-radius: 10px; background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red-line); font-size: 14.5px; line-height: 1.6; }
.psg-confirm__row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* 선택 칩 (해석·끊어 읽기 등) */
.psg-tog { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px 0 10px; border-radius: 10px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 14px; font-weight: 650; color: var(--ink-2); transition: background-color 150ms ease, box-shadow 150ms ease, color 150ms ease; }
.psg-tog__box { width: 17px; height: 17px; border-radius: 5px; box-shadow: inset 0 0 0 1.5px var(--line-2); display: grid; place-items: center; color: transparent; }
.psg-tog__box .ico { width: 12px; height: 12px; stroke-width: 2.6; }
.psg-tog.is-on { background: var(--pen-soft); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--pen); }
.psg-tog.is-on .psg-tog__box { background: var(--pen); box-shadow: none; color: var(--on-pen); }
.psg-tog:disabled { opacity: 0.45; cursor: default; }

/* ---------- 목록 ---------- */
.psg-lhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.psg-gfilter { margin: -8px 0 20px; }
.psg-group { margin-bottom: 28px; }
.psg-group__h { font-size: 15px; font-weight: 750; color: var(--ink-2); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.psg-group__h span { font-size: 13px; color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.psg-cards { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.psg-card { position: relative; display: flex; flex-wrap: wrap; align-items: flex-start; background: var(--paper); border-radius: 14px; box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); transition: box-shadow 150ms ease; }
.psg-card__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 16px 4px 16px 18px; }
.psg-card__title { font-weight: 750; font-size: 16.5px; line-height: 1.4; }
.psg-card__preview { color: var(--ink-2); font-size: 14.5px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.psg-card__meta { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.psg-card__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.psg-badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; font-weight: 700; }
.psg-badge .ico { width: 13px; height: 13px; }
.psg-badge--ai { background: var(--pen-soft); color: var(--pen); }
.psg-badge--score { background: var(--amber-soft); color: var(--amber-ink); }
.psg-card__acts { display: flex; flex-direction: column; padding: 6px 6px 0 0; }
.psg-card .psg-confirm { flex: 1 1 100%; margin: 0 12px 12px; }
@media (hover: hover) and (pointer: fine) { .psg-card:hover { box-shadow: var(--shadow-1), inset 0 0 0 1px var(--ink-3); } }

.psg-empty { max-width: 560px; margin: 8px auto 0; text-align: center; padding: 36px 20px; background: var(--paper); border: 1px dashed var(--line-2); border-radius: 16px; color: var(--ink-2); }
.psg-empty__ico { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--pen-soft); color: var(--pen); margin-bottom: 14px; }
.psg-empty__ico .ico { width: 28px; height: 28px; }
.psg-empty__t { font-family: var(--font-display); font-size: 22px; color: var(--ink); margin-bottom: 10px; }
.psg-empty p { margin-bottom: 20px; line-height: 1.7; }
.psg-steps { list-style: none; counter-reset: st; display: grid; gap: 8px; margin: 26px 0 12px; text-align: left; }
.psg-steps li { counter-increment: st; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 10px; background: var(--surface); font-size: 14.5px; }
.psg-steps li::before { content: counter(st); font-family: var(--font-display); font-weight: 800; color: var(--pen); }
.psg-steps span { color: var(--ink-3); font-size: 13.5px; }
.psg-empty__imp { margin-top: 4px; }

.psg-foot { margin-top: 12px; padding-top: 18px; border-top: 1px dashed var(--line-2); }
.psg-foot__row { display: flex; flex-wrap: wrap; gap: 8px; }
.psg-foot__note { margin-top: 10px; color: var(--ink-3); font-size: 13px; line-height: 1.6; }

/* ---------- 편집 ---------- */
.psg-back { margin-bottom: 10px; }
.psg-form { display: flex; flex-direction: column; gap: 16px; }
.psg-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.psg-fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.psg-fld__l { font-size: 14px; font-weight: 750; color: var(--ink-2); }
.psg-fld__l small { font-weight: 600; color: var(--ink-3); margin-left: 4px; }
.psg-fld__top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.psg-count { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.psg-count.is-full { color: var(--red-ink); font-weight: 700; }
.psg-gchips { margin-top: -6px; }
.psg-ta { min-height: 260px; font-size: 16px; line-height: 1.7; }
.psg-clean { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.psg-clean__info { font-size: 13.5px; color: var(--pen); font-weight: 600; }
.psg-help { font-size: 13px; color: var(--ink-3); line-height: 1.6; }
.psg-prev:empty { display: none; }
.psg-prev { padding: 14px 16px; border-radius: 12px; background: var(--surface); font-size: 14.5px; }
.psg-prev__n { margin-bottom: 6px; }
.psg-prev__list { padding-left: 1.4em; color: var(--ink-2); line-height: 1.6; font-size: 14.5px; }
.psg-prev__list li + li { margin-top: 4px; }
.psg-prev__more { margin-top: 6px; color: var(--ink-3); font-size: 13px; }
.psg-warn { list-style: none; margin-top: 10px; display: grid; gap: 6px; }
.psg-warn li { display: flex; gap: 6px; align-items: flex-start; color: var(--amber-ink); font-size: 13.5px; line-height: 1.55; }
.psg-warn .ico { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.psg-err { color: var(--red-ink); font-weight: 650; font-size: 14.5px; }
.psg-form__acts { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 상세: 고정 막대 + 탭 ---------- */
.psg-bar { position: sticky; top: var(--topbar-h); z-index: 30; background: color-mix(in oklch, var(--bg) 90%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.psg-bar__in { max-width: 820px; margin: 0 auto; display: flex; align-items: center; gap: 6px; padding: 8px 24px 4px 16px; }
.psg-bar__t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.psg-bar__t b { font-size: 16px; font-weight: 750; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.psg-bar__g { font-size: 12px; color: var(--ink-3); font-weight: 650; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.psg-bar__ask { height: 40px; flex: none; }
.psg-bar__short { display: none; }
.psg-tabs { max-width: 820px; margin: 0 auto; display: flex; gap: 6px; padding: 4px 24px 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.psg-tabs::-webkit-scrollbar { display: none; }
.psg-tab { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px; border-radius: 999px; font-size: 15px; font-weight: 700; color: var(--ink-2); background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease; }
.psg-tab .ico { width: 18px; height: 18px; }
.psg-tab.is-on { background: var(--ink); color: var(--paper); box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .psg-tab:not(.is-on):hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink-3); } }
.psg-body { padding-top: 20px; }

/* ---------- 읽기 ---------- */
.psg-readbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.psg-play { height: 40px; }
.psg-play[aria-pressed="true"] { background: var(--red); color: white; }
.psg-togs { display: flex; gap: 6px; flex-wrap: wrap; }
.psg-sents { list-style: none; background: var(--paper); border-radius: 14px; box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); padding: 6px 0; }
.psg-sent { display: grid; grid-template-columns: 30px minmax(0, 1fr) 44px; gap: 4px 8px; align-items: start; padding: 12px 10px 12px 12px; transition: background-color 200ms ease; }
.psg-sent + .psg-sent { border-top: 1px dashed var(--line); }
.psg-sent__n { padding-top: 6px; font-family: var(--font-display); font-weight: 800; font-size: 14px; color: var(--ink-3); text-align: center; font-variant-numeric: tabular-nums; }
.psg-sent__b { min-width: 0; }
.psg-en { font-size: var(--psg-en); line-height: 1.75; color: var(--ink); cursor: pointer; border-radius: 6px; padding: 2px 4px; margin: 0 -4px; overflow-wrap: anywhere; }
.psg-slash { color: var(--pen); font-weight: 700; }
.psg-ko { margin-top: 4px; color: var(--ink-2); font-size: 15px; line-height: 1.65; }
.psg-ko small { color: var(--ink-3); }
.psg-ko--peek { padding: 8px 10px; border-radius: 8px; background: var(--surface); margin: 0 0 8px; }
.psg-pts { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.psg-pts li { font-size: 13px; line-height: 1.5; padding: 3px 9px; border-radius: 7px; background: var(--amber-soft); color: var(--amber-ink); box-shadow: inset 0 0 0 1px var(--amber-line); }
.psg-sent__acts { margin-top: 10px; }
.psg-sent__acts .chipbtn { height: 40px; }
.psg-sent.is-open { background: var(--surface); }
.psg-sent.is-reading { background: var(--pen-soft); }
.psg-sent.is-reading .psg-sent__n { color: var(--pen); }
.psg-say { color: var(--ink-3); }
.psg-say.is-playing { color: var(--pen); background: var(--pen-soft); }
.psg-foothint { margin-top: 12px; font-size: 13px; color: var(--ink-3); line-height: 1.6; }
@media (hover: hover) and (pointer: fine) { .psg-en:hover { background: var(--surface); } .psg-sent.is-open .psg-en:hover, .psg-sent.is-reading .psg-en:hover { background: transparent; } }

/* ---------- 암기 훈련 ---------- */
.psg-modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; margin-bottom: 16px; }
.psg-mode { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 16px; border-radius: 14px; background: var(--paper); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); transition: box-shadow 150ms ease, transform 160ms var(--ease-out); }
.psg-mode:active:not(:disabled) { transform: scale(0.98); }
.psg-mode:disabled { opacity: 0.55; cursor: default; }
.psg-mode__ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--pen-soft); color: var(--pen); }
.psg-mode__b { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.psg-mode__t { font-weight: 750; font-size: 16px; }
.psg-mode__d { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.psg-mode__best { font-size: 12.5px; font-weight: 700; color: var(--amber-ink); font-variant-numeric: tabular-nums; }
.psg-mode__best small { font-weight: 600; color: var(--ink-3); }
@media (hover: hover) and (pointer: fine) { .psg-mode:hover:not(:disabled) { box-shadow: var(--shadow-1), inset 0 0 0 1px var(--ink-3); } }

.psg-runhead { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; margin-bottom: 12px; }
.psg-runhead .psg-h2 { flex: 1 1 auto; }
.psg-runhead__back { order: -1; flex-basis: 100%; }
.psg-runhead__stop { margin-left: auto; }
.psg-runtools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.psg-runtools .seg__b { min-height: 40px; }
.psg-runstat { font-size: 13.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.psg-runstat b { color: var(--ink); }
.psg-runfoot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }

/* 첫 글자 힌트 · 빈칸 */
.psg-hint, .psg-gaps { list-style: none; background: var(--paper); border-radius: 14px; box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); padding: 6px 0; }
.psg-hint__s, .psg-gaps__s { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 12px 10px 12px 12px; }
.psg-hint__s + .psg-hint__s, .psg-gaps__s + .psg-gaps__s { border-top: 1px dashed var(--line); }
.psg-hint__n { padding-top: 6px; font-family: var(--font-display); font-weight: 800; font-size: 14px; color: var(--ink-3); text-align: center; }
.psg-hint__p, .psg-gaps__s p { font-size: var(--psg-en); line-height: 2; overflow-wrap: anywhere; }
.psg-hint__open { margin-top: -2px; color: var(--ink-3); }
.psg-w { display: inline; padding: 1px 2px; border-radius: 4px; font: inherit; color: var(--ink); font-weight: 650; }
button.psg-w { cursor: pointer; background: var(--surface-2); }
.psg-w__m { color: var(--ink-3); letter-spacing: 0.04em; font-weight: 400; }
.psg-w.is-rev { background: var(--amber-soft); color: var(--amber-ink); font-weight: 650; }
.psg-w.is-got { font-weight: 400; background: none; }
.psg-hint__s.is-no, .psg-gaps__s.is-no { background: color-mix(in oklch, var(--red-soft) 60%, transparent); }
@media (hover: hover) and (pointer: fine) { button.psg-w:hover { background: var(--pen-soft); } }

.psg-gap { display: inline-block; height: 32px; padding: 0 4px; margin: 0 1px; border: 0; border-bottom: 2px solid var(--pen-line); border-radius: 4px 4px 0 0; background: var(--surface); font: inherit; font-size: 16.5px; color: var(--ink); text-align: center; vertical-align: baseline; max-width: 100%; transition: border-color 150ms ease, background-color 150ms ease; }
.psg-gap:focus { outline: none; border-bottom-color: var(--pen); background: var(--pen-soft); }
.psg-gap::placeholder { color: var(--ink-3); }
.psg-gap.is-right { border-bottom-color: var(--pen); background: var(--pen-soft); color: var(--pen); font-weight: 650; }
.psg-gap.is-wrong { border-bottom-color: var(--red); background: var(--red-soft); color: var(--red-ink); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.psg-gap__ans { display: inline-block; margin: 0 4px 0 2px; padding: 0 6px; border-radius: 5px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--pen-line); color: var(--pen); font-weight: 700; font-size: 15.5px; line-height: 1.6; }

/* 문장 순서 */
.psg-segs { margin-bottom: 8px; }
.psg-ord { list-style: none; display: grid; gap: 8px; counter-reset: none; }
.psg-ord__it { width: 100%; display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; text-align: left; min-height: 48px; padding: 12px 14px; border-radius: 12px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow 150ms ease, background-color 150ms ease, transform 160ms var(--ease-out); }
.psg-ord__it:active:not(:disabled) { transform: scale(0.99); }
.psg-ord__n { flex: none; font-family: var(--font-display); font-weight: 800; color: var(--pen); min-width: 1.4em; line-height: 1.65; }
.psg-ord__t { flex: 1; min-width: 0; font-size: 16px; line-height: 1.65; }
.psg-ord--picked .psg-ord__it { background: var(--pen-soft); box-shadow: inset 0 0 0 1px var(--pen-line); }
.psg-ord__it.is-ok { background: var(--pen-soft); box-shadow: inset 0 0 0 1.5px var(--pen); }
.psg-ord__it.is-no { background: var(--red-soft); box-shadow: inset 0 0 0 1.5px var(--red-line); }
.psg-ord__it:disabled { cursor: default; }
.psg-ord__fix { flex-basis: 100%; padding-left: calc(1.4em + 10px); font-size: 13px; font-weight: 700; color: var(--red-ink); }
.psg-ord__empty { padding: 16px; border-radius: 12px; border: 1px dashed var(--line-2); color: var(--ink-3); font-size: 14.5px; text-align: center; }
@media (hover: hover) and (pointer: fine) { .psg-ord__it:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--ink-3); } }

/* 한 문장씩 (배열 · 받아쓰기 · 영작) */
.psg-seqbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.psg-seqbar .qbar__meter { flex: 1; }
.psg-seq { display: flex; flex-direction: column; gap: 14px; background: var(--paper); border-radius: 14px; padding: 20px; box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
.psg-seq__ko { font-size: 15.5px; line-height: 1.7; color: var(--ink-2); }
.psg-seq__kobig { font-size: 18px; line-height: 1.7; font-weight: 650; }
.psg-seq__hint { font-size: 16px; line-height: 1.9; color: var(--ink-2); letter-spacing: 0.02em; }
.psg-seq__hint span { color: var(--ink-3); }
.psg-seq__say, .psg-seq__acts, .psg-seq__next { display: flex; flex-wrap: wrap; gap: 8px; }
.psg-seq__in { font-size: 17px; line-height: 1.7; }
.psg-seq .q__input { font-size: 16.5px; }
.psg-arr .ord__tok { min-height: 44px; }
.psg-seqfb { display: flex; flex-direction: column; gap: 10px; }
.psg-seqfb .fb__verdict { margin-bottom: 0; }
.psg-diff { font-size: 16.5px; line-height: 1.9; }
.psg-diff ins, .psg-diff__legend ins { text-decoration: none; background: var(--pen-soft); color: var(--pen); box-shadow: inset 0 -2px 0 var(--pen); padding: 0 3px; border-radius: 3px; font-weight: 700; }
.psg-diff del, .psg-diff__legend del { color: var(--red-ink); text-decoration: line-through; text-decoration-thickness: 2px; padding: 0 2px; }
.psg-diff__legend { display: flex; gap: 12px; font-size: 12.5px; color: var(--ink-3); }
.psg-answer { font-size: 16.5px; line-height: 1.75; }
.psg-seq__ko2 { color: var(--ink-2); font-size: 15px; }

/* 결과 */
.psg-res { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 18px; align-items: center; margin-top: 18px; padding: 20px; border-radius: 14px; background: var(--paper); box-shadow: var(--shadow-1), inset 0 0 0 1.5px var(--ink); }
.psg-res__score { display: flex; align-items: baseline; gap: 2px; }
.psg-res__score b { font-family: var(--font-display); font-size: 52px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.psg-res__score span { font-size: 16px; color: var(--ink-3); font-weight: 700; }
.psg-res__msg { font-weight: 650; line-height: 1.6; }
.psg-res__best { margin-top: 4px; font-size: 13.5px; color: var(--amber-ink); font-weight: 650; }
.psg-res__acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.psg-reslist { list-style: none; margin-top: 16px; background: var(--paper); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.psg-reslist li { display: grid; grid-template-columns: 24px 24px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 12px 14px; font-size: 15px; line-height: 1.6; }
.psg-reslist li + li { border-top: 1px dashed var(--line); }
.psg-reslist__m .ico { width: 18px; height: 18px; margin-top: 3px; stroke-width: 2.4; }
.psg-reslist .is-ok .psg-reslist__m { color: var(--pen); }
.psg-reslist .is-no .psg-reslist__m { color: var(--red); }
.psg-reslist__n { color: var(--ink-3); font-weight: 700; text-align: center; }
.psg-reslist__s { font-size: 13px; color: var(--red-ink); font-weight: 700; white-space: nowrap; }

/* ---------- AI 분석 ---------- */
.psg-intro p { color: var(--ink-2); line-height: 1.7; margin: 8px 0 12px; }
.psg-checks { list-style: none; display: grid; gap: 6px; margin-bottom: 18px; }
.psg-checks li { display: flex; gap: 8px; align-items: center; font-size: 15px; }
.psg-checks .ico { width: 17px; height: 17px; color: var(--pen); stroke-width: 2.4; }
.psg-intro .psg-meta { margin-top: 12px; }

.psg-prog { box-shadow: var(--shadow-1), inset 0 0 0 1.5px var(--pen-line); }
.psg-prog__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.psg-prog__top b { flex: 1; min-width: 12em; font-size: 15.5px; }
.psg-spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--pen-line); border-top-color: var(--pen); animation: psg-spin 900ms linear infinite; flex: none; }
@keyframes psg-spin { to { transform: rotate(360deg); } }
.psg-meter { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin: 14px 0 8px; }
.psg-meter i { display: block; height: 100%; background: var(--pen); border-radius: inherit; transition: width 400ms var(--ease-out); }
.psg-prog__t { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.psg-prog__note { margin-top: 4px; font-size: 12.5px; color: var(--ink-3); }

.psg-errbox { box-shadow: inset 0 0 0 1.5px var(--red-line); background: var(--red-soft); }
.psg-errbox__t { display: flex; gap: 8px; align-items: flex-start; line-height: 1.65; }
.psg-errbox__t .ico { flex: none; color: var(--red); margin-top: 3px; }
.psg-errbox__row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.psg-raw { margin-top: 12px; background: var(--paper); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); }
.psg-raw summary { cursor: pointer; padding: 10px 14px; font-weight: 700; font-size: 14px; min-height: 44px; display: flex; align-items: center; }
.psg-raw__md { padding: 0 14px 14px; font-size: 14px; line-height: 1.7; max-height: 360px; overflow: auto; overflow-wrap: anywhere; }

.psg-sum { display: grid; gap: 12px; margin-top: 12px; }
.psg-sum > div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; }
.psg-sum dt { font-size: 13px; font-weight: 750; color: var(--ink-3); padding-top: 3px; }
.psg-sum dd { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.psg-sum__en { font-size: 16.5px; line-height: 1.6; font-weight: 600; }
.psg-sum__ko { font-size: 14.5px; color: var(--ink-2); line-height: 1.6; }
.psg-more { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--amber-soft); box-shadow: inset 0 0 0 1px var(--amber-line); }

.psg-voc { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 0 18px; margin-top: 6px; }
.psg-voc li { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px dashed var(--line); min-height: 52px; }
.psg-voc__say { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--ink-3); }
.psg-voc__say .ico { width: 18px; height: 18px; }
.psg-voc__w { font-weight: 750; font-size: 16.5px; }
.psg-voc__pos { font-size: 12px; color: var(--ink-3); font-style: italic; }
.psg-voc__m { flex: 1 1 8em; min-width: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.psg-voc__add { height: 36px; margin-left: auto; }
.psg-voc__ok { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--pen); }
.psg-voc__ok .ico { width: 14px; height: 14px; stroke-width: 2.4; }
@media (hover: hover) and (pointer: fine) { .psg-voc__say:hover { background: var(--surface-2); color: var(--ink); } }

.psg-sentdet > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; min-height: 32px; }
.psg-sentdet > summary::-webkit-details-marker { display: none; }
.psg-sentdet > summary small { color: var(--ink-3); font-size: 13px; font-weight: 600; }
.psg-sentdet > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 1.75px solid var(--ink-3); border-bottom: 1.75px solid var(--ink-3); transform: rotate(45deg) translateY(-3px); transition: transform 200ms var(--ease-out); }
.psg-sentdet[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
.psg-alist { list-style: none; margin: 12px 0; }
.psg-alist li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; padding: 12px 0; border-top: 1px dashed var(--line); }
.psg-alist__n { font-family: var(--font-display); font-weight: 800; color: var(--ink-3); font-size: 14px; padding-top: 3px; }
.psg-alist__chunk, .psg-alist li p[lang="en"] { font-size: 16.5px; line-height: 1.75; overflow-wrap: anywhere; }
.psg-alist li.is-empty { opacity: 0.7; }
.psg-reana { margin: 4px 0 8px; }

/* ---------- 변형 문제 ---------- */
.psg-fs { border: 0; padding: 0; margin: 14px 0 0; min-width: 0; }
.psg-fs legend { font-size: 14px; font-weight: 750; color: var(--ink-2); margin-bottom: 8px; padding: 0; }
.psg-fs__tools { display: flex; gap: 14px; margin-top: 4px; }
.psg-kinds .tchip { min-height: 44px; }
.psg-qopts { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.psg-qopts .seg__b { min-height: 40px; }
.psg-qgen__acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.psg-qgen__acts .btn { white-space: normal; text-align: center; min-height: 44px; height: auto; padding-top: 8px; padding-bottom: 8px; }
.psg-qgen .psg-meta { margin-top: 10px; }
.psg-qgen .psg-prog { margin: 18px 0 0; box-shadow: inset 0 0 0 1.5px var(--pen-line); }
.psg-qgen .psg-errbox { margin: 18px 0 0; }

.psg-qset { margin: 24px 0; }
.psg-qset__head { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; margin-bottom: 12px; }
.psg-qset__tools { display: flex; align-items: center; gap: 4px 14px; flex-wrap: wrap; }
.psg-qscore { font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.psg-qscore b { color: var(--pen); font-size: 16px; }
.psg-qset .psg-confirm { margin: 0 0 12px; }
.psg-qlist { display: grid; gap: 16px; }
.psg-q .q__passage[lang="en"] { font-size: 16px; line-height: 1.8; }
.psg-q .q__passage .box { line-height: 1.75; }
.psg-q .q__passage p + p { margin-top: 0.5em; }
.psg-q .choice__t[lang="en"] { font-size: 15.5px; }
.psg-q .q__input { min-width: 0; }
.psg-q .ord__tok { min-height: 40px; }
.psg-full p { padding: 0 14px 12px; font-size: 15px; line-height: 1.75; }
.psg-local { margin-top: 28px; }
.psg-local__btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.psg-local .psg-meta { margin-top: 10px; }
#psg-loclist { scroll-margin-top: calc(var(--topbar-h) + 120px); }

/* ---------- 터치 기기: 44px ---------- */
@media (pointer: coarse) {
  .psg .btn--sm, .psg .chipbtn, .psg .fchip { min-height: 44px; }
  .psg .btn--sm { height: auto; }
  .psg .chipbtn { height: auto; }
  .psg .seg__b { min-height: 44px; }
  .psg .linkbtn { min-height: 44px; }
  .psg .ord__tok { min-height: 44px; }
}

/* ---------- 휴대폰 ---------- */
@media (max-width: 640px) {
  .psg { --psg-en: 17px; }
  .psg-lhead { flex-direction: column; align-items: stretch; }
  .psg-lhead .btn { align-self: flex-start; }
  .psg-form__row { grid-template-columns: minmax(0, 1fr); }
  .psg-bar__in { padding: 6px var(--gutter) 2px 6px; gap: 2px; }
  .psg-bar__long { display: none; }
  .psg-bar__short { display: inline; }
  .psg-bar__ask { padding: 0 12px; }
  .psg-tabs { padding: 4px var(--gutter) 8px; gap: 6px; }
  .psg-tab { padding: 0 14px; font-size: 14.5px; }
  .psg-body { padding-top: 16px; }
  .psg-box { padding: 16px; border-radius: 12px; }
  .psg-sent { grid-template-columns: 22px minmax(0, 1fr) 44px; padding: 10px 6px 10px 8px; gap: 4px 6px; }
  .psg-hint__s, .psg-gaps__s { grid-template-columns: 22px minmax(0, 1fr) auto; padding: 10px 8px; gap: 6px; }
  .psg-seq { padding: 16px; }
  .psg-res { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .psg-res__acts .btn { flex: 1 1 100%; }
  .psg-sum > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .psg-q.q--practice { padding: 18px 14px 16px; border-radius: 14px; }
  .psg-q .q__passage { padding: 12px 12px; }
  .psg-q .q__short { flex-wrap: wrap; }
  .psg-q .q__short .btn { flex: 1 1 auto; }
  .psg-reslist li { grid-template-columns: 20px 20px minmax(0, 1fr); }
  .psg-reslist__s { grid-column: 3; }
  .psg-local__btns .btn { flex: 1 1 calc(50% - 4px); }
}

@media (prefers-reduced-motion: reduce) {
  .psg-spin { animation: none; border-top-color: var(--pen-line); border-right-color: var(--pen); }
  .psg-meter i, .psg-sent, .psg-mode, .psg-ord__it, .psg-tab, .psg-tog { transition: none; }
}
