/* 테라러닝 문제 화면 공용 모양 (2026-11-10 허브) — 크기 · 배치의 본은 마이메르시 문풀 화면(실측 값은 화면표준 12절)
 * 색은 앱의 --pt. 클래스는 전부 tq- 로 시작한다. tera-q.js 와 같이 싣는다.
 * 화면 틀: .tq-top(머리) → .tq-prog(진행) → .tq-meta(번호 · 최빈출 · 단추) → .tq-stem(발문) → .tq-choices | .tq-ox → .tq-exp(해설) · .tq-bar(아래 줄) · .tq-omr(답안 번호판)
 */
:root { --tq-p: var(--pt, var(--t-app, var(--cta, #0F766E))); --tq-ps: color-mix(in srgb, var(--tq-p) 8%, #fff); --tq-pi: color-mix(in srgb, var(--tq-p) 78%, #111419);
  --tq-ink: #111827; --tq-ink2: #334155; --tq-sub: #5B6B82; --tq-line: #E2E8F0; --tq-fill: #F1F5F9; --tq-ok: #16B364; --tq-no: #E5322D; }

/* 머리: ‹ 과목 이름 …… 시간 */
.tq-top { display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 16px; }
.tq-top .tq-back { width: 36px; height: 36px; border: 0; background: none; font-size: 20px; color: var(--tq-ink); cursor: pointer; }
.tq-top b { flex: 1; font-weight:600;font-size:20px;line-height:20px; color: #0F172A; letter-spacing: -.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tq-top time { font-weight:500;font-size:14px;line-height:1; color: var(--tq-sub); font-variant-numeric: tabular-nums; }

/* 진행 막대 + 남은 수 */
.tq-prog { display: flex; align-items: center; gap: 12px; margin: 8px 0 22px; }
.tq-prog i { flex: 1; height: 8px; border-radius: 999px; background: var(--tq-fill); overflow: hidden; }
.tq-prog i u { display: block; height: 100%; border-radius: 999px; background: var(--tq-p); transition: width .3s; }
.tq-prog span { font-weight:500;font-size:13px;line-height:1; color: var(--tq-sub); white-space: nowrap; } .tq-prog span b { font-weight: 800; color: var(--tq-ink); }

/* 번호 줄 */
.tq-meta { display: flex; align-items: center; gap: 10px; min-height: 36px; margin-bottom: 10px; }
.tq-meta .tq-no { font-weight:500;font-size:14px;line-height:1; color: #64748B; }
.tq-meta .tq-sp { flex: 1; }
.tq-stars { font-size: 14px; line-height: 1; letter-spacing: 1px; } .tq-stars b { color: var(--tq-p); font-weight: 500; } .tq-stars i { color: #E2E8F0; font-style: normal; }
.tq-tier { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-weight: 800; font-size: 13px; line-height: 1; color: #fff; }
.tq-tier-S { background: var(--tq-p); } .tq-tier-A { background: color-mix(in srgb, var(--tq-p) 55%, #fff); } .tq-tier-B { background: color-mix(in srgb, var(--tq-p) 18%, #fff); color: var(--tq-pi); } .tq-tier-C { background: #E9ECF0; color: #5F6670; }
.tq-badge { display: inline-flex; align-items: center; gap: 3px; font-weight:500;font-size:13px;line-height:1; color: #475569; }
.tq-badge svg { width: 14px; height: 14px; color: #F97316; } .tq-badge b { font-weight: 600; }
.tq-icon { flex: none; width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--tq-line); background: #fff; color: #64748B; display: grid; place-items: center; cursor: pointer; padding: 0; }
.tq-icon svg { width: 17px; height: 17px; } .tq-icon.is-on { background: var(--tq-p); border-color: var(--tq-p); color: #fff; }

/* 발문 */
.tq-stem { font-weight:600;font-size:20px;line-height:30px; color: var(--tq-ink); letter-spacing: -.5px; word-break: keep-all; overflow-wrap: anywhere; margin: 0 0 22px; }
.tq-box { margin: -8px 0 22px; padding: 14px 16px; border-radius: 12px; background: #F8FAFC; border: 1px solid var(--tq-line); font-weight:500;font-size:16px;line-height:28px; color: var(--tq-ink2); }

/* 개념어: 물결 밑줄 + 뜻 말풍선 */
.tq-term { padding: 0 1px; border-radius: 0; cursor: help; color: inherit; text-decoration: none; outline: none;
  background: linear-gradient(transparent 62%, color-mix(in srgb, var(--tq-p) 22%, #fff) 0); transition: background .15s; }
.tq-term:hover, .tq-term:focus, .tq-term.is-on { background: color-mix(in srgb, var(--tq-p) 22%, #fff); }
.tq-terms-off .tq-term { color: inherit; text-decoration: none; cursor: inherit; background: none; padding: 0; pointer-events: none; }
.tq-bubble { --tail: 50%; position: fixed; z-index: 2147482000; max-width: min(320px, calc(100vw - 16px)); padding: 9px 14px; background: #fff; color: #1E293B; font: 600 13px/1.45 'Pretendard Variable', Pretendard, -apple-system, 'Malgun Gothic', sans-serif; letter-spacing: -.2px;
  border: 0; border-radius: 14px; box-shadow: 0 14px 34px -14px rgba(15, 23, 42, .45), 0 0 0 1px #E2E8F0; word-break: keep-all; }
.tq-bubble::after { content: ""; position: absolute; top: 100%; left: var(--tail); width: 10px; height: 10px; margin: -5px 0 0 -5px; background: #fff; box-shadow: 1px 1px 0 #E2E8F0; border-radius: 0 0 3px; transform: rotate(45deg); }
.tq-bubble.is-below::after { top: 0; box-shadow: -1px -1px 0 #E2E8F0; border-radius: 3px 0 0; }

/* 선지: 판 없이 줄로. 번호 동그라미 30px */
.tq-choices { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tq-choice { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; font-weight:500;font-size:16px;line-height:30px; color: var(--tq-ink2); letter-spacing: -.5px; }
.tq-choice .tq-n { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid #94A3B8; display: grid; place-items: center; font-weight:500;font-size:16px;line-height:1; color: var(--tq-ink2); background: #fff; }
.tq-choice .tq-t { flex: 1; min-width: 0; word-break: keep-all; overflow-wrap: anywhere; }
.tq-choice:hover .tq-n { border-color: var(--tq-p); }
.tq-choice.is-pick { color: var(--tq-pi); } .tq-choice.is-pick .tq-n { border-color: var(--tq-p); color: var(--tq-p); }
.tq-choice.is-ok { color: var(--tq-ok); font-weight: 700; } .tq-choice.is-ok .tq-n { border-color: var(--tq-ok); background: var(--tq-ok); color: #fff; }
.tq-choice.is-no { color: var(--tq-no); } .tq-choice.is-no .tq-n { border-color: var(--tq-no); color: var(--tq-no); }
.tq-choice.is-out .tq-t { color: #94A3B8; text-decoration: line-through; }
.tq-x { flex: none; width: 28px; height: 28px; border-radius: 12px; border: 1px solid var(--tq-line); background: #fff; color: #94A3B8; font-size: 14px; line-height: 1; cursor: pointer; }

/* O·X: 높이 64px(화면표준 4절) */
.tq-ox { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tq-ox button { height: 64px; border-radius: 14px; border: 1.5px solid #CBD5E1; background: #fff; font-weight:800;font-size:26px;line-height:1; color: var(--tq-ink); cursor: pointer; }
.tq-ox button.is-ok { border-color: var(--tq-ok); color: var(--tq-ok); background: color-mix(in srgb, var(--tq-ok) 10%, #fff); }
.tq-ox button.is-no { border-color: var(--tq-no); color: var(--tq-no); background: color-mix(in srgb, var(--tq-no) 8%, #fff); }
.tq-ox button.is-rest { color: #94A3B8; }

/* 해설 */
.tq-exp { margin-top: 26px; }
.tq-tabs { display: flex; background: #FAFAFA; border-bottom: 1px solid var(--tq-line); }
.tq-tabs button { height: 50px; padding: 0 18px; border: 0; background: none; font-weight:500;font-size:14px;line-height:1; color: #64748B; cursor: pointer; border-bottom: 2px solid transparent; }
.tq-tabs button.is-on { font-weight: 700; color: var(--tq-p); border-bottom-color: var(--tq-p); }
.tq-exp-box { margin-top: 10px; padding: 20px; border: 1px solid var(--tq-line); border-radius: 12px; background: #fff; font-weight:500;font-size:16px;line-height:28.8px; color: var(--tq-ink2); letter-spacing: -.5px; }
.tq-exp-box .tq-ans { display: block; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--tq-fill); text-align: right; font-weight: 700; color: var(--tq-ink); }

/* 아래 줄: 도구 단추 + 이전 · 번호 · 다음 */
.tq-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(72px + env(safe-area-inset-bottom)); padding: 11px 16px calc(12px + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -2px 10px rgba(0, 0, 0, .03); border-top: 1px solid var(--tq-fill); display: flex; align-items: center; gap: 2px; }
.tq-tool { width: 56px; height: 48px; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight:500;font-size:13px;line-height:1; color: #475569; letter-spacing: -.5px; cursor: pointer; }
.tq-tool svg { width: 22px; height: 22px; } .tq-tool.is-on { color: var(--tq-p); font-weight: 700; }
.tq-bar .tq-sp { flex: 1; }
.tq-pos { font-weight:600;font-size:16px;line-height:1; color: var(--tq-ink); padding: 0 12px; white-space: nowrap; } .tq-pos small { font-weight:500;font-size:14px;line-height:1; color: #94A3B8; }
.tq-nav { flex: none; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--tq-line); background: #fff; color: var(--tq-ink2); display: grid; place-items: center; cursor: pointer; font-size: 20px; }
.tq-nav.is-next { width: auto; min-width: 88px; padding: 0 20px; border: 0; background: var(--tq-p); color: #fff; font-weight: 800; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tq-nav:disabled { opacity: .4; cursor: default; }

/* 답안 번호판 + 안 푼 문제로 이동 */
.tq-omr { padding: 15px; border-radius: 12px; background: #fff; border: 1px solid #EDF2F7; box-shadow: 0 10px 26px rgba(15, 23, 42, .07); }
.tq-jump { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 42px; border-radius: 12px; border: 0; background: color-mix(in srgb, var(--tq-p) 9%, #fff); color: var(--tq-pi); font-weight:600;font-size:14px;line-height:1; cursor: pointer; }
.tq-jump b { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--tq-p); color: #fff; font-weight:700;font-size:13px;line-height:1; }
.tq-jump[hidden] { display: none; }
.tq-omr-row { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 10px; margin-top: 8px; border-radius: 12px; border: 1px solid var(--tq-fill); font-weight:500;font-size:13px;line-height:1; color: #64748B; cursor: pointer; }
.tq-omr-row.is-now { background: var(--tq-ps); border-color: color-mix(in srgb, var(--tq-p) 40%, #fff); color: var(--tq-pi); }
.tq-omr-row .tq-qn { width: 46px; white-space: nowrap; } .tq-omr-row.is-todo .tq-qn::before { content: "• "; color: var(--tq-p); }
.tq-omr-row i { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--tq-line); background: #fff; display: grid; place-items: center; font-weight:700;font-size:13px;line-height:1; color: #6B7280; font-style: normal; }
.tq-omr-row i.is-on { background: color-mix(in srgb, var(--tq-p) 70%, #fff); border-color: transparent; color: #fff; }

/* 안내 말풍선 */
.tq-coach { position: absolute; z-index: 2147481500; width: 250px; padding: 14px 14px 12px; border-radius: 14px; background: #fff; color: #334155; box-shadow: 0 18px 40px -16px rgba(15, 23, 42, .45), 0 0 0 1px #E2E8F0; font: 400 13px/1.55 'Pretendard Variable', Pretendard, -apple-system, 'Malgun Gothic', sans-serif; letter-spacing: -.3px; }
.tq-coach b { display: block; font-weight:800;font-size:14px;line-height:1.3; margin-bottom: 6px; color: var(--tq-pi); } .tq-coach p { margin: 0 0 12px; color: #475569; word-break: keep-all; }
.tq-coach div { display: flex; align-items: center; justify-content: space-between; }
.tq-coach button { border: 0; cursor: pointer; font-weight:600;font-size:13px;line-height:1; } .tq-coach-off { background: none; color: #94A3B8; padding: 8px 6px; }
.tq-coach-ok { height: 36px; padding: 0 14px; border-radius: 12px; background: var(--tq-p); color: #fff; font-weight: 700; }

/* 테라에이전트: 헷갈려요? → 질문 제안 */
.tq-ask { position: relative; }
.tq-ask-pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 9px; border-radius: 999px; border: 0; background: var(--tq-p); color: #fff; font-weight:700;font-size:13px;line-height:1; cursor: pointer; box-shadow: 0 6px 14px -6px var(--tq-p); }
.tq-ask-pill svg { width: 17px; height: 17px; }
.tq-ask-pan { position: fixed; right: 16px; bottom: 88px; z-index: 60; width: min(340px, calc(100vw - 32px)); border-radius: 14px; background: #fff; box-shadow: 0 20px 48px -20px rgba(15, 23, 42, .4), 0 0 0 1px var(--tq-line); overflow: hidden; }
.tq-ask-h { display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 0 8px 0 16px; background: var(--tq-p); color: #fff; } .tq-ask-h b { font-weight:700;font-size:16px;line-height:1; }
.tq-ask-h button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .2); color: #fff; font-size: 16px; cursor: pointer; }
.tq-ask-q { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px; }
.tq-ask-q button { height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--tq-p) 45%, #fff); background: #fff; color: var(--tq-pi); font-weight:600;font-size:13px;line-height:1; cursor: pointer; }
.tq-ask-pan form { display: flex; gap: 8px; padding: 0 14px 14px; }
.tq-ask-pan input { flex: 1; min-width: 0; height: 42px; border-radius: 999px; border: 1px solid var(--tq-line); padding: 0 16px; font-weight:500;font-size:14px;line-height:1; outline: none; }
.tq-ask-pan form button { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--tq-p); color: #fff; font-size: 20px; cursor: pointer; }

/* 넓은 화면: 문제 왼쪽 · 답안 번호판 오른쪽 */
.tq-wrap { max-width: 560px; margin: 0 auto; padding: 0 20px 110px; font-family: 'Pretendard Variable', Pretendard, -apple-system, 'Malgun Gothic', sans-serif; }
@media (min-width: 960px) { .tq-wrap.has-omr { max-width: 980px; display: grid; grid-template-columns: minmax(0, 1fr) 364px; gap: 30px; align-items: start; } .tq-wrap.has-omr .tq-omr { position: sticky; top: 70px; } }
@media (max-width: 959px) { .tq-wrap .tq-omr { display: none; } .tq-wrap .tq-omr.is-open { display: block; position: fixed; left: 12px; right: 12px; bottom: 84px; z-index: 50; max-height: 60vh; overflow: auto; } }
@media (max-width: 389px) { .tq-stem { font-size: 20px; line-height: 28px; } }
/* 11-12 첫 안내 말풍선을 한 줄 띠로 줄임: 큰 말풍선이 선지를 가렸다(NCS 768px 에서 4번 선지 전부). 높이 약 52px · 8초 뒤 스스로 닫힘 */
.tq-coach { width: auto; max-width: min(340px, calc(100vw - 24px)); padding: 9px 8px 9px 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; align-items: center; border-radius: 14px; }
.tq-coach b { grid-column: 1; margin: 0 0 1px; font-size: 13px; } .tq-coach p { grid-column: 1; margin: 0; font-size: 12.5px; line-height: 1.4; }
.tq-coach div { grid-column: 2; grid-row: 1 / span 2; } .tq-coach-off { display: none; } .tq-coach-ok { height: 34px; }
.tq-coach.tq-coach-flow { grid-column: 1 / -1; position: static; max-width: none; margin: 0 0 10px; box-shadow: 0 0 0 1px #E5E7EB; background: var(--tq-ps, #E3F2F0); }
