/* quiz: 원본 marketpug.com 과 맞추기 (2026-10-21) — 수치는 앱 lib/features/quiz/** 그대로 */
.quiz .mi, .qsheet .mi, .qspg .mi, .qdlg .mi { flex: none; display: block }
/* 왼쪽: 상태(불러오는 중 · 데이터 부족 · 실패) 또는 게임(종목 머리 · 차트 · 맞히기 칸) */
.qz-l { position: relative }
.qtopn { display: none }
.qgame { flex: 1; min-height: 0; display: flex; flex-direction: column } .qgame[hidden], .qstate[hidden] { display: none }
.qstate { flex: 1; min-height: 0; display: flex; flex-direction: column }
/* 불러오는 중 (앱 _LoadingSkeleton: 좌우 12 · 큰 판 16 · 48 · 52+52) */
.qstate.q-loading { padding: 0 12px }
.qsk1 { flex: 1; height: auto; border-radius: 16px } .qsk2 { flex: none; height: 48px; border-radius: 14px; margin-top: 12px }
.qsk3 { display: flex; gap: 12px; margin-top: 8px } .qsk3 .sk { flex: 1; height: 52px; border-radius: 14px }
/* 데이터 부족 (앱 _EmptyBody) */
.qstate.q-empty, .qstate.q-error { align-items: center; justify-content: center }
.qemp { display: flex; flex-direction: column; align-items: center; padding: 28px; text-align: center; color: var(--tx3) }
.qemp b { margin-top: 12px; color: var(--tx2); font-size: 14px; font-weight: 600 } .qemp small { margin-top: 6px; color: var(--tx3); font-size: 12px; line-height: 1.4 }
.qfill { margin-top: 16px; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 24px 0 16px; border: 0; border-radius: 999px; background: var(--brand); color: #381E72; font-size: 14px; font-weight: 500 }
.qtxt { margin-top: 6px; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 16px 0 12px; border: 0; border-radius: 999px; background: none; color: var(--brand); font-size: 14px; font-weight: 500 }
.qtxt:hover { background: color-mix(in srgb, var(--brand) 8%, transparent) } .qfill:hover { filter: brightness(1.06) }
/* 불러오기 실패 (앱 ErrorRetry) */
.qerr { display: flex; flex-direction: column; align-items: center; padding: 20px; color: var(--tx3); text-align: center } .qerr span { margin-top: 10px; color: var(--tx2); font-size: 13px }
.qretry { margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 20px 0 14px; border: 1px solid var(--line); border-radius: 12px; background: none; color: var(--brand); font-size: 14px; font-weight: 500 }
/* 종목 머리 (앱 _QuizSymbolHeader: 바깥 12·6 · 안 4 · 아이콘 36 · 10 · 이름 18/800 · 11.5) */
.sy-hb.qsym { margin: 6px 12px; padding: 4px; flex: none; border-radius: 10px; gap: 10px; width: auto }
.sy-hb.qsym:hover { background: rgba(255,255,255,.04) } :root[data-theme="light"] .sy-hb.qsym:hover { background: rgba(0,0,0,.04) }
.qsym .sy-n b { font-size: 18px; font-weight: 800; line-height: 1.45 } .qsym .sy-n small { font-size: 11.5px; line-height: 1.45 } .qsym > .mi:last-child { color: var(--tx3); margin-left: 6px }
/* 로고: 그림은 흰 칩(안쪽 12%) · 없으면 surface2 바탕 첫 글자 (앱 SymbolIcon) */
.quiz .lg:has(img), .qsheet .lg:has(img) { padding: calc(var(--s) * .12); box-sizing: border-box }
.quiz .lg:not(:has(img)), .qsheet .lg:not(:has(img)) { background: var(--surface2); color: var(--tx2); font-size: calc(var(--s) * .42) }
/* 차트: 좌우 16 · 위 4 · 아래 8 */
.qcw { flex: 1; min-height: 80px; height: auto; padding: 4px 16px 5.2px; position: relative }   /* 앱은 머리 높이를 60 으로 어림해 차트 = 남은 높이 − 72 (아래 8 중 2.8 이 잘림) */
/* 맞히기 칸 (앱 _QuizPanel: 16·14 · 위 둥근 20 · 그림자 0 −4 20 #33000000) */
.qpanel { border-radius: 20px 20px 0 0; padding: 14px 16px; background: var(--surface); box-shadow: 0 -4px 20px rgba(0,0,0,.2); min-height: 0; gap: 0; flex: none; display: flex; flex-direction: column }
.qlink { align-self: flex-end; display: inline-flex; align-items: center; gap: 5px; padding: 2px 6px; border: 0; background: none; color: var(--tx3); font-size: 12.5px; font-weight: 700; line-height: 1.45 }
.qprompt { margin: 6px 0 14px; text-align: center; font-size: 14px; font-weight: 500; color: var(--tx2); line-height: 1.45 } .qprompt b { color: var(--brand); font-weight: 800 }
.qbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
.qb { height: auto; padding: 11px 0; border-radius: 14px; font-size: 15px; font-weight: 800; line-height: 1.45; display: flex; align-items: center; justify-content: center; gap: 8px; transition: transform .11s ease-out }
.qb:active { transform: scale(.96) } .qb.dn svg { transform: none }
.qb.up { color: var(--up); border: 1px solid color-mix(in srgb, var(--up) 45%, transparent); background: linear-gradient(0deg, color-mix(in srgb, var(--up) 28%, transparent), color-mix(in srgb, var(--up) 6%, transparent)) }
.qb.dn { color: var(--down); border: 1px solid color-mix(in srgb, var(--down) 45%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--down) 28%, transparent), color-mix(in srgb, var(--down) 6%, transparent)) }
/* 결과 카드 (앱 _ResultUI · elasticOut 0.5초) + 다음 문제 */
.qresw { display: flex; flex-direction: column; animation: qel .5s linear both }
@keyframes qel { 0% { transform: scale(0) } 5% { transform: scale(.5) } 10% { transform: scale(1) } 15% { transform: scale(1.25) } 20% { transform: scale(1.25) } 25% { transform: scale(1.125) } 30% { transform: scale(1) } 35% { transform: scale(.938) } 40% { transform: scale(.938) } 45% { transform: scale(.969) } 50% { transform: scale(1) } 55% { transform: scale(1.016) } 60% { transform: scale(1.016) } 70% { transform: scale(1) } 80% { transform: scale(.996) } 100% { transform: scale(1) } }
@media (prefers-reduced-motion: reduce) { .qresw { animation: none } }
.qres { --c: var(--up); display: flex; align-items: center; justify-content: center; padding: 14px 20px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--c) 25%, transparent); background: linear-gradient(90deg, color-mix(in srgb, var(--c) 15%, transparent), color-mix(in srgb, var(--c) 5%, transparent)); color: var(--c); gap: 0 }
.qres.no { --c: var(--down) } .qres b { margin-left: 10px; font-size: 20px; font-weight: 800; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0 }
.qres .qpc { margin-left: 12px; padding: 3px 8px; border-radius: 6px; background: var(--bg); font-size: 12px; font-weight: 700; line-height: 1.45; flex: none }
.qnext { margin-top: 12px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 15px 0; border: 0; border-radius: 14px; background: linear-gradient(90deg, var(--brand), var(--brand2)); color: #fff; font-size: 15px; font-weight: 800; line-height: 1.45; transition: transform .11s ease-out }
.qnext:active { transform: scale(.97) }
/* 오른쪽 320 (앱 _SidePanel: 위 8 · 아래 20) */
.qz-r { padding: 8px 0 20px }
.qtitle { font-size: 20px; font-weight: 800; letter-spacing: -.5px; margin: 0; padding: 8px 16px 6px; line-height: 1.45 }
.qsetr { display: flex; align-items: center; gap: 0; margin: 2px 12px; height: 42px; width: calc(100% - 24px); padding: 0 12px; background: var(--surface); border: .5px solid var(--line); border-radius: 10px; text-align: left; color: var(--tx3) }
.qsetr > .mi:first-child { margin-right: 8px } .qsetr b { font-size: 13px; font-weight: 700; color: var(--tx); white-space: nowrap }
/* 앱 Spacer + Flexible: 남는 폭을 반씩 — 글은 뒤쪽 반까지만 · 뒤에 4 + 꺾쇠 */
.qsetr .sp, .qlnk .sp { flex: 1 1 0; min-width: 0 } .qsetr .qtr { flex: 1 1 22px; min-width: 0; display: flex; align-items: center; gap: 4px }
.qtr small { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis } .qsetr .qtr small { font-size: 12px; color: var(--tx2) } .qtr .mi { color: var(--tx3) }
#qstats { padding: 18px 12px 0 }
.qsh { font-size: 16px; font-weight: 800; margin: 0 0 12px; line-height: 1.45 }
.qtiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 0 }
.qt { margin: 0 4px; background: var(--surface2); border-radius: 12px; padding: 14px 2px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; min-width: 0 }
.qt b { font-size: 19px; font-weight: 800; line-height: 1.45; white-space: nowrap } .qt span { font-size: 11px; color: var(--tx2); line-height: 1.45 } .qt b.br { color: var(--brand) }
.qsh2 { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; margin: 22px 0 0; line-height: 1.45; color: var(--tx) }
.qcap { margin: 4px 0 0; font-size: 12px; color: var(--tx3); line-height: 1.45 }
.qempty { margin-top: 12px; padding: 28px 0; background: var(--surface2); border-radius: 14px; text-align: center; font-size: 13px; color: var(--tx3); line-height: 1.45 }
.qsl { display: flex; flex-direction: column; gap: 8px; margin-top: 12px }
.qsr { display: flex; align-items: center; padding: 14px; background: var(--surface2); border: .5px solid var(--line); border-radius: 14px; gap: 0 }
.qrk { width: 22px; flex: none; font-size: 14px; font-weight: 800; color: var(--tx3); text-align: left }
.qsm { flex: 1; min-width: 0; margin-left: 12px; display: flex; flex-direction: column } .qsm b { font-size: 16px; font-weight: 800; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.qsm small { margin-top: 3px; font-size: 12px; color: var(--tx3); line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.qsv { flex: none; max-width: 100px; margin-left: 8px; display: flex; flex-direction: column; align-items: flex-end; min-width: 0 } .qsv b { font-size: 20px; font-weight: 800; line-height: 1.45; white-space: nowrap }
.qsv small { font-size: 10px; color: var(--tx3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100% }
.qreset { margin-top: 18px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; height: 32px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: none; color: var(--tx2); font-size: 14px; font-weight: 500 }
.qreset:hover { background: color-mix(in srgb, var(--tx2) 8%, transparent) }
/* 좁은 화면 통계 시트 (앱 _showStatsSheet: 70% · 20·14·20·20 · 손잡이 40×4) */
.bsb.qsheet { height: 70vh; max-height: 95vh; padding: 14px 20px 20px; gap: 0; display: block }
.qgrab { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 18px }
.qsheet .qsh { font-size: 18px; text-align: center; margin: 0 0 18px } .qsheet .qreset { margin-top: 20px }
/* 머티리얼 알림 창 (AlertDialog) */
.modal.qdlgm { place-items: center; padding: 24px 40px; background: rgba(0,0,0,.54) }
.qdlg { min-width: 280px; max-width: 560px; padding: 24px 0 20px; border-radius: 28px; background: var(--surface); box-shadow: 0 6px 30px rgba(0,0,0,.35) }
.qdlg h2 { margin: 0; padding: 0 24px 16px; font-size: 24px; font-weight: 400; line-height: 1.33; color: var(--tx) }
.qdb { padding: 0 24px; font-size: 14px; line-height: 1.43; color: var(--tx) } .qdb p { margin: 0 } .qdb > small { display: block; font-size: 12px; color: var(--tx3); margin-bottom: 10px }
.qda { display: flex; justify-content: flex-end; gap: 8px; padding: 20px 24px 0 }
.qda button { height: 40px; min-width: 64px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--brand); font-size: 14px; font-weight: 500 } .qda button:hover { background: color-mix(in srgb, var(--brand) 8%, transparent) }
.qda button.dng { color: var(--down); font-weight: 700 } .qda button.dng:hover { background: color-mix(in srgb, var(--down) 8%, transparent) }
.qin { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--tx2); padding: 12px 0 } .qin:focus-within { border-bottom: 2px solid var(--brand); padding-bottom: 11px }
.qin input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--tx); font: inherit; font-size: 16px; caret-color: var(--brand) } .qin input::placeholder { color: var(--tx3) } .qin span { color: var(--tx); font-size: 16px }
/* 퀴즈 설정 페이지 (앱 QuizSettingsScreen: 목록 16·8·16·40 · 머리 34 아이콘 · 칸 사이 12 / 28) */
.qspg .pgh h1 { font-size: 22px; font-weight: 400 } .qspg .pgh .ib { width: 40px; height: 40px }
.pgb.qspb { padding: 8px 16px 40px; display: block }
.qssh { display: flex; align-items: flex-start; gap: 12px; margin: 28px 0 12px } .qssh:first-child { margin-top: 0 }
.qssi { width: 34px; height: 34px; flex: none; border-radius: 10px; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); display: grid; place-items: center }
.qssh > span:last-child { display: flex; flex-direction: column; min-width: 0 } .qssh b { font-size: 15px; font-weight: 800; color: var(--tx); line-height: 1.45 } .qssh small { margin-top: 2px; font-size: 12px; color: var(--tx3); line-height: 1.3 }
.qwcs { display: flex; flex-wrap: wrap; gap: 10px }
.qwc { width: 80px; padding: 16px 0; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--tx); display: flex; flex-direction: column; align-items: center; transition: background .15s, border-color .15s }
.qwc b { font-size: 22px; font-weight: 800; line-height: 1 } .qwc .mi { width: 22px; height: 22px } .qwc small { margin-top: 3px; font-size: 11px; font-weight: 600; color: var(--tx3); line-height: 1.45 }
.qwc.on { background: var(--brand); border-color: var(--brand); color: #fff } .qwc.on small { color: rgba(255,255,255,.85) }
.qyr { display: flex; align-items: center } .qtl { margin: 0 10px; color: var(--tx2); font-size: 16px }
.qydd { flex: 1; min-width: 0; display: flex; align-items: center; padding: 2px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; color: var(--tx2) }
.qydd small { font-size: 12px; color: var(--tx3); margin-right: 8px; flex: none } .qydd b { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; color: var(--tx); line-height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.qfull { margin-top: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 0; height: 16px; line-height: 16px; border: 0; background: none; color: var(--tx3); font-size: 12px; font-weight: 600 } .qfull.act { color: var(--brand) } .qfull:disabled { cursor: default }
.qldc { font-size: 12px; color: var(--tx3) }
.qtog { display: flex; align-items: center; justify-content: space-between; min-height: 54px; padding: 2px 0 2px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer }
.qtog.on { border-color: color-mix(in srgb, var(--brand) 40%, transparent) } .qtog b { font-size: 14px; font-weight: 600; color: var(--tx2) } .qtog.on b { color: var(--tx) }
.qtog .sw3 { margin: 0 20px 0 0 } .qtog .sw3:not(.on) { border-color: #938F99; background: #36343B } .qtog .sw3:not(.on) i { background: #938F99 } .qtog .sw3.on { background: color-mix(in srgb, var(--brand) 50%, var(--surface)) }
:root[data-theme="light"] .qtog .sw3:not(.on) { border-color: #79747E; background: #E6E0E9 } :root[data-theme="light"] .qtog .sw3:not(.on) i { background: #79747E }
.qlnk { width: 100%; display: flex; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: left }
.qlnk b { flex: none; font-size: 14px; font-weight: 600; color: var(--tx) } .qlnk .qtr { flex: 1 1 24px; min-width: 0; display: flex; align-items: center; gap: 4px } .qlnk .qtr small { font-size: 13px; color: var(--tx3) }
.qspg .qsave { color: #381E72; font-size: 14px; font-weight: 700 } :root[data-theme="light"] .qspg .qsave { color: #fff }
/* 연도 메뉴 (DropdownButton 메뉴: 줄 48 · 고른 줄 밝게) */
.qymm { position: fixed; inset: 0; z-index: 90 }
.qym { position: fixed; overflow: auto; padding: 8px 0; background: var(--surface); border-radius: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.3) }
.qym button { display: flex; align-items: center; width: 100%; height: 48px; padding: 0 16px; border: 0; background: none; color: var(--tx); font-size: 14px; font-weight: 700; text-align: left }
.qym button:hover { background: rgba(255,255,255,.06) } .qym button.on { background: rgba(255,255,255,.16) }
:root[data-theme="light"] .qym button:hover { background: rgba(0,0,0,.05) } :root[data-theme="light"] .qym button.on { background: rgba(0,0,0,.1) }
/* 좁은 화면 (<900, 앱 Column: 제목 · 누적 손익 칩 + 설정 단추 · 4 · 게임) — 화면 높이 안에 맞춤 */
@media (max-width: 900px) {
  body[data-r="quiz"] main { height: calc(100dvh - 66px); overflow: hidden }
  .quiz { flex-direction: column; height: 100% } .quiz .qz-r, .quiz.col .qz-r { display: none !important }
  .qz-l { flex: 1; min-height: 0 } .qcw { flex: 1; height: auto }
  .qtopn { display: block; flex: none; margin-bottom: 4px }
  .qssr { display: flex; gap: 8px; padding: 0 12px }
  .qpnl { flex: 1; min-width: 0; height: 42px; display: flex; align-items: center; padding: 0 12px; background: var(--surface); border: .5px solid var(--line); border-radius: 10px; color: var(--tx3); text-align: left }
  .qpnl span { margin-left: 8px; min-width: 0; flex: 0 1 auto; font-size: 12.5px; font-weight: 600; color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis } .qpnl b { margin-left: 8px; font-size: 14px; font-weight: 800 } .qpnl .mi:last-child { margin-left: 2px }
  .qtune { width: 48px; height: 42px; flex: none; display: grid; place-items: center; background: var(--surface); border: .5px solid var(--line); border-radius: 10px; color: var(--brand) }

}
/* 앱: 데스크톱 브라우저는 머티리얼 compact 밀도(단추 32) · 터치 기기는 40 */
@media (pointer: coarse) { .qreset, .qfill, .qtxt, .qretry { height: 40px } }
