/* ============================================================
   mobile.css — 모바일·태블릿 전용 보정. 모든 스타일시트 뒤에 불러온다.
   1. 시뮬레이션 공통(폰·태블릿)  2. 시뮬레이션 폰 가로  3. 시뮬레이션 태블릿
   4. 홈(대시보드)  5. 홈에서 뜨는 모달(레벨 도전 퀴즈·챗봇)
   body.sim-mobile  : 터치 기기에서 시뮬레이션에 들어온 상태
   body.touch-phone : 짧은 변이 520px 미만 / body.touch-tablet : 520px 이상
   ============================================================ */

/* ---------- 1. 시뮬레이션 공통 ---------- */
/* 조이스틱: 화면 높이에 맞춰 크기를 정한다. 손잡이·화살표는 비율로 따라온다. */
body.sim-mobile #stage{--joy:clamp(96px,28vh,116px)}
body.touch-tablet.sim-mobile #stage{--joy:clamp(124px,17vh,148px)}
body.sim-mobile #stage .joy,
body.touch-phone #stage .joy,
body.touch-tablet #stage .joy{
  width:var(--joy);height:var(--joy);
  left:max(12px,env(safe-area-inset-left));bottom:max(12px,env(safe-area-inset-bottom));
  background:rgba(255,255,255,.3);border:2px solid rgba(255,255,255,.75);
  box-shadow:0 8px 22px rgba(20,40,32,.14);touch-action:none}
body.sim-mobile #stage .joy-knob,
body.touch-phone #stage .joy-knob,
body.touch-tablet #stage .joy-knob{width:42%;height:42%;margin:-21% 0 0 -21%;background:rgba(255,255,255,.86);box-shadow:0 4px 12px rgba(20,40,32,.22)}
body.sim-mobile #stage .joy-dir{width:9px;height:9px;border-color:rgba(255,255,255,.9)}
body.sim-mobile #stage .joy-n{top:9%}
body.sim-mobile #stage .joy-s{bottom:9%}
body.sim-mobile #stage .joy-e{right:9%}
body.sim-mobile #stage .joy-w{left:9%}
/* 퀴즈·요약 카드·결과가 떠 있는 동안에는 이동할 수 없으므로 조이스틱을 숨겨 자리를 내준다. */
body.sim-mobile #stage.floor-sheet .joy{opacity:0;pointer-events:none}
/* 진행 안내(지금 할 일)는 조이스틱과 오른쪽 아래 도움말 사이에 둔다. */
body.sim-mobile #stage .dock,
body.touch-phone.sim-mobile #stage .dock,
body.touch-tablet.sim-mobile #stage .dock{
  padding-left:calc(var(--joy) + max(24px,env(safe-area-inset-left,0px) + 20px))}
body.sim-mobile #stage .phone-launch{bottom:calc(var(--joy) + 24px + env(safe-area-inset-bottom,0px))}
body.sim-mobile #stage .ins .phone-launch,
body.touch-phone #stage .ins .phone-launch{bottom:auto}

/* 상단 위치 표시: 차시 코드(A-1)가 두 줄로 꺾이지 않게 한다. */
body.sim-mobile #stage .scene-caption .what{flex-wrap:nowrap;white-space:nowrap}
body.sim-mobile #locCode{flex:none;white-space:nowrap}

/* 조작 도움말을 펼쳤을 때: 글자가 겹치지 않게 세로로 쌓고, 넘치면 안에서 스크롤한다. */
body.sim-mobile.help-open #stage .camera-help,
body.touch-phone.sim-mobile.help-open #stage .camera-help{
  width:min(300px,58vw);max-height:calc(100% - 52px);overflow-y:auto;overflow-x:hidden;
  padding:4px 12px 10px;gap:0;flex-direction:column;align-items:stretch;-webkit-overflow-scrolling:touch}
body.sim-mobile.help-open #stage .camera-help .kh{flex:none}
body.sim-mobile.help-open #stage .camera-help{z-index:12}
body.sim-mobile.help-open #stage .camera-help .help-line{
  flex:none;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:3px;
  min-height:0;padding:7px 0;border-top:1px solid rgba(255,255,255,.14)}
body.sim-mobile.help-open #stage .camera-help .help-line b{font-size:12px;line-height:1.3}
body.sim-mobile.help-open #stage .camera-help .help-body{
  display:flex;flex-wrap:nowrap;align-items:center;gap:8px;font-size:12px;line-height:1.4;font-weight:400;color:rgba(255,255,255,.92);white-space:normal;word-break:keep-all}
body.sim-mobile.help-open #stage .camera-help .joy-mini{flex:none;width:26px;height:26px}

/* ---------- 2. 시뮬레이션: 폰 가로 ---------- */
/* 접힌 도움말 토글은 아이콘과 스위치만 남겨, 가운데 진행 안내와 겹치지 않게 한다. */
body.touch-phone.sim-mobile:not(.help-open) #stage .camera-help{width:auto;padding:2px 8px 2px 10px}
body.touch-phone.sim-mobile:not(.help-open) #stage .camera-help h2{font-size:0;gap:0}
body.touch-phone.sim-mobile:not(.help-open) #stage .camera-help .sw span{display:none}
body.touch-phone.sim-mobile:not(.help-open) #stage .camera-help .kh{gap:8px}
body.touch-phone.sim-mobile #stage .dock{padding-right:max(112px,calc(env(safe-area-inset-right,0px) + 104px))}
/* 요약 카드: 상단 바 아래에서 화면 높이 안에 들어오게 하고, '체험 시작'은 항상 보이게 붙여 둔다. */
body.touch-phone.sim-mobile .sheet-wrap.floor:not(.phone-center) .sheet.brief{
  width:min(480px,calc(100% - 24px));max-width:calc(100% - 24px);
  max-height:calc(100% - 46px - env(safe-area-inset-top,0px));margin:0 auto 6px;padding:10px 12px 0;overflow-y:auto}
body.touch-phone.sim-mobile .sheet-wrap.floor .sheet.brief .cfoot{
  position:sticky;bottom:0;z-index:2;margin:6px -12px 0;padding:6px 12px 10px;background:#fff;border-radius:0 0 14px 14px}
@media (max-height:340px){
  body.touch-phone.sim-mobile .sheet-wrap.floor .sheet.brief .sub{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}
}

/* 진행 중 퀴즈: 왼쪽에 상단 바 아래부터 화면 끝까지 쓰고, 진행 안내는 오른쪽 아래로 옮긴다. */
body.touch-phone.sim-mobile #stage.floor-sheet.keep-dock>.sheet-wrap.floor:not(.phone-center):not(.phone-corner){
  top:calc(44px + env(safe-area-inset-top,0px));left:0;right:auto;bottom:0;width:57%;
  padding:0 0 max(6px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
  align-items:flex-start;justify-content:flex-start}
body.touch-phone.sim-mobile #stage.floor-sheet.keep-dock>.sheet-wrap.floor:not(.phone-center):not(.phone-corner) .sheet{
  width:100%;max-width:none;max-height:100%;margin:0;padding:10px 12px 10px;gap:8px;border-radius:16px;
  overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch}
body.touch-phone.sim-mobile #stage.floor-sheet.keep-dock>.dock{
  padding-left:calc(57% + 8px);padding-right:max(8px,env(safe-area-inset-right));justify-content:flex-end}
body.touch-phone.sim-mobile #stage.floor-sheet.keep-dock .ins{width:100%;max-width:300px}
/* 퀴즈 글자와 누르는 영역을 손가락에 맞게 키운다. */
body.touch-phone.sim-mobile .sheet-wrap.floor .sheet>h3:first-child,
body.touch-phone.sim-mobile .sheet-wrap.floor .sheet>.sheet-x+h3,
body.touch-phone.sim-mobile .sheet-wrap.floor .sheet>.k:first-child+h3{font-size:13.5px;line-height:1.35;min-height:30px}
body.touch-phone.sim-mobile .sheet-wrap.floor .sheet .sub{font-size:12px}
body.touch-phone.sim-mobile .sheet-wrap.floor .opts{gap:6px;flex:0 0 auto;overflow:visible}
body.touch-phone.sim-mobile .sheet-wrap.floor .opt{font-size:13px;line-height:1.35;min-height:38px;max-height:none;padding:7px 10px 7px 8px;border-radius:12px;align-items:center}
body.touch-phone.sim-mobile .sheet-wrap.floor .opt::before{width:22px;height:22px;font-size:11px}
body.touch-phone.sim-mobile .sheet-wrap.floor .fb{font-size:12.5px;line-height:1.45}
body.touch-phone.sim-mobile .sheet-wrap.floor .sheet .row .btn,
body.touch-phone.sim-mobile .sheet-wrap.floor .btn{font-size:13px;min-height:36px;padding:6px 16px}
body.touch-phone.sim-mobile .sheet-wrap.floor .sheet>.sheet-x{min-height:28px;padding:3px 10px;font-size:12px}
/* 보기가 많아 창이 스크롤될 때도 확인·다음 버튼은 항상 보이게 아래에 붙인다. */
body.touch-phone.sim-mobile #stage.floor-sheet.keep-dock>.sheet-wrap.floor:not(.phone-center):not(.phone-corner) .sheet>.row:last-child{position:sticky;bottom:0;z-index:2;margin:0 -12px -10px;padding:6px 12px 10px;background:#fff;box-shadow:0 -8px 10px -6px rgba(255,255,255,.95)}
/* 사진 보기: 폰에서는 사진을 낮게 줄여 두 줄이 한 화면에 들어오게 한다. */
body.touch-phone.sim-mobile .sheet-wrap.floor .opts.pics{grid-template-columns:1fr 1fr;gap:8px}
body.touch-phone.sim-mobile .sheet-wrap.floor .opt.pic{padding:6px}
body.touch-phone.sim-mobile .sheet-wrap.floor .opt.pic .art{height:clamp(64px,24vh,104px);border-radius:8px}

/* 결과 화면: 상단 바를 가리지 않게 높이를 제한하고, 통계는 한 줄에 놓는다. */
body.touch-phone.sim-mobile .sheet-wrap.floor .sheet:has(.res-head){
  width:min(460px,calc(100% - 24px));max-width:calc(100% - 24px);
  max-height:calc(100% - 46px - env(safe-area-inset-top,0px));margin:0 auto 6px;padding:12px 14px;gap:8px;overflow-y:auto}
body.touch-phone.sim-mobile .sheet-wrap .res-head .big{font-size:22px}
body.touch-phone.sim-mobile .sheet-wrap .stats{grid-template-columns:repeat(auto-fit,minmax(72px,1fr));gap:6px}
body.touch-phone.sim-mobile .sheet-wrap .stat{padding:6px 6px;border-radius:12px}
body.touch-phone.sim-mobile .sheet-wrap .stat b{font-size:17px}
body.touch-phone.sim-mobile .sheet-wrap .stat span{font-size:11px}
body.touch-phone.sim-mobile .sheet-wrap.floor .sheet:has(.res-head) .row{flex-wrap:nowrap;justify-content:flex-end;gap:6px}

/* ---------- 3. 시뮬레이션: 태블릿 ---------- */
/* 폰 가로에 맞춘 작은 조작부를 태블릿 크기로 키운다. */
body.touch-tablet.sim-mobile #stage .loc-cluster{height:44px;gap:8px;top:max(10px,env(safe-area-inset-top));left:max(10px,env(safe-area-inset-left))}
body.touch-tablet.sim-mobile #stage .scene-caption{border-radius:14px;font-size:14px}
body.touch-tablet.sim-mobile #stage .scene-caption .where,
body.touch-tablet.sim-mobile #stage .scene-caption .what{font-size:14px;gap:6px;padding:0 12px}
body.touch-tablet.sim-mobile #stage .scene-caption .where .ico{width:16px;height:16px}
body.touch-tablet.sim-mobile #stage .scene-caption .where span{max-width:24vw}
body.touch-tablet.sim-mobile #locTitle{max-width:22vw}
body.touch-tablet.sim-mobile #lessonSwap{width:38px;border-radius:0 14px 14px 0}
body.touch-tablet.sim-mobile #lessonSwap .ico{width:18px;height:18px}
body.touch-tablet.sim-mobile #locEnd{padding:0 14px;border-radius:14px;font-size:14px}
body.touch-tablet.sim-mobile #lessonPane{top:60px;left:10px;width:min(380px,calc(100% - 20px))}
body.touch-tablet.sim-mobile #lessonPane .row{min-height:44px;padding:6px 10px}
body.touch-tablet.sim-mobile #simCorner{top:max(10px,env(safe-area-inset-top));right:max(10px,env(safe-area-inset-right));gap:8px}
body.touch-tablet.sim-mobile #stage .hud .h{min-height:34px;padding:4px 12px;font-size:14px;gap:5px}
body.touch-tablet.sim-mobile #stage .hud .h b{font-size:14px}
body.touch-tablet.sim-mobile #stage .hud .h .ico{width:15px;height:15px}
body.touch-tablet.sim-mobile #simCorner>#kimLaunch{height:42px;padding:0 14px 0 5px;gap:6px}
body.touch-tablet.sim-mobile #kimLaunch img{width:32px;height:32px}
body.touch-tablet.sim-mobile #kimLaunch .kim-cap b{font-size:14px}
body.touch-tablet.sim-mobile #stage .dock,
body.touch-tablet.sim-mobile #stage .dock{padding-right:max(200px,calc(env(safe-area-inset-right,0px) + 190px));padding-bottom:max(12px,env(safe-area-inset-bottom,0px))}
body.touch-tablet.sim-mobile #stage .ins,
body.touch-tablet #stage .ins{width:min(440px,46vw);max-width:min(440px,46vw);padding:10px 14px 12px;border-radius:16px;gap:4px}
body.touch-tablet.sim-mobile #stage .q-h{font-size:13px}
body.touch-tablet.sim-mobile #stage .ins .ko,
body.touch-tablet #stage .ins .ko{font-size:15px;line-height:1.4;-webkit-line-clamp:3}
body.touch-tablet.sim-mobile #stage .ins .hint{font-size:13px;padding:3px 8px}
body.touch-tablet.sim-mobile #stage .ins .btn{font-size:13px;padding:6px 12px}
body.touch-tablet.sim-mobile #segs i{height:5px}
body.touch-tablet.sim-mobile #stepJumpBar{top:-34px}
body.touch-tablet.sim-mobile #stepBadge,
body.touch-tablet.sim-mobile #stage .step-jump{height:26px;padding:0 10px;font-size:12.5px}
body.touch-tablet.sim-mobile #stage .phone-launch .glyph,
body.touch-tablet #stage .phone-launch .glyph{width:52px;height:52px;border-radius:14px}
body.touch-tablet.sim-mobile #stage .phone-launch .bezel,
body.touch-tablet #stage .phone-launch .bezel{width:24px;height:40px;padding:3px;border-radius:7px}
body.touch-tablet.sim-mobile #autoWalk,
body.touch-tablet.sim-mobile #driveExit{min-height:40px;padding:0 16px;font-size:14px;border-radius:12px}
body.touch-tablet.sim-mobile #stage .interact-mark .tap{width:40px;height:40px}
body.touch-tablet.sim-mobile #stage .interact-mark .name{height:26px;font-size:13px;padding:0 10px}
body.touch-tablet.sim-mobile #stage .camera-help{right:max(12px,env(safe-area-inset-right));bottom:max(12px,env(safe-area-inset-bottom));width:auto;max-height:none;padding:4px 14px 6px}
body.touch-tablet.sim-mobile.help-open #stage .camera-help{width:min(320px,42vw);max-height:60vh}
body.touch-tablet.sim-mobile #stage .camera-help h2{font-size:14px}
body.touch-tablet.sim-mobile #stage .camera-help .sw{min-height:40px;font-size:13px}
body.touch-tablet.sim-mobile.help-open #stage .camera-help .help-line b,
body.touch-tablet.sim-mobile.help-open #stage .camera-help .help-body{font-size:13.5px}
/* 요약 카드 */
body.touch-tablet.sim-mobile .sheet-wrap.floor:not(.phone-center) .sheet.brief{
  width:min(640px,calc(100% - 48px));max-width:calc(100% - 48px);max-height:min(70vh,520px);margin:0 auto 16px;padding:18px 20px;border-radius:20px}
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet.brief>h3{font-size:20px}
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet.brief .sub{font-size:14.5px;line-height:1.5}
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet.brief .sumrow{grid-template-columns:44px minmax(0,1fr) 44px;gap:10px;margin-top:12px}
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet.brief .arw{width:44px;height:44px}
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet.brief .arw .ico{width:20px;height:20px}
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet.brief .sum{padding:14px 16px;border-radius:16px}
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet.brief .sum .k{font-size:13px !important;padding:3px 10px}
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet.brief .sum h4{font-size:17px;margin-top:6px}
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet.brief .sum li{font-size:15px;line-height:1.5;gap:8px}
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet.brief .cfoot{margin-top:12px}
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet.brief .go{min-height:44px;padding:0 18px;font-size:15px;border-radius:12px}
/* 퀴즈 창 */
body.touch-tablet.sim-mobile #stage.floor-sheet.keep-dock>.sheet-wrap.floor:not(.phone-center):not(.phone-corner) .sheet{margin-bottom:32px}
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet>h3:first-child:not(:only-child)::before,
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet>.sheet-x+h3::before{left:12px;width:26px;height:26px;margin-top:-13px}
/* 결과 화면: 화면 가운데 아래에 넉넉한 크기로 */
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet:has(.res-head){width:min(560px,calc(100% - 48px));max-width:calc(100% - 48px);margin:0 auto 24px;padding:20px 22px;gap:12px}
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet:has(.res-head) .res-head .big{font-size:28px}
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet:has(.res-head) .stat b{font-size:22px}
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet:has(.res-head) .stat span{font-size:13px}
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet:has(.res-head) .btn{font-size:15px;min-height:44px;padding:8px 20px}
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet>h3:first-child:not(:only-child),
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet>.sheet-x+h3{padding-left:46px;padding-right:76px}
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet:has(.opt .mk)>.sheet-x+h3{padding-left:22px}
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet>.sheet-x+h3{min-height:46px}
body.touch-tablet.sim-mobile .sheet-wrap.floor:not(.phone-center) .sheet:not(.brief){width:min(520px,52vw);max-width:min(520px,52vw)}
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet>h3:first-child,
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet>.sheet-x+h3,
body.touch-tablet.sim-mobile .sheet-wrap.floor .sheet>.k:first-child+h3{font-size:16px;line-height:1.4}
body.touch-tablet.sim-mobile .sheet-wrap.floor .opt{font-size:15px;line-height:1.4;min-height:46px;padding:9px 14px 9px 10px}
body.touch-tablet.sim-mobile .sheet-wrap.floor .fb{font-size:14px}
body.touch-tablet.sim-mobile .sheet-wrap.floor .btn{font-size:14px;min-height:40px;padding:6px 18px}
body.touch-tablet.sim-mobile .sheet-wrap.floor .opt.pic .art{height:clamp(110px,17vh,168px)}

/* ---------- 4. 홈(대시보드) ---------- */
@media (max-width:760px){
  /* 진행 경로: 가로로 밀어야 보이던 7개 파트를 4칸 줄바꿈으로 한눈에 보이게 한다. */
  body.home-v2 #home .prog{padding:20px 10px 18px}
  body.home-v2 #home .prog>div:first-child{padding:0 10px}
  body.home-v2 #home .steps{grid-template-columns:repeat(4,minmax(0,1fr));overflow:visible;row-gap:18px;padding:0}
  body.home-v2 #home .steps li:nth-child(4n+1)::before{display:none}
  body.home-v2 #home .steps li+li::before{left:calc(-50% + 22px);right:calc(50% + 22px)}
  body.home-v2 #home .steps li,
  body.home-v2 #home .steps button{min-width:0;max-width:100%}
  body.home-v2 #home .steps b{max-width:100%;font-size:12.5px;line-height:1.3;white-space:normal;word-break:keep-all;overflow-wrap:anywhere;padding:0 2px}
  body.home-v2 #home .steps small{max-width:100%;font-size:11.5px;white-space:nowrap}
  body.home-v2 #home .cur small{padding:2px 6px}
  /* 첫 화면에서는 말풍선이 진행 카드를 가리므로, 히어로를 지난 뒤에만 보여 준다. */
  body.home-v2:not(.hdr-solid) .fab .bub{display:none}
  body.home-v2 .fab .bub{max-width:calc(100vw - 112px)}
  /* 내 배지: 좁은 화면에서 넘치지 않게 줄바꿈한다. */
  body.home-v2 #home .mybadge{flex-wrap:wrap;row-gap:8px;max-width:100%}
  body.home-v2 #home .mybadge ol{flex-wrap:wrap;margin-left:8px}
  /* 레벨 도전의 잠긴 파트 묶음: 글자 원이 카드 밖으로 나가지 않게 한다. */
  body.home-v2 #home .lp .lh{flex-wrap:wrap;row-gap:6px}
  body.home-v2 #home .lp{min-width:0;overflow:hidden}
  body.home-v2 #home .lparts .lp *{min-width:0}
}
@media (max-width:380px){
  body.home-v2 #home .mybadge ol{gap:3px;margin-left:6px}
  body.home-v2 #home .mybadge li{width:30px;height:30px;font-size:14px}
  body.home-v2 #home .mybadge li.sm{font-size:12px}
  body.home-v2 #home .copy h1{font-size:30px}
  body.home-v2 #home .steps b{font-size:12px}
  body.home-v2 #home .lparts{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:350px){
  /* 아주 좁은 폰: 진행 경로를 3칸으로 */
  body.home-v2 #home .steps{grid-template-columns:repeat(3,minmax(0,1fr))}
  body.home-v2 #home .steps li:nth-child(4n+1)::before{display:block}
  body.home-v2 #home .steps li:nth-child(3n+1)::before{display:none}
  body.home-v2 .util .lang button{padding:0 5px}
}
/* 폰을 가로로 든 홈: 히어로가 화면보다 지나치게 길어지지 않게 한다. */
@media (max-height:480px) and (orientation:landscape) and (max-width:960px){
  body.home-v2 #home .hero{min-height:0;gap:20px;padding-top:96px}
  body.home-v2 #home .copy h1{font-size:28px}
  body.home-v2 #home .copy h1 br{display:none}
  body.home-v2 #home .steps{grid-template-columns:repeat(7,minmax(0,1fr));row-gap:0}
  body.home-v2 #home .steps li:nth-child(4n+1)::before{display:block}
  body.home-v2 #home .steps li:first-child::before{display:none}
}

/* ---------- 5. 홈에서 뜨는 모달 ---------- */
/* 레벨 도전 퀴즈(세로 폰): 사진 높이를 화면에 맞춰 줄여 보기 네 개가 한 화면에 들어오게 한다. */
@media (max-width:640px){
  .sheet-wrap .sq .opt.pic .art{height:clamp(84px,17.5vh,140px)}
  .sq .sq-foot{min-height:46px;padding:6px 8px}
  .sq .sq-foot .cap{font-size:14px;line-height:1.3;word-break:keep-all}
  .sq .sq-foot .mk{width:24px;height:24px;font-size:13px}
  .sq .sq-top h3{font-size:18px}
}
/* 레벨 도전 퀴즈(가로 폰): 보기를 한 줄에 네 개 놓고 머리글을 줄인다. */
@media (max-height:520px) and (orientation:landscape){
  body.home-view #app > .sheet-wrap:has(.sheet.sq){padding:8px 12px}
  .sheet-wrap .sheet.study.sq{max-width:min(960px,100%);max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);border-radius:18px}
  .sq .sq-hd{height:44px;padding:0 18px}
  .sq .sq-hd b{font-size:16px}
  .sq .sq-badge{width:28px;height:28px;font-size:14px}
  .sq .sq-top{padding:8px 18px 0;gap:8px}
  .sq .sq-top h3{font-size:17px;line-height:1.35}
  .sq .sq-prog span{font-size:13px}
  .sheet-wrap .sq .opts.pics{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:10px 18px 14px}
  .sheet-wrap .sq .opts.pics.txt{grid-template-columns:1fr 1fr}
  .sheet-wrap .sq .opt.pic{height:auto}
  .sheet-wrap .sq .opt.pic .art{flex:none;height:clamp(72px,26vh,120px);min-height:0}
  .sq .sq-foot{min-height:40px;padding:5px 8px;gap:6px}
  .sq .sq-foot .cap{font-size:13px;line-height:1.3;word-break:keep-all}
  .sq .sq-foot .mk{width:22px;height:22px;font-size:12px}
  .sheet-wrap .sq .opt.pic.nopic .sq-foot{min-height:44px;padding:8px 12px}
  .sq .sq-top>.fb{padding:10px 14px;font-size:14px;line-height:1.5}
  .sq .sq-main>.fb{margin:0 18px 14px}
  .sq .sq-ft{padding:16px 18px 12px;margin-top:-16px;background:linear-gradient(to bottom,rgba(255,255,255,0),#fff 16px)}
  .sq .sq-next{height:42px;font-size:16px}
  .sq .sq-main{padding-bottom:16px}
  /* 챗봇: 가로 폰에서는 화면 밖으로 잘리지 않게 전체 화면으로 연다. */
  body.home-v2 .chatp{top:0;left:0;right:0;bottom:0;width:100%;height:100%;max-height:none;border-radius:0}
  body.home-v2 .chat-x{top:8px;right:10px;bottom:auto;width:44px;height:44px;border-radius:12px;box-shadow:none}
  body.home-v2 .chatp .ch{padding-right:64px}
  /* 일반 모달(로그인·내 계정·수업 선택): 화면 높이 안에서 스크롤한다. */
  body.home-view #app > .sheet-wrap{padding-top:8px;padding-bottom:8px}
  body.home-view #app > .sheet-wrap > .sheet{max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);overflow-y:auto}
}
