/* 초음파 진단: '종이 위 그림' (studio/DESIGN.md, 2026-10-17)
   - 틀(위 막대·판·단추·창)은 공용 묶음 kit/paper.css(빌드가 studio/_kit에서 복사)의 토큰과 부품을 그대로 쓴다:
     .k-btn·.k-primary(단추), .k-seg·.k-on(고른 상태), .k-range(슬라이더), .k-w(범례 낱말), .k-link(진행 지우기),
     .k-dark(어두운 그림 위 초점 링), [hidden] !important. 이 파일에는 배치와 이 작품의 대상 색만 둔다.
   - 어두운 그림은 둘이다: 3D 장면(#fig)과 기계 화면(#monBody: 메아리 그래프·단면 영상). 1단계 기록표는 종이 위 표다.
   - 같은 대상은 같은 색(어두운 그림 위 / 종이 위): 펄스·메아리 = 청록, 손잡이·파장 자·되돌아오는 메아리 = 흰색(호박은 경고에만), 경계·균열 = 빨강,
     찾아 표시한 것 = 초록. 3D 이름표, 글 속 범례 낱말, 그래프·영상의 표시가 같은 색을 쓴다. 맞힘 ✓ 초록, 틀림 ✗ 빨강.
   - 반경: 단추·입력·세그먼트 var(--k-r), 판·그림·꼬리표·창 0, 손잡이·점만 원. */
:root {
  --wave-d: #8fe6ff; --wave-p: #0b7285;
  --hand-d: #ffffff; --hand-p: #343a40;
  --bd-d: #ff8a8a;   --bd-p: #c92a2a;
  --ok-d: #6ff0b6;   --ok-p: #237032;
  --bad-p: #c92a2a;
  --scene: #0a0f18;
  --hdr: 52px;
  --sideW: clamp(300px, 38%, 470px);
  --monH: 42%;
  --tap: 40px;
  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; color: var(--k-ink); font-family: var(--k-font); background: var(--k-paper);
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
/* 줄바꿈은 낱말 경계에서만: 한국어는 어절, 영어는 단어(하이픈 분철 없음), 일본어는 구절(크롬)과 금칙.
   화면을 넘칠 만큼 긴 낱말만 끊는다. 가운뎃점·괄호·숫자 단위는 i18n.js의 wrapText·keepWords가 맡는다 */
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; }
sub, sup { line-height: 0; }
.k-w.wave { --w: var(--wave-p); }
.k-w.hand { --w: var(--hand-p); }
.k-w.bd { --w: var(--bd-p); }

#app {
  position: fixed; inset: 0; display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sideW);
  grid-template-rows: var(--hdr) minmax(0, 1fr);
  grid-template-areas: "top top" "view side";
  background: var(--k-paper);
}
#app > * { min-width: 0; min-height: 0; }
/* 시작 화면: 판 자리(데스크톱 오른쪽) */
body.starting #side { display: none !important; }
body.starting #app { grid-template-areas: "top top" "view start"; }
#app > .k-start { grid-area: start; min-height: 0; padding: 14px 14px 12px 6px; }
.k-start.x-tiny { gap: 6px; }
.k-start.x-tiny .k-q { font-size: 14px; line-height: 1.25; }
body.thumb #app > :not(#view) { 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; }
body.thumb #sceneTools, body.thumb #fine, body.thumb #labels { display: none !important; }

/* ── 위 막대 ── */
#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); }
body.starting #chap { font-size: 17px; }
body.starting #chName { font-weight: 800; color: var(--k-ink); }
body.starting #btnMenu { visibility: hidden; }
body.starting #tabs { display: none; }
html.phone body:not(.starting) #chName, html.micro body:not(.starting) #chName { display: none; }
#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; }
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 그림 ── */
#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; }
/* 장면 이름표: 반경 0, 장면과 같은 불투명 바탕, 글자색으로 대상을 가른다 */
.lbl { position: absolute; left: 0; top: 0; padding: 2px 7px 3px; background: var(--scene); white-space: nowrap; line-height: 1.25; font-size: 13px; font-weight: 700; color: #eef3ff; }
.lbl small { display: block; font-size: 12px; font-weight: 600; color: #b4c0d6; }
.lbl.hot { color: var(--hand-d); }
.lbl.cy { color: var(--wave-d); }
.lbl.red { color: var(--bd-d); }
html.compact .lbl, html.short .lbl { font-size: 12px; padding: 1px 6px 2px; }
html.compact .lbl small, html.short .lbl small { display: none; }
#sceneTools { position: absolute; left: 8px; top: 8px; right: 8px; z-index: 3; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
#sceneTools > * { pointer-events: auto; }
#sceneTools .k-btn { height: var(--tap); }
#sceneTools .k-btn.ico, #fine .k-btn.ico { width: var(--tap); padding: 0; }
#fine { position: absolute; right: 8px; bottom: 8px; z-index: 3; display: flex; gap: 6px; }
#fine .k-btn { height: var(--tap); touch-action: none; }
#noGL { position: absolute; inset: 0; display: grid; place-items: center; color: #e6edf8; font-size: 14px; text-align: center; padding: 20px; }
#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: 600; line-height: 1.45;
  width: max-content; max-width: min(calc(100% - 24px), 520px); text-align: center; transition: opacity 0.2s, transform 0.2s;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ── 오른쪽(아래) 판: 미션, 기계 화면 ── */
#side { grid-area: side; display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; padding: 4px 14px 12px 4px; }
#mission { flex: none; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
#mHead { display: flex; align-items: center; gap: 8px; min-width: 0; }
#mDots { display: 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; }
#mGoal { font-size: 15px; font-weight: 800; line-height: 1.3; min-width: 0; }
#mText { margin: 0; font-size: 14px; line-height: 1.5; }
#mText:empty { display: none; }
#mText .warn { font-weight: 700; }
.pr { font-weight: 800; }
.pr.ok { color: var(--ok-p); }
.pr.no { color: var(--bad-p); }
#mActs { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
#mActs:empty { display: none; }
#mActs .k-btn { height: var(--tap); }
html.free #mHead { display: none; }

/* 기계 화면: 머리(제목·읽음값, 종이 위) + 어두운 화면 + 조작(종이 위) */
#monitor { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
#monHead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 8px; min-width: 0; }
#monTitle { font-size: 13.5px; font-weight: 800; min-width: 0; } /* 말줄임 대신 줄을 바꾼다 */
#monRead { font-size: 13.5px; font-weight: 750; white-space: nowrap; font-variant-numeric: tabular-nums; }
#monBody { flex: 1 1 auto; min-height: 0; position: relative; display: flex; flex-direction: column; gap: 6px; background: var(--scene); }
#monBody.tbl { background: var(--k-paper); }
#monBody canvas { display: block; width: 100%; flex: 1 1 0; min-height: 0; touch-action: none; }
#gA { cursor: ew-resize; }
#gB { cursor: crosshair; }
#monCtl { flex: none; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
#monCtl:empty { display: none; }
#monCtl .k-btn { height: var(--tap); }
.slider { flex: 1 1 160px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.slider label { font-size: 13.5px; font-weight: 750; white-space: nowrap; }
.slider input { flex: 1 1 auto; min-width: 60px; }

/* 1단계 기록표(종이 위): 머리 칸이 경계 고르기 단추 */
#tbl { flex: 1 1 auto; display: grid; grid-template-columns: auto repeat(5, minmax(0, 1fr)); grid-auto-rows: minmax(0, auto); gap: 0 4px; align-content: start; font-size: 13px; }
#tbl .rh { font-weight: 750; color: var(--k-sub); font-size: 12.5px; line-height: 1.2; align-self: center; padding-right: 4px; max-width: 5.2em; min-width: min-content; }
#tbl .kb { min-height: 40px; min-width: 0; padding: 4px 0; overflow-wrap: normal; font-size: 12.5px; line-height: 1.15; margin-bottom: 6px; }
html:lang(en) #tbl .kb { letter-spacing: -0.03em; } /* 영어 "Heavy"가 좁은 칸을 넘지 않게 */
#tbl .cell { min-height: 30px; border-top: 1px solid var(--k-rule); display: flex; align-items: center; justify-content: center; gap: 3px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13px; }
#tbl .cell.na { color: var(--k-sub); font-weight: 600; font-size: 12.5px; }
#tbl .cell svg { width: 14px; height: 14px; flex: none; }
#tbl .cw { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13.5px; line-height: 1.3; font-weight: 750; padding: 6px 2px; font-variant-numeric: tabular-nums; border-top: 1px solid var(--k-rule); }
#tbl .cw span { white-space: nowrap; }
html.compact #tbl .kb, html.short #tbl .kb { min-height: var(--tap); }
html.compact #tbl .rh { max-width: 5.6em; }
html.compact #tbl .cw, html.short #tbl .cw { font-size: 12.5px; }
html.compact #tbl .cell, html.short #tbl .cell { min-height: 24px; font-size: 12.5px; }
html.monTight #monitor { gap: 3px; }
html.monTight #tbl .kb { min-height: var(--tap); padding: 2px 0; margin-bottom: 3px; }
html.monTight #tbl .cell { min-height: 20px; }
html.monTight #tbl .cw { padding: 3px 2px; font-size: 12px; line-height: 1.25; gap: 0 10px; }
html.monTight2 #monHead { display: none; }

/* ── 옆 창(예측·결과): 판 맨 위(미션 줄·기계 조작 자리). 기계 화면은 그 아래 그대로 보인다.
   다 들어가지 않으면 화면도 접고(cardOnly), 그래도 넘치면 그림까지 접는다(cardFull, main.js fitSide) ── */
#sheet { position: relative; z-index: 6; flex: none; display: flex; flex-direction: column; min-width: 0; min-height: 0; max-height: 100%; background: var(--k-paper); }
html.carded #mission, html.carded #monCtl { display: none; }
html.cardOnly #monitor { display: none; }
html.cardOnly #sheet { flex: 1 1 auto; }
html.cardFull #view { display: none; }
html.cardFull #side { grid-column: 1 / -1; }
#sheet h2 { font-size: 18px; line-height: 1.4; margin: 0 0 8px; }
#sheet .ctx { color: var(--k-sub); font-size: 14px; line-height: 1.5; margin: 0 0 6px; }
#sheet .acts { margin-top: 12px; }
.res { margin-bottom: 8px; }
.res .hd { font-size: 16px; font-weight: 800; margin: 0 0 2px; line-height: 1.4; }
.res .hd.ok { color: var(--ok-p); }
.res .hd.bad { color: var(--bad-p); }
.res .pk { font-size: 14px; color: var(--k-sub); margin: 0 0 2px; line-height: 1.45; }
/* ── 가운데 창 ── */
#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(600px, 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(700px, 100%); }
.card > .cb { min-height: 0; overflow: auto; }
.card > .acts { flex: none; }
.card [tabindex="-1"]:focus { outline: none; }
.card h2 { font-size: 21px; 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, .card .body { margin: 8px 0; font-size: 15px; line-height: 1.6; }
.card .note { font-size: 13.5px; color: var(--k-sub); line-height: 1.5; }
.card ul { margin: 6px 0; padding-left: 20px; }
.card li { font-size: 14.5px; line-height: 1.55; margin: 3px 0; }
.card.info table { width: 100%; border-collapse: collapse; margin: 8px 0 4px; font-size: 13px; font-variant-numeric: tabular-nums; }
.card.info th, .card.info td { padding: 4px 6px; border-bottom: 1px solid var(--k-rule); text-align: right; }
.card.info th:first-child, .card.info td:first-child { text-align: left; }
.card.info th { color: var(--k-sub); font-weight: 800; font-size: 12.5px; }
.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; display: flex; align-items: center; gap: 10px;
}
.opts button .ic { flex: none; width: 74px; height: 30px; }
@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; }
.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; }
.stars { font-size: 24px; letter-spacing: 3px; color: var(--k-ctl); margin: 2px 0 6px; }
.stars .on { color: var(--k-ink); }
.cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; margin: 4px 0 8px; }
.cases > div { padding: 6px 0; border-top: 1px solid var(--k-rule); }
.cases b { display: block; font-size: 14px; margin-bottom: 2px; }
.cases span { font-size: 13.5px; line-height: 1.45; color: var(--k-ink-2); }

/* 낮은 데스크톱 */
@media (max-height: 560px) and (min-aspect-ratio: 21/20) {
  :root { --hdr: 46px; }
  #modal .card { padding: 14px 18px; }
  .card h2 { font-size: 18px; margin-bottom: 6px; line-height: 1.35; }
  .card p, .card .body { font-size: 14px; line-height: 1.5; margin: 6px 0; }
  .card li { font-size: 13.5px; }
  .acts { margin-top: 10px; }
  .opts { margin-top: 8px; gap: 6px; }
  .opts button { min-height: 40px; font-size: 14px; padding: 5px 10px; }
  .stList > button { min-height: 40px; padding: 3px 4px; font-size: 15px; }
  .stList .t small { display: none; }
  .cases span { 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 body.starting #app { grid-template-rows: var(--hdr) minmax(0, 1fr) minmax(0, 2.4fr); grid-template-areas: "top" "view" "start"; }
html.compact #view { padding: 0 10px 6px; }
html.compact #side { padding: 0 10px 8px; gap: 6px; height: calc(100vh - var(--hdr) - 150px); height: calc(100dvh - var(--hdr) - 150px); max-height: 58vh; }
html.compact #mGoal { font-size: 14px; }
html.compact #mText { font-size: 13.5px; line-height: 1.42; }
html.compact #sheet h2 { font-size: 17px; line-height: 1.38; margin-bottom: 6px; }
html.compact #sheet p, html.compact #sheet .body { 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: 5px 10px; }
html.compact #sheet .acts { margin-top: 10px; }
html.compact.cardFull #side { grid-row: 2 / -1; height: auto; max-height: none; }
html.compact #app > .k-start { padding: 10px 10px 6px; }
html.compact #modal { padding: 8px; }
html.compact #modal .card { padding: 16px 16px 14px; }
html.compact .card h2 { font-size: 18px; }
html.compact .stList > button { min-height: 42px; font-size: 15px; }
html.compact .stList .t small { display: none; }
html.compact .cases span { display: none; }
@media (max-height: 520px) and (max-aspect-ratio: 21/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, .card .body { font-size: 13.5px; line-height: 1.5; margin: 6px 0; }
  .acts { margin-top: 10px; }
}

/* ── 낮은 가로 화면(750×280 등): 그림 왼쪽, 오른쪽 판 ── */
html.short { --hdr: 44px; --sideW: minmax(0, 50%); }
html.short #app { grid-template-columns: minmax(0, 1fr) minmax(0, 50%); }
html.short body.starting #app { grid-template-columns: minmax(0, 1fr) minmax(0, 60%); }
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 2px; gap: 5px; }
html.short #mission { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 3px 8px; }
html.short #mHead { display: none; }
html.short #mText { flex: 1 1 55%; font-size: 13px; line-height: 1.38; }
html.short #mActs { flex: 0 1 auto; }
html.short #monitor { gap: 4px; }
html.short #monTitle, html.short #monRead { font-size: 12.5px; }
html.short #sheet h2 { font-size: 15px; margin-bottom: 4px; }
html.short #sheet p, html.short #sheet .body, html.short #sheet .ctx { font-size: 13px; line-height: 1.45; margin: 4px 0; }
html.short .res .hd { font-size: 14.5px; }
html.short .res .pk { font-size: 13px; }
html.short #sheet .opts { margin-top: 6px; gap: 5px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
html.short #sheet .opts button { min-height: 36px; font-size: 13px; padding: 3px 8px; }
html.short #sheet .opts button .ic { display: none; }
html.short #sheet .acts { margin-top: 6px; }
html.short.cardOnly:not(.micro) #app { grid-template-columns: minmax(0, 1fr) minmax(0, 64%); }
html.short #app > .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, html.short .card .body { font-size: 13px; margin: 4px 0; line-height: 1.45; }
html.short .card li { font-size: 13px; margin: 2px 0; }
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 .stList .t small { display: none; }
html.short .stars { font-size: 20px; margin: 0; }
html.short .cases { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html.short .cases span { display: none; }

/* ── 아주 낮은 화면(320×200 등): 판의 칸을 바로 격자에 놓는다. 기계 화면은 조작만 남긴다 ── */
html.micro { --hdr: 40px; }
html.micro #top { gap: 2px; padding: 2px 4px; }
html.micro .icon { width: 36px; height: 36px; }
html.micro #chap { font-size: 12.5px; }
html.micro:not(.free) #tabs { display: none; }
html.micro #app { grid-template-columns: minmax(0, 34%) minmax(0, 66%); grid-template-rows: var(--hdr) minmax(0, 1fr) auto; grid-template-areas: "top top" "view mission" "ctl ctl"; }
html.micro body.starting #app { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--hdr) minmax(0, 1fr); grid-template-areas: "top" "start"; }
html.micro body.starting #view { display: none; }
html.micro #side, html.micro #monitor { display: contents; }
html.micro #monHead, html.micro #monBody { display: none !important; }
html.micro #view { padding: 0 4px 4px 6px; }
html.micro #mission { grid-area: mission; min-height: 0; padding: 0 6px 2px 2px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px 6px; align-content: flex-start; }
html.micro #mHead { flex: 1 1 100%; }
html.micro #mDots { display: none; }
html.micro #mGoal { font-size: 12.5px; }
html.micro #mText { flex: 1 1 100%; font-size: 12px; line-height: 1.25; }
html.micro #monCtl { grid-area: ctl; padding: 2px 6px 4px; gap: 4px; }
html.micro #sheet { grid-area: mission; }
html.micro.cardOnly #sheet { grid-row: 2 / 4; grid-column: 1 / 3; padding: 0 8px 4px; }
html.micro #monCtl .k-btn, html.micro #mActs .k-btn, html.micro .k-seg > button { height: 36px; min-height: 36px; min-width: 32px; padding: 0 7px; font-size: 12.5px; }
html.micro #sceneTools { left: 3px; top: 3px; right: 3px; gap: 3px; }
html.micro #sceneTools .k-btn { height: 36px; min-height: 36px; }
html.micro #sceneTools .k-btn.ico, html.micro #fine .k-btn.ico { width: 36px; }
html.micro #sceneTools .k-btn:not(.ico) { padding: 0 6px; font-size: 12px; }
#btnAlt .ls, html.micro #btnAlt .lf { display: none; }
html.micro #btnAlt .ls { display: inline; }
/* 미션 칸: 단추를 글 끝 줄에 붙여 한 줄을 아낀다 */
html.micro:not(.carded) #mission { display: block; }
html.micro #mText { display: inline; }
html.micro #mActs { display: inline-flex; vertical-align: middle; margin: 2px 0 0 6px; gap: 4px; }
html.micro #mActs:empty { display: none; }
html.micro #mission.mHide #mText { display: none; }
html.noHome #btnView { display: none; }
html.micro #sheet h2 { font-size: 13.5px; line-height: 1.35; margin-bottom: 3px; }
html.micro #sheet .opts { margin-top: 4px; gap: 4px; }
html.micro #sheet .opts button { min-height: 36px; font-size: 12.5px; line-height: 1.2; padding: 2px 6px; }
html.micro #sheet .acts { margin-top: 4px; }
html.micro #fine { right: 3px; bottom: 3px; gap: 3px; }
html.micro #fine .k-btn { height: 36px; min-height: 36px; }
html.micro .card h2 { font-size: 14px; margin-bottom: 2px; }
html.micro .acts { margin-top: 4px; }

@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }
/* 아주 작은 틀: 메뉴의 단계 목록은 한 줄에 하나(두 칸이면 일본어 가타카나 낱말이 칸보다 길어 갈린다). 창 안 스크롤로 본다 */
html.micro .stList { grid-template-columns: minmax(0, 1fr); }
