/* 소음 제거 헤드폰: '종이 위 그림' (studio/DESIGN.md, 2026-10-17)
   - 틀(위 막대·판·단추·창)은 공용 묶음 _kit/paper.css의 토큰과 부품을 그대로 쓴다:
     .k-btn·.k-primary(단추), .k-seg·.k-on(고른 상태 = 굵은 글자 + 칸 아래 3px 막대), .k-range(슬라이더),
     .k-w(범례 낱말), .k-link(진행 지우기), .k-dark(어두운 그림 위 초점 링), [hidden] !important.
     이 파일에는 배치와 이 작품의 대상 색만 둔다.
   - 3D 장면은 흰 종이 위의 어두운 그림(#sceneBox)이다. 듣기·소음 고르기는 그림 아래 종이 위(#dock), 과제·계기·파형·손잡이는 오른쪽 판.
   - 같은 대상은 같은 색과 같은 선 모양: ① 소음(기계·스피커 A) 주황 실선, ② 반대 소리(스피커 B·청록 스피커) 청록 점선,
     ③ 귀·자리(① + ②) 잉크 굵은 실선(장면에서는 흰색), 귀덮개 보라, 조용한 자리 파랑, 큰 자리 호박(소리가 큰 곳 = 경고).
     3D(scene.js COL), 장면 꼬리표, 글 속 낱말(.k-w), 읽음값, 파형·진동수 그래프(scope.js)가 모두 따른다.
     -d는 어두운 장면 위, -p는 흰 종이 위(흰 바탕 대비 4.5:1 이상).
   - 반경: 단추·입력·세그먼트 var(--k-r), 판·그림·그래프·꼬리표·창 0, 슬라이더 손잡이만 원. */

:root {
  --scene: #0b1022;  /* 3D 그림 바탕·장면 꼬리표 바탕 */
  --noise-d: #ff8c42; --noise-p: #c2410c;
  --anti-d: #2fd3c4;  --anti-p: #0f766e;
  --ear-d: #f4f1e6;   --ear-p: #171717;
  --cup-d: #b996ff;   --cup-p: #6d28d9;
  --quiet-d: #6f9bff; --quiet-p: #1d4ed8;
  --loud-d: #ffd166;  --loud-p: #b45309;
  --ok-p: #237032;    --bad-p: #c92a2a;
  --hdr: 52px;
  --tap: 40px;        /* 누르는 것의 최소 높이(DESIGN.md '크기'). 낮은 화면은 36px */
  --side: clamp(340px, 40vw, 560px);
  font-family: var(--k-font);
  color: var(--k-ink);
  -webkit-text-size-adjust: 100%;
}
@media (max-height: 560px) { :root { --tap: 36px; } }
/* 좁은 가로 틀(크롬북 867×487, 830×466 등): 판을 조금 넓혀 과제 글의 줄 수를 줄인다(347px에서 381px로). 글이 '더 보기'로 접히던 틀이다(2026-11-14) */
@media (max-width: 1000px) and (min-aspect-ratio: 19/20) { :root { --side: clamp(340px, 44vw, 560px); } }
* { 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; 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, [tabindex]:focus-visible { outline: 2px solid var(--k-ink); outline-offset: 2px; }
canvas#c3d:focus-visible { outline-offset: -4px; outline-color: var(--k-paper); }
i { font-style: italic; font-family: "Times New Roman", Georgia, serif; font-size: 1.08em; }
sub { font-size: max(12px, 0.72em); }
.nw { white-space: nowrap; }

/* ── 범례 낱말(.k-w)의 대상 색과 선 모양 ── */
.k-w { white-space: nowrap; }
.k-w.nz { --w: var(--noise-p); }
.k-w.an { --w: var(--anti-p); text-decoration-style: dashed; }
.k-w.ea { --w: var(--ear-p); text-decoration-thickness: 3px; }
.k-w.cu { --w: var(--cup-p); }
.k-w.qu { --w: var(--quiet-p); }
.k-w.lo { --w: var(--loud-p); }

#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 .lb { flex: none; font-size: 15px; font-weight: 800; margin: 0 10px 0 4px; white-space: nowrap; }
#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); }
#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.nolb .lb { display: none; }
#stages.num button:not(.k-on) .t, #stages.num button:not(.k-on) .mk { display: none; }
#stages.min button .t { display: none; }
#starBox { flex: none; font-size: 14px; font-weight: 750; white-space: nowrap; font-variant-numeric: tabular-nums; padding: 0 6px; }
#starBox:empty { display: none; }
.snd { flex: none; height: var(--tap); padding: 0 12px 0 9px; gap: 6px; }
.snd[aria-pressed="true"] { box-shadow: inset 0 -3px 0 var(--anti-p); font-weight: 750; }
body.starting #bMenu { display: none; }
body.starting #ttl { margin: 0 6px 0 8px; }
@media (max-width: 400px) { #ttl { font-size: 15px; } }
body.starting #stages, body.starting #starBox { display: none; }
body.free #starBox { display: none; }

/* ── 본문 격자: 가로 화면은 그림(왼쪽)·판(오른쪽). 그림과 판의 요소는 한 격자에 놓인다 ── */
#main {
  flex: 1 1 auto; min-height: 0; display: grid; column-gap: 14px; row-gap: 8px; padding: 0 12px 10px;
  grid-template-columns: minmax(0, 1fr) var(--side);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "scene task" "scene head" "scene scope" "dock ctrls";
}
#app.nodock #main { grid-template-areas: "scene task" "scene head" "scene scope" "scene ctrls"; }
#sceneCol, #panel { display: contents; }
#sceneBox { grid-area: scene; position: relative; min-height: 0; min-width: 0; overflow: hidden; background: var(--scene); }
#c3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#dock { grid-area: dock; display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; min-width: 0; align-self: end; }
#dock:empty, #app.nodock #dock { display: none; }
#listenBox:empty, #freeBox:empty, #nzBox:empty { display: none; }
#freeBox { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
#task { grid-area: task; min-width: 0; }
#scHead { grid-area: head; }
#scopeBox { grid-area: scope; min-height: 0; min-width: 0; display: flex; flex-direction: column; }
#ctrls { grid-area: ctrls; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
#ctrls:empty { display: none; }
#vizSw { display: none !important; }
#app.port #vizSw { display: inline-flex !important; }
#app.port #viewSw { display: none !important; }

/* 그림 위: 처음 시점 단추(어두운 바탕, 회색 테두리) */
#btnReset { position: absolute; right: 8px; top: 8px; z-index: 3; background: var(--scene); color: #e8ecff; border: 1.5px solid var(--k-ctl); }
@media (hover: hover) { #btnReset:hover { background: #1b2036; } }

/* ── 과제(스토리 모드): 판 맨 위, 종이 위에 ── */
#task { padding: 2px 0 10px; border-bottom: 1px solid var(--k-rule); overflow: hidden; max-height: var(--taskMax, 52vh); display: flex; flex-direction: column; }
body.free #task { display: none; }
.tkHead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
#tkStep { font-size: 15px; font-weight: 800; color: var(--k-ink); }
#tkStep .no { color: var(--k-sub); font-weight: 700; margin-right: 8px; font-variant-numeric: tabular-nums; }
#tkDots { display: flex; gap: 5px; }
#tkDots i { width: 10px; height: 10px; display: block; box-shadow: inset 0 0 0 1.5px var(--k-ctl); }
#tkDots i.ok { background: var(--k-ink); box-shadow: none; }
#tkDots i.on { box-shadow: inset 0 0 0 2.5px var(--k-ink); }
#tkBody { min-height: 0; flex: 1 1 auto; overflow: hidden; }
#tkBody p { margin: 0; line-height: 1.45; font-size: 15px; }
#tkBody p + p { margin-top: 5px; }
#tkBody p.q { font-size: 17px; font-weight: 650; line-height: 1.42; }
#tkBody p.main { font-weight: 600; }
#tkBody p.fb b.ok { color: var(--ok-p); }
#tkBody p.fb b.no { color: var(--bad-p); }
#tkBody p.sub { color: var(--k-ink-2); font-size: 14px; }
#tkBody p.know { color: var(--k-ink-2); font-size: 14px; }
#tkActs .okmsg { margin-right: auto; font-size: 14px; font-weight: 800; color: var(--k-ink); }
#tkBody p.hint { color: var(--k-ink); font-size: 14px; font-weight: 650; }
#tkBody .pickChip { font-size: 14px; color: var(--k-sub); }
#tkBody .pickChip b { color: var(--k-ink); }
/* 예측 보기: 회색 테두리 단추(고른 것은 없이 바로 넘어간다) */
.opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.opt {
  display: flex; align-items: center; gap: 8px; min-height: var(--tap); text-align: left; border: 1.5px solid var(--k-ctl); border-radius: var(--k-r);
  background: var(--k-paper); color: var(--k-ink); padding: 6px 10px; font-weight: 650; font-size: 14.5px; line-height: 1.25;
}
.opt b { flex: none; font-weight: 800; }
@media (hover: hover) { .opt:hover { background: var(--k-wash); border-color: var(--k-ink); } }
/* 진행 표시(✓·○): 알약이 아닌 글자 줄 */
.pgs { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 6px; }
.pg { font-size: 14px; color: var(--k-sub); white-space: nowrap; }
.pg.on { color: var(--k-ink); font-weight: 750; }
#tkActs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; justify-content: flex-end; align-items: center; flex: 0 0 auto; }
#tkActs:empty { display: none; }
#tkActs .k-btn { height: var(--tap); }
#tkActs .stars { margin-right: auto; font-size: 20px; color: var(--k-ink); }
.tkHead .stars { margin-left: auto; font-size: 17px; color: var(--k-ink); white-space: nowrap; }
.tkHead .stars + .moreBtn, .tkHead .moreBtn + .stars { margin-left: 0; }
#tkActs .moreBtn, #tkActs .subBtn { margin-right: auto; min-width: 40px; }
#tkActs .subBtn + .moreBtn { margin-right: 0; }

/* ── 계기 줄: (휴대폰) 보기 전환, (진동수별 단계) 그래프 보기, 귀에 닿는 소리 ── */
#scHead { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: nowrap; }
#scHead .k-seg > button { min-height: var(--tap); padding: 2px 12px; }
#meter { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 2px; white-space: nowrap; }
#meter .mLab { color: var(--k-sub); font-size: 13px; line-height: 1.2; white-space: nowrap; }
#meter .mRow { display: flex; align-items: center; gap: 8px; justify-content: flex-end; min-width: 0; max-width: 100%; }
/* 막대: 각진 칸, 100 % 눈금. 귀(합)는 잉크, 아주 조용하면 파랑, 아주 크면 호박(경고) */
#meter .bar { position: relative; flex: 0 1 110px; min-width: 40px; height: 10px; box-shadow: inset 0 0 0 1.5px var(--k-ctl); }
#meter .bar::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1.5px; background: var(--k-sub); }
#meter .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ear-p); }
#meter .bar i.q { background: var(--quiet-p); }
#meter .bar i.l { background: var(--loud-p); }
#meter .mVal { font-variant-numeric: tabular-nums; color: var(--k-ink); font-size: 18px; font-weight: 800; }
#meter .db { color: var(--k-sub); font-weight: 650; font-size: 14px; margin-left: 6px; }
#scopeWrap { position: relative; flex: 1 1 auto; min-height: 0; background: var(--k-paper); }
#scope { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#scopeWrap.tiny canvas { visibility: hidden; }

/* ── 손잡이·켜고 끄기 ── */
#ctrls .row { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
#ctrls .row.sls { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 2px 14px; }
#ctrls.st1 .row.sls, #ctrls.one .row.sls { grid-template-columns: minmax(0, 1fr); }
.sl { min-width: 0; }
.sl label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; color: var(--k-sub); font-weight: 650; }
.sl label .nm { color: var(--k-ink); }
.sl output { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 15px; white-space: nowrap; color: var(--k-ink); }
.sl.anti output { color: var(--anti-p); }
.sl.anti .k-range { --q: var(--anti-p); }
.sl.locked { opacity: 0.45; }
.slRow { display: flex; align-items: center; gap: 4px; }
.slRow .k-range { flex: 1 1 auto; min-width: 0; }
.stp { flex: none; width: 40px; height: 40px; border: 1.5px solid var(--k-ctl); border-radius: var(--k-r); background: var(--k-paper); padding: 0; font-weight: 800; font-size: 17px; line-height: 1; display: grid; place-items: center; color: var(--k-ink); }
@media (hover: hover) { .stp:not(:disabled):hover { background: var(--k-wash); } }
@media (max-height: 560px) { .stp { width: 36px; height: 36px; } }
/* 켜고 끄기: 네모 칸에 ✓, 켠 것은 굵은 글자 + 아래 막대(대상 색) */
.tg { flex: none; height: var(--tap); padding: 0 12px 0 10px; gap: 8px; font-size: 14px; }
.tg .chk { width: 16px; height: 16px; border: 2px solid currentColor; border-radius: var(--k-r); display: inline-block; position: relative; flex: none; }
.tg[aria-pressed="true"] { font-weight: 750; box-shadow: inset 0 -3px 0 var(--k-on, var(--k-ink)); }
.tg[aria-pressed="true"] .chk { background: var(--k-ink); border-color: var(--k-ink); }
.tg[aria-pressed="true"] .chk::after { content: ""; position: absolute; left: 3.5px; top: 0; width: 5px; height: 9px; border: solid var(--k-paper); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.tg[data-k="anc"], .tg[data-k="anti"], .tg[data-k="spkB"] { --k-on: var(--anti-p); }
.tg[data-k="cup"] { --k-on: var(--cup-p); }
.tg[data-k="spkA"] { --k-on: var(--noise-p); }
/* 소음 고르기·듣기·미션 배치: 공용 세그먼트(고른 칸 = 굵은 글자 + 막대) */
.k-seg > button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); white-space: nowrap; min-width: 40px; }
.k-seg .lab { display: flex; align-items: center; padding: 0 8px 0 10px; font-size: 14px; color: var(--k-sub); font-weight: 650; background: var(--k-paper); }
.k-seg .lab + button { border-left: 1px solid var(--k-rule); }
#nzBox > button, .nzIn > button { --k-on: var(--noise-p); }
#app.nzIcons #nzBox .nz span, .nzIn .nz span { display: none; }
.nz svg { flex: none; }

/* ── 그림 위 읽음값: 장면 꼬리표처럼 어두운 불투명 바탕, 반경 0 ── */
#readout {
  position: absolute; left: 8px; top: 8px; z-index: 2; display: flex; flex-direction: column; gap: 1px;
  background: var(--scene); color: #e8ecff; padding: 5px 10px; font-size: 14px; line-height: 1.45;
  pointer-events: none; font-variant-numeric: tabular-nums; white-space: nowrap; max-width: calc(100% - 64px); overflow: hidden;
}
#readout svg { vertical-align: -3px; color: var(--noise-d); }
#readout b.cA { color: var(--anti-d); }
#readout b.cN { color: var(--noise-d); }
#readout b.cE { color: var(--ear-d); }
#readout .slow, #readout .lam { color: #b9c0cf; font-size: 13px; font-family: var(--k-font); font-weight: 600; }
#readout .legend { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #b9c0cf; font-family: var(--k-font); }
#readout .legend svg { display: block; color: inherit; }
#readout sub { font-size: 12px; vertical-align: -0.2em; line-height: 1; }
#app.st2 #readout, #app.st3 #readout { top: auto; bottom: 8px; }
#app.short #readout .slow, #app.port #readout .slow { display: none; }

/* 장면 꼬리표: 반경 0, 장면색 바탕, 테두리 없이 글자색과 밑줄 모양으로 대상을 가른다 */
#labels { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
#labels .lb { position: absolute; left: 0; top: 0; width: 0; height: 0; }
#labels .lb::before { content: ""; position: absolute; left: -3.5px; top: -3.5px; width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--scene); }
#labels .lb.nodot::before { display: none; }
#labels .lb em {
  position: absolute; font-style: normal; white-space: nowrap; font-size: 13px; line-height: 1; font-weight: 700; color: #e8ecff;
  background: var(--scene); padding: 4px 7px 5px; text-decoration-thickness: 1.6px; text-underline-offset: 3px;
}
#labels .lb.cN em { color: var(--noise-d); text-decoration-line: underline; }
#labels .lb.cA em { color: var(--anti-d); text-decoration-line: underline; text-decoration-style: dashed; }
#labels .lb.cE em { color: var(--ear-d); text-decoration-line: underline; text-decoration-thickness: 2.5px; }
#labels .lb.dist em, #labels .lb.pin em { font-size: 12px; padding: 3px 6px 4px; }
#labels .lb.pin.quiet em { color: var(--quiet-d); }
#labels .lb.pin.loud em { color: var(--loud-d); }

/* 알림: 흰 종이, 반경 0, 그림자 없음 */
#toast {
  position: fixed; left: 50%; top: calc(var(--hdr) + 6px); transform: translate(-50%, -8px); z-index: 40; background: var(--k-paper);
  border: 1.5px solid var(--k-ink); padding: 8px 14px; font-weight: 650; font-size: 14px; max-width: min(92vw, 520px); text-align: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ── 가운데 창(정보·메뉴·더 보기·정리): 흰 종이, 반경 0, 그림자 없음. 뒤만 어둡게 ── */
#modal { position: fixed; inset: 0; z-index: 50; background: var(--k-dim); display: grid; place-items: center; padding: 12px; }
.card { width: min(620px, 100%); max-height: 100%; display: flex; flex-direction: column; background: var(--k-paper); color: var(--k-ink); overflow: hidden; }
.cardBody { padding: 20px 22px 6px; overflow: auto; min-height: 0; position: relative; -webkit-user-select: text; user-select: text; }
.cardActs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; justify-content: flex-end; padding: 12px 22px 18px; flex: 0 0 auto; }
.cardActs .k-btn { height: var(--tap); }
.cardActs .k-link { margin-right: auto; }
.card h2 { margin: 0 0 10px; font-size: 21px; font-weight: 750; line-height: 1.38; }
.card p { line-height: 1.6; margin: 8px 0; font-size: 15px; }
.card .small { color: var(--k-sub); font-size: 13.5px; }
.card ul { padding-left: 18px; margin: 4px 0; }
.card li { line-height: 1.55; margin: 6px 0; font-size: 14.5px; }
.card dl { margin: 0; }
.card dt { font-weight: 800; margin-top: 10px; }
.card dd { margin: 2px 0 0; line-height: 1.5; font-size: 14.5px; }
/* ⓘ 창 탭: 공용 세그먼트 */
.tabs { display: flex; margin: -4px 0 12px; position: sticky; top: -20px; padding-top: 4px; background: var(--k-paper); z-index: 2; width: fit-content; max-width: 100%; flex-wrap: wrap; }
/* 생활 속 사례: 카드 대신 줄로 나눈 목록 */
.cases { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 20px; }
.case { border-top: 1px solid var(--k-rule); padding: 10px 0 8px; }
.case b { font-size: 15px; }
.case p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; }
.moreBody .opts { margin-top: 12px; }
.moreBody p { margin: 6px 0; }
/* 단계·장면 목록(지금 것 = 공용 .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; }

/* ── 시작 화면(_kit/start.js의 startSheet): 판 자리에 놓인다. 장면은 그대로 보인다 ── */
#panel > .k-start { grid-column: 2; grid-row: 1 / -1; height: 100%; min-height: 0; padding: 6px 4px 8px 6px; }
body.starting #task, body.starting #scHead, body.starting #scopeBox, body.starting #ctrls, body.starting #dock { display: none !important; }
body.starting #main { grid-template-areas: "scene sheet" "scene sheet" "scene sheet" "scene sheet"; }
.k-start.x-tiny { gap: 6px; }
.k-start.x-tiny .k-q { font-size: 14px; line-height: 1.25; }

/* ── 세로 화면(휴대폰): 그림(또는 파형) / 조작판 / 계기 / 손잡이 / 과제 ── */
#app.port #main, #app.port.nodock #main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto auto; grid-template-areas: "viz" "head" "ctrls" "task"; row-gap: 6px; padding: 0 10px 8px; }
/* 휴대폰: 듣기·자유 모드 켜고 끄기는 그림 왼쪽 아래에 얹는다(종이색 세그먼트, 줄을 하나 아낀다). 방 장면은 읽음값이 아래라 왼쪽 위 */
#app.port #dock { grid-area: viz; align-self: end; justify-self: start; z-index: 4; margin: 0 0 6px 6px; flex-wrap: nowrap; gap: 6px; }
#app.port.st2 #dock, #app.port.st3 #dock { align-self: start; margin: 6px 0 0 6px; }
#app.port.pvScope #dock { visibility: hidden; }
#app.port #dock .k-seg .lab { display: none; }
#app.port #dock .k-seg .lab + button { border-left: 0; }
@media (max-width: 400px) { #app.port .nzIn .nz { min-width: 36px; padding: 2px 6px; } #app.port .tg { padding: 0 9px 0 8px; gap: 6px; } }
#app.port #sceneBox, #app.port #scopeBox { grid-area: viz; }
#app.port.pvScope #sceneBox { visibility: hidden; }
#app.port:not(.pvScope) #scopeBox { visibility: hidden; }
#app.port #task { padding: 8px 0 0; border-bottom: 0; border-top: 1px solid var(--k-rule); }
#app.port #tkBody p { font-size: 14px; line-height: 1.42; }
#app.port #tkBody p.q { font-size: 15px; }
#app.port .opts { gap: 6px; margin-top: 8px; }
#app.port .opt { gap: 5px; padding: 4px 7px; font-size: 13.5px; }
#app.port #ctrls .row.sls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; }
#app.port #ctrls.st1 .row.sls, #app.port #ctrls.one .row.sls { grid-template-columns: minmax(0, 1fr); }
#app.port #ctrls { gap: 4px; }
#app.port .sl label { font-size: 13px; }
#app.port .sl output { font-size: 14px; }
#app.port #readout { font-size: 13px; padding: 3px 8px; left: 6px; top: 6px; }
#app.port.st2 #readout, #app.port.st3 #readout { top: auto; bottom: 6px; }
#app.port #btnReset { right: 6px; top: 6px; }
#app.port #meter .bar { flex-basis: 60px; min-width: 30px; }
#app.port #meter .mVal { font-size: 16px; }
#app.port #dock { gap: 6px; } /* 세로 위치는 위 규칙(그림 왼쪽 아래, 방 장면은 왼쪽 위). 가운데로 두면 부품 이름표와 겹쳤다(2026-10-24) */
body.starting #app.port #main { grid-template-rows: minmax(0, 1fr) minmax(0, 2.4fr); grid-template-areas: "viz" "sheet"; }
body.starting #app.port #panel > .k-start { grid-column: 1; grid-row: 2; padding: 10px 2px 4px; }
body.starting #app.port #scopeBox { display: none; }
@media (max-height: 520px) and (max-aspect-ratio: 95/100) { body.starting #app.port #main { grid-template-rows: minmax(0, 1fr) minmax(0, 2.9fr); } }

/* ── 좁은·낮은 화면 ── */
#app.compact #ctrls .row.sls { gap: 2px 10px; }
#app.narrow .snd .tx { display: none; }
#app.narrow .snd { padding: 0 9px; }
#app.narrow #starBox { padding: 0 2px; font-size: 13px; }
#app.narrowSide #meter .bar { flex-basis: 56px; min-width: 30px; }
#app.short { --hdr: 44px; --side: min(50vw, 420px); }
#app.short #main { row-gap: 5px; column-gap: 10px; padding: 0 8px 6px; }
#app.short #task { padding: 0 0 6px; }
#app.short .tkHead { display: none; }
#app.short #tkBody p { font-size: 13.5px; line-height: 1.38; }
#app.short #tkBody p.q { font-size: 14px; }
#app.short #tkActs { margin-top: 4px; }
#app.short #tkActs .stars { display: none; } /* 낮은 가로 화면: 별은 위 막대(★ n/12)에서 본다 */
#app.short .opts { gap: 4px; margin-top: 4px; }
#app.short .opt { gap: 4px; font-size: 13px; padding: 2px 6px; }
#app.short .pgs { margin-top: 3px; }
#app.short .pg { font-size: 13px; }
#app.short #readout { font-size: 12.5px; padding: 2px 7px; left: 6px; top: 6px; }
#app.short.st2 #readout, #app.short.st3 #readout { top: auto; bottom: 6px; }
#app.short #meter .mLab { font-size: 12px; }
#app.short #meter .mVal { font-size: 15px; }
#app.short #scopeWrap { min-height: 62px; }
#app.short #scopeBox { min-height: 62px; }
/* 키 낮은 가로 화면: 손잡이·조작판은 그림 아래, 오른쪽은 과제·계기·그래프 */
#app.short #main, #app.short.nodock #main { grid-template-rows: auto auto minmax(0, 1fr) auto; grid-template-areas: "scene task" "scene head" "scene scope" "ctrls scope"; }
/* 조작판 줄이 오른쪽 칸과 같은 격자 줄을 쓰면 그래프가 조작판 높이(95px)보다 낮아질 수 없어, 자리가 남아도 과제 글이 한 줄로 줄었다(750×280, 2026-11-16).
   조작판은 그림 칸 아래쪽에 얹고 그림은 그만큼 위에서 끝낸다. 오른쪽 칸의 높이는 과제 글과 그래프만 나눈다(--ctrlsH는 main.js syncCtrlsH) */
#app.land.short:not(.micro) #main, #app.land.short:not(.micro).nodock #main { grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "scene task" "scene head" "scene scope"; }
#app.land.short:not(.micro) #sceneBox { margin-bottom: var(--ctrlsH, 0px); }
#app.land.short:not(.micro) #ctrls { grid-area: scene; align-self: end; }
/* 낮은 가로 화면: 듣기·소음 고르기는 그림 오른쪽 아래에 얹는다(종이색 세그먼트, 그림 높이를 지킨다). 손잡이는 한 줄로 */
#app.short #dock { grid-area: scene; align-self: end; justify-self: end; z-index: 4; margin: 0 6px 6px 0; flex-wrap: nowrap; gap: 6px; }
#app.short #ctrls { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 4px 10px; }
#app.short #ctrls .row.sls { flex: 1 1 260px; }
#app.short #dock .k-seg .lab { display: none; }
#app.short #dock .k-seg .lab + button { border-left: 0; }
/* 방 장면(3·4단계)은 읽음값이 왼쪽 아래에 있으므로 조작판을 왼쪽 위에 얹는다 */
#app.short.st2 #dock, #app.short.st3 #dock { align-self: start; justify-self: start; margin: 6px 0 0 6px; }
#app.land.short:not(.micro):not(.st2):not(.st3) #dock { margin-bottom: calc(var(--ctrlsH, 0px) + 6px); }
#app.short .sl label { font-size: 12.5px; }
#app.short .sl output { font-size: 13px; }
#app.short .stp { width: 36px; height: 36px; }
/* 아주 작은 틀(320×200 등): 왼쪽은 그림, 오른쪽 칸(과제·계기·손잡이)은 통째로 안에서 스크롤한다(사이트 틀 크기에서는 쓰이지 않는다) */
#app.micro #scopeBox, #app.micro #dock { display: none !important; }
/* 320×200: 그림 칸이 좁아 읽음값이 잘리므로 숨긴다(같은 값은 오른쪽 칸의 조절 값과 결과 글에 있다) */
#app.micro #readout { display: none; }
#app.micro.micro.micro #main { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); grid-template-rows: minmax(0, 1fr); grid-template-areas: "scene side"; }
#app.micro #panel { display: flex; flex-direction: column; gap: 6px; grid-area: side; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
#app.micro #task { max-height: none; overflow: visible; flex: none; }
#app.micro #tkBody { overflow: visible; }
#app.micro #ctrls { flex-direction: column; }
#app.micro #ctrls .row.sls { grid-template-columns: minmax(0, 1fr); }
#app.micro .opts { grid-template-columns: minmax(0, 1fr); }
body.starting #app.micro #panel { overflow: hidden; }
#app.micro .k-seg .lab { display: none; }
#app.micro .k-seg .lab + button { border-left: 0; }
body.starting #app.micro #panel > .k-start { flex: 1; padding: 2px 6px 4px; }
body.starting #app.micro #ttl { display: none; }
body.starting #app.micro #top { display: none; } /* 320×200: 시작 화면이 틀 전체를 쓴다 */
#app.micro #scHead .k-seg { display: none !important; }
#app.micro #tkActs:empty { display: none; }
#app.port .card .cardBody, #app.short .card .cardBody { padding: 14px 16px 4px; }
#app.port .card p, #app.short .card p { font-size: 14px; line-height: 1.5; margin: 6px 0; }
#app.port .cardActs, #app.short .cardActs { padding: 8px 16px 12px; }
#app.short .card h2 { font-size: 17px; }
#app.short .stList > button { min-height: 36px; padding: 2px 4px; font-size: 14.5px; }
#app.short .card h2 { margin-bottom: 4px; }
#app.micro #modal { padding: 4px; }
/* 과제 카드 접기 단계 */
#task.c1 .pickChip { display: none; }
/* 넓은 가로 틀에서 글이 길 때(main.js fitTask): 문장을 접기 전에 글자를 한 단계씩. t2는 낮은 가로 틀(#app.short)과 같은 크기 */
#task.t1 #tkBody p { font-size: 14px; line-height: 1.42; }
#task.t1 #tkBody p.q { font-size: 15.5px; line-height: 1.4; }
#task.t1 #tkBody p.sub, #task.t1 #tkBody p.know, #task.t1 #tkBody p.hint, #task.t1 #tkBody .pickChip { font-size: 13.5px; }
#task.t1 #tkActs { margin-top: 6px; }
#task.t2 #tkBody p { font-size: 13.5px; line-height: 1.38; }
#task.t2 #tkBody p.q { font-size: 14.5px; line-height: 1.38; }
#task.t2 #tkBody p.sub, #task.t2 #tkBody p.know, #task.t2 #tkBody p.hint, #task.t2 #tkBody .pickChip { font-size: 13px; }
#task.t2 #tkBody p + p { margin-top: 3px; }
#task.t2 #tkActs { margin-top: 4px; }
#task.t2 .tkHead { margin-bottom: 2px; }
#task.nh .tkHead { display: none; }
/* 그래도 넘치면 힌트·정리 줄은 '더 보기' 창에서만 */
#task.c5 p.hint, #task.c5 p.sub, #task.c5 p.know, #task.c5 .pgs { display: none; }
/* 예측을 고르는 동안 휴대폰·낮은 가로 화면은 조작판을 접는다(보기를 고른 뒤 다시 편다). 질문과 보기가 잘리지 않게 */
#app.asking.port #ctrls, #app.asking.short #ctrls, #app.asking.askFold #ctrls { display: none; }
.tkHead .moreBtn { margin-left: auto; min-height: 36px; min-width: 40px; }
@media (max-width: 360px) { #starBox { display: none; } }
body.starting #app.micro #sceneBox { display: none; }
body.starting #app.micro.micro.micro #main { grid-template-columns: minmax(0, 1fr); grid-template-areas: "side"; }
#task.split:not(.showSub) p.sub { display: none; }
#task.split.showSub p.fb, #task.split.showSub .pickChip { display: none; }
#task.split.showSub p.sub { color: var(--k-ink); font-size: 14px; line-height: 1.42; }
#task.split.showSub .stars { display: none !important; }
#task.noOpts .opts { display: none; }

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