@font-face { font-family: "SUIT"; font-weight: 400; font-display: swap; src: url("fonts/SUIT-Regular.woff2") format("woff2"); }
@font-face { font-family: "SUIT"; font-weight: 500; font-display: swap; src: url("fonts/SUIT-Medium.woff2") format("woff2"); }
@font-face { font-family: "SUIT"; font-weight: 600; font-display: swap; src: url("fonts/SUIT-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "SUIT"; font-weight: 700; font-display: swap; src: url("fonts/SUIT-Bold.woff2") format("woff2"); }

/* 코드핏 수업 화면 토큰 (pacemaker apps/web/src/styles.css와 같은 값) */
:root {
  --bg: #fffffc; --surface: #ffffff; --surface-2: #f6f3ec;
  --text: #000000; --text-secondary: #4f4a40; --text-muted: #66635c;
  --border: #e8e2d4; --border-soft: #f1ece1; --border-strong: #b5ad9c;
  --primary: #cf9c44; --primary-ink: #9e6809;
  --danger: #b3261e; --danger-soft: #fdeceb; --success: #2e6b3f; --success-soft: #e9f3e7;
  --room: #15110b; --room-2: #1f1a12; --room-3: #2d261b; --room-deep: #0d0a06; --room-line: #443a2a;
  --room-ink: #fffaf0; --room-ink-2: #c2b7a3; --room-on-primary: #15110b; --room-mine: #4d3a18; --room-link: #ecc98a;
  --room-danger: #ff9c9f; --room-danger-soft: #43191b; --room-success: #a7d6a0; --room-success-soft: #223220;
  --room-warning: #f4cd80; --room-warning-soft: #3d2e10; --room-info: #a9d0f2; --room-info-soft: #1a3044;
  --blk-marked: #ff4d6d;
  --font: "SUIT", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--room); color: var(--room-ink); line-height: 1.5; letter-spacing: -0.005em; overflow: hidden; }
button { font: inherit; cursor: pointer; }
svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.muted { color: var(--room-ink-2); }
.small { font-size: 13px; }
.xs { font-size: 11px; }

/* ── 수업 화면 틀 ── */
.room { height: 100vh; display: grid; grid-template-rows: 52px 1fr; padding-bottom: 46px; }
.room-top { display: flex; align-items: center; gap: 12px; padding: 0 14px; border-bottom: 1px solid var(--room-line); background: var(--room-2); }
.room-top .title { font-size: 16px; font-weight: 700; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--room-3); color: var(--room-ink-2); }
.pill b { font-variant-numeric: tabular-nums; color: var(--room-ink); font-weight: 600; }
.pill.red { background: var(--room-danger-soft); color: var(--room-danger); }
.pill svg { width: 13px; height: 13px; }
.btn { border: 1px solid var(--room-line); background: var(--room-3); color: var(--room-ink); border-radius: 10px; padding: 7px 13px; font-weight: 600; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--room-danger); }
.mode-switch { display: inline-flex; background: var(--room-3); border-radius: 10px; padding: 3px; gap: 2px; }
.mode-switch button { border: 0; background: transparent; color: var(--room-ink-2); padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; }
.mode-switch button.on { background: var(--room-ink); color: var(--room); }
.room-body { display: grid; grid-template-columns: 1fr 340px; min-height: 0; }
.room-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 12px; gap: 10px; }
.room-side { border-left: 1px solid var(--room-line); display: flex; flex-direction: column; min-height: 0; background: var(--room-2); }

/* ── 학생 작품 (밝은 블록 화면) ── */
.bx { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px 1fr; grid-template-rows: auto minmax(0, 1fr); background: var(--surface-2); color: var(--text); border-radius: 12px; overflow: hidden; }
.bx-bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--surface); border-bottom: 1px solid var(--border); font-size: 12px; }
.bx-title { font-weight: 700; color: var(--text-muted); }
.bx-saved { color: var(--text-muted); }
.bx-left { background: var(--surface); border-right: 1px solid var(--border); padding: 14px; display: flex; flex-direction: column; gap: 14px; overflow: auto; }
.task-h { font-weight: 700; font-size: 15px; letter-spacing: -0.02em; }
.task p { margin: 6px 0 8px; font-size: 13px; color: var(--text-secondary); word-break: keep-all; }
.task-data { font-size: 12px; font-family: ui-monospace, Consolas, monospace; background: var(--surface-2); border-radius: 8px; padding: 6px 9px; color: var(--text-secondary); }
.run { border-top: 1px solid var(--border-soft); padding-top: 12px; }
.run-h { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.run-out { font-size: 14px; min-height: 44px; border-radius: 10px; padding: 9px 11px; background: var(--surface-2); }
.run-out .muted { color: var(--text-muted); }
.run-out.fail { background: var(--danger-soft); color: var(--danger); }
.run-out.pass { background: var(--success-soft); color: var(--success); }
.run-out b { font-size: 16px; }
.run-out.flash { animation: flash .5s ease; }
@keyframes flash { from { transform: scale(.97); opacity: .5; } to { transform: none; opacity: 1; } }
.run-hist { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.bx-ws { position: relative; overflow: auto; background-color: var(--bg); background-image: linear-gradient(var(--border-soft) 1px, transparent 1px), linear-gradient(90deg, var(--border-soft) 1px, transparent 1px); background-size: 24px 24px; padding: 34px 40px; }

/* ── 블록 (엔트리 색) ── */
.script { display: inline-flex; flex-direction: column; align-items: flex-start; }
.blk { --c: #888; --s: #666; position: relative; display: inline-flex; align-items: center; gap: 6px; background: var(--c); border: 1.5px solid var(--s); color: #fff; font-size: 13px; font-weight: 700; padding: 6px 14px 6px 12px; border-radius: 5px; min-height: 32px; white-space: nowrap; margin-top: -1.5px; transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .2s, outline-color .2s; }
.blk.hat { border-radius: 18px 6px 6px 6px; padding-left: 14px; min-height: 38px; }
.blk.hat::before { content: ""; width: 0; height: 0; border-left: 8px solid #fff; border-top: 5px solid transparent; border-bottom: 5px solid transparent; margin-right: 2px; }
.ev { --c: #00b400; --s: #009400; }
.ctl { --c: #19baea; --s: #1498c0; }
.var { --c: #dd47d8; --s: #b819b3; }
.looks { --c: #ff3a61; --s: #c72042; }
.calc { --c: #ffb100; --s: #ff9b00; }
.cblk { display: flex; flex-direction: column; align-items: flex-start; margin-top: -1.5px; }
.cblk > .blk { border-bottom-left-radius: 0; }
.cbody { display: flex; flex-direction: column; align-items: flex-start; border-left: 16px solid var(--c); padding: 1.5px 0 2px; min-height: 24px; position: relative; }
.cbody::before { content: ""; position: absolute; left: -17.5px; top: 0; bottom: 0; width: 1.5px; background: var(--s); }
.cfoot { height: 16px; width: 70px; background: var(--c); border: 1.5px solid var(--s); border-top: 0; border-radius: 0 0 5px 5px; margin-top: -1.5px; }
.slot { display: inline-flex; align-items: center; background: #fff; color: #222; border-radius: 999px; padding: 1px 9px; font-weight: 700; min-width: 26px; justify-content: center; font-variant-numeric: tabular-nums; }
.slot.var-r { background: #f7c8f5; color: #6a0f67; }
.slot.calc-r { background: #ffe1a1; color: #6b4400; }
.slot.bool { border-radius: 4px; background: #c1effc; color: #0b5a73; clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%); padding: 1px 12px; }
.slot.changed { animation: slotflash .9s ease; }
@keyframes slotflash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 3px #ffd166; } }
.blk.running { box-shadow: 0 0 0 3px #ffd166, 0 0 14px rgba(255, 209, 102, .9); }
.blk.lift { transform: translate(18px, -6px); box-shadow: 0 12px 18px rgba(0, 0, 0, .25); z-index: 5; }
.cursor { position: absolute; width: 18px; height: 18px; pointer-events: none; transition: left .5s ease, top .5s ease, opacity .3s; z-index: 10; opacity: 0; }
.cursor svg { width: 18px; height: 18px; fill: #fff; stroke: #222; stroke-width: 1.4; }

/* ── 오른쪽: 영상·자막 ── */
.videos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 10px 6px; }
.tile { position: relative; aspect-ratio: 4/3; background: var(--room-deep); border-radius: 10px; overflow: hidden; display: grid; place-items: center; }
.tile .name { position: absolute; left: 6px; bottom: 6px; font-size: 11px; background: rgba(0,0,0,.55); padding: 2px 7px; border-radius: 6px; }
.tile.speaking { outline: 3px solid #ff3b3f; outline-offset: -3px; box-shadow: 0 0 14px rgba(255, 59, 63, .55); }
.face { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.face.t { background: #3a3122; color: var(--room-link); }
.face.c { background: #23324a; color: var(--room-info); }
.caption { margin: 0 10px 8px; min-height: 38px; font-size: 13px; color: var(--room-ink-2); line-height: 1.45; padding: 7px 10px; border-radius: 9px; background: var(--room-3); transition: opacity .3s; }
.caption b { color: var(--room-ink); font-weight: 600; margin-right: 4px; }
.caption.empty { opacity: .45; }
.side-tabs { display: flex; border-bottom: 1px solid var(--room-line); border-top: 1px solid var(--room-line); }
.side-tabs button { flex: 1; background: transparent; border: 0; color: var(--room-ink-2); padding: 10px; font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; position: relative; }
.side-tabs button.on { color: var(--room-ink); border-bottom-color: var(--primary); }
.dot { display: none; position: absolute; top: 9px; margin-left: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--room-warning); }
.dot.on { display: inline-block; }
.tab { flex: 1; min-height: 0; overflow: auto; }
.tab[hidden] { display: none; }
.chat { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.chat .msg { max-width: 92%; background: var(--room-3); padding: 7px 10px; border-radius: 10px; }
.chat .msg.mine { align-self: flex-end; background: var(--room-mine); }
.chat .who { font-size: 11px; color: var(--room-ink-2); }
.log { padding: 10px 12px; font-size: 12px; color: var(--room-ink-2); display: flex; flex-direction: column; gap: 4px; font-variant-numeric: tabular-nums; }
.log div b { color: var(--room-ink); font-weight: 600; }

/* ── 수업 보조 ── */
.assist { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.watch { background: var(--room-3); border-radius: 10px; padding: 9px 11px 10px; }
.watch-row { display: flex; align-items: baseline; gap: 8px; font-size: 13px; margin-bottom: 7px; }
.watch-label { color: var(--room-ink-2); font-size: 12px; }
.watch b { font-weight: 700; }
.watch b.warn { color: var(--room-warning); }
.watch b.ok { color: var(--room-success); }
.meter { height: 5px; border-radius: 99px; background: var(--room-2); overflow: hidden; }
.meter > div { height: 100%; width: 4%; background: var(--room-ink-2); border-radius: 99px; transition: width .4s ease, background .4s; }
.meter > div.hot { background: var(--room-warning); }
.sos { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; border: 1px solid var(--room-line); background: var(--room-2); color: var(--room-ink); border-radius: 12px; padding: 10px 12px; transition: background .15s, border-color .15s, transform .1s; }
.sos:hover { border-color: var(--room-danger); }
.sos:active, .sos.press { transform: scale(.98); background: var(--room-danger-soft); border-color: var(--room-danger); }
.sos svg { width: 22px; height: 22px; color: var(--room-danger); }
.sos span { display: flex; flex-direction: column; line-height: 1.25; }
.sos b { font-size: 15px; letter-spacing: .02em; }
.sos small { font-size: 12px; color: var(--room-ink-2); }
.cards { display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--room-3); border: 1px solid var(--room-line); border-radius: 12px; padding: 11px 12px 12px; font-size: 13px; animation: cardin .35s cubic-bezier(.2,.8,.2,1); }
@keyframes cardin { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.card.alert { border-color: #6b5320; box-shadow: inset 3px 0 0 var(--room-warning); }
.card.sosc { border-color: #6a2b2e; box-shadow: inset 3px 0 0 var(--room-danger); }
.card.done { opacity: .85; }
.card.done .sec, .card.done .foot { display: none; }
.card-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.card-h b { font-size: 14px; }
.card-h .kind { font-size: 12px; font-weight: 700; color: var(--room-warning); }
.card.sosc .card-h .kind { color: var(--room-danger); }
.card-h .t { margin-left: auto; font-size: 11px; color: var(--room-ink-2); font-variant-numeric: tabular-nums; }
.sec { margin-top: 9px; }
.sec-h { font-size: 11px; font-weight: 700; color: var(--room-ink-2); margin-bottom: 3px; letter-spacing: .01em; }
.why { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; color: var(--room-ink); }
.why li { padding-left: 10px; position: relative; }
.why li::before { content: ""; position: absolute; left: 0; top: .65em; width: 4px; height: 4px; border-radius: 50%; background: var(--room-ink-2); }
.flow { display: flex; flex-direction: column; gap: 3px; }
.flow div { display: grid; grid-template-columns: 40px 1fr; gap: 6px; }
.flow span { color: var(--room-ink-2); font-variant-numeric: tabular-nums; font-size: 12px; }
.diag { color: var(--room-ink); }
.diag em { font-style: normal; color: var(--room-ink-2); font-size: 11px; margin-left: 4px; }
.lines { display: flex; flex-direction: column; gap: 6px; }
.line { width: 100%; text-align: left; border: 1px solid var(--room-line); background: var(--room-2); color: var(--room-ink); border-radius: 9px; padding: 8px 10px; line-height: 1.45; font-size: 13px; transition: border-color .15s, background .15s; }
.line:hover, .line.hl { border-color: var(--primary); background: var(--room-mine); }
.line small { display: block; color: var(--room-ink-2); font-size: 11px; margin-top: 3px; }
.acts { display: flex; gap: 6px; margin-top: 8px; }
.acts button { border: 0; background: transparent; color: var(--room-ink-2); font-size: 12px; font-weight: 600; padding: 4px 6px; border-radius: 6px; }
.acts button:hover { background: var(--room-2); color: var(--room-ink); }
.said { margin-top: 8px; padding: 8px 10px; border-radius: 9px; background: var(--room-mine); line-height: 1.45; }
.said small { display: block; color: var(--room-ink-2); font-size: 11px; }
.after { margin-top: 8px; font-size: 12px; color: var(--room-ink-2); display: flex; align-items: center; gap: 6px; }
.after.ok { color: var(--room-success); }
.next { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.explain { color: var(--room-ink); line-height: 1.55; }
.goto { margin-top: 6px; border: 1px solid var(--room-line); background: var(--room-2); color: var(--room-link); border-radius: 8px; padding: 5px 9px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.loading { display: flex; align-items: center; gap: 8px; color: var(--room-ink-2); }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--room-line); border-top-color: var(--room-ink-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.foot { margin-top: 9px; font-size: 11px; color: var(--room-ink-2); }

/* ── 시연 막대 ── */
.demo { position: fixed; left: 0; right: 0; bottom: 0; height: 46px; display: flex; align-items: center; gap: 14px; padding: 0 14px; background: #0b0905; border-top: 1px solid var(--room-line); font-size: 12px; color: var(--room-ink-2); z-index: 20; }
.demo-note { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-note b { color: var(--room-ink); margin-right: 6px; }
.demo-ctl { display: flex; align-items: center; gap: 6px; }
.demo-ctl button { border: 1px solid var(--room-line); background: var(--room-2); color: var(--room-ink); border-radius: 8px; padding: 4px 10px; font-size: 12px; font-weight: 600; }
.demo-ctl button:hover { border-color: var(--room-ink-2); }
.demo-step { min-width: 110px; text-align: right; }

@media (max-width: 1100px) {
  .bx { grid-template-columns: 240px 1fr; }
  .room-body { grid-template-columns: 1fr 310px; }
}
@media (max-width: 820px) {
  body { overflow: auto; }
  .room { height: auto; min-height: 100vh; grid-template-rows: auto auto; padding-bottom: 92px; }
  .room-top { flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .room-top .mode-switch, .room-top .btn { display: none; }
  .room-body { grid-template-columns: 1fr; }
  .room-main { padding: 10px 12px; }
  .bx { grid-template-columns: 1fr; min-height: 560px; }
  .bx-left { border-right: 0; border-bottom: 1px solid var(--border); }
  .bx-ws { padding: 20px 16px; min-height: 340px; }
  .room-side { border-left: 0; border-top: 1px solid var(--room-line); }
  .tab { overflow: visible; }
  .demo { height: auto; flex-direction: column; align-items: stretch; gap: 6px; padding: 8px 12px; }
  .demo-note { white-space: normal; }
  .demo-ctl { flex-wrap: wrap; }
  .demo-step { display: none; }
}

/* ── 예시 설정 스위치 ── */
.feat { display: flex; align-items: center; gap: 12px; padding: 4px 12px 4px 10px; border-radius: 10px; border: 1px dashed var(--room-line); }
.sw { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--room-ink-2); cursor: pointer; user-select: none; }
.sw input { position: absolute; opacity: 0; pointer-events: none; }
.sw i { width: 30px; height: 17px; border-radius: 99px; background: var(--room-3); border: 1px solid var(--room-line); position: relative; transition: background .2s, border-color .2s; }
.sw i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: var(--room-ink-2); transition: transform .2s, background .2s; }
.sw input:checked + i::after { transform: translateX(13px); background: var(--room); }
.alert-sw input:checked + i { background: var(--room-warning); border-color: var(--room-warning); }
.sos-sw input:checked + i { background: #ff7b80; border-color: #ff7b80; }
.sw input:checked ~ * { color: var(--room-ink); }
.sw:has(input:checked) { color: var(--room-ink); }
.sw input:focus-visible + i { outline: 2px solid var(--primary); outline-offset: 2px; }
.sos-pill { background: #4a1518 !important; color: #ffb3b6 !important; }

/* ── 색 구분: 머뭇거림 알림 = 노랑, SOS = 빨강 ── */
.card.alert { background: #2a2312; border-color: #6b5320; }
.card.alert .card-h .kind { color: var(--room-warning); }
.card.sosc { background: #2a1416; border-color: #6a2b2e; }
.card.muted-note { background: transparent; border: 1px dashed var(--room-line); color: var(--room-ink-2); padding: 8px 11px; font-size: 12px; animation: cardin .35s; }
.card.muted-note b { color: var(--room-warning); font-weight: 600; }
.sos.on { background: #4a1518; border-color: #ff7b80; }
.sos.on small { color: #ffb3b6; }
.watch-sos { color: #ffb3b6; font-size: 12px; margin-top: 7px; display: none; }
.watch.sos-active .watch-sos { display: block; }
.watch.sos-active .meter > div { background: var(--room-line); }
.watch.off { opacity: .55; }

/* ── 가운데 창: 코드핏 본서비스 Modal(흰 카드·얇은 테두리·제목 줄·테두리형 버튼)과 같은 틀 ── */
.room-main { position: relative; }
.room-main.sos-on::after { content: ""; position: absolute; inset: 0; background: rgba(21, 17, 11, .55); border-radius: 12px; z-index: 5; animation: fadein .2s; }
@keyframes fadein { from { opacity: 0; } }
.hm { --c: #b3261e; --c-soft: #fdeceb; --c-tint: #f9d6d3; --c-dot: #d93a30;
  position: absolute; z-index: 6; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto;
  background: #fff; color: #000; border: 1px solid #e8e2d4; border-radius: 14px; padding: 18px 20px;
  box-shadow: 0 18px 48px -12px rgba(0, 0, 0, .55); display: flex; flex-direction: column; gap: 12px; animation: hmin .22s cubic-bezier(.2,.8,.2,1); }
.hm.alert { --c: #805400; --c-soft: #fff1d6; --c-tint: #ffe6b3; --c-dot: #e0a020; }
@keyframes hmin { from { opacity: 0; transform: translate(-50%, calc(-50% + 10px)); } }
.hm-head { display: flex; align-items: center; gap: 8px; }
.hm-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c-dot); box-shadow: 0 0 0 4px var(--c-soft); }
.hm-head h3 { margin: 0; flex: 1; font-size: 17px; font-weight: 600; letter-spacing: -0.025em; color: #000; }
.hm-cnt { font-size: 13px; color: #66635c; font-variant-numeric: tabular-nums; }
.hm-label { font-size: 13px; font-weight: 600; color: #66635c; margin-top: 2px; }
.hm-line { margin: -4px 0 4px; font-size: 22px; line-height: 1.5; font-weight: 600; letter-spacing: -0.02em; color: var(--c); word-break: keep-all; }
.hm-foot { display: flex; align-items: center; gap: 12px; border-top: 1px solid #f1ece1; padding-top: 12px; }
.hm-vo { flex: 1; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #66635c; }
.hm-vo .bars, .caption .bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 13px; }
.hm-vo .bars i, .caption .bars i { width: 3px; height: 4px; border-radius: 2px; background: #d8d0bf; }
.hm-vo.on { color: var(--c); font-weight: 600; }
.hm-vo.on .bars i, .caption.live .bars i { background: var(--c, #ff3b3f); animation: bar .9s ease-in-out infinite; }
.hm-vo.on .bars i:nth-child(2), .caption.live .bars i:nth-child(2) { animation-delay: .15s; }
.hm-vo.on .bars i:nth-child(3), .caption.live .bars i:nth-child(3) { animation-delay: .3s; }
.hm-vo.on .bars i:nth-child(4) { animation-delay: .45s; }
.hm-vo.end { color: #000; font-weight: 600; }
@keyframes bar { 0%, 100% { height: 4px; } 50% { height: 13px; } }
.hm-done { border: 1px solid var(--c); background: var(--c-soft); color: var(--c); border-radius: 10px; padding: 10px 20px; font-size: 15px; font-weight: 600; transition: transform .06s, background .15s; }
.hm-done:hover, .hm-done.hl { background: var(--c-tint); }
.hm-done:active { transform: translateY(1px); }
.hm-loading { display: flex; align-items: center; gap: 8px; padding: 18px 0 6px; font-size: 14px; color: #66635c; }
.hm .spin { border-color: #e8e2d4; border-top-color: var(--c); }

/* ── 버튼 두 개: 노랑 막힘 알림 · 빨강 SOS ── */
.helpbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.helpbtns:has(> [hidden]) { grid-template-columns: 1fr; }
.hb { display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--room-line); background: var(--room-2); color: var(--room-ink); border-radius: 12px; padding: 10px 11px; min-height: 64px; transition: background .2s, border-color .2s, transform .1s, opacity .2s; }
.hb .lamp { flex: none; width: 12px; height: 12px; border-radius: 50%; background: #4d4436; }
.hb-t { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.hb b { font-size: 14px; font-weight: 700; }
.hb small { font-size: 11px; color: var(--room-ink-2); word-break: keep-all; }
.hb.alert .lamp { background: #6b5320; }
.hb.sos .lamp { background: #6a2b2e; }
.hb.alert.blink { border-color: #f4cd80; animation: blinkY 1s ease-in-out infinite; }
.hb.alert.blink .lamp { background: #ffd166; box-shadow: 0 0 10px #ffd166; }
.hb.alert.blink small { color: #f4cd80; }
.hb.sos.blink { border-color: #ff7b80; animation: blinkR 1s ease-in-out infinite; }
.hb.sos.blink .lamp { background: #ff5a5f; box-shadow: 0 0 10px #ff5a5f; }
.hb.sos.blink small { color: #ffb3b6; }
.hb.sos.on { background: #4a1518; border-color: #ff7b80; }
.hb.sos.on .lamp { background: #ff5a5f; }
.hb.sos.on small { color: #ffb3b6; }
.hb.alert.rest { opacity: .55; }
.hb.alert.done .lamp { background: #a7d6a0; }
.hb.press { transform: scale(.97); }
@keyframes blinkY { 0%, 100% { background: var(--room-2); box-shadow: none; } 50% { background: #3d2e10; box-shadow: 0 0 0 3px rgba(255, 209, 102, .35); } }
@keyframes blinkR { 0%, 100% { background: var(--room-2); box-shadow: none; } 50% { background: #43191b; box-shadow: 0 0 0 3px rgba(255, 90, 95, .35); } }
.card .said { color: var(--room-ink); line-height: 1.5; margin-bottom: 4px; }

/* ── 자막: 말하는 동안만 켜짐 ── */
.caption { display: flex; flex-direction: column; gap: 2px; }
.caption .who { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--room-ink-2); }
.caption .tx { color: var(--room-ink-2); }
.caption.live { background: #2a2116; box-shadow: inset 3px 0 0 #ff3b3f; }
.caption.live .who { color: var(--room-ink); }
.caption.live .tx { color: var(--room-ink); }
.caption.past { opacity: .6; }
.caption.past .who::after { content: " · 방금"; font-weight: 500; }
.subtitle { position: fixed; left: 50%; bottom: 62px; transform: translateX(-50%); max-width: min(900px, calc(100% - 32px)); z-index: 30; pointer-events: none;
  background: rgba(0, 0, 0, .78); color: #fff; font-size: 19px; line-height: 1.45; font-weight: 600; padding: 9px 18px; border-radius: 10px; text-align: center; word-break: keep-all; opacity: 0; transition: opacity .2s; }
.subtitle.on { opacity: 1; }
.subtitle b { color: #ffd166; margin-right: 8px; }
.subtitle.tutor b { color: #ffb3b6; }

/* ── 데모 안내 줄 ── */
.demo { height: 52px; }
.demo-now { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; white-space: nowrap; overflow: hidden; }
.demo-tag { font-size: 11px; color: var(--room-ink-2); border: 1px solid var(--room-line); border-radius: 6px; padding: 2px 6px; }
.demo-scene { font-size: 13px; font-weight: 700; color: #0b0905; background: #ffd166; border-radius: 7px; padding: 3px 9px; }
.demo-step { font-size: 14px; font-weight: 600; color: var(--room-ink); overflow: hidden; text-overflow: ellipsis; min-width: 0; text-align: left; }

@media (max-width: 1250px) {
  .feat .sw { font-size: 11px; }
}
@media (max-width: 820px) {
  .feat { order: 5; width: 100%; justify-content: flex-start; }
  .hm-line { font-size: 19px; }
  .demo-step { white-space: normal; font-size: 12px; }
}
[hidden] { display: none !important; }
.step-h .n { white-space: nowrap; }
