/* 충돌과 운동량: 화면 배치와 GlowScript 위젯(단추·슬라이더·그래프) 모양.
   디자인은 studio/DESIGN.md '종이 위 그림'(2026-10-17)을 따른다. 공용 토큰(--k-*)과 부품은 paper.css에서 온다
   (build.sh가 _kit/paper.css를 dist/paper.css로 고치지 않고 복사하고, index.html이 이 파일보다 먼저 부른다).
   - 틀은 흰 종이와 잉크. 단추는 잉크 칠(주 동작 '충돌'·'출발') 또는 회색 테두리. 색은 장면 속 대상과 물리량에만 쓴다.
   - 고른 상태(탭·세그먼트·판 고르기)는 공용 .k-on·.k-seg: 굵은 글자 + 칸 아래 3px 막대. sim.py의 paint()는 aria-pressed·aria-selected만 바꾼다.
   - GlowScript 단추는 글자색·바탕을 style 속성으로 박아 넣으므로 여기서 !important로 덮는다.
   - 반경은 단추·세그먼트 3px(--k-r)만. 판·그래프·표·창·꼬리표는 0, 슬라이더 손잡이만 원.
   배치 모드(body.wide / body.narrow / compact)와 캔버스·그래프 크기는 sim.py의 layout()이 정한다. */
:root {
  /* 장면 속 대상의 색: sim.py의 COL_*·CUSHIONS[].line과 같은 값 */
  --c-car: #dc2626;   /* 충격량 실험의 수레, 수레 A */
  --c-b: #2563eb;     /* 수레 B */
  --c-sum: #6d28d9;   /* 운동량의 합 */
  --btn-h: 40px;      /* 누르는 것의 높이: 40px, 낮은 화면(560px 이하) 36px (DESIGN.md '크기') */
}
@media (max-height: 560px) { :root { --btn-h: 36px; } }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
/* 줄바꿈은 낱말 경계에서만: 한국어는 어절, 영어는 단어(하이픈 분철 없음), 일본어는 구절(크롬)과 금칙.
   사파리(auto-phrase 없음)는 wrap.js가 넣은 U+200B(구절 경계)와 빈칸에서만 줄을 바꾼다 */
html { overflow-wrap: break-word; hyphens: none; -webkit-hyphens: none; }
html:lang(ko) { word-break: keep-all; }
html:lang(ja) { word-break: auto-phrase; line-break: strict; }
@supports not (word-break: auto-phrase) { html:lang(ja) { word-break: keep-all; } }
/* 그래프(Flot) 눈금 숫자는 칸이 좁아도 줄을 바꾸지 않는다("20 / 0"이 되지 않게) */
.tickLabel { overflow-wrap: normal; color: var(--k-sub) !important; }
body {
  background: var(--k-paper);
  color: var(--k-ink);
  font-family: var(--k-font);
  font-size: 15px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

#app { display: flex; padding: 8px 10px; overflow: hidden; overflow: clip; }
/* ↑ GlowScript 그래프(Flot)는 눈금 글자 크기를 잴 때 너비 10000px짜리 임시 상자를 잠깐 붙였다 뗀다.
   휴대폰에서 직접 열면 그 순간 페이지가 넓어져 스크롤이 튄다. #app 밖으로 넘친 것을 잘라 페이지 크기가 변하지 않게 한다 */
/* GlowScript가 만드는 빈 제목·설명 칸과 크기 조절 손잡이는 쓰지 않는다 */
#glowscript > :not(.glowscript-canvas-wrapper):not(.glowscript-graph):not(.stage) { display: none; }
.ui-resizable-handle { display: none !important; }
/* 3D·그래프: 카드 없이 종이 위에 (반경 0, 테두리 없음) */
.glowscript-canvas-wrapper { overflow: hidden; background: var(--k-paper); }
.glowscript-graph { background: var(--k-paper); margin-top: 8px; }

/* ── 배치: 창 하나에 다 들어간다 (페이지 스크롤 없음). 3D·그래프 크기는 sim.py의 layout()이 정한다 ──
   #glowscript·(세로 화면의) #side는 상자 없이(contents) 그 안의 칸들이 #app 격자에 바로 놓인다 */
#glowscript { display: contents; }
.glowscript-canvas-wrapper { grid-area: view; justify-self: start; align-self: start; position: relative; touch-action: none; }
.glowscript-canvas-wrapper > canvas { vertical-align: top; }   /* 캔버스 아래 글자 기준선 틈을 없애 3D 칸 높이 = 캔버스 높이 */
.stage { margin: 0; }
.stage.act { grid-area: act; }
.stage.act .btns { margin: 6px 0 0; }
.stage.gcap { grid-area: cap; margin-top: 4px; }
.glowscript-graph { grid-area: main; margin: 4px 0 0; align-self: start; }
.stage.res { grid-area: res; margin-top: 4px; }
.stage.mres { grid-area: main; margin-top: 6px; min-height: 0; }
.mres .msg { margin-top: 0; min-height: 2.7em; }
tr.todo td { color: var(--k-sub); }
.switch { display: none; }
.inforow { display: flex; margin-left: auto; }
.inforow button { margin: 0 !important; }

/* 'ⓘ 설명' 창: 흰 종이, 반경 0, 그림자 없음. 뒤는 어둡게만 (닫기 · Esc · 바깥 누르기로 닫는다) */
.infoov { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 14px;
  background: var(--k-dim); }
.infocard { background: var(--k-paper); border-radius: 0; width: 100%; max-width: 580px; max-height: 100%; overflow-y: auto;
  padding: 0 18px 16px; overscroll-behavior: contain; }
.infocard:focus { outline: none; }
.infohead { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--k-paper); padding: 10px 0 8px; border-bottom: 1px solid var(--k-rule); margin-bottom: 6px; font-size: 16px; }
.infohead b { font-weight: 800; }
.infohead button { margin: 0 !important; }
.infocard .more .foot { font-size: 14px; line-height: 1.55; color: var(--k-ink); margin: 0 0 8px; padding: 0; }

/* 3D 시점: 끌어서 돌리기·확대 안내(장면 위 글, 불투명 종이 바탕, 반경 0)와 '처음 시점' 단추 */
.camhint { position: absolute; left: 0; bottom: 6px; z-index: 3; pointer-events: none; font-size: 12px; line-height: 1.3;
  color: var(--k-sub); background: var(--k-paper); padding: 1px 4px; max-width: 60%; }
.camhint.used { display: none; }
#app .camreset { position: absolute; right: 0; bottom: 0; z-index: 3; padding: 2px 10px; font-size: 13px !important; }

/* 넓은 화면: 왼쪽 [3D → 버튼 → 그래프 → 표] (운동량: 3D → 버튼 → 결과), 오른쪽 조작판 */
body.wide #app { display: grid; height: 100vh; height: 100dvh; column-gap: 16px; row-gap: 0;
  grid-template-columns: minmax(0, 1fr) var(--sw, 300px);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  grid-template-areas: "view side" "act side" "cap side" "main side" "res side"; }
body.wide #side { grid-area: side; display: flex; flex-direction: column; gap: 10px; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain; }
body.wide #side > * { flex-shrink: 0; }
/* ↑ 마지막 안전망: 조작판이 창보다 길면 sim.py layout()이 먼저 tight(조금 작은 글자)를, 그래도 넘치면 낮은 화면 배치(compact)를 쓴다 */
body.wide:not(.compact) .switch { display: none !important; }
/* 넓은 화면의 조작판: 판 사이에만 구역 선 */
body.wide:not(.compact) #side .panel { border-top: 1px solid var(--k-rule); padding-top: 8px; }
body.wide.tight #side { gap: 6px; }
body.wide.tight #side button { font-size: 14px !important; line-height: 1.15; }
body.wide.tight .hdr .q { font-size: 15px; line-height: 1.3; }

/* 세로 화면(높이가 넉넉할 때): 탭·질문·예측 → 3D → 부딪치는 곳 → 버튼 → 판 고르기 → 판 하나가 남은 높이를 다 쓴다 */
body.narrow #app { display: grid; height: 100vh; height: 100dvh; row-gap: 6px; padding: 4px 10px 8px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto auto auto auto minmax(0, 1fr);
  grid-template-areas: "hdr" "view" "cush" "act" "switch" "cap" "pane"; }
body.narrow #side { display: contents; }
body.narrow .hdr { grid-area: hdr; }
body.narrow .panel.cush { grid-area: cush; margin: 0; }
body.narrow .switch { grid-area: switch; display: flex; }
body.narrow .switch button { flex: 1 1 0; margin: 0 !important; }
body.narrow .inforow { display: none; }
body.narrow .stage.act .btns { margin: 0; }
body.narrow .stage.gcap { margin: 0; }
body.narrow .glowscript-graph { grid-area: pane; margin: 0; }
body.narrow .stage.res, body.narrow .panel.spanel, body.narrow .panel.mpanel, body.narrow .stage.mres {
  grid-row: 6 / span 2; grid-column: 1; margin: 0; min-height: 0; overflow: hidden; }
/* 판 보이기 (pv-이름은 sim.py가 붙인다): 충격량 그래프·표·조건 / 운동량 결과·조건. 'ⓘ 설명'은 창으로 연다.
   '장면' 판은 낮은 화면(compact)에만 있다. 넉넉한 화면에서는 3D가 늘 보인다 */
body:not(.compact) .switch .scenebtn { display: none !important; }
body.narrow.partS:not(.compact):not(.pv-graph) .stage.gcap, body.narrow.partS:not(.compact):not(.pv-graph) .glowscript-graph { display: none !important; }
body.narrow.partS:not(.compact):not(.pv-table) .stage.res { display: none !important; }
body.narrow.partS:not(.compact):not(.pv-cond) .panel.spanel { display: none !important; }
body.narrow.partM:not(.compact):not(.pv-result) .stage.mres { display: none !important; }
body.narrow.partM:not(.compact):not(.pv-cond) .panel.mpanel { display: none !important; }
body.narrow:not(.roomy) .hdr .title { display: none; }
body.narrow #app button { font-size: 14px !important; line-height: 1.15; padding: 4px 6px; }

/* ── 낮은 화면(compact): 3D 장면도 판 하나가 된다 ──
   휴대폰 사파리의 임베드 틀(356×496 · 359×492 · 341×470 · 390×604)과 가로로 눕힌 휴대폰(750×280).
   판 고르기 [장면 · 그래프 · 표 · 조건 · ⓘ] 아래 판 하나가 남은 높이를 다 쓰고, 부딪치는 곳·충돌 단추는 늘 보인다.
   판은 학생이 누를 때만 바뀐다(2026-10-18): 표·조건 판에서 충돌·출발을 누르면 그 모습을 보도록 '장면' 판으로 가고,
   멈춘 뒤에는 저절로 바뀌지 않는다(sim.py on_crash·finish_safety·on_m_start).
   3D·그래프 크기는 sim.py layout()이 .paneprobe(판 자리 전체에 놓인 보이지 않는 상자)의 높이를 재서 정한다.
   세로:  탭·질문·예측 → 판 고르기 → [판] → 부딪치는 곳 → 충돌 단추
   가로:  왼쪽 판 고르기 → [판],  오른쪽 탭·질문·예측 → 부딪치는 곳 → 충돌 단추 */
.paneprobe { display: none; }
body.compact #app { display: grid; height: 100vh; height: 100dvh; gap: 6px 10px; padding: 4px 10px 6px; }
body.compact #side { display: contents; }
body.narrow.compact.partS #app { grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  grid-template-areas: "hdr" "switch" "cap" "main" "cush" "act"; }
body.wide.compact.partS #app { grid-template-columns: minmax(0, 1fr) var(--sw, 300px);
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  grid-template-areas: "switch hdr" "cap hdr" "main hdr" "main cush" "main act"; }
body.narrow.compact.partM #app { grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  grid-template-areas: "hdr" "switch" "main" "msg" "act"; }
body.wide.compact.partM #app { grid-template-columns: minmax(0, 1fr) var(--sw, 300px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "switch hdr" "main hdr" "msg act"; }
body.compact .hdr { grid-area: hdr; align-self: start; min-width: 0; }
body.compact .hdr .title { display: none; }
body.compact .tabs { margin-bottom: 2px; }
body.compact .hdr .q { font-size: 15.5px; line-height: 1.3; }
/* 예측: '예측' 이름표 옆에 단추 셋 (예측 물음은 바로 위 탐구 질문과 같아 줄인다) */
body.compact .predbox { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; align-items: center; margin-top: 4px; }
body.compact .predbox .pred { margin: 0; }
body.compact .predbox .pq { display: none; }
body.compact .predbox .seg { margin: 0; }
body.compact .predbox .msg { grid-column: 1 / -1; margin: 0; }
/* 두 곳 이상 부딪친 뒤: 결과 문장(가장 작았던 곳, 내 예측 ✓)이 예측 단추 자리를 쓴다. 판(그래프)의 높이가 줄지 않게. 상자 없이 글 */
body.compact .predbox.done .pred, body.compact .predbox.done .seg { display: none; }
body.compact .predbox.done .msg { min-height: 36px; display: flex; align-items: center; font-size: 13.5px; line-height: 1.3; }
body.compact .panel.cush { grid-area: cush; margin: 0; padding: 0; }
body.compact .panel.cush .grp { margin: 0 0 2px; font-size: 13px; line-height: 1.25; }
body.compact .panel.cush .seg { margin: 0; }
body.compact .stage.act { grid-area: act; margin: 0; }
body.compact .stage.act .btns { margin: 0; flex-wrap: nowrap; }
body.compact .stage.act .btns > span { flex: 1 1 0; min-width: 0; font-size: 13px; line-height: 1.25; }
body.compact .inforow { display: none; }
body.compact .switch { grid-area: switch; display: flex; }
body.compact #app button { font-size: 14px !important; line-height: 1.15; padding: 3px 6px; }
body.compact #app .switch button { flex: 1 1 0; min-width: 0; margin: 0 !important; padding: 2px 3px; }
body.compact #app .switch button.infobtn { flex: 0 0 44px; font-size: 18px !important; }
body.compact .stage.res, body.compact .stage.mres, body.compact .panel.spanel, body.compact .panel.mpanel {
  display: flow-root; margin: 0; min-height: 0; overflow: hidden; align-self: start; }
/* ↑ flow-root: 가로 compact에서 사파리(WebKit)가 판 안의 표를 판의 바깥 너비로 그려 오른쪽이 잘리던 것을 막는다 */
body.compact .paneprobe { display: block; visibility: hidden; pointer-events: none; min-height: 0; align-self: stretch; }
/* 충격량: 장면·표·조건은 판 자리 전체, 그래프는 설명(cap) 아래 */
body.compact.partS .glowscript-canvas-wrapper, body.compact.partS .stage.res, body.compact.partS .panel.spanel,
body.compact.partS .paneprobe { grid-column: main; grid-row: cap-start / main-end; }
body.compact.partS .stage.gcap { grid-area: cap; margin: 0; }
body.compact.partS .glowscript-graph { grid-area: main; margin: 0; }
body.compact.partS:not(.pv-scene) .glowscript-canvas-wrapper,
body.compact.partS:not(.pv-graph) .stage.gcap, body.compact.partS:not(.pv-graph) .glowscript-graph,
body.compact.partS:not(.pv-table) .stage.res, body.compact.partS:not(.pv-cond) .panel.spanel { display: none !important; }
/* 운동량: 장면 판은 3D + 결과 문장(표는 '결과' 판) */
body.compact.partM .glowscript-canvas-wrapper, body.compact.partM .paneprobe { grid-area: main; }
body.compact.partM .stage.mres, body.compact.partM .panel.mpanel { grid-column: main; grid-row: main-start / msg-end; }
body.compact.partM.pv-scene .stage.mres { grid-area: msg; padding: 0 2px; }
body.compact.partM.pv-scene .stage.mres .out { display: none; }
body.compact.partM:not(.pv-scene) .glowscript-canvas-wrapper,
body.compact.partM.pv-cond .stage.mres, body.compact.partM:not(.pv-cond) .panel.mpanel { display: none !important; }
/* 가로 compact에서 오른쪽 칸이 넘칠 때 (sim.py layout()이 tight를 붙인다): 글자만 줄이고 누르는 크기는 36px을 지킨다 */
body.compact.tight .tabs { margin-bottom: 0; }
body.compact.tight #app button { min-height: 36px; }
body.compact.tight .hdr .q { font-size: 14px; line-height: 1.25; }

/* 작은 3D: 안내 글은 빼고 '처음 시점' 단추는 아이콘만 */
body.small-view .camhint { display: none; }
body.small-view #app button.camreset { min-width: var(--btn-h); padding: 0 8px; }
body.small-view #app button.camreset .lb { display: none; }

/* ── 조작판 ── */
body.wide .hdr .title { display: none; }
.hdr .title { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.predbox { margin-top: 6px; }
.predbox .msg { margin-top: 4px; min-height: 0; }
/* 탐구 질문: '탐구 질문' 라벨과 노란 상자 없이 화면에서 가장 큰 글자 */
.hdr .q { font-size: 18px; font-weight: 750; line-height: 1.32; margin: 2px 0 0; }
/* 실험 탭: 글자 탭, 고른 탭은 공용 .k-on (굵은 글자 + 칸 아래 3px 막대). '심화'는 괄호 속 보조 글자 */
.tabs { display: flex; gap: 0 14px; margin: 0 0 4px; }
#app .tabs button { flex: 0 1 auto; border: 0 !important; background: none !important; border-radius: 0; padding: 0 4px; color: var(--k-sub) !important; font-weight: 600; margin: 0 !important; min-width: 32px; }
#app .tabs button.k-on { color: var(--k-ink) !important; font-weight: 750; }
@media (hover: hover) { #app .tabs button:not(.k-on):hover { color: var(--k-ink) !important; } }
.hib { font-weight: 600; color: var(--k-sub); font-size: max(12px, 0.9em); }
.hib::before { content: "("; }
.hib::after { content: ")"; }
html:lang(ja) .hib::before { content: "（"; }
html:lang(ja) .hib::after { content: "）"; }
/* 판: 상자 없이 종이 위 (넓은 화면은 판 사이에만 구역 선) */
.panel { padding: 0; }
.gcap { font-size: 13px; line-height: 1.35; color: var(--k-sub); }
.gcap b { color: var(--k-ink); }
.res .msg { margin-top: 2px; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 14px; }
.grp { font-weight: 700; font-size: 14px; color: var(--k-ink-2); margin: 2px 0 2px; }
.row { margin: 2px 0 0; font-size: 14px; display: flex; align-items: center; gap: 4px; }
.row > span:first-child { flex: none; white-space: nowrap; }
.row > .ui-slider { flex: 1 1 auto; min-width: 80px; }
.pair .row { display: block; }
/* 읽음값: tabular 숫자, 숫자는 그 물리량의 색(--q), 단위는 같은 줄 */
.rv { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rv b { font-weight: 800; color: var(--q, var(--k-ink)); }
.btns { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 2px; }
.btns button { margin: 0 !important; }
.btns > span { align-self: center; font-size: 13px; color: var(--k-sub); margin-left: 4px; }
/* 세그먼트(예측·부딪치는 곳): 모양은 공용 .k-seg. 여기서는 배치만. GlowScript가 단추 사이에 넣는 빈칸 글은 감춘다 */
.seg { display: flex; margin: 2px 0; }
.seg.k-seg { display: flex; }
#app .seg button { flex: 1 1 0; min-width: 0; margin: 0 !important; padding: 4px 4px !important; white-space: normal; line-height: 1.15; }
.pred { font-size: 14px; margin: 2px 0 4px; }
.pred b { font-weight: 800; margin-right: 4px; }
.out { font-size: 14px; margin-top: 2px; }
.msg { font-size: 14px; margin-top: 2px; }
.panel .msg { min-height: 0; margin-top: 2px; }
.mine { font-weight: 700; }
.mk { font-weight: 800; color: var(--k-ink); }
.note { font-size: 13px; line-height: 1.4; color: var(--k-sub); margin-top: 2px; }
.note b { color: var(--k-ink); }
.foot { font-size: 13px; line-height: 1.4; color: var(--k-sub); padding: 4px 0 0; }
/* 표: 머리줄 아래 선 하나, 줄 사이 옅은 선 */
table.tbl { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.tbl th, table.tbl td { border-bottom: 1px solid var(--k-rule); padding: 1px 4px; text-align: right; font-size: 14px; line-height: 1.45; white-space: nowrap; }
table.tbl th:first-child, table.tbl td:first-child { text-align: left; }
table.tbl th { color: var(--k-sub); font-weight: 600; font-size: 12.5px; white-space: normal; vertical-align: bottom; border-bottom: 1.5px solid var(--k-ink-2); }
table.tbl th .thu { font-weight: 500; white-space: nowrap; }
/* 쿠션 이름 앞 짧은 선 = 힘-시간 그래프의 그 쿠션 선 (범례) */
.sw { display: inline-block; width: 16px; height: 0; border-top: 3px solid; vertical-align: middle; margin-right: 5px; }
/* 글 속 낱말 = 장면의 범례: 공용 .k-w에 대상 색 */
.w-car { --w: var(--c-car); }
.w-b { --w: var(--c-b); }
.w-sum { --w: var(--c-sum); }

/* ── GlowScript 단추: 보조는 회색 테두리, 주 동작은 잉크 칠 (style 속성을 덮는다) ── */
#app button, .infocard button {
  min-height: var(--btn-h);
  padding: 4px 12px;
  border: 1.5px solid var(--k-ctl);
  border-radius: var(--k-r);
  background: var(--k-paper) !important;
  color: var(--k-ink) !important;
  font: inherit;
  font-size: 15px !important;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  text-wrap: balance;
}
#app button.primary { background: var(--k-ink) !important; border-color: var(--k-ink); color: var(--k-paper) !important; font-weight: 700; }
@media (hover: hover) {
  #app button:not(:disabled):not(.primary):not([aria-pressed="true"]):not([aria-selected="true"]):hover, .infocard button:hover { background: var(--k-wash) !important; }
  #app button.primary:not(:disabled):hover { background: #000 !important; }
}
#app button:disabled { cursor: default; opacity: 0.45; }
#app button:focus-visible, .infocard button:focus-visible, .ui-slider-handle:focus-visible { outline: 2px solid var(--k-ink); outline-offset: 2px; }
/* 세그먼트 칸: 공용 .k-seg의 칸 모양 (테두리는 바깥 하나, 칸 사이 선) */
#app .k-seg > button { border: 0; border-radius: 0; color: var(--k-ink-2) !important; }
#app .k-seg > button + button { border-left: 1px solid var(--k-rule); }
#app .k-seg > button[aria-pressed="true"], #app .k-seg > button[aria-selected="true"] { color: var(--k-ink) !important; font-weight: 750; }
#app .k-seg > button:focus-visible { outline-offset: -4px; }
/* 아이콘이 든 단추 */
#app button .ico { width: 1em; height: 1em; flex: none; fill: currentColor; vertical-align: -0.125em; margin-right: 5px; }

/* ── jQuery UI 슬라이더: 공용 .k-range와 같은 모양으로 그린다 ──
   회색 트랙 4px, 지나온 쪽(range) 진하게, 흰 원 손잡이. 손잡이 테두리 = 그 물리량의 색(--q, sim.py slider_row) */
.ui-slider { position: relative; touch-action: none; }
.ui-slider-horizontal {
  display: block !important;
  width: auto !important;
  height: 4px !important;
  margin: 18px 14px 18px 12px !important;
  background: var(--k-rule);
  border-radius: 0;
  cursor: pointer;
}
.ui-slider-horizontal::before { content: ""; position: absolute; left: -12px; right: -14px; top: -18px; bottom: -18px; }
.ui-slider .ui-slider-range { position: absolute; z-index: 1; display: block; border: 0; top: 0; left: 0; height: 100%; border-radius: 0; background: var(--k-ink-2) !important; }
.ui-slider .ui-slider-handle {
  position: absolute; z-index: 2; top: -9px; width: 22px; height: 22px; margin-left: -11px;
  border-radius: 50%; border: 3px solid var(--q, var(--k-ink)); background: var(--k-paper) !important; box-shadow: none;
  cursor: grab; touch-action: none;
}
.ui-slider-disabled { opacity: 0.45; cursor: default; }

/* 불러오기·오류 안내: 종이 위 글 */
.boot { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); background: var(--k-paper);
  padding: 14px 18px; font-size: 15px; color: var(--k-sub); max-width: 92vw; }
.boot.error { color: #9b1c1c; top: 10px; transform: translateX(-50%); border: 1.5px solid var(--k-ctl); }
.boot pre { white-space: pre-wrap; font-size: 13px; margin: 8px 0 0; color: var(--k-ink); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ── 아주 작은 창(320×200 등, body.mini): [왼쪽 판 하나 | 오른쪽 한 칸(이 칸만 안에서 스크롤)] ──
   sim.py set_mini()가 탭·질문·예측(hdr), 판 고르기, 부딪치는 곳, 단추 줄을 .minicol로 옮긴다 */
.minicol, .ph { display: none; }
body.mini .minicol { grid-area: col; display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
body.mini .minicol > * { flex: none; }
body.mini.compact.partS #app, body.mini.compact.partM #app { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "cap col" "main col"; padding: 4px 10px; gap: 4px 8px; }
body.mini .hdr .q { font-size: 13px; line-height: 1.3; }
body.mini .predbox { grid-template-columns: minmax(0, 1fr); }
body.mini .predbox .pred { margin-bottom: 2px; }
body.mini .switch { flex-wrap: wrap; }
body.mini .stage.act .btns { flex-wrap: wrap; }
body.mini .stage.act .btns > span { flex: 1 1 100%; }
body.mini.partS .glowscript-canvas-wrapper, body.mini.partS .stage.res, body.mini.partS .panel.spanel, body.mini.partS .paneprobe { grid-column: main; grid-row: cap-start / main-end; }
body.mini.partM .stage.mres, body.mini.partM .panel.mpanel { grid-column: main; grid-row: cap-start / main-end; }
body.mini.partM .glowscript-canvas-wrapper, body.mini.partM .paneprobe { grid-column: main; grid-row: cap-start / main-end; }
body.mini.partM.pv-scene .stage.mres { display: none !important; }   /* 결과 문장은 '결과' 판에서 */
body.mini .panel.spanel, body.mini .panel.mpanel, body.mini .stage.res, body.mini .stage.mres { overflow: auto; overscroll-behavior: contain; align-self: stretch; }
/* 좁은 오른쪽 칸: 세그먼트·판 고르기 칸은 낱말을 자르지 않고 다음 줄로 넘긴다 */
body.mini .minicol { font-size: 13px; }
body.mini .k-seg { flex-wrap: wrap; }
body.mini #app .seg button, body.mini #app .switch button { flex: 1 1 auto; min-width: 44px; white-space: nowrap; font-size: 13px !important; }
body.mini #app .tabs button { white-space: normal; font-size: 13px !important; }
body.mini .pair { grid-template-columns: minmax(0, 1fr); }
