/* 해석 레벨 진단 (시연) */
.demo-tag { font-size: 12px; font-weight: 800; color: var(--accent); background: var(--accent-soft); padding: 2px 10px; border-radius: 999px; }
.how { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 8px; font-size: 14px; }
.how li { background: var(--bg); border-radius: 10px; padding: 8px 12px; }

.q-top { display: flex; justify-content: space-between; align-items: center; margin: 16px 2px 6px; font-weight: 800; color: var(--muted); }
.q-tier { font-size: 13px; color: var(--accent); background: var(--accent-soft); padding: 2px 10px; border-radius: 999px; }
.timer { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.timer div { height: 100%; width: 100%; background: var(--accent); transition: width 0.25s linear; }
.timer div.low { background: var(--bad); }
.q-panel { text-align: center; }
.q-en { font-size: clamp(20px, 5.4vw, 26px); font-weight: 800; line-height: 1.45; margin: 6px 0 16px; word-break: keep-all; }
.q-en.small { font-size: 17px; margin: 0 0 12px; color: var(--ink); }
/* 말하는 동안 화면이 움직이면 손가락이 버튼에서 미끄러져서, 위쪽 칸들은 높이를 고정 */
#answer { display: block; width: 100%; height: 104px; overflow-y: auto; font: inherit; font-size: 17px; padding: 12px; border: 2px solid var(--line); border-radius: 12px; resize: none; background: #fff; color: var(--ink); }
#answer:focus { outline: none; border-color: var(--accent); }
#answer.rec { border-color: var(--bad); }
.listening { color: var(--bad); font-weight: 700; font-size: 14px; margin: 6px 0 0; height: 22px; line-height: 22px; visibility: hidden; white-space: nowrap; }
.listening.show { visibility: visible; }

/* 누르고 있는 동안 말하기 */
/* 크게, 그리고 누르는 동안 크기·위치가 절대 바뀌지 않게 (색만 바뀜) */
.mic { width: 100%; height: 132px; margin-top: 8px; padding: 0 12px; border-radius: 22px; border: 3px solid var(--accent); background: var(--accent-soft); color: var(--accent);
  font: inherit; font-size: 19px; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: none; }
.mic-ico { font-size: 40px; line-height: 1; }
.mic span { white-space: nowrap; pointer-events: none; }
.mic.on { background: var(--bad); border-color: var(--bad); color: #fff; }
.mic:disabled { opacity: 0.5; cursor: not-allowed; }
.q-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin-top: 10px; }
.q-actions .btn.primary { margin-top: 0; }

/* 문장 채점 결과 */
.fb-head { font-size: 22px; font-weight: 800; text-align: center; margin: 0 0 10px; }
.fb-head.correct { color: var(--good); }
.fb-head.partial { color: #c77c00; }
.fb-head.wrong, .fb-head.invalid { color: var(--bad); }
.fb-label { font-size: 12px; font-weight: 800; color: var(--muted); margin: 12px 0 4px; }
.fb-mine { margin: 0; padding: 10px 12px; background: var(--bg); border-radius: 10px; }
.chunks { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.chunks li { display: grid; grid-template-columns: 28px 1fr; gap: 6px; align-items: start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.chunks .mark { font-weight: 800; font-size: 18px; line-height: 1.4; text-align: center; }
.chunks .ok .mark, .chunks .loose .mark { color: var(--good); }
.chunks .partial .mark { color: #c77c00; }
.chunks .miss .mark { color: var(--bad); }
.chunks .note { display: block; font-size: 13px; color: var(--muted); }

/* 최종 결과 */
.r-card { text-align: center; background: linear-gradient(135deg, #5b3fd6, #7d5cf0); color: #fff; border: 0; }
.r-sub { margin: 0; opacity: 0.85; font-size: 13px; }
.r-title { font-family: "Jua", sans-serif; font-weight: 400; font-size: 28px; margin: 4px 0 6px; }
.r-desc { margin: 0 0 12px; opacity: 0.95; }
.r-stats { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.r-stats span { background: rgba(255,255,255,0.18); border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 700; }
.weak, .review { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.weak li { padding: 8px 12px; background: var(--bg); border-radius: 10px; }
.review li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.review .en { font-weight: 700; }
.review .ko { color: var(--muted); }
.review .tag { font-weight: 800; margin-right: 4px; }


/* 결과: 진단 중 다른 화면으로 나간 횟수 */
.r-leave { margin: 12px 0 0; font-size: 14px; background: rgba(255,255,255,0.18); border-radius: 12px; padding: 8px 12px; }
.r-leave.warn { background: #fff4d6; color: #7a4b00; }
.r-leave.strong { background: #ffe1e1; color: #a12a2a; }
/* 결과 카드: "○○ 레벨 진단 결과"와 레벨 이름을 2배로 (원장님 2026-11-15) */
.r-sub { font-size: 26px; font-weight: 700; }
.panel.r-card h2.r-title { font-size: clamp(28px, 9.6vw, 36px); line-height: 1.25; word-break: keep-all; } /* 화면에 18px로 보이던 것의 2배 */
.panel.r-card .r-sub { font-size: 26px; }
/* 남은 시간: 굵은 막대 + 초 숫자 (원장님 2026-11-15) */
.timer-row { display: flex; align-items: center; gap: 10px; margin: 0 2px 8px; }
.timer-row .timer { flex: 1; height: 12px; }
.timer-left { font-weight: 800; font-size: 17px; color: var(--accent); min-width: 62px; text-align: right; font-variant-numeric: tabular-nums; }
.timer-left.low { color: var(--bad); }
/* 답 칸 오른쪽: 한 줄 지우기·전체 지우기 */
.ans-row { display: grid; grid-template-columns: 1fr 64px; gap: 6px; }
.ans-tools { display: grid; grid-template-rows: 1fr 1fr; gap: 6px; height: 104px; }
.ans-del { font: inherit; font-size: 12px; font-weight: 800; line-height: 1.25; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 0 2px; cursor: pointer; }
.ans-del:active { background: var(--accent-soft); color: var(--accent); }
#answer { white-space: pre-wrap; }
/* 레벨 이름은 노란색으로 눈에 띄게 (원장님 2026-11-15) */
.panel.r-card h2.r-title { color: #ffe066; }
/* 해석: 위쪽 시간 줄을 작게 해서 문장·답 칸이 더 위로 (원장님 2026-11-16) */
.q-top:has(+ .q-panel) { margin: 6px 2px 2px; font-size: 14px; }
.timer-row { gap: 8px; margin: 0 2px 4px; }
.timer-row .timer { height: 6px; }
.timer-left { font-size: 13px; min-width: 46px; }
.panel.q-panel { margin-top: 6px; }
/* 해석 문제 화면 정리 (원장님 2026-11-16): 문장 글씨 작게, 시간 막대는 문장 아래, 말하기 버튼 왼쪽 반 + 오른쪽에 모르겠어요·제출하기 */
.q-panel .q-en { font-size: clamp(17px, 4.6vw, 21px); line-height: 1.4; margin: 2px 0 8px; }
.q-panel .timer-row { margin: 0 0 10px; }
.q-panel .listening { margin: 4px 0 0; height: 20px; line-height: 20px; font-size: 13px; }
.q-bottom { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; margin-top: 4px; }
.q-bottom .mic { grid-row: 1 / 3; grid-column: 1; height: 124px; margin-top: 0; padding: 0 8px; font-size: 15px; border-radius: 18px; }
.q-bottom .mic-ico { font-size: 34px; }
.q-bottom .mic span { white-space: normal; text-align: center; word-break: keep-all; line-height: 1.3; }
.q-bottom #skip { grid-column: 2; grid-row: 1; margin: 0; width: 100%; height: 100%; font-size: 15px; }
.q-bottom #submit { grid-column: 2; grid-row: 2; margin: 0; width: 100%; height: 100%; font-size: 17px; padding: 0; }
/* 한 줄 지우기·전체 지우기: 답 칸 높이에 맞춰 위아래로 꽉 차게, 글씨도 크게 (원장님 2026-11-16) */
.ans-row { grid-template-columns: 1fr 76px; align-items: stretch; }
.ans-tools { height: auto; min-height: 104px; }
.ans-del { font-size: 14px; line-height: 1.3; color: var(--ink); border: 1.5px solid var(--line); border-radius: 12px; }
