/* GPS 시계 보정 끄기: '종이 위 그림' (studio/DESIGN.md, 2026-10-17)
   - 틀(위 막대·판·단추·창)은 공용 묶음 kit/paper.css(빌드가 studio/_kit에서 복사)의 토큰과 부품을 그대로 쓴다:
     .k-btn·.k-primary(단추), .k-seg·.k-on(고른 상태 = 굵은 글자 + 칸 아래 3px 막대), .k-range(슬라이더),
     .k-w(범례 낱말), .k-link(진행 지우기), .k-dark(어두운 그림 위 초점 링), [hidden] !important.
     이 파일에는 배치와 이 작품의 대상 색만 둔다.
   - 3D 장면은 흰 종이 위의 어두운 그림(#fig)이다. 계기판·미션은 그 옆(휴대폰은 아래) 종이 위에 놓인다.
   - 같은 대상은 같은 색과 같은 선 모양: 위성 시계(높은 곳의 시계) 주황 점선, 땅 시계·학교(낮은 곳) 초록 실선,
     높이 효과 보라 점선, 속력 효과 파랑 점점선, 두 효과의 합은 잉크 실선. 3D 이름표, 글 속 낱말, 읽음값, 그래프 선이 모두 이것을 따른다.
   - 반경: 단추·입력·세그먼트 var(--k-r), 판·그림·그래프·꼬리표·창 0, 손잡이·끄는 점만 원. */
:root {
  /* 대상 색: -d는 어두운 장면 위(3D·이름표), -p는 흰 종이 위(글·읽음값·그래프). 흰 바탕 대비는 모두 4.5:1 이상 */
  --sat-d: #ff8c42;  --sat-p: #c2410c;   /* 위성 시계, 위성 A, 높은 쪽(천장) 시계. 예전 금색(틀 강조색과 같았음)을 주황으로 옮겼다 */
  --gnd-d: #6ff0b2;  --gnd-p: #237032;   /* 땅 시계, 우리 학교, 낮은 쪽(바닥) 시계 */
  --grav-d: #b9a2ff; --grav-p: #6741d9;  /* 높이 효과(중력 퍼텐셜) */
  --vel-d: #7fb6ff;  --vel-p: #1864ab;   /* 속력 효과(속도 화살표) */
  --b-d: #52d6ff;    --b-p: #0e7490;     /* 위성 B, 5단계의 공 */
  --c-d: #ff8ad8;    --c-p: #c2255c;     /* 위성 C */
  --bad-d: #ff8a73;  --bad-p: #c92a2a;   /* 계산이 틀린 위치, 빠져나가는 기체, 사건의 지평선 */
  --planet-d: #8fb8ff; --planet-p: #1c5fbf;
  --ok-p: #237032;
  --scene: #03050b;  /* 3D 장면 바탕(earth.js·rooms.js·cosmos.js와 같은 어둠) */
  --hdr: 52px;
  --pw: clamp(300px, 34%, 420px);
  --tap: 40px;       /* 누르는 것의 최소 높이(DESIGN.md '크기'). 낮은 화면은 36px */
  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);
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
/* 줄바꿈: 한국어는 어절, 영어는 낱말, 일본어는 구절·금칙. 틀을 넘는 긴 낱말만 끊는다 */
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 없음): 문구에 넣은 U+200B(구절 경계, i18n.js는 이때만 넣는다)에서만 줄을 바꾼다 */
@supports not (word-break: auto-phrase) { html:lang(ja) { word-break: keep-all; } }
.nb { white-space: nowrap; }
button { font-family: inherit; font-size: 14px; color: inherit; cursor: pointer; }
button:focus-visible, canvas:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--k-ink); outline-offset: 2px; }
button:disabled { cursor: default; opacity: 0.45; }
b { font-weight: 800; }
sup, sub { font-size: max(12px, 0.74em); line-height: 0; }
i.v { font-style: italic; font-family: "Times New Roman", Georgia, serif; font-size: 1.08em; }

/* ── 범례 낱말(.k-w)과 읽음값의 대상 색 ── */
.k-w.sat { --w: var(--sat-p); }
.k-w.gnd { --w: var(--gnd-p); }
.k-w.grav { --w: var(--grav-p); }
.k-w.vel { --w: var(--vel-p); }
.k-w.sb { --w: var(--b-p); }
.k-w.sc { --w: var(--c-p); }
.k-w.bad { --w: var(--bad-p); }
.k-w.ball { --w: var(--b-p); }
.k-w.planet { --w: var(--planet-p); }
.cg { color: var(--sat-p); } .cc { color: var(--b-p); } .cp { color: var(--c-p); } .cv { color: var(--grav-p); } .cs { color: var(--vel-p); }
.cm { color: var(--ok-p); } .cr { color: var(--bad-p); } .ck { color: var(--k-ink); }
.cgn { color: var(--gnd-p); }
/* 촘촘한 화면에서만(oc) / 넉넉한 화면에서만(nc) 보이는 것 */
html.dense .nc { display: none !important; }
html:not(.dense) .oc { display: none !important; }

#app {
  position: fixed; inset: 0; display: grid;
  grid-template-columns: minmax(0, 1fr) var(--pw);
  grid-template-rows: var(--hdr) minmax(0, 1fr);
  grid-template-areas: "top top" "view side";
  background: var(--k-paper);
}

/* ── 위 막대: 메뉴, 지금 단계(굵게)와 부제, 단계 번호 탭(미션 점), 정보, 소리 ── */
#top { grid-area: top; display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 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); } }
#chap { flex: 1; min-width: 0; display: flex; align-items: center; padding: 0 6px; font-size: 15px; line-height: 1.3; }
#chap .in { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; min-width: 0; }
#chTag { font-weight: 800; margin-right: 0.45em; }
#chTag:empty { display: none; }
#chName { font-weight: 500; color: var(--k-ink-2); }
#chap.noSub #chName { display: none; } /* 두 줄에 다 들어가지 않으면 부제를 접는다(main.js fitChap) */
body.starting #chap { font-size: 17px; }
body.starting #chName { font-weight: 800; color: var(--k-ink); }
body.starting #btnMenu, body.starting #tabs { visibility: hidden; }
/* 단계 탭: 번호(자유 모드는 넓으면 이름도). 고른 단계 = 공용 .k-on(굵은 글자 + 칸 아래 막대). 스토리 모드는 번호 아래 미션 점 셋 */
#tabs { display: flex; align-items: center; gap: 2px; flex: none; min-width: 0; overflow: hidden; }
#tabs .lb { flex: none; font-size: 15px; font-weight: 800; margin: 0 8px 0 4px; white-space: nowrap; }
#tabs button {
  flex: none; position: relative; height: var(--tap); min-width: 34px; padding: 0 8px; border: 0; border-radius: 0; background: none;
  color: var(--k-sub); font-size: 15px; font-weight: 650; white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 5px;
}
#tabs button .n { font-variant-numeric: tabular-nums; }
#tabs button .t { display: none; }
#tabs .pip { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); display: flex; gap: 2px; }
#tabs .pip i { width: 5px; height: 5px; box-shadow: inset 0 0 0 1px var(--k-ctl); }
#tabs .pip i.on { background: var(--k-ink); box-shadow: none; }
#tabs.story button { padding-bottom: 8px; }
@media (hover: hover) { #tabs button:not(.k-on):hover { background: var(--k-wash); color: var(--k-ink); } }
html.free:not(.tabsHidden) #chap { display: none; }
html.tabsHidden #tabs { display: none; }
html.free #tabs { flex: 1; }
html.free #tabs button .t { display: inline; }
html.free #tabs.nolb .lb { display: none; }
html.free #tabs.num button:not(.k-on) .t, html.free #tabs.min button .t { display: none; }
/* 좁은 화면: 번호 칸을 32px까지 줄인다(누르는 폭 32px 이상, DESIGN.md '크기') */
html.free #tabs.min { gap: 0; }
html.free #tabs.min button { min-width: 32px; padding: 0 4px; }
@media (max-width: 820px) { html:not(.free) #tabs { display: none; } }

/* ── 3D 그림: 흰 종이 위의 어두운 그림(.k-dark: 초점 링에 흰 띠) ── */
#view { grid-area: view; display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 0 10px 12px 12px; }
#fig { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--scene); }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
#sceneTools { position: absolute; left: 8px; top: 8px; right: 8px; z-index: 3; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; pointer-events: none; }
#sceneTools > * { pointer-events: auto; }
#sceneTools .k-btn { height: var(--tap); }
#sceneTools .k-btn.ico { width: var(--tap); padding: 0; }
#toast {
  position: absolute; left: 50%; bottom: 10px; transform: translate(-50%, 8px); z-index: 5; opacity: 0; pointer-events: none;
  background: var(--k-paper); color: var(--k-ink); padding: 7px 12px; font-size: 14px; font-weight: 650; line-height: 1.4;
  width: max-content; max-width: min(calc(100% - 24px), 480px); text-align: center; transition: opacity 0.2s, transform 0.2s;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }
/* 촘촘한 화면: 지금 할 일은 그림 바로 아래 종이 위 한두 줄(미션 칸을 한 줄로 접었으므로) */
#caption { display: none; margin: 6px 2px 0; font-size: 14px; line-height: 1.42; }
html.dense:not(.free) #caption:not(:empty) { display: block; }
body.starting #caption { display: none !important; }

/* 장면 이름표: 반경 0, 바탕은 장면과 같은 불투명 색, 테두리 없이 글자색과 밑줄 모양으로 대상을 가른다 */
.lbl {
  position: absolute; left: 0; top: 0; padding: 2px 6px 4px; background: var(--scene); color: #e8eeff;
  white-space: nowrap; line-height: 1.24; font-size: 13px; font-weight: 700; display: flex; flex-direction: column; align-items: center; will-change: transform;
  text-decoration-thickness: 1.5px; text-underline-offset: 3px;
}
.lbl small { font-size: 12px; font-weight: 600; color: #b9c0cf; font-variant-numeric: tabular-nums; text-decoration: none; }
.lbl b { font-variant-numeric: tabular-nums; }
.lbl.home { color: var(--gnd-d); text-decoration-line: underline; }
.lbl.clock b { font-size: 14px; }
.lbl.clock.sat { color: var(--sat-d); text-decoration-line: underline; text-decoration-style: dashed; }
.lbl.sA { color: var(--sat-d); } .lbl.sB { color: var(--b-d); } .lbl.sC { color: var(--c-d); }
.lbl.bad { color: var(--bad-d); }
.lbl.vel { color: var(--vel-d); text-decoration-line: underline; text-decoration-style: dotted; text-decoration-thickness: 2px; }
.lbl.ball { color: var(--b-d); }
.lbl.planet { color: var(--planet-d); }
.lbl.gasP { color: #ffb27a; }
.lbl.dim { color: #b9c0cf; }
html.compact .lbl { font-size: 12px; padding: 1px 5px 3px; }

/* ── 옆 판(휴대폰은 아래): 예측·결과 옆 창, 계기판, 미션 ── */
#side { grid-area: side; display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; padding: 2px 14px 10px 4px; overflow: hidden; }
#panel { flex: none; display: flex; flex-direction: column; gap: 8px; min-height: 0; padding: 4px 2px 0; }
#panel:empty { display: none; }
#panel > .k-seg { align-self: flex-start; max-width: 100%; }
/* 예측하는 동안은 계기판을 잠근다(옆 창에 막이 없으므로) */
#panel[inert], #sceneTools[inert] { opacity: 0.45; }
#mission { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px 2px 0; border-top: 1px solid var(--k-rule); overflow: hidden; }
html.free #mission { display: none; }
#mHead { display: none; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; line-height: 1.3; min-width: 0; }
#mDots { display: inline-flex; gap: 4px; flex: none; }
#mDots i { width: 10px; height: 10px; display: block; box-shadow: inset 0 0 0 1.5px var(--k-ctl); }
#mDots i.on { background: var(--k-ink); box-shadow: none; }
#mDots i.cur { box-shadow: inset 0 0 0 2.5px var(--k-ink); }
#mDots i.on.cur { box-shadow: none; }
#goals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
#goals button {
  display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 6px; width: 100%; min-height: 40px; padding: 3px 2px;
  border: 0; border-top: 1px solid var(--k-rule); background: none; text-align: left; font-size: 14.5px; line-height: 1.3; color: var(--k-sub);
}
#goals li:last-child button { border-bottom: 1px solid var(--k-rule); }
#goals .n { font-variant-numeric: tabular-nums; font-weight: 650; }
#goals li.done .n { color: var(--k-ink); font-weight: 800; }
#goals li.cur button { color: var(--k-ink); font-weight: 750; }
@media (hover: hover) { #goals button:not(.k-on):hover { background: var(--k-wash); } }
#mText { margin: 0; font-size: 15px; line-height: 1.5; }
#mText:empty { display: none; }
#mActs { display: flex; gap: 8px; flex-wrap: wrap; }
#mActs:empty { display: none; }
#mActs .k-btn { height: var(--tap); }

/* 옆 창(예측·결과): 막 없이 판 맨 위에 끼운다. 계기판은 그 아래에 그대로 보인다 */
#sheet { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 10px 2px 12px 4px; border-bottom: 1px solid var(--k-rule); background: var(--k-paper); }
#side.carded #mission { display: none; }
#side.cardOnly > :not(#sheet) { display: none !important; }
#side.cardOnly > #sheet { flex: 1 1 auto; border-bottom: 0; }

/* ── 계기판 부품 ── */
.ph { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 750; color: var(--k-sub); min-height: 22px; }
.ph .sp { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.num { font-variant-numeric: tabular-nums; }
.big { font-size: 22px; font-weight: 850; font-variant-numeric: tabular-nums; }
.mid { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.muted { color: var(--k-sub); }
canvas.pc { display: block; width: 100%; touch-action: none; background: var(--k-paper); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.k-btn.chip { height: var(--tap); padding: 0 12px; font-size: 14px; font-variant-numeric: tabular-nums; }
.k-btn.chip.sm { padding: 0 10px; min-width: 40px; }
.k-seg > button { min-height: var(--tap); }
/* 켜고 끄는 효과(높이·속력·상대론 보정): 네모 칸에 ✓, 켜면 칸을 그 대상의 색으로 칠한다 */
.k-btn.sw { gap: 8px; padding: 0 12px 0 10px; }
.sw .chk { width: 17px; height: 17px; flex: none; border: 2px solid var(--q, var(--k-ink)); border-radius: var(--k-r); position: relative; }
.sw[aria-checked="true"] .chk { background: var(--q, var(--k-ink)); }
.sw[aria-checked="true"] .chk::after { content: ""; position: absolute; left: 4px; top: 0.5px; width: 5px; height: 9px; border: solid var(--k-paper); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.sw.grav { --q: var(--grav-p); }
.sw.vel { --q: var(--vel-p); }
.sw.corr { --q: var(--ok-p); }
.sw .val { font-variant-numeric: tabular-nums; color: var(--k-sub); font-weight: 650; }
.k-range { min-width: 60px; }
/* 읽음값: 이름은 작게, 값은 크게 tabular, 단위는 같은 줄 */
.stats { display: flex; flex-direction: column; }
.stat { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; padding: 3px 0; border-top: 1px solid var(--k-rule); }
.stat:last-child { border-bottom: 1px solid var(--k-rule); }
.stat .l { color: var(--k-sub); font-weight: 650; white-space: nowrap; }
.stat .v { font-weight: 800; font-size: 15.5px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.clocks { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 14px; }
.clk { display: flex; flex-direction: column; min-width: 0; }
.clk .h { font-size: 13px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clk.gnd .h { color: var(--gnd-p); }
.clk.sat .h { color: var(--sat-p); }
.clk .t { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.clk .us { font-size: 20px; font-weight: 850; color: var(--sat-p); font-variant-numeric: tabular-nums; white-space: nowrap; }
.clk .us small { font-size: 13px; color: var(--k-sub); font-weight: 650; margin-left: 5px; }
.bars { display: flex; flex-direction: column; gap: 4px; }
.bar { display: grid; grid-template-columns: max-content minmax(40px, 1fr) 52px; gap: 8px; align-items: center; font-size: 13px; font-weight: 750; }
.bar.grav > span:first-child { color: var(--grav-p); }
.bar.vel > span:first-child { color: var(--vel-p); }
.bar .tr { height: 12px; background: var(--k-wash); position: relative; overflow: hidden; }
.bar .tr .z { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--k-ink); }
.bar .tr .f { position: absolute; top: 0; bottom: 0; transition: left 0.3s, width 0.3s; }
.bar .v { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; font-weight: 700; }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 3px solid currentColor; vertical-align: middle; margin-right: 5px; }
.legend .grav { color: var(--grav-p); } .legend .grav i { border-top-style: dashed; }
.legend .vel { color: var(--vel-p); } .legend .vel i { border-top-style: dotted; }
.legend .tot { color: var(--k-ink); }
.timebtns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.timebtns .k-btn { padding: 0 4px; }
.freq { font-size: 13.5px; color: var(--k-sub); font-weight: 650; line-height: 1.45; }
.freq b { color: var(--k-ink); font-variant-numeric: tabular-nums; }
.freq.note { color: var(--k-ink); margin: 4px 0 0; }
/* 알아 둘 것(예측 질문 위): 이 단계에서 볼 것과 낱말의 뜻 */
#sheet p.know { margin: 0 0 8px; font-size: 14px; line-height: 1.5; color: var(--k-sub); }
html.compact #sheet p.know { font-size: 13px; line-height: 1.42; margin: 0 0 5px; }
/* 2단계 목표 3: 아직 못 한 조건 표시(✓ 한 것, ○ 할 것) */
#mText .prog, #caption .prog { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 4px; font-size: 14px; font-weight: 700; color: var(--k-sub); }
#mText .prog .ok, #caption .prog .ok { color: var(--ok-p); }
/* 목표를 시작할 때 되돌린 것 알림(main.js rsNote): 할 일 글 위 한 줄 */
#mText .rs, #caption .rs { display: block; color: var(--k-sub); }
/* 효과 셋(높이·속력·합)을 한 줄에: 가운뎃점 대신 사이를 띄운다 */
.freq.trio { display: flex; flex-wrap: wrap; gap: 2px 14px; align-items: baseline; font-variant-numeric: tabular-nums; }
.k-btn svg { flex: none; }
.satrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0 10px; align-items: baseline; font-size: 14px; padding: 4px 2px; border-top: 1px solid var(--k-rule); }
.satrow:last-child { border-bottom: 1px solid var(--k-rule); }
.satrow .id { font-weight: 850; }
.satrow .tt { color: var(--k-sub); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.satrow .dd { font-weight: 850; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.satrow .err { grid-column: 1 / -1; font-size: 13px; color: var(--bad-p); font-weight: 750; }
.gauge { position: relative; height: 14px; background: var(--k-wash); overflow: hidden; }
.gauge .f { position: absolute; left: 0; top: 0; bottom: 0; background: var(--k-ink); transition: width 0.15s; }
.gauge.bh .f { background: var(--bad-p); }
.gauge .c { position: absolute; right: 0; top: 0; bottom: 0; width: 2px; background: var(--bad-p); }
.ticks { position: relative; height: 16px; font-size: 12px; color: var(--k-sub); font-weight: 650; }
.ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ticks span:first-child { transform: none; }
.ticks.two { height: 32px; margin-top: -4px; }
.ticks.two span { top: 0; display: inline-flex; flex-direction: column; align-items: center; transform: translateX(-50%); }
.ticks.two span i { display: none; }
.ticks.two span.lo { top: 15px; }
.ticks.two span.rt { transform: translateX(-100%); align-items: flex-end; }
.ticks.two span.lf { transform: none; align-items: flex-start; }

/* ── 창: 흰 종이, 반경 0, 그림자 없음. 몸통(.cb)이 넘치면 몸통만 스크롤하고 단추 줄은 늘 보인다 ── */
/* 가운데 창(메뉴·정보·탐구 질문의 답)만 뒤를 어둡게 가린다 */
#modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: var(--k-dim); padding: 12px; }
#modal .card { display: flex; flex-direction: column; width: min(580px, 100%); max-height: calc(100% - 8px); overflow: hidden; background: var(--k-paper); color: var(--k-ink); padding: 20px 22px 18px; }
#modal .card.info { width: min(720px, 100%); }
.card > .cb { min-height: 0; overflow: auto; }
.card > .acts { flex: none; }
.card [tabindex="-1"]:focus { outline: none; }
.card h2 { font-size: 22px; font-weight: 750; margin: 0 0 10px; line-height: 1.38; }
.card h3 { font-size: 15px; font-weight: 800; margin: 14px 0 4px; }
.card p { margin: 8px 0; font-size: 15px; line-height: 1.6; }
.card ul { margin: 0; padding-left: 18px; }
.card li { font-size: 14.5px; line-height: 1.6; margin: 4px 0; }
.card .eq { font-size: 15px; font-weight: 750; font-variant-numeric: tabular-nums; margin: 6px 0; }
.res { margin: 0 0 4px; }
.res .hd { margin: 0 0 4px; font-size: 17px; font-weight: 800; }
.res .hd.ok { color: var(--ok-p); }
.res .hd.bad { color: var(--bad-p); }
.res .hd .pk { display: block; margin-top: 2px; font-size: 14px; font-weight: 600; color: var(--k-sub); }
.res .gl { font-size: 13.5px; color: var(--k-sub); font-weight: 650; margin: 0; }
.opts { display: grid; gap: 8px; margin-top: 12px; grid-template-columns: minmax(0, 1fr); }
.opts button {
  min-height: 46px; border: 1.5px solid var(--k-ctl); border-radius: var(--k-r); background: var(--k-paper); color: var(--k-ink);
  font-weight: 650; font-size: 15px; padding: 8px 12px; line-height: 1.35; text-align: left;
}
@media (hover: hover) { .opts button:hover { background: var(--k-wash); border-color: var(--k-ink); } }
.acts { display: flex; gap: 8px 10px; justify-content: flex-end; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.acts .k-btn { height: var(--tap); }
.acts .k-link { margin-right: auto; }
/* 단계·장면 목록: 줄로 나눈 목록(지금 단계 = 공용 .k-on) */
.stList { display: grid; margin-top: 6px; }
.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; display: flex; flex-direction: column; }
.stList .t small { font-size: 13.5px; font-weight: 500; color: var(--k-sub); }
.stList .c { font-size: 14px; color: var(--k-sub); white-space: nowrap; font-variant-numeric: tabular-nums; }
.info h3:first-child { margin-top: 0; }

/* ── 시작 화면(kit/start.js의 startSheet): 판 자리에 놓인다. 장면은 그대로 보인다 ── */
body.starting #side > :not(.k-start) { display: none !important; }
#side > .k-start { flex: 1; min-height: 0; padding: 14px 6px 12px 6px; }
.k-start.x-tiny { gap: 6px; }
.k-start.x-tiny .k-q { font-size: 14px; line-height: 1.25; }

/* ── 작은 데스크톱 틀(830×466, 1184×665 아래쪽): 계기판·미션을 촘촘하게 ── */
html.dense #panel { gap: 6px; }
html.dense .k-btn.chip { padding: 0 10px; font-size: 13.5px; }
html.dense .stat { font-size: 13.5px; padding: 2px 0; }
html.dense .stat .v { font-size: 14.5px; }
html.dense .clk .us { font-size: 17px; }
html.dense #goals { display: none; }
html.dense #mText { display: none; }
html.dense #mission { flex: none; flex-direction: row; align-items: center; gap: 8px; padding: 6px 0 0; }
html.dense #mHead { display: flex; flex: 1 1 auto; }
html.dense #mGoal { min-width: 0; }
html.dense #mActs { flex: none; flex-wrap: nowrap; }
html.dense #mActs .k-btn { padding: 0 12px; }
html.dense .card h2 { font-size: 19px; }
/* 예측 창이 판에 다 들어가지 않을 때(main.js fitPred): 글을 한 단계 줄이고(tight), 그래도 넘치면 보기를 두 칸으로(cols2) */
#sheet.tight p.know { font-size: 13px; line-height: 1.42; margin: 0 0 5px; }
#sheet.tight h2 { font-size: 16.5px; line-height: 1.35; margin-bottom: 5px; }
#sheet.tight .opts { margin-top: 6px; gap: 5px; }
#sheet.tight .opts button { min-height: 38px; font-size: 14px; padding: 4px 10px; }
#sheet.tighter p.know { font-size: 12.5px; line-height: 1.38; margin: 0 0 4px; }
#sheet.tighter h2 { font-size: 15px; line-height: 1.33; margin-bottom: 4px; }
#sheet.tighter .opts button { min-height: 36px; font-size: 13.5px; line-height: 1.3; padding: 3px 9px; }
#sheet.cols2 .opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* 작은 데스크톱 틀(830×466 등, 낮은 가로 화면): 창 글을 한 단계 줄인다 */
@media (max-height: 560px) and (min-aspect-ratio: 23/20) {
  #modal .card { padding: 14px 18px; }
  .card h2 { font-size: 18px; margin-bottom: 6px; line-height: 1.35; }
  .card p { font-size: 14px; line-height: 1.5; margin: 6px 0; }
  .card li { font-size: 13.5px; line-height: 1.5; }
  .res .hd { font-size: 15px; }
  .acts { margin-top: 10px; }
  .opts { margin-top: 8px; gap: 6px; }
  .opts button { min-height: 40px; font-size: 14px; padding: 6px 10px; }
  .stList > button { min-height: 40px; padding: 3px 4px; font-size: 15px; }
  .stList .t small { display: none; }
}

/* ── 세로 화면(휴대폰 세로·좁은 창): 그림 위, 계기판·미션 아래 ── */
html.compact { --hdr: 50px; }
html.compact #app { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--hdr) minmax(0, 1fr) auto; grid-template-areas: "top" "view" "side"; }
html.compact #view { padding: 0 10px; }
html.compact #side { padding: 6px 10px 8px; gap: 6px; }
html.compact #panel { padding: 0; }
html.compact #chap { font-size: 14px; }
html.compact .clk .t { font-size: 15px; }
/* 옆 창: 아래 판을 덮는다(막 없음, 장면은 그대로 보인다) */
html.compact #sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; max-height: calc(100% - var(--hdr));
  padding: 12px 14px; border-bottom: 0; border-top: 1px solid var(--k-rule);
}
html.compact #sheet h2 { font-size: 17px; line-height: 1.38; margin-bottom: 6px; }
html.compact #sheet p { font-size: 14px; line-height: 1.5; margin: 6px 0; }
html.compact #sheet .opts { gap: 6px; margin-top: 8px; }
html.compact #sheet .opts button { min-height: 40px; font-size: 14.5px; padding: 6px 10px; }
html.compact #sheet .acts { margin-top: 10px; }
/* 시작 화면이 떠 있는 동안만 장면을 줄여 판을 넓힌다(DESIGN.md '모드') */
html.compact body.starting #app { grid-template-rows: var(--hdr) minmax(0, 1fr) minmax(0, 2.4fr); }
html.compact #side > .k-start { padding: 10px 2px 6px; }
html.compact #modal { padding: 8px; }
html.compact #modal .card { padding: 16px 16px 14px; }
html.compact .card h2 { font-size: 18px; }
html.compact .card p { font-size: 14.5px; }
html.compact .stList > button { min-height: 42px; font-size: 15px; }
html.compact .stList .t small { display: none; }
@media (max-width: 560px) {
  #chap .in { -webkit-line-clamp: 2; }
  .lbl { font-size: 12px; }
}
/* 낮은 세로 휴대폰(341×470 등) */
@media (max-height: 520px) and (max-aspect-ratio: 23/20) {
  html.compact body.starting #app { grid-template-rows: var(--hdr) minmax(0, 1fr) minmax(0, 2.9fr); }
  .card { padding: 12px 14px; }
  .card h2 { font-size: 17px; line-height: 1.35; margin-bottom: 6px; }
  .card p { font-size: 13.5px; line-height: 1.5; margin: 6px 0; }
  .acts { margin-top: 10px; }
}

/* ── 낮은 가로 화면(가로 휴대폰 750×280 등): 그림 왼쪽, 계기판 오른쪽 절반 ── */
html.compact.short { --hdr: 44px; }
html.compact.short #app { grid-template-columns: minmax(0, 1fr) minmax(0, 50%); grid-template-rows: var(--hdr) minmax(0, 1fr); grid-template-areas: "top top" "view side"; }
html.short #top { padding: 2px 6px 2px 4px; gap: 4px; }
html.short #chap { font-size: 13px; }
html.short #chap .in { line-height: 1.22; }
html.short #view { padding: 0 6px 6px 8px; }
html.short #side { padding: 0 8px 6px 4px; gap: 4px; }
html.short #panel { gap: 4px; }
html.short .stat { padding: 1px 0; font-size: 13px; }
html.short .stat .v { font-size: 13.5px; }
html.short .ph { min-height: 18px; font-size: 12.5px; }
html.short .clk .us { font-size: 15px; }
html.short #mission { padding-top: 4px; }
html.short #panel:has(canvas.fill) { flex: 1 1 auto; }
html.short canvas.pc.fill { flex: 1 1 0; min-height: 118px; } /* 기체 다섯 줄이 겹치지 않는 높이 */
html.short .k-btn.chip { padding: 0 8px; }
html.short #sheet {
  position: fixed; left: auto; right: 0; top: var(--hdr); bottom: 0; width: min(64vw, 520px); max-height: none;
  padding: 8px 12px; border-top: 0; border-left: 1px solid var(--k-rule);
}
html.short #sheet h2 { font-size: 15px; margin-bottom: 4px; }
html.short #sheet p { font-size: 13px; line-height: 1.45; margin: 4px 0; }
html.short .res .hd { font-size: 14.5px; }
html.short .res .hd .pk { display: inline; margin-left: 6px; font-size: 13px; }
html.short #sheet .opts { margin-top: 6px; gap: 5px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
html.short #sheet .opts button { min-height: 36px; font-size: 13px; padding: 3px 8px; }
html.short #sheet .acts { margin-top: 6px; }
html.compact.short body.starting #app { grid-template-columns: minmax(0, 1fr) minmax(0, 60%); grid-template-rows: var(--hdr) minmax(0, 1fr); }
html.short #side > .k-start { padding: 6px 4px 4px; }
html.short #modal { padding: 4px; }
html.short #modal .card { padding: 10px 14px; }
html.short .card h2 { font-size: 16px; margin-bottom: 4px; }
html.short .card p { font-size: 13px; margin: 4px 0; line-height: 1.45; }
html.short .acts { margin-top: 8px; }
html.short .stList { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; }
html.short .stList > button { min-height: 36px; padding: 2px; gap: 4px; grid-template-columns: 20px minmax(0, 1fr) auto; font-size: 13.5px; }
html.short .stList > button:nth-last-child(-n+2) { border-bottom: 1px solid var(--k-rule); }
html.short #toast { bottom: auto; top: 6px; transform: translate(-50%, -8px); font-size: 13px; padding: 4px 10px; }
html.short #toast.on { transform: translate(-50%, 0); }
/* 아주 작은 틀(320×200 등): 그림 36%, 판 64%. 판에는 조작과 핵심 값만 두고 보조 표시(.mx)는 숨긴다 */
html.micro { --hdr: 40px; }
html.micro #app, html.micro.compact.short #app { grid-template-columns: minmax(0, 36%) minmax(0, 64%); }
html.micro #view { padding: 0 4px 4px 6px; }
html.micro #side { padding: 0 6px 4px 2px; gap: 3px; }
html.micro .mx { display: none !important; }
html.micro #panel { gap: 4px; }
html.micro #chap { font-size: 12px; }
html.micro #top { gap: 2px; padding: 2px 4px; }
html.micro .icon { width: 36px; height: 36px; }
html.micro .k-range { min-width: 40px; }
html.micro .mid { font-size: 15px; }
html.micro #toast { z-index: 25; position: fixed; top: calc(var(--hdr) + 4px); bottom: auto; max-width: calc(100vw - 16px); font-size: 13px; padding: 4px 10px; }
html.micro #chap .in { line-height: 1.2; }
html.micro .k-btn.chip { padding: 0 7px; min-width: 36px; font-size: 13px; }
html.micro .k-btn.sw { padding: 0 8px 0 6px; gap: 5px; font-size: 13px; }
html.micro .k-seg > button { padding: 2px 7px; font-size: 13px; }
html.micro .row, html.micro .chips { gap: 4px; }
html.micro .timebtns { gap: 3px; }
html.micro .stat { font-size: 12.5px; }
html.micro .clk .us { font-size: 15px; }
/* 미션 줄은 위 막대 안(main.js layout이 옮긴다): 목표 이름과 단추 한 줄 */
html.micro #top > #mission { flex: 1 1 auto; min-width: 0; padding: 0 2px; gap: 4px; border-top: 0; }
html.micro:not(.free) #chap { display: none; }
body.starting #mission { display: none !important; }
html.micro body.starting #chap { display: flex; }
html.micro #mDots { display: none; }
html.micro #mGoal { font-size: 12.5px; line-height: 1.2; }
html.micro #mActs .k-btn { padding: 0 8px; font-size: 13px; }
html.micro #sceneTools { left: 4px; top: 4px; right: 4px; gap: 4px; }
html.micro #sceneTools .k-btn:not(.ico) { padding: 0 8px; font-size: 13px; }
html.micro .card h2 { font-size: 14px; margin-bottom: 2px; }
html.micro .acts { margin-top: 4px; }
/* 시작 화면: 그림 자리가 없으므로 판이 화면 전체를 쓴다 */
html.micro body.starting #view { display: none; }
html.micro.compact.short body.starting #app { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--hdr) minmax(0, 1fr); grid-template-areas: "top" "side"; }

/* 사진(썸네일)용: 3D만 */
body.thumb #top, body.thumb #side, body.thumb #sceneTools, body.thumb #modal, body.thumb #toast, body.thumb #caption { display: none !important; }
body.thumb #app { grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr; grid-template-areas: "view"; }
body.thumb #view { padding: 0; }

@media (prefers-reduced-motion: reduce) {
  #toast, .bar .tr .f, .gauge .f { transition: none; }
}

/* 낮은 화면(높이 560px 이하): 누르는 칸 36px로 충분하다 */
@media (max-height: 560px) { #goals button { min-height: 36px; } }
/* 휴대폰 세로: 옆 창(고정)이 판을 덮는 동안 판의 넘침 자르기를 풀어 창 글이 판 경계에서 잘린 것처럼 재지 않게 */
#side.carded { overflow: visible; }
.k-seg > button { min-width: 32px; } /* 누르는 칸 폭 32px 이상(번호·숫자 한 글자 칸) */
/* 아주 작은 틀: 메뉴의 단계 목록은 한 줄에 하나(두 칸이면 일본어 가타카나 낱말이 칸보다 길어 갈린다). 창 안 스크롤로 본다 */
html.micro .stList { grid-template-columns: minmax(0, 1fr); }
html.micro .k-seg > button { padding-left: 4px; padding-right: 4px; } /* 좁은 칸에서 "ボール" 같은 낱말이 갈리지 않게 */
