/* 해머던지기: '종이 위 그림' (studio/DESIGN.md, 2026-10-17)
   - 틀(위 막대·판·단추·창)은 공용 묶음 _kit/paper.css의 토큰과 부품을 그대로 쓴다:
     .k-btn·.k-primary(단추), .k-seg·.k-on(고른 상태 = 굵은 글자 + 칸 아래 3px 막대), .k-range(슬라이더),
     .k-w(범례 낱말), .k-link(진행 지우기·자세히), [hidden] !important. 이 파일에는 배치와 이 작품의 대상 색만 둔다.
   - 3D 경기장은 흰 종이 위의 밝은 그림(#sceneBox)이다. 조작판(#dock)은 그림 아래 종이 위, 과제와 각도계는 오른쪽(휴대폰은 아래) 판.
   - 같은 대상은 같은 색과 같은 선 모양: 속도 v와 조준선(속도의 수평 방향) 파랑(조준선은 점선), 힘(장력 T·중력 mg·마찰력 f) 빨강,
     장력의 속도 방향 성분 보라, 중심 쪽 기준선 흰 점선, 놓는 곳 흰 고리, 0.2초 점 흰 점. 3D(scene.js), 장면 꼬리표, 글 속 낱말(.k-w),
     각도계, 읽음값이 모두 따른다. 흰 것은 종이 위에서 잉크·회색으로 쓴다(흰 바탕 대비 4.5:1 이상).
   - 반경: 단추·입력·세그먼트 var(--k-r), 판·그림·꼬리표·창 0, 슬라이더 손잡이만 원. */

:root {
  --sky: #d6e2ee;     /* 3D 그림의 안개·하늘색(scene.js fog와 같다): 그림이 뜨기 전 바탕 */
  --v-p: #1d4ed8;     /* 속도 v, 조준선 */
  --f-p: #c92a2a;     /* 힘: 장력 T, 중력 mg, 마찰력 f */
  --par-p: #6d3fd0;   /* 장력의 속도 방향 성분(×5) */
  --ctr-p: #5f5f5f;   /* 중심 쪽 기준선(장면에서는 흰 점선) */
  --ok-p: #237032;
  --bad-p: #c92a2a;
  --hdr: 52px;
  --tap: 40px;        /* 누르는 것의 최소 높이(DESIGN.md '크기'). 낮은 화면은 36px */
  --cardW: 340px;
  font-family: var(--k-font);
  color: var(--k-ink);
  -webkit-text-size-adjust: 100%;
}
@media (max-height: 560px) { :root { --tap: 36px; } }
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: var(--k-paper); color: var(--k-ink);
  font-family: var(--k-font); font-size: 15px; line-height: 1.45; touch-action: manipulation;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
/* 줄바꿈: 한국어는 어절, 영어는 낱말(하이픈 분철 없음), 일본어는 구절·금칙. 틀을 넘는 긴 낱말만 끊는다 */
html { overflow-wrap: break-word; -webkit-hyphens: none; hyphens: none; }
html:lang(ko) { word-break: keep-all; }
html:lang(ja) { word-break: auto-phrase; line-break: strict; }
/* 사파리(auto-phrase 없음): i18n.js가 이때만 넣는 U+200B(구절 경계)에서만 줄을 바꾼다 */
@supports not (word-break: auto-phrase) { html:lang(ja) { word-break: keep-all; } }
button { font-family: inherit; color: inherit; cursor: pointer; font-size: inherit; }
button:disabled { cursor: default; opacity: 0.45; }
button:focus-visible, input:focus-visible, canvas:focus-visible, [role="tab"]:focus-visible { outline: 2px solid var(--k-ink); outline-offset: 2px; }
canvas#c3:focus-visible { outline-offset: -4px; }
i { font-style: italic; font-family: "Times New Roman", Georgia, serif; font-size: 1.08em; }
.nw { white-space: nowrap; }

/* ── 범례 낱말(.k-w)의 대상 색과 선 모양 ── */
.k-w { white-space: nowrap; }
.k-w.v { --w: var(--v-p); }
.k-w.aim { --w: var(--v-p); text-decoration-style: dashed; }
.k-w.f { --w: var(--f-p); }
.k-w.par { --w: var(--par-p); }
.k-w.ctr { --w: var(--ctr-p); text-decoration-style: dashed; }
.k-w.mk { --w: var(--k-ink); }
.k-w.dots { --w: var(--k-ink-2); text-decoration-style: dotted; }
.k-w.zone { --w: var(--k-ink); text-decoration-thickness: 4px; }

#app { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--k-paper); }

/* ── 위 막대: 메뉴 · 작품 이름 · 단계 탭(자유 모드는 장면 탭) · 정보 · 소리 ── */
#top { flex: none; height: var(--hdr); display: flex; align-items: center; gap: 4px; padding: 0 8px 0 6px; min-width: 0; }
.icon {
  flex: none; width: var(--tap); height: var(--tap); border: 0; border-radius: var(--k-r); background: none;
  display: grid; place-items: center; padding: 0; color: var(--k-ink);
}
@media (hover: hover) { .icon:hover { background: var(--k-wash); } }
#ttl { flex: 0 1 auto; min-width: 0; font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0 14px 0 6px; }
#stages { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; overflow: hidden; }
#stages button {
  flex: none; height: var(--tap); min-width: 32px; border: 0; border-radius: 0; background: none; padding: 0 9px;
  font-size: 15px; font-weight: 600; color: var(--k-sub); white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 6px;
}
#stages button .n { font-variant-numeric: tabular-nums; }
#stages button .mk { font-size: 13px; font-weight: 700; color: var(--k-ink); font-variant-numeric: tabular-nums; }
#stages button .mk:empty { display: none; }
#stages button.k-on { color: var(--k-ink); }
@media (hover: hover) { #stages button:not(.k-on):hover { background: var(--k-wash); color: var(--k-ink); } }
#top.nottl #ttl { display: none; }
#stages.num button:not(.k-on) .t, #stages.num button:not(.k-on) .mk { display: none; }
#stages.min button .t { display: none; }
body.starting #bMenu, body.starting #stages, body.starting #views, body.starting #sceneBtns { display: none; }
body.starting #ttl { margin: 0 6px 0 8px; }
@media (max-width: 400px) { #ttl { font-size: 15px; } }

/* ── 본문: 가로 화면은 그림(왼쪽)·판(오른쪽) ── */
#main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--cardW); column-gap: 16px; padding: 0 12px 10px; }
#sceneCol { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; min-height: 0; }
#sceneBox { grid-row: 1; position: relative; min-height: 0; overflow: hidden; background: var(--sky); }
#c3 { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#c3.drag { cursor: grabbing; }
#c3.tap { cursor: pointer; }
#panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

/* 장면 꼬리표: 반경 0, 흰 바탕(밝은 그림), 테두리 없음. 글자색 = 대상의 색 */
/* overflow: clip(스크롤 상자가 아니다): 꼬리표는 main.js place()가 그림 안쪽으로 붙인다 */
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; overflow: clip; z-index: 2; }
.lab {
  position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 13px; font-weight: 700; line-height: 1.25;
  padding: 1px 6px; border-radius: 0; background: var(--k-paper); color: var(--k-ink); will-change: transform;
}
.lab.v { color: var(--v-p); }
.lab.f { color: var(--f-p); }
.lab.par { color: var(--par-p); font-size: 12px; }
.lab.gh { font-size: 14px; min-width: 24px; text-align: center; }
.lab.gh.on { font-weight: 800; box-shadow: inset 0 -3px 0 var(--k-ink); }
.lab.gh.ok { color: var(--ok-p); font-weight: 800; }
.lab.mark { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.lab.land { font-size: 14px; font-weight: 800; }
.lab.land.foul { color: var(--bad-p); }
.lab.tg { font-size: 12px; }
.lab.info { font-weight: 650; font-size: 12px; color: var(--k-ink-2); }
.lab i { font-size: 1.12em; }

/* 그림 위 단추(밝은 그림이라 흰 종이 바탕 그대로): 왼쪽 위 시점, 오른쪽 위 느리게·처음 시점 */
#views { position: absolute; left: 8px; top: 8px; z-index: 3; }
#views > button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 40px; min-height: var(--tap); padding: 2px 10px; white-space: nowrap; }
#views .tx { display: none; }
#app.wide #views .tx { display: inline; }
#sceneBtns { position: absolute; right: 8px; top: 8px; z-index: 3; display: flex; gap: 6px; }
#sceneBtns .k-btn { height: var(--tap); padding: 0 10px; }
#sceneBtns .k-btn.ic { width: var(--tap); padding: 0; }
#bSlow b { font-variant-numeric: tabular-nums; font-weight: 800; }
#bSlow .tx { display: none; }
#app.wide #bSlow .tx { display: inline; }
#toast {
  position: absolute; left: 50%; top: 56px; transform: translateX(-50%); z-index: 4; opacity: 0; transition: opacity 0.25s;
  background: var(--k-paper); color: var(--k-ink); padding: 5px 12px; font-size: 14px; font-weight: 650; pointer-events: none; white-space: nowrap;
}
#toast.on { opacity: 1; }

/* ── 조작판(그림 아래 종이 위) ── */
#dock { grid-row: 2; display: flex; align-items: center; gap: 12px; padding: 8px 0 0; min-width: 0; }
#dock > * { flex: none; }
.grp { flex: 1 1 auto !important; min-width: 0; display: flex; align-items: center; gap: 10px; }
.grp label { font-size: 14px; color: var(--k-sub); font-weight: 650; white-space: nowrap; }
.grp output { flex: 0 0 auto; min-width: 74px; text-align: right; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
#spdOut { color: var(--v-p); }
#spdOut .ar { color: var(--k-sub); font-weight: 600; }
.grp .k-range { flex: 1 1 0; width: 0; min-width: 60px; }
#spd { --q: var(--v-p); }
#dock .k-btn { height: var(--tap); }
#bAim svg { flex: none; }
#bAim[aria-pressed="true"] { font-weight: 750; box-shadow: inset 0 -3px 0 var(--v-p); }
#bMain { min-width: 112px; font-size: 16px; font-weight: 750; }
#dock.solo { justify-content: flex-end; }

/* ── 판: 과제(스토리 모드) ── */
#card { flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; padding: 2px 0 10px; min-height: 0; min-width: 0; overflow: hidden; }
.cHead { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 26px; }
#cStep { min-width: 0; font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#cStep .no { color: var(--k-sub); font-weight: 700; margin-right: 8px; font-variant-numeric: tabular-nums; }
#cStep .st { margin-left: 8px; font-weight: 700; letter-spacing: -1px; }
#cMore { flex: none; margin-left: auto; min-width: 40px; font-size: 14px; }
/* 가로 틀: '자세히'(누르는 높이 36~40px)가 보여도 머리 줄 높이(26px)는 그대로 둔다. 머리 줄이 5~9px 높아지면 글 칸이 그만큼 줄어
   글 맞춤(fitCard)이 '자세히'가 보이는지에 따라 달리 재었다(2026-11-13). 누르는 자리는 위아래 틈으로 넘어가 그대로다 */
#app:not(.port):not(.short):not(.micro) #cMore { margin-top: -7px; margin-bottom: -7px; }
#cDots { display: flex; gap: 5px; align-items: center; margin-left: auto; }
#cMore:not([hidden]) + #cDots { margin-left: 0; }
/* 단계 점: 각진 칸. 끝낸 것은 잉크로 칠하고, 지금 것은 테두리를 굵게 */
#cDots i { width: 10px; height: 10px; display: block; box-shadow: inset 0 0 0 1.5px var(--k-ctl); }
#cDots i.ok { background: var(--k-ink); box-shadow: none; }
#cDots i.on { box-shadow: inset 0 0 0 2.5px var(--k-ink); }
#cBody { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; min-height: 0; overflow: hidden; }
#cBody > *, #cActs { flex-shrink: 0; }
#cBody.snug { gap: 4px; } /* 몇 px만 넘칠 때(main.js fitCard): 글을 줄이기 전에 칸 사이부터 */
/* 넓은 가로 틀에서 글이 길 때(main.js fitCard): 문장을 줄이기 전에 목표 셋을 짧은 이름 한 줄로(grow), 그다음 글자를 한 단계씩. t2는 낮은 가로 틀(#app.short)과 같은 크기 */
.goals .gs { display: none; }
#cBody.grow .goals:not(.row) { display: flex; flex-direction: row; flex-wrap: wrap; gap: 2px 14px; padding: 0; }
#cBody.grow .goals:not(.row) li { gap: 3px; font-size: 14px; }
#cBody.grow .goals:not(.row) li .st { width: auto; font-size: 15px; }
#cBody.grow .goals .gl { display: none; }
#cBody.grow .goals .gs { display: inline; }
#app #card #cBody.t1 .q { font-size: 15.5px; line-height: 1.42; }
#app #card #cBody.t1 .know { font-size: 13.5px; line-height: 1.42; }
#app #card #cBody.t2 .q { font-size: 14px; line-height: 1.38; }
#app #card #cBody.t2 .know { font-size: 13px; line-height: 1.38; }
#app #card #cBody.t2 .goals.row li, #app #card #cBody.t2 .stats { font-size: 13px; }
#app #card #cBody.t3 .q { font-size: 13.5px; line-height: 1.36; }
#cBody p { margin: 0; }
#cBody .q { font-size: 17px; line-height: 1.45; font-weight: 650; }
#cBody .fb { font-size: 15.5px; line-height: 1.5; }
#cBody .fb .mk, .moreBody .fb .mk { font-weight: 800; margin-right: 4px; }
.mk.ok { color: var(--ok-p); }
.mk.no { color: var(--bad-p); }
#cBody .note { color: var(--k-sub); font-size: 14px; line-height: 1.45; }
#cBody ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
#cBody ul.sum li { font-size: 15.5px; line-height: 1.45; }
#cBody .wait { color: var(--k-sub); font-size: 15px; }
#cBody .pk { font-size: 14px; color: var(--k-sub); }
#cBody .pk b { color: var(--k-ink); }
/* 알아 둘 것(단계 첫머리, 처음 나오는 낱말의 뜻)과 조건을 채운 줄('결과 보기' 앞) */
#cBody .know { font-size: 14px; line-height: 1.45; color: var(--k-ink-2); }
#cBody .done { font-size: 15.5px; font-weight: 650; line-height: 1.45; }
#cBody .done .mk { font-weight: 800; margin-right: 5px; }
/* 예측 보기: 회색 테두리 칸. 고르면 굵은 글자 + 칸 아래 막대(kit .k-on과 같은 표시) */
.choices { display: grid; gap: 6px; }
.choices button {
  display: flex; align-items: center; gap: 10px; text-align: left; min-height: var(--tap); padding: 6px 12px;
  border: 1.5px solid var(--k-ctl); border-radius: var(--k-r); background: var(--k-paper); color: var(--k-ink);
  font-size: 15px; font-weight: 600; line-height: 1.3;
}
@media (hover: hover) { .choices:not(.locked) button:hover { background: var(--k-wash); } }
.choices button > b { flex: none; color: var(--k-sub); font-weight: 800; }
.choices button[aria-pressed="true"] { font-weight: 750; box-shadow: inset 0 -3px 0 var(--k-ink); }
.choices button[aria-pressed="true"] > b { color: var(--k-ink); }
.choices button .ck { margin-left: auto; color: var(--ok-p); font-weight: 800; }
.choices.locked button { cursor: default; }
#cActs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; margin-top: auto; }
#cActs:empty { display: none; }
#cActs .k-btn { height: var(--tap); }
#cActs .k-btn.ic { width: var(--tap); padding: 0; }
.goals { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.goals li { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.goals li .st { width: 18px; text-align: center; font-size: 16px; color: var(--k-ctl); }
.goals li.ok .st { color: var(--k-ink); }
#cBody .goals.row { display: flex; flex-direction: row; flex-wrap: wrap; gap: 2px 14px; padding: 0; }
.goals.row li { gap: 3px; font-size: 14px; }
.goals.row li .st { width: auto; font-size: 15px; }
.stats { display: flex; gap: 16px; font-size: 14px; color: var(--k-sub); }
.stats b { color: var(--k-ink); font-variant-numeric: tabular-nums; }
.res { font-weight: 700; font-size: 15.5px; }
.res .big { font-size: 20px; font-variant-numeric: tabular-nums; }
.res .sub { display: block; font-weight: 500; font-size: 14px; color: var(--k-sub); }
.ok-tag { color: var(--ok-p); font-weight: 750; }
body.free #card { display: none !important; }

/* ── 판: 자유 모드 장면 설명과 던진 기록 ── */
#freeBox { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 8px; padding: 2px 0 10px; }
#freeBox h2 { margin: 0; font-size: 15px; font-weight: 800; }
#freeBox .fd { margin: 0; font-size: 16px; line-height: 1.45; font-weight: 600; }
#freeBox .fn { margin: 0; font-size: 14px; color: var(--k-sub); line-height: 1.45; }
#freeBox .stats { margin-top: 2px; }
#freeBox .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: auto; }

/* ── 각도계(판 아래, 종이 위): 속도 v를 오른쪽에 두고 힘이 이루는 각 ── */
#gauge { flex: none; border-top: 1px solid var(--k-rule); padding: 8px 0 0; min-width: 0; }
#gauge .gT { font-size: 13px; font-weight: 700; color: var(--k-sub); margin-bottom: 2px; }
.gMain { display: grid; grid-template-columns: 132px minmax(0, 1fr); grid-template-areas: "dial num" "dial zoom" "dial rows"; column-gap: 14px; align-items: center; }
.gDial { grid-area: dial; }
#dial { display: block; width: 100%; height: auto; }
#dV path:first-child { stroke: var(--v-p); }
#dV path:last-child { fill: var(--v-p); }
#dF path:first-child { stroke: var(--f-p); }
#dF path:last-child { fill: var(--f-p); }
#gauge .gEnds { display: flex; justify-content: space-between; font-size: 12px; color: var(--k-sub); font-weight: 650; margin-top: -2px; }
#gauge .gNum { grid-area: num; line-height: 1.2; }
#gauge .gNum b { display: block; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
#gauge .gNum span { display: block; font-size: 14px; font-weight: 700; color: var(--k-ink-2); }
#gauge .gRows { grid-area: rows; display: grid; gap: 0; font-size: 14px; margin-top: 2px; }
#gauge .gRows div { display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; }
#gauge .gRows span { color: var(--k-sub); }
#gauge .gRows b { font-variant-numeric: tabular-nums; font-weight: 800; }
#gauge .rv b, #gauge .rv i { color: var(--v-p); }
#gauge .rf b, #gauge .rf i { color: var(--f-p); }
#zoomSt { grid-area: zoom; display: none; margin: 4px 0 2px; }
#gauge.zoom #zoomSt { display: block; }
#zoomSt .zt { position: relative; height: 14px; margin: 0 10px; }
#zoomSt .zt::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; background: var(--k-rule); }
#zoomSt .zm { position: absolute; left: 50%; top: 0; width: 2px; height: 14px; margin-left: -1px; background: var(--k-ink); }
#zoomSt #gZm { position: absolute; top: 1px; left: 50%; width: 4px; height: 12px; margin-left: -2px; background: var(--f-p); }
#zoomSt .zlab { display: flex; justify-content: space-between; font-size: 12px; color: var(--k-sub); line-height: 1.2; }
#gauge.off #dF, #gauge.off #dV { display: none; }
#gauge.hidden .gNum b { color: var(--k-sub); }

/* ── 가운데 창(소개·도움말·지도·메뉴·정리): 흰 종이, 반경 0, 그림자 없음. 뒤만 어둡게 ── */
#modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 12px; background: var(--k-dim); }
.mcard { width: min(560px, 100%); max-height: 100%; display: flex; flex-direction: column; background: var(--k-paper); color: var(--k-ink); overflow: hidden; }
.mBody { padding: 20px 22px 6px; overflow-y: auto; min-height: 0; -webkit-user-select: text; user-select: text; }
.mActs { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 10px; padding: 12px 22px 16px; }
.mActs .k-btn { height: var(--tap); }
.mActs .k-link { margin-right: auto; }
.mcard h2 { margin: 0 0 10px; font-size: 21px; font-weight: 750; line-height: 1.35; }
.mcard h2 .no { color: var(--k-sub); font-weight: 700; margin-right: 8px; }
.mcard p { margin: 6px 0; line-height: 1.55; }
.mcard .note, .mcard .small { color: var(--k-sub); font-size: 14px; }
.mcard .tabs { display: flex; flex-wrap: wrap; margin-bottom: 12px; }
.mcard .tabs > button { min-height: var(--tap); }
.mcard ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; }
.mcard li { line-height: 1.55; font-size: 14.5px; }
.moreBody { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.moreBody p { margin: 0; }
.moreBody .q { font-weight: 650; }
.moreBody .note { color: var(--k-sub); font-size: 14px; }
.moreBody ul { margin: 0; padding-left: 18px; }
.moreBody .goals { display: none; }
.mcard.map { width: min(820px, 100%); }
.mapwrap { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; align-items: center; }
.mapwrap svg { width: 100%; height: auto; }
.mapwrap ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.mapwrap ol b { font-variant-numeric: tabular-nums; }
/* 단계·장면 목록(지금 것 = 공용 .k-on) */
.stList { display: grid; margin-top: 4px; }
.stList > button {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 6px; width: 100%; min-height: 46px; padding: 6px 4px;
  border: 0; border-top: 1px solid var(--k-rule); background: none; text-align: left; color: var(--k-ink); font-size: 16px;
}
.stList > button:last-child { border-bottom: 1px solid var(--k-rule); }
@media (hover: hover) { .stList > button:not(.k-on):hover { background: var(--k-wash); } }
.stList .n { color: var(--k-sub); font-variant-numeric: tabular-nums; font-weight: 650; }
.stList > button.done .n { color: var(--k-ink); font-weight: 800; }
.stList .t { font-weight: 650; }
.stList .c { font-size: 14px; color: var(--k-sub); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
  .mapwrap { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .mapwrap svg { max-width: 132px; margin: 0 auto; }
  .mapwrap ol { gap: 1px; font-size: 13px; line-height: 1.4; }
  .mcard .msum { font-size: 14px; margin: 4px 0; }
  .mcard .msum + .note { font-size: 13px; margin: 2px 0 0; line-height: 1.4; }
  .mBody { padding: 14px 14px 4px; }
  .mActs { padding: 8px 14px 12px; }
  .mcard h2 { font-size: 18px; margin-bottom: 6px; }
  .mcard .mapsub { display: none; }
}
/* 낮은 휴대폰 세로: 지도는 목록과 정리만(각도는 목록 앞 굵은 글자). 점 그림과 그 도식 안내는 넓은 화면에서 */
@media (max-width: 520px) and (max-height: 540px), (max-height: 320px) {
  .mcard.map .mapwrap { display: block; }
  .mcard.map .mapwrap svg, .mcard.map .msum + .note, .mcard.map .mapsub { display: none; }
  .mcard.map .mapwrap ol { list-style: none; padding: 0; font-size: 12.5px; line-height: 1.3; gap: 2px; }
  .mcard.map h2 { font-size: 16px; margin-bottom: 4px; }
  .mcard.map .msum { font-size: 13px; margin: 2px 0 0; line-height: 1.4; }
  .mcard.map .mBody { padding-top: 10px; }
}
/* 낮은 가로 화면: 지도는 그림을 줄이고 목록을 한 줄씩 */
@media (min-width: 521px) and (max-height: 520px) {
  .mcard.map .mapsub { display: none; }
  .mcard.map .mapwrap { grid-template-columns: 150px minmax(0, 1fr); gap: 12px; }
  .mcard.map .mapwrap ol { font-size: 13px; line-height: 1.32; gap: 0; }
  .mcard.map .msum { font-size: 13.5px; margin: 4px 0 2px; }
  .mcard.map .note { font-size: 13px; margin: 0; line-height: 1.4; }
}
@media (max-height: 420px) {
  #modal { padding: 6px; }
  .mcard { width: min(680px, 100%); }
  .mBody { padding: 10px 16px 2px; }
  .mActs { padding: 6px 16px 8px; }
  .mcard h2 { font-size: 17px; margin-bottom: 4px; }
  .mcard p { margin: 4px 0; font-size: 14px; }
  .mcard .mapsub { display: none; }
  .stList > button { min-height: 38px; padding: 2px 4px; font-size: 14.5px; }
}
@media (max-height: 420px) and (min-width: 521px) { .mcard.map .mapwrap { grid-template-columns: 110px minmax(0, 1fr); } .mcard.map .mapwrap ol { font-size: 12.5px; line-height: 1.28; } .mcard.map .msum { font-size: 13px; margin: 2px 0; } .mcard.map .note { font-size: 12.5px; } }

/* ── 시작 화면(_kit/start.js의 startSheet): 판 자리에 놓인다. 장면은 그대로 보인다 ── */
body.starting #panel > :not(.k-start) { display: none !important; }
body.starting #dock { display: none !important; }
body.starting #app.land #main { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
#panel > .k-start { flex: 1; height: 100%; min-height: 0; padding: 6px 4px 8px 6px; }
.k-start.x-tiny { gap: 6px; }
.k-start.x-tiny .k-q { font-size: 14px; line-height: 1.25; }

/* ── 세로 화면(휴대폰): 그림 / 각도계 / 조작판 / 과제 ── */
#app.port #main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto auto; row-gap: 0; padding: 0 10px 8px; }
#app.port #sceneCol, #app.port #panel { display: contents; }
#app.port #sceneBox { grid-row: 1; }
#app.port #gauge { grid-row: 2; }
#app.port #dock { grid-row: 3; padding: 6px 0 0; gap: 8px; }
#app.port #card, #app.port #freeBox { grid-row: 4; max-height: var(--cardMax, 52vh); border-top: 1px solid var(--k-rule); margin-top: 6px; padding: 8px 0 0; }
#app.port #card { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); align-content: start; column-gap: 8px; row-gap: 6px; }
#app.port .cHead { grid-column: 1; grid-row: 1; }
#app.port #cActs { grid-column: 2; grid-row: 1; margin: 0; flex-wrap: nowrap; gap: 6px; }
#app.port #cBody { grid-column: 1 / -1; grid-row: 2; }
#app.port #cDots { display: none; }
#app.port #cBody .q { font-size: 15.5px; line-height: 1.42; }
#app.port #cBody .fb, #app.port #cBody ul.sum li { font-size: 14.5px; }
#app.port #cBody .note { font-size: 13.5px; }
#app.port #cBody .know { font-size: 13px; line-height: 1.4; }
#app.port #cBody .done { font-size: 14.5px; }
#app.port .choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#app.port .choices button { flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1px; padding: 3px 4px 5px; font-size: 13px; line-height: 1.25; }
#app.port .choices button .ck { margin: 0; }
#app.port #freeBox .fd { font-size: 15px; }
/* 휴대폰 각도계: 한 줄 띠(그림 바로 아래) */
#app.port #gauge { padding: 4px 0 0; }
#app.port #gauge .gT, #app.port #gauge .gEnds { display: none; }
#app.port .gMain { grid-template-columns: 56px auto minmax(0, 1fr); grid-template-areas: "dial num rows"; column-gap: 10px; }
#app.port #gauge.zoom .gMain { grid-template-areas: "dial num zoom"; }
#app.port #gauge.zoom .gRows { display: none; }
#app.port #gauge .gNum b { font-size: 18px; }
#app.port #gauge .gNum span { font-size: 13px; white-space: nowrap; }
#app.port #gauge .gRows { font-size: 13.5px; justify-self: end; }
#app.port #gauge .gRows .w { display: none; }
#app.port #zoomSt { margin: 0; min-width: 120px; }
/* 도전 단계 휴대폰 세로: 각도계는 반원 없이 한 줄(각·상태 | v·T). 장면과 과제 글에 자리를 준다(main.js gauge) */
#app.port #gauge.slim { padding: 3px 0 0; }
#app.port #gauge.slim .gDial { display: none; }
#app.port #gauge.slim .gMain { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "num rows"; column-gap: 12px; }
#app.port #gauge.slim .gNum { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
#app.port #gauge.slim .gNum b { font-size: 16px; }
#app.port #gauge.slim .gRows { display: flex; gap: 12px; margin: 0; }
#app.port .grp label { display: none; }
#app.port .grp output { min-width: 0; font-size: 15px; }
#app.port #bMain { min-width: 96px; }
#app.port #bAim .tx { display: none; }
#app.port #bAim { width: var(--tap); padding: 0; }
#app.port #spdOut .ar { display: none; }
/* 휴대폰 시작 화면: 판을 넓히고 장면을 줄인다(시작 화면이 떠 있는 동안만) */
body.starting #app.port.port.port #main { grid-template-rows: minmax(0, 1fr) 0 0 minmax(0, 2.4fr); }
body.starting #app.port #panel > .k-start { grid-row: 4; padding: 10px 2px 4px; }

/* ── 좁은·낮은 화면 ── */
#app.compact { --hdr: 48px; }
#app.compact #cBody .q { font-size: 15.5px; }
#app.compact #cBody .fb { font-size: 14.5px; }
#app.compact .choices button { font-size: 14px; }
#app.compact .grp label { font-size: 13px; }
#app.compact #bAim .tx { display: none; }
#app.compact #bAim { width: var(--tap); padding: 0; }
#app.compact #spdOut .ar { display: none; }
#app.compact .grp output { min-width: 62px; }
#app.compact .gMain { grid-template-columns: 104px minmax(0, 1fr); column-gap: 10px; }
#app.compact #gauge .gNum b { font-size: 20px; }
#app.compact #gauge .gNum span { font-size: 13px; }
#app.compact #gauge .gRows { font-size: 13px; }
#app.compact #gauge .gRows .w { display: none; }
/* 낮은 가로 화면(휴대폰 가로): 과제는 첫 줄에 단계 이름과 단추, 둘째 줄에 글. 각도계는 한 줄 */
#app.short { --hdr: 44px; }
#app.short #main { padding: 0 8px 6px; column-gap: 12px; }
#app.short #dock { padding-top: 4px; gap: 8px; }
#app.short #card { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); align-content: start; column-gap: 8px; row-gap: 4px; padding-bottom: 6px; }
#app.short .cHead { grid-column: 1; grid-row: 1; }
#app.short #cActs { grid-column: 2; grid-row: 1; margin: 0; flex-wrap: nowrap; gap: 6px; }
#app.short #cBody { grid-column: 1 / -1; grid-row: 2; gap: 5px; }
#app.short #cDots { display: none; }
#app.short #cStep { font-size: 14px; }
#app.short #cBody .q { font-size: 14px; line-height: 1.38; }
#app.short #cBody .fb, #app.short #cBody ul.sum li, #app.short .res { font-size: 13.5px; line-height: 1.4; }
#app.short #cBody .note, #app.short .stats, #app.short .goals.row li { font-size: 13px; }
#app.short #cBody .know { font-size: 13px; line-height: 1.38; }
#app.short #cBody .done { font-size: 13.5px; }
/* 낮은 가로 화면의 예측 보기: 한 줄에 셋(질문과 보기가 판 높이에 들게) */
#app.short .choices { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
#app.short .choices button { flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 0; font-size: 13px; padding: 3px 4px 5px; line-height: 1.25; }
#app.short .choices button .ck { margin: 0; }
#app.short #gauge { padding-top: 4px; }
#app.short #gauge .gT, #app.short #gauge .gEnds, #app.short #gauge .gRows { display: none; }
#app.short .gMain { grid-template-columns: 52px minmax(0, 1fr); grid-template-areas: "dial num"; column-gap: 10px; }
#app.short #gauge.zoom .gMain { grid-template-columns: 52px auto minmax(0, 1fr); grid-template-areas: "dial num zoom"; }
#app.short #gauge .gNum b { font-size: 17px; }
#app.short #gauge .gNum span { font-size: 13px; }
#app.short #zoomSt { margin: 0; }
#app.short #freeBox .fd { font-size: 14px; }
#app.short #freeBox .fn { font-size: 13px; }
#app.short #views .tx, #app.short #bSlow .tx { display: none; }
/* 단추가 넓어 단계 이름이 줄어들면 말줄임 대신 숨긴다(위 탭에 단계가 보인다) */
#card.nostep #cStep { display: none; }
/* 아주 작은 틀(320×200 등): 그림 | 과제 두 단. 꼭 필요한 것만 */
#app.micro { --hdr: 40px; }
#app.micro #main { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); padding: 0 6px 4px; column-gap: 8px; }
#app.micro #views, #app.micro #bReset, #app.micro #toast { display: none; }
#app.micro #sceneBtns { top: 4px; right: 4px; }
#app.micro #dock .grp label { display: none; }
/* 아주 작은 틀(320×200)의 과제: 카드 전체가 판 안에서 스크롤된다(머리 줄, 글, 단추 차례로. 글을 자르지 않는다) */
#app.micro #card { display: block; overflow: auto; padding-bottom: 4px; }
#app.micro .cHead { margin-bottom: 4px; }
#app.micro #cBody { overflow: visible; gap: 5px; }
#app.micro #cActs { margin-top: 6px; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
#app.micro .choices { grid-template-columns: minmax(0, 1fr); }
#app.micro .choices button { flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; gap: 8px; padding: 3px 8px; }
#app.micro .choices button .ck { margin-left: auto; }
/* 아주 작은 틀: 조작판이 좁아 읽음값(목표 속력·시간)은 그림 왼쪽 아래 꼬리표 자리로 올린다(흰 바탕, 반경 0) */
#app.micro .grp { position: relative; }
#app.micro .grp output { position: absolute; left: 0; bottom: calc(100% + 4px); min-width: 0; padding: 0 5px; font-size: 13px; background: var(--k-paper); line-height: 1.4; }
#app.micro #bMain { min-width: 0; font-size: 14px; padding: 0 10px; }
#app.micro #bAim { display: none; }
#app.micro #card .stats, #app.micro #card .note, #app.micro #card .res .sub { display: none; }
#app.micro #cBody p, #app.micro #cBody li, #app.micro .res, #app.micro .choices button { font-size: 12.5px; line-height: 1.38; }
#app.micro #cStep { font-size: 13px; }
#app.micro .choices button { min-height: 36px; }
#app.micro #gauge .gNum span { display: none; }
#app.micro .gMain { grid-template-columns: 40px minmax(0, 1fr); }
#app.micro #gauge.zoom .gMain { grid-template-columns: 40px auto minmax(0, 1fr); }
#app.micro #zoomSt .zlab { display: none; }
#app.micro #freeBox .fn { display: none; }
#app.micro #freeBox .fd { font-size: 12.5px; }
/* 아주 작은 틀의 시작 화면: 판 자리가 없으므로 그림 자리와 위 막대 자리까지 쓴다 */
body.starting #app.micro #sceneCol, body.starting #app.micro #top { display: none; }
body.starting #app.micro #main { grid-template-columns: minmax(0, 1fr); }

/* 썸네일 찍기용(시험 창구 ht.thumb) */
#app.thumb #top, #app.thumb #panel, #app.thumb #dock, #app.thumb #views, #app.thumb #sceneBtns, #app.thumb #toast { display: none !important; }
#app.thumb #main { grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: minmax(0, 1fr) !important; padding: 0 !important; }
#app.thumb #sceneCol { grid-template-rows: minmax(0, 1fr) !important; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* 낮은 가로 화면에서 보기를 고르는 동안 과제 글이 넘치면 각도계를 접는다(main.js fitCard) */
#app.gHide #gauge { display: none; }
