/* ============================================================
   폰 전용 화면(2026-10-12) — '내 퀴즈'(m-quiz.html) + 퀴즈 풀기(quiz.html)·충전(payment*.html)의 폰 배치
   모든 규칙은 html.is-phone 아래에서만 동작 — PC·태블릿 화면은 전혀 바뀌지 않는다.
   폰 홈(m-home.css)과 같은 규칙: 흰 바탕 + 연회색 테두리 카드(16px 둥글기), 파랑은 누르는 것·중요한 숫자에만,
   글자 크기 5단계(28 / 20 / 17 / 15 / 13). ⚠️ 왼쪽 세로띠 금지(CLAUDE.md 10-1).
   ============================================================ */
html.is-phone {
  --m-main: #2b57c9; --m-dark: #1d3c8f; --m-tint: #eef2fd;
  --m-ink: #0f172a; --m-ink2: #475569; --m-ink3: #94a3b8;
  --m-line: #e2e8f0; --m-soft: #f8fafc;
  --m-good: #059669; --m-good-bg: #ecfdf5; --m-bad: #dc2626; --m-bad-bg: #fef2f2; --m-warn: #b45309; --m-warn-bg: #fffbeb;
  --m-pad: 20px; --m-radius: 16px;
  --m-safe-b: env(safe-area-inset-bottom, 0px);
  -webkit-text-size-adjust: 100%;
}

/* ─────────────────────────── 내 퀴즈(m-quiz.html) ─────────────────────────── */
.mq-body { background: var(--m-soft); color: var(--m-ink); font-family: var(--font); word-break: keep-all; -webkit-font-smoothing: antialiased; min-height: 100dvh; margin: 0; padding: 0 !important; }
.mq-body * { box-sizing: border-box; }
.mq-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--m-line); padding-top: env(safe-area-inset-top, 0px); }
.mq-header-in { height: 56px; padding: 0 var(--m-pad); display: flex; align-items: center; justify-content: space-between; max-width: 560px; margin: 0 auto; }
.mq-logo { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 19px; letter-spacing: .3px; color: var(--m-main); text-decoration: none; }
.mq-header-right { display: flex; align-items: center; gap: 8px; }
.mq-credit { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--m-tint); color: var(--m-main); font-size: 13px; font-weight: 700; text-decoration: none; font-variant-numeric: tabular-nums; }
.mq-account { width: 34px; height: 34px; border-radius: 999px; border: 0; background: var(--m-main); color: #fff; font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.mq-credit[hidden], .mq-account[hidden] { display: none; }

.mq-main { max-width: 560px; margin: 0 auto; padding: 24px var(--m-pad) calc(40px + var(--m-safe-b)); }
.mq-head { margin-bottom: 24px; }
.mq-h1 { font-size: 28px; line-height: 1.3; letter-spacing: -.02em; font-weight: 800; margin: 0 0 4px; }
.mq-sub { font-size: 14px; color: var(--m-ink2); margin: 0; }
.mq-sec { margin-bottom: 28px; }
.mq-sec[hidden] { display: none; }
.mq-h2 { font-size: 15px; font-weight: 700; color: var(--m-ink2); margin: 0 0 10px; }
.mq-h2[hidden] { display: none; }
.mq-list { display: flex; flex-direction: column; gap: 10px; }

.mq-card { width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px; background: #fff; border: 1px solid var(--m-line); border-radius: var(--m-radius); text-align: left; font-family: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .1s, border-color .15s; }
.mq-card:active { transform: scale(.985); border-color: #cbd5e1; }
.mq-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mq-card-name { font-size: 15px; font-weight: 700; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mq-card-meta { font-size: 13px; color: var(--m-ink3); display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.mq-card-meta i { font-style: normal; color: #cbd5e1; }
.mq-card-meta b { font-weight: 700; }
.mq-card-meta b.good { color: var(--m-good); } .mq-card-meta b.mid { color: var(--m-warn); } .mq-card-meta b.low { color: var(--m-bad); }
.mq-card-meta b.prog { color: var(--m-main); } .mq-card-meta b.new { color: var(--m-ink2); }
.mq-chev { flex-shrink: 0; color: #cbd5e1; }
.mq-badge { flex-shrink: 0; width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mq-badge small { font-size: 10px; font-weight: 700; margin-left: 1px; }
.mq-badge.good { background: var(--m-good-bg); color: var(--m-good); }
.mq-badge.mid { background: var(--m-warn-bg); color: var(--m-warn); }
.mq-badge.low { background: var(--m-bad-bg); color: var(--m-bad); }
.mq-badge.prog { background: var(--m-tint); color: var(--m-main); font-size: 14px; }
.mq-badge.new { background: var(--m-soft); color: var(--m-ink2); border: 1px solid var(--m-line); }
.mq-bar { display: block; height: 4px; border-radius: 99px; background: var(--m-tint); overflow: hidden; margin-top: 4px; }
.mq-bar span { display: block; height: 100%; background: var(--m-main); border-radius: 99px; }

.mq-skel { height: 82px; border-radius: var(--m-radius); background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 50%, #eef1f6 75%); background-size: 200% 100%; animation: mq-shimmer 1.2s infinite; }
@keyframes mq-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .mq-skel { animation: none; } }

.mq-more { width: 100%; height: 48px; margin-top: 12px; border-radius: 12px; border: 1px solid var(--m-line); background: #fff; color: var(--m-ink2); font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.mq-more[hidden] { display: none; }
.mq-empty { text-align: center; padding: 48px 12px; }
.mq-empty[hidden], .mq-error[hidden] { display: none; }
.mq-empty-icon { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 16px; background: var(--m-tint); color: var(--m-main); display: flex; align-items: center; justify-content: center; }
.mq-empty-title { font-size: 17px; font-weight: 700; margin: 0 0 8px; }
.mq-empty-desc { font-size: 14px; line-height: 1.65; color: var(--m-ink2); margin: 0; text-wrap: balance; }
.mq-empty-desc b { color: var(--m-main); }
.mq-error { text-align: center; padding: 32px 8px; font-size: 14px; color: var(--m-ink2); line-height: 1.6; }
.mq-error p { margin: 0 0 14px; }

/* 공용 큰 버튼 */
.mq-btn { width: 100%; min-height: 52px; padding: 10px 16px; border-radius: 14px; border: 0; background: var(--m-main); color: #fff; font-family: inherit; font-size: 15px; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent; transition: transform .1s, background .15s; }
.mq-btn small { font-size: 12px; font-weight: 500; opacity: .85; }
.mq-btn:active { transform: scale(.98); }
.mq-btn.ghost { background: #fff; color: var(--m-ink); border: 1px solid var(--m-line); }
.mq-btn.loading { opacity: .6; pointer-events: none; }

/* 아래에서 올라오는 창 */
.mq-sheet-wrap { position: fixed; inset: 0; z-index: 100030; pointer-events: none; }
.mq-sheet-back { position: absolute; inset: 0; background: rgba(15,23,42,.38); opacity: 0; transition: opacity .2s; }
.mq-sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; background: #fff; border-radius: 22px 22px 0 0; padding: 10px var(--m-pad) calc(16px + var(--m-safe-b)); transform: translateY(100%); transition: transform .25s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; gap: 10px; }
.mq-sheet-wrap.open { pointer-events: auto; }
.mq-sheet-wrap.open .mq-sheet-back { opacity: 1; }
.mq-sheet-wrap.open .mq-sheet { transform: none; }
.mq-sheet-grip { width: 40px; height: 5px; border-radius: 99px; background: #e2e8f0; margin: 0 auto 6px; }
.mq-sheet-title { font-size: 17px; font-weight: 800; line-height: 1.4; margin: 0; overflow-wrap: anywhere; }
.mq-sheet-meta { font-size: 13px; color: var(--m-ink3); margin: -6px 0 4px; }
.mq-sheet-meta:empty { display: none; }
.mq-sheet-actions { display: flex; flex-direction: column; gap: 10px; }
@media (prefers-reduced-motion: reduce) { .mq-sheet, .mq-sheet-back { transition: none; } }

html.is-phone .toast-container { left: 16px; right: 16px; bottom: calc(16px + var(--m-safe-b)); top: auto; align-items: stretch; }

/* ─────────────────────────── 퀴즈 풀기(quiz.html) 폰 배치 ─────────────────────────── */
/* PC 전용 버튼(.m-only의 반대)은 그대로 두고, 폰 전용 버튼은 PC에서 숨긴다 */
.m-only { display: none !important; }
html.is-phone .m-only { display: inline-flex !important; }
html.is-phone .m-only[style*="display: none"], html.is-phone .m-only[style*="display:none"] { display: none !important; }

html.is-phone body:has(#quiz-area) { padding: 0 !important; background: #fff; overflow-x: hidden; }
html.is-phone body:has(#quiz-area) .bg-gradient,
html.is-phone body:has(#quiz-area) .bg-noise,
html.is-phone body:has(#quiz-area) .st-sidebar,
html.is-phone body:has(#quiz-area) .feedback-fab,
html.is-phone body:has(#quiz-area) #feedback-fab,
html.is-phone #quiz-doc-name,
html.is-phone #shuffle-btn,
html.is-phone #exclude-question-btn,
html.is-phone #quiz-original-btn,
html.is-phone #drag-memo-tip,
html.is-phone #quiz-selection-toolbar,
html.is-phone #quiz-memo-input-wrap,
html.is-phone .q-memo-bubble,
html.is-phone .quiz-original-panel,
html.is-phone .quiz-resize-handle,
html.is-phone #weakness-section,
html.is-phone .similar-q-btn,
html.is-phone .results-actions > :not(.m-only) { display: none !important; }

/* 위쪽 줄: [✕] [진행 막대] [3 / 20] — 스크롤해도 붙어 있다 */
html.is-phone .quiz-topbar { position: sticky; top: 0; z-index: 60; margin-top: 0; padding: calc(6px + env(safe-area-inset-top, 0px)) 8px 6px 4px; background: rgba(255,255,255,.94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--m-line); }
html.is-phone .quiz-topbar-inner { gap: 10px; max-width: none; }
html.is-phone .quiz-quit-btn { order: -1; font-size: 18px; color: var(--m-ink2); }
html.is-phone .quiz-progress-bar { height: 6px; background: var(--m-tint); }
html.is-phone .quiz-progress-fill { box-shadow: none; }
html.is-phone .quiz-counter { font-size: 14px; color: var(--m-ink); font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }

/* 문제 카드 — 테두리·그림자 없이 화면을 넓게 쓴다 */
html.is-phone .quiz-main { padding: 14px 18px calc(96px + var(--m-safe-b)); min-height: auto; }
html.is-phone .quiz-layout { display: block; max-width: none; }
html.is-phone .quiz-card-container { width: 100% !important; }
html.is-phone .quiz-card { padding: 0; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
html.is-phone .quiz-card.answered-correct, html.is-phone .quiz-card.answered-wrong { border: 0; box-shadow: none; }
html.is-phone .question-nav { margin: 0 -18px 16px; padding: 2px 18px 12px; scrollbar-width: none; }
html.is-phone .question-nav::-webkit-scrollbar { display: none; }
html.is-phone .q-nav-btn { width: 38px; height: 38px; font-size: 13px; }
html.is-phone #question-source { font-size: 12px; }
html.is-phone .quiz-question { font-size: 17px; line-height: 1.65; margin-bottom: 20px; word-break: keep-all; overflow-wrap: anywhere; }
html.is-phone .quiz-options { gap: 10px; }
html.is-phone .quiz-option { min-height: 56px; padding: 12px 14px; font-size: 15px; line-height: 1.5; border-radius: 14px; background: #fff; border: 1.5px solid var(--m-line); -webkit-tap-highlight-color: transparent; }
html.is-phone .quiz-option:hover:not(:disabled) { transform: none; }
html.is-phone .quiz-option:active:not(:disabled) { background: var(--m-soft); }
html.is-phone .option-marker { width: 28px; height: 28px; font-size: 12px; }
html.is-phone .ox-options { gap: 12px; }
html.is-phone .ox-option { padding: 22px 12px; font-size: 44px; border-radius: 16px; }
html.is-phone .ox-option:hover:not(:disabled) { transform: none; box-shadow: none; }
/* 16px 미만이면 아이폰이 입력할 때 화면을 확대해버린다 */
html.is-phone .short-answer-input, html.is-phone #cloze-input { font-size: 16px; min-height: 64px; padding: 14px 16px; border-radius: 14px; }
html.is-phone .quiz-explanation { padding: 16px; border-radius: 14px; font-size: 14.5px; line-height: 1.75; }
html.is-phone .quiz-explanation table { display: block; overflow-x: auto; }
html.is-phone #question-text .katex-display, html.is-phone #explanation-text .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }

/* 아래 버튼 줄: [←] [AI에게 질문] [제출하기 / 다음 문제] — 엄지가 닿는 자리, 키보드가 뜨면 그 위로 */
/* 결과 화면·퀴즈 없음 화면에선 숨김(버튼 줄을 body로 옮겨서 퀴즈 영역과 같이 안 숨겨진다) */
html.is-phone body:has(#quiz-area[style*="display: none"]) .quiz-actions.m-dock,
html.is-phone body:has(#quiz-area[style*="display:none"]) .quiz-actions.m-dock { display: none; }
html.is-phone .quiz-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; margin: 0; padding: 10px 14px calc(10px + var(--m-safe-b)); gap: 8px; background: rgba(255,255,255,.96); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--m-line); transform: translateY(calc(-1 * var(--m-kb, 0px))); }
html.is-phone .quiz-actions .btn { height: 52px; min-height: 52px; border-radius: 14px; font-size: 15px; font-weight: 700; padding: 0 14px; }
html.is-phone .quiz-actions #prev-btn { flex: 0 0 auto; margin-right: 0; padding: 0 14px; }
html.is-phone .quiz-actions #prev-btn span { display: none; }
html.is-phone .quiz-actions #submit-btn, html.is-phone .quiz-actions #next-btn { flex: 1 1 auto; }
html.is-phone .quiz-actions #submit-btn { background: var(--m-main); color: #fff; border: 0; }
html.is-phone .quiz-ask-btn { height: 52px; border-radius: 14px; padding: 0 14px; font-size: 14px; font-weight: 700; flex: 0 0 auto; background: var(--m-tint); color: var(--m-main); border: 0; }

/* AI 질문 창 — 아래에서 올라오는 창(보이는 화면 높이에 맞춰 키보드 위로) */
html.is-phone #mobile-chat-backdrop { display: none; position: fixed; inset: 0; z-index: 100024; background: rgba(15,23,42,.38); }
html.is-phone #mobile-chat-backdrop.visible { display: block; }
html.is-phone .quiz-chat-panel { position: fixed; left: 0; right: 0; top: auto; bottom: var(--m-kb, 0px); z-index: 100025; width: auto; min-width: 0; height: calc(var(--m-vvh, 100dvh) * 0.9); max-height: calc(var(--m-vvh, 100dvh) - 24px); border-radius: 20px 20px 0 0; border: 0; box-shadow: 0 -8px 30px rgba(15,23,42,.12); background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
html.is-phone .quiz-chat-panel.open { animation: m-sheet-up .22s cubic-bezier(.2,.8,.2,1); }
@keyframes m-sheet-up { from { transform: translateY(40%); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { html.is-phone .quiz-chat-panel.open { animation: none; } }
html.is-phone .quiz-chat-handle { display: block; width: 40px; height: 5px; border-radius: 99px; background: #e2e8f0; margin: 8px auto 0; flex-shrink: 0; }
html.is-phone .quiz-chat-header { padding: 10px 16px 12px; background: #fff; }
html.is-phone .quiz-chat-close { font-size: 18px; min-width: 40px; min-height: 40px; }
html.is-phone .quiz-chat-messages { padding: 14px 16px; }
html.is-phone .quiz-chat-msg.user .quiz-chat-bubble, html.is-phone .quiz-chat-msg.ai .quiz-chat-bubble { font-size: 15px; }
html.is-phone .quiz-chat-input-row { padding: 10px 12px calc(10px + var(--m-safe-b)); background: #fff; }
html.is-phone .quiz-chat-input { font-size: 16px; min-height: 44px; padding: 10px 12px; border-radius: 12px; }
html.is-phone .quiz-chat-send { width: 44px; height: 44px; border-radius: 12px; }
html.is-phone .quiz-chat-buy-btn { min-height: 40px; padding: 8px 14px; font-size: 13px; }

/* 결과 화면 */
html.is-phone .results-wrap { padding: calc(20px + env(safe-area-inset-top, 0px)) 16px calc(32px + var(--m-safe-b)); min-height: auto; }
html.is-phone .results-summary-card, html.is-phone .results-weakness-card { padding: 20px 18px; border-radius: 18px; }
html.is-phone .results-actions { flex-direction: column; gap: 10px; }
html.is-phone .results-actions .m-only { width: 100%; height: 52px; justify-content: center; align-items: center; border-radius: 14px; font-size: 15px; font-weight: 700; }
html.is-phone .wrong-answer-card { padding: 14px 16px; }
html.is-phone .wrong-collapsed-chevron { top: 16px; right: 14px; }
html.is-phone .modal { width: calc(100vw - 32px); max-width: 420px; }

/* ─────────────────────────── 충전(payment.html)·결제 결과 화면 폰 배치 ─────────────────────────── */
/* 폰에선 PC용 메뉴 줄·떠 있는 버튼을 숨기고, 위에 '뒤로' 줄(payment.js가 붙임)만 둔다 */
html.is-phone body:has(.payment-page) .st-sidebar,
html.is-phone body:has(.payment-page) .bg-noise,
html.is-phone body:has(#fail-title) .st-sidebar,
html.is-phone body:has(#success-state) .st-sidebar,
html.is-phone .feedback-fab, html.is-phone #feedback-fab { display: none !important; }
html.is-phone body:has(.payment-page) { padding: 0 !important; background: var(--m-soft); }
html.is-phone .m-subhead { position: sticky; top: 0; z-index: 60; height: calc(52px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 12px 0 4px; display: flex; align-items: center; gap: 2px; background: rgba(255,255,255,.94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--m-line); }
html.is-phone .m-subhead-back { width: 44px; height: 44px; border: 0; background: none; color: var(--m-ink); display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 12px; }
html.is-phone .m-subhead-title { font-size: 16px; font-weight: 700; color: var(--m-ink); }

html.is-phone .payment-page { padding: 16px 0 calc(40px + var(--m-safe-b)) !important; }
html.is-phone .payment-page .container { padding: 0 16px; }
html.is-phone .payment-hero { margin: 0 0 16px; padding: 16px 18px 18px; border-radius: 18px; box-shadow: none; }
html.is-phone .payment-hero::before { width: 180px; height: 180px; right: -50px; bottom: -70px; }
html.is-phone .payment-hero-pill { margin-bottom: 10px; font-size: 11px; }
html.is-phone .payment-hero h1 { font-size: 20px; margin-bottom: 0; }
html.is-phone .payment-hero-sub { font-size: 13px; }
html.is-phone .payment-hero-sub { display: none; }
html.is-phone .plan-toggle { margin-bottom: 14px; }
html.is-phone .packages-grid { grid-template-columns: 1fr; gap: 10px; margin: 0 0 16px; }
/* 카드는 한 줄 요약형: 이름·크레딧 왼쪽, 가격 오른쪽(누르면 고르기) */
html.is-phone .package-card { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name price" "sub price" "credits orig"; align-items: center; column-gap: 12px; row-gap: 2px; padding: 16px 16px 14px; border-radius: 16px; border-width: 1.5px; background: #fff; }
html.is-phone .package-card:hover, html.is-phone .package-card.selected { transform: none; }
html.is-phone .package-card.selected { border-color: var(--m-main); box-shadow: 0 0 0 3px rgba(43,87,201,.14); background: #fff; }
html.is-phone .package-name { grid-area: name; font-size: 16px; margin: 0; }
html.is-phone .package-subtitle { grid-area: sub; font-size: 12.5px; margin: 0; }
html.is-phone .package-credits { grid-area: credits; font-size: 20px; margin: 6px 0 0; }
html.is-phone .year-badge-row { grid-area: credits; margin: 6px 0 0 !important; }
html.is-phone .package-price-row { grid-area: price; margin: 0; justify-self: end; }
html.is-phone .package-price { font-size: 20px; }
html.is-phone .package-price-original { grid-area: orig; justify-self: end; margin: 6px 0 0; font-size: 12px; }
html.is-phone .package-unit-price,
html.is-phone .package-features,
html.is-phone .package-select-btn { display: none !important; }
html.is-phone .popular-badge { top: -9px; right: 14px; left: auto; font-size: 10.5px; padding: 2px 9px; }
/* 고르면 동의 체크 + 결제 버튼이 화면 아래에 붙는다 */
html.is-phone body:has(#pay-btn[style*="flex"]) .payment-page { padding-bottom: calc(220px + var(--m-safe-b)) !important; }
html.is-phone body:has(#pay-btn[style*="flex"]) #payment-action { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; max-width: none !important; margin: 0 !important; padding: 12px 16px calc(12px + var(--m-safe-b)); background: #fff; border-top: 1px solid var(--m-line); box-shadow: 0 -6px 24px rgba(15,23,42,.08); }
html.is-phone body:has(#pay-btn[style*="flex"]) #payment-action #payment-consent { margin-bottom: 10px !important; padding: 10px 12px !important; }
html.is-phone body:has(#pay-btn[style*="flex"]) #payment-action #payment-consent label { font-size: 12px !important; }
html.is-phone body:has(#pay-btn[style*="flex"]) #payment-action #consent-checkbox { width: 20px !important; height: 20px !important; }
html.is-phone body:has(#pay-btn[style*="flex"]) #payment-action #pay-btn { min-height: 52px; border-radius: 14px; font-size: 15px; }
html.is-phone body:has(#pay-btn[style*="flex"]) #payment-action > p { margin-top: 8px !important; font-size: 11.5px !important; }
html.is-phone body:has(#pay-btn[style*="flex"]) #payment-action > p + p { display: none; }
html.is-phone #promo-section, html.is-phone #referral-section { margin-top: 24px !important; padding: 20px 16px !important; border-radius: 16px !important; }
/* 결제 결과 화면 */
html.is-phone body:has(#success-state) .glass, html.is-phone body:has(#fail-title) .glass { padding: 32px 20px !important; border-radius: 20px !important; }
html.is-phone body:has(#success-state) .btn, html.is-phone body:has(#fail-title) .btn { width: 100%; justify-content: center; min-height: 52px; border-radius: 14px; }
/* 알림(토스트)이 아래 버튼 줄을 가리지 않게 그 위에 띄운다 */
html.is-phone body:has(.quiz-actions.m-dock) .toast-container { bottom: calc(86px + var(--m-safe-b) + var(--m-kb, 0px)); }
html.is-phone body:has(#quiz-area[style*="display: none"]) .toast-container { bottom: calc(16px + var(--m-safe-b)); }
html.is-phone .results-actions .m-only.btn-glass { background: #fff; border: 1px solid var(--m-line); color: var(--m-ink); }
/* staging 표시(주황 배지)가 폰의 아래 버튼 줄을 가리지 않게 위로 올리고 눌리지 않게 한다 */
html.is-phone #gwatop-env-badge { bottom: calc(96px + var(--m-safe-b)) !important; pointer-events: none !important; opacity: .85; }

/* 내 퀴즈 — 파일별로 보기(2026-10-12) */
.mq-badge.file { background: var(--m-tint); color: var(--m-main); }
.mq-file-head { display: flex; align-items: center; gap: 4px; margin: -8px 0 18px -10px; }
.mq-file-head[hidden] { display: none; }
.mq-file-back { flex-shrink: 0; width: 44px; height: 44px; border: 0; background: none; color: var(--m-ink); display: flex; align-items: center; justify-content: center; border-radius: 12px; cursor: pointer; }
.mq-file-head-text { min-width: 0; }
.mq-file-head-name { margin: 0; font-size: 20px; font-weight: 800; line-height: 1.35; letter-spacing: -.01em; overflow-wrap: anywhere; }
.mq-file-head-meta { margin: 2px 0 0; font-size: 13px; color: var(--m-ink3); }
/* 폰: 답을 내기 전에는 '다음 문제'를 숨긴다(2026-10-12 유저 요청) — 다시 풀기·이어 풀기는 건너뛰기용으로 처음부터 떠 있었다.
   제출하면(제출하기 버튼이 숨겨지면) 다시 보인다. 건너뛰려면 위쪽 문제 번호 줄을 누르면 된다. */
html.is-phone .quiz-actions:has(#submit-btn:not([style*="display: none"]):not([style*="display:none"])) #next-btn { display: none !important; }

/* '이 자료로 공부하기'(2026-10-13) — 파일을 열면 맨 위 */
html.is-phone .mq-study { margin-bottom: 10px; }
/* 폴더(2026-10-13) — PC '내 파일'의 폴더를 폰에서도 */
html.is-phone .mq-badge.folder { background: #fff4dc; color: #c27a00; }
html.is-phone .mq-note { margin: 8px 2px; font-size: 14px; color: var(--m-ink3); }
