/* 태블릿 문제 화면(H160, 2026-11-14). 폰(폭 699 이하)은 이 파일의 어떤 규칙도 받지 않는다.
   ① 가로(폭 1000 이상): 두 칸. 왼쪽 약 560 = 무대 띠 160 + 문제 종이(그림·문제 글·풀이·맞힌 뒤 막대), 오른쪽 약 400 = 답 칸 + 숫자판(키 56) + [도움] [확인].
      카드 한 장 화면은 왼쪽 이야기·짐작·확인 뒤 칸, 오른쪽 해 보기 + [확인]. 어떤 화면이 두 칸인지는 layout.js 가 main 의 data-cols="2" 로 알린다(--dock-h = 오른쪽 위 칸 높이 + 16).
   ② 세로 태블릿(폭 700~999, 높이 900 이상): 한 칸·글 열 480 그대로, 무대를 440 → 260 으로 낮춰 풀이까지 한 화면에 들어오게 한다(시안 그림은 열이 600 이지만 열 폭은 바꾸지 않았다 — 옛 시험·다른 화면과 어긋남).
   움직임·색·글자는 건드리지 않는다. */

@media (min-width: 1000px) {
  .app:has(.screen.learn[data-cols="2"]) { max-width: 1040px; }
  .screen.learn[data-cols="2"] { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 400px); grid-template-rows: auto repeat(10, auto) 1fr; column-gap: 40px; justify-content: center; align-content: start; }
  .screen.learn[data-cols="2"] > .learn-top { grid-column: 1 / -1; grid-row: 1; margin-bottom: 8px; }
  .screen.learn[data-cols="2"] > .learn-body { display: contents; }
  /* 왼쪽 칸: 몸통의 나머지 전부 */
  .screen.learn[data-cols="2"] > .learn-body > * { grid-column: 1; min-width: 0; margin: 0 0 12px; }
  /* 오른쪽 칸: 답 칸·숫자판(또는 해 보기) 아래에 아래 줄 */
  .screen.learn[data-cols="2"] > .learn-body > :is(.learn-input, .learn-choices, .c1-try) { grid-column: 2; grid-row: 2 / -1; align-self: start; margin: 0; }
  .screen.learn[data-cols="2"] > .learn-bar { grid-column: 2; grid-row: 2 / -1; align-self: start; position: static; margin: var(--dock-h, 0px) 0 0; padding: 0; background: none; z-index: auto; }
  .screen.learn[data-cols="2"] .learn-bar__left { flex: 0 0 auto; }
  .screen.learn[data-cols="2"] .learn-bar__main { flex: 1 1 auto; margin-left: 0; }
  .screen.learn[data-cols="2"] .learn-bar__main .ui-btn { width: 100%; }
  /* 숫자판은 붙박이가 아니라 오른쪽 칸 안에서 흐른다. 키 56 */
  .screen.learn[data-cols="2"] .learn-input.has-pad { position: static; margin: 0; padding: 0; background: none; gap: 8px; }
  .screen.learn[data-cols="2"] .learn-input.has-pad .learn-field { min-height: 56px; }
  .screen.learn[data-cols="2"] .learn-input.has-pad .ui-keypad__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .screen.learn[data-cols="2"] .learn-input.has-pad .ui-key { min-height: 56px; }
  /* 문장제 그림 문제는 폰에서 키를 48·칸을 46으로 줄이는데(next.css), 두 칸에서는 답판이 옆 칸이라 줄일 까닭이 없다 — 56 그대로 */
  .screen.learn[data-cols="2"][data-screen="battle"]:has(.learn-prompt ~ .learn-figure > .wd-story) .learn-input.has-pad :is(.ui-key, .learn-field) { min-height: 56px; }
  .screen.learn[data-cols="2"] .learn-input.has-pad .ui-key--sub { order: 0; }
  /* 무대 띠 160(5~6학년의 한 줄 무대는 그대로) */
  html:not([data-band="5-6"]) .screen.learn[data-cols="2"][data-screen="battle"]:not([data-phase="result"]) { --bt-stage-h: 160px; --bt-mon: 92px; }
  html .screen.learn[data-cols="2"][data-screen="battle"]:not([data-phase="result"]) > .learn-body > .bt-stage { flex: none; max-height: none; height: var(--bt-stage-h); }
  html:not([data-band="5-6"]) .screen.learn[data-cols="2"][data-screen="practice"] .mix-stage { flex: none; height: 160px; max-height: none; }
}

@media (min-width: 700px) and (max-width: 999px) and (min-height: 900px) {
  html .screen.learn[data-screen="battle"]:not([data-phase="result"]) { --bt-stage-h: 260px; --bt-mon: 140px; }
  html .screen.learn[data-screen="battle"]:not([data-phase="result"]) > .learn-body > .bt-stage { flex: none; max-height: none; height: var(--bt-stage-h); }
  .screen.learn[data-screen="practice"] .learn-body:not(:has(.fill-scene[data-scene="practiceEnd"])) .mix-stage { flex: none; height: 260px; max-height: none; }
}
