/* 고고 스테이지 v1 - 스카이 민트 디자인 시스템 */

@font-face { font-family: 'Juache';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_one@1.0/BMJUA.woff') format('woff');
  font-weight: normal; font-display: swap; }
@font-face { font-family: 'PretendardVariable';
  src: url('https://cdn.jsdelivr.net/gh/Project-Noonnu/2611030106@font-variable-694/variable-694/PretendardVariable.woff2') format('woff2');
  font-weight: 45 930; font-display: swap; }
/* 숫자는 프리텐다드의 '숫자 폭 고정(tabular-nums)'을 써요. 숫자 사이가 넓고 흔들리지 않아요. */

:root {
  --bg: #F3F8FC;
  --card: #FFFFFF;
  --pastel-sky: #C3E2F8;
  --pastel-mint: #C4EEE2;
  --pastel-lilac: #DDD6F8;
  --pastel-lemon: #FFF2B8;
  --point: #2C74A8;
  --text: #1F3346;
  --state-done: #22775F;
  --state-help: #B5435D;
  --state-doing: #8A640F;

  --font-title: 'Juache', 'PretendardVariable', sans-serif;
  --font-body: 'PretendardVariable', 'Malgun Gothic', sans-serif;
  --font-number: 'PretendardVariable', 'Malgun Gothic', sans-serif;

  --letterbox: #0F1B29;
  --ui-line: #D7E3EE;
  --ui-muted: #5E7288;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font-variant-numeric: tabular-nums; background: var(--letterbox); color: var(--text); font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }
svg { display: block; }

/* ---------- 1920x1080 고정 캔버스 ---------- */
#viewport { position: fixed; inset: 0; overflow: hidden; }
#frame { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; overflow: hidden; background: var(--bg); }
.layer { position: absolute; inset: 0; overflow: hidden; }
body.idle, body.idle * { cursor: none !important; }

/* ---------- 배경 ---------- */
.screen { position: absolute; inset: 0; background: var(--bg); overflow: hidden; }
.screen.bg-plain { background: var(--bg); }
.screen.bg-sky { background: #E3F1FB; }
.screen.bg-mint { background: #E6F7F1; }
.screen.bg-dark { background: var(--text); }
.screen.bg-shapes::before, .screen.bg-shapes::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; }
.screen.bg-shapes::before { width: 760px; height: 760px; right: -220px; top: -300px; background: var(--pastel-sky); opacity: .7; }
.screen.bg-shapes::after { width: 520px; height: 520px; left: -200px; bottom: -260px; background: var(--pastel-mint); opacity: .8; }

/* ---------- 위젯 공통 (반응형: --k = 위젯 크기 비율) ---------- */
.widget { --k: 1; position: absolute; background: var(--card); border-radius: calc(32px * var(--k)); box-shadow: inset 0 0 0 max(3px, calc(5px * var(--k))) var(--accent, var(--pastel-sky)); padding: calc(34px * var(--k)) calc(40px * var(--k)); display: flex; flex-direction: column; overflow: hidden; }
.widget.bare { background: transparent; box-shadow: none; padding: 0; border-radius: 0; }
.w-body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.editing .widget { cursor: move; }
.editing .widget:hover { outline: 3px solid rgba(44,116,168,.35); outline-offset: 4px; }
.editing .widget.selected { outline: 4px dashed var(--point); outline-offset: 6px; }
.editing .widget video, .editing .widget audio, .editing .widget .media-nav { pointer-events: none; }
.widget.inline-editing, .editing .widget.inline-editing { outline: 4px solid var(--point); outline-offset: 6px; cursor: text; }
.rs-handle { display: none; position: absolute; right: 4px; bottom: 4px; width: 48px; height: 48px; border-radius: 14px; background: var(--point); cursor: nwse-resize; z-index: 20; box-shadow: 0 2px 8px rgba(31,51,70,.25); }
.rs-handle::after { content: ''; position: absolute; inset: 14px; border-right: 4px solid #fff; border-bottom: 4px solid #fff; border-radius: 2px; }
.editing .widget.selected .rs-handle { display: block; }
.empty-hint { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); text-align: center; color: var(--ui-muted); font-size: 40px; font-weight: 600; line-height: 1.6; pointer-events: none; }
.empty-hint b { display: block; font-family: var(--font-title); font-weight: normal; font-size: 64px; color: var(--point); margin-bottom: 10px; }

.w-head { display: flex; align-items: center; justify-content: space-between; gap: calc(16px * var(--k)); margin-bottom: calc(18px * var(--k)); }
.tag { display: inline-block; background: var(--accent, var(--pastel-sky)); color: var(--text); font-family: var(--font-body); font-weight: 700; font-size: calc(26px * var(--k)); padding: calc(8px * var(--k)) calc(22px * var(--k)); border-radius: 999px; white-space: nowrap; }
.chip-btn { border: 0; background: var(--point); color: #fff; font-weight: 700; font-size: calc(24px * var(--k)); padding: calc(10px * var(--k)) calc(24px * var(--k)); border-radius: 999px; white-space: nowrap; }
.chip-btn:hover { filter: brightness(1.08); }
.placeholder { white-space: pre-line; flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--ui-muted); font-size: calc(28px * var(--k)); line-height: 1.5; border: 3px dashed var(--ui-line); border-radius: calc(20px * var(--k)); padding: calc(24px * var(--k)); word-break: keep-all; }

/* 배경색 (텍스트, 프롬프트) */
.widget.bgc-none { background: transparent; box-shadow: none; }
.widget.bgc-white { background: #fff; }
.widget.bgc-sky { background: var(--pastel-sky); box-shadow: none; }
.widget.bgc-mint { background: var(--pastel-mint); box-shadow: none; }
.widget.bgc-lilac { background: var(--pastel-lilac); box-shadow: none; }
.widget.bgc-lemon { background: var(--pastel-lemon); box-shadow: none; }
.widget.bgc-navy { background: var(--text); box-shadow: none; color: #fff; }
.widget.bgc-sky .tag, .widget.bgc-mint .tag, .widget.bgc-lilac .tag, .widget.bgc-lemon .tag { background: #fff; }
.widget.bgc-navy .tag { background: var(--pastel-sky); }

/* 위젯 툴바 (편집 모드) */
.wtools { position: absolute; display: flex; gap: 8px; background: #fff; padding: 8px; border-radius: 18px; box-shadow: 0 6px 24px rgba(31,51,70,.18); z-index: 9000; }
.wtools button { width: 52px; height: 52px; border: 0; border-radius: 12px; background: transparent; color: var(--text); display: grid; place-items: center; }
.wtools button:hover { background: var(--bg); }
.wtools button.danger { color: var(--state-help); }
.wtools svg { width: 28px; height: 28px; }

/* ---------- 텍스트 (바로 입력 + 자동 크기) ---------- */
.w-text .w-body { justify-content: center; }
.txt-fit { width: 100%; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; outline: none; }
.txt-title .txt-fit { font-family: var(--font-title); line-height: 1.2; }
.txt-body .txt-fit { font-family: var(--font-body); font-weight: 500; line-height: 1.45; }
.txt-chapter .txt-fit { line-height: 1.2; }
.txt.al-center .txt-fit { text-align: center; } .txt.al-right .txt-fit { text-align: right; }
.txt.col-text { color: var(--text); } .txt.col-point { color: var(--point); } .txt.col-white { color: #fff; }
.chap-part { font-family: var(--font-number); font-weight: 700; color: var(--point); font-size: .42em; letter-spacing: .02em; margin-bottom: .2em; outline: none; min-height: 1em; }
.chap-title { font-family: var(--font-title); outline: none; min-height: 1em; }
.txt.col-white .chap-part { color: var(--pastel-sky); }
.txt.custom-color .chap-part { color: inherit; opacity: .8; }
[data-edit]:empty::before { content: attr(data-ph); color: var(--ui-muted); opacity: .55; }
.screen:not(.editing) .widget:not(.inline-editing) [data-edit]:empty::before { content: ''; }
[data-edit][contenteditable] { cursor: text; caret-color: var(--point); }

/* ---------- 프롬프트 ---------- */
.p-text { flex: 1; min-height: 0; overflow: hidden; }
.p-inner { white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; line-height: 1.55; font-weight: 500; outline: none; min-height: 1em; }

/* ---------- 타이머 ---------- */
/* 가운데 원형 게이지 + 오른쪽 작은 분 선택 */
.w-timer .w-head { margin-bottom: calc(8px * var(--k)); }
.t-wrap { flex: 1; min-height: 0; display: flex; position: relative; }
/* 동그라미는 위젯 가운데, 분 버튼은 오른쪽에 따로 (양쪽 여백을 같게 둬서 정중앙 유지) */
.t-center { flex: 1; min-width: 0; container-type: size; display: flex; align-items: center; justify-content: center; margin: 0 calc(88px * var(--k)); }
.t-ring { position: relative; width: min(100cqw, 100cqh); height: min(100cqw, 100cqh); container-type: size; }
.t-ring > svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.t-track { fill: none; stroke: var(--t-track, #34A853); stroke-width: 7; }
.t-prog { fill: none; stroke: var(--t-ring, #EA4335); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .25s linear, stroke .3s; }
.t-inner { position: absolute; inset: 0; }
/* 숫자는 동그라미 정중앙, 재생 버튼은 그 아래 */
.t-digits { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); white-space: nowrap; font-family: var(--font-number); font-weight: 800; color: var(--t-digit, #4285F4); font-size: 21cqw; line-height: 1; letter-spacing: 0.02em; }
.t-main { position: absolute; left: 50%; top: 76%; transform: translate(-50%, -50%); width: 14cqw; height: 14cqw; border: 0; padding: 0; border-radius: 50%; background: var(--t-digit, #4285F4); color: #fff; display: grid; place-items: center; cursor: pointer; }
.t-main svg { width: 44%; height: 44%; display: block; }
.t-side { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; justify-content: center; gap: calc(8px * var(--k)); }
.t-side .t-sm { font-size: calc(19px * var(--k)); padding: calc(6px * var(--k)) calc(14px * var(--k)); }
.t-side .t-sm.on { background: var(--pastel-mint); border-color: var(--pastel-mint); }
.w-timer.warn .t-digits { color: #EA4335; }
.w-timer.warn .t-main { background: #EA4335; }
.w-timer.done, .w-alarm.ringing { animation: flash 1s ease-in-out 4; }
@keyframes flash { 50% { background: var(--pastel-lemon); } }
.t-ctrl, .al-ctrl { display: flex; gap: calc(12px * var(--k)); flex-wrap: wrap; align-items: center; }
.t-sm { border: 2px solid var(--ui-line); background: #fff; color: var(--text); font-weight: 600; font-size: calc(24px * var(--k)); padding: calc(10px * var(--k)) calc(18px * var(--k)); border-radius: 999px; white-space: nowrap; }
.t-sm:hover, .chip-btn:hover, .t-main:hover { filter: brightness(1.05); }

/* ---------- 시계 ---------- */
.w-clock .w-body { container-type: size; align-items: center; justify-content: center; text-align: center; }
.clk-time { font-family: var(--font-number); font-weight: 800; color: var(--point); font-size: min(56cqh, 23cqw); line-height: 1; letter-spacing: 0.02em; white-space: nowrap; }
.clk-time small { font-size: .42em; color: var(--text); opacity: .55; margin-left: .08em; }
.clk-time small.ap { margin: 0 .12em 0 0; font-family: var(--font-body); }
.clk-date { font-family: var(--font-body); font-size: min(14cqh, 7cqw); font-weight: 600; margin-top: 4cqh; color: var(--text); }

/* ---------- 알람 ---------- */
/* 알람: 고정 크기 상자(540x370)를 위젯 크기에 맞춰 가운데에서 통째로 확대/축소 */
.w-alarm { padding: 24px; }
.al-body { position: relative; overflow: hidden; }
.al-box { position: absolute; left: 50%; top: 50%; width: 540px; height: 370px; transform: translate(-50%, -50%); transform-origin: 50% 50%; display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center; }
.al-box .tag { font-size: 26px; padding: 8px 22px; }
.al-box .al-row { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 0; }
.al-box .al-pic { font-size: 104px; }
.al-box .al-time { font-size: 132px; margin: 0; }
.al-box .al-left { font-size: 28px; margin: 0; }
.al-box .al-ctrl { justify-content: center; gap: 12px; }
.al-box .t-sm { font-size: 24px; padding: 10px 20px; }
.w-alarm.ringing .al-pic { animation: baRing 1s ease-in-out 6; }
.al-row { display: flex; align-items: center; gap: 4cqw; margin-top: auto; }
.al-row .al-time { margin-top: 0; }
.al-pic { font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; font-size: min(30cqh, 18cqw); line-height: 1; transform-origin: 50% 70%; }
.w-alarm.ringing .al-pic { animation: baRing 1s ease-in-out 6; }
.w-alarm.off .al-pic { filter: grayscale(1); opacity: .5; }
.al-time { font-family: var(--font-number); font-weight: 800; color: var(--point); font-size: min(40cqh, 24cqw); line-height: 1; letter-spacing: 0.02em; margin-top: auto; }
.al-left { font-size: calc(26px * var(--k)); font-weight: 600; color: var(--ui-muted); margin: calc(10px * var(--k)) 0 calc(18px * var(--k)); }
.w-alarm.off .al-time { color: var(--ui-muted); opacity: .5; }
.al-toggle.on { background: var(--state-done); color: #fff; border-color: var(--state-done); }
/* 끝났을 때 화면 정중앙을 꽉 채우는 알림 */
.big-alert { position: absolute; inset: 0; z-index: 9600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px; background: rgba(181, 67, 93, .94); color: #fff; cursor: pointer; text-align: center; animation: bigIn .45s cubic-bezier(.34,1.56,.64,1); }
.big-alert.time-up { background: rgba(44, 116, 168, .95); }
.big-alert { gap: 24px; }
.big-alert .ba-pic { font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; font-size: 230px; line-height: 1; animation: baRing 1s ease-in-out infinite; transform-origin: 50% 70%; filter: drop-shadow(0 12px 24px rgba(0,0,0,.25)); }
@keyframes baRing { 0%, 100% { transform: rotate(0); } 10% { transform: rotate(-14deg); } 20% { transform: rotate(12deg); } 30% { transform: rotate(-10deg); } 40% { transform: rotate(8deg); } 50% { transform: rotate(-4deg); } 60% { transform: rotate(0); } }
.big-alert .ba-box { width: 1720px; height: 380px; display: flex; align-items: center; justify-content: center; }
.big-alert .ba-title { font-family: var(--font-title); line-height: 1.12; word-break: keep-all; width: 100%; }
.big-alert .ba-sub { font-family: var(--font-body); font-weight: 800; font-size: 76px; opacity: .92; }
.big-alert .ba-hint { position: absolute; bottom: 44px; font-size: 28px; font-weight: 600; opacity: .7; }
@keyframes bigIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.alarm-banner { position: absolute; left: 50%; top: 70px; transform: translateX(-50%); background: var(--state-help); color: #fff; font-family: var(--font-title); font-size: 76px; padding: 28px 70px; border-radius: 999px; z-index: 9500; box-shadow: 0 16px 50px rgba(31,51,70,.35); white-space: nowrap; cursor: pointer; display: flex; align-items: center; gap: 28px; }
.alarm-banner.time-up { background: var(--point); }
.alarm-banner small { font-family: var(--font-number); font-weight: 700; font-size: .6em; opacity: .85; }

/* ---------- 이미지 / 영상 / 오디오 ---------- */
.media-box { flex: 1; min-height: 0; position: relative; border-radius: calc(20px * var(--k)); overflow: hidden; background: #EAF2F9; }
.media-box img, .media-box video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #EAF2F9; }
.media-box.fit-cover img { object-fit: cover; }
.media-box video { background: #000; }
.v-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: calc(130px * var(--k)); height: calc(130px * var(--k)); min-width: 64px; min-height: 64px; border-radius: 50%; border: 0; background: rgba(44, 116, 168, .92); color: #fff; display: grid; place-items: center; cursor: pointer; z-index: 3; box-shadow: 0 8px 30px rgba(0,0,0,.3); transition: opacity .2s; }
.v-play svg { width: 42%; height: 42%; display: block; margin-left: 6%; }
.media-box.playing .v-play { opacity: 0; }
.media-box.playing .v-play svg { margin-left: 0; }
.media-box.playing:hover .v-play { opacity: .85; }
.widget.bare-media { padding: 0; box-shadow: none; background: transparent; }
.widget.bare-media .media-box { border-radius: calc(24px * var(--k)); }
.media-nav { position: absolute; top: 50%; transform: translateY(-50%); width: calc(72px * var(--k)); height: calc(72px * var(--k)); border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: var(--text); display: grid; place-items: center; opacity: 0; transition: opacity .2s; }
.media-nav svg { width: 50%; height: 50%; }
.media-box:hover .media-nav { opacity: 1; }
.media-nav.prev { left: 16px; } .media-nav.next { right: 16px; }
.media-count { position: absolute; right: 16px; bottom: 14px; background: rgba(31,51,70,.75); color: #fff; font-family: var(--font-number); font-weight: 700; font-size: calc(22px * var(--k)); padding: 4px 14px; border-radius: 99px; }
.media-cap { margin-top: calc(14px * var(--k)); font-size: calc(30px * var(--k)); font-weight: 600; text-align: center; word-break: keep-all; }

.a-title { font-size: calc(34px * var(--k)); font-weight: 700; line-height: 1.3; word-break: break-all; margin-bottom: auto; }
.a-row { display: flex; align-items: center; gap: calc(20px * var(--k)); margin-top: calc(20px * var(--k)); }
.a-play { width: calc(88px * var(--k)); height: calc(88px * var(--k)); flex: none; border-radius: 50%; border: 0; background: var(--point); color: #fff; display: grid; place-items: center; }
.a-play svg { width: 44%; height: 44%; }
.a-prog { flex: 1; height: calc(14px * var(--k)); border-radius: 99px; background: var(--pastel-sky); overflow: hidden; cursor: pointer; }
.a-prog b { display: block; height: 100%; width: 0; background: var(--point); border-radius: 99px; }
.a-time { font-family: var(--font-number); font-weight: 700; font-size: calc(26px * var(--k)); color: var(--point); min-width: calc(90px * var(--k)); text-align: right; }

/* ---------- 입장 QR ---------- */
.en-count { font-size: calc(24px * var(--k)); font-weight: 600; color: var(--ui-muted); white-space: nowrap; }
.en-count b, .wq-count b { font-family: var(--font-number); font-weight: 800; color: var(--point); font-size: 1.3em; }
.en-code { display: flex; align-items: baseline; justify-content: center; gap: calc(14px * var(--k)); margin-top: calc(12px * var(--k)); font-size: calc(24px * var(--k)); font-weight: 700; color: var(--ui-muted); }
.en-code b { font-family: var(--font-number); font-weight: 800; color: var(--point); font-size: calc(64px * var(--k)); letter-spacing: .12em; }
.wq-card { position: absolute; right: 120px; top: 230px; width: 470px; background: #fff; border-radius: 36px; padding: 34px; display: flex; flex-direction: column; align-items: center; gap: 16px; box-shadow: 0 20px 60px rgba(31,51,70,.12); }
.wq-card.wq-empty { top: 330px; }
#waiting:has(.wq-card) .w-center { right: 660px; }
#waiting:has(.wq-card) .w-title { font-size: 104px; }
.wq-title { font-family: var(--font-title); font-size: 44px; color: var(--text); }
.wq-card .wq-qr { width: 360px; height: 360px; flex: none; container-type: size; }
.wq-code { font-size: 30px; font-weight: 700; color: var(--ui-muted); }
.wq-code b { font-family: var(--font-number); font-weight: 800; font-size: 64px; color: var(--point); letter-spacing: .12em; margin-left: 10px; }
.wq-count { font-size: 30px; font-weight: 600; color: var(--ui-muted); }
.wq-help { white-space: pre-line; text-align: center; font-size: 28px; line-height: 1.5; color: var(--ui-muted); }
.wq-start { font-size: 30px; }

/* ---------- 발표 자료 ---------- */
.w-share.drop-on { box-shadow: inset 0 0 0 8px var(--point); }
.w-share.drop-on .sh-drop { border-color: var(--point); color: var(--point); }
.sh-who { margin-right: auto; margin-left: calc(4px * var(--k)); font-size: calc(22px * var(--k)); font-weight: 600; color: var(--ui-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-who b { font-family: var(--font-title); font-weight: normal; font-size: 1.3em; color: var(--text); margin-left: .2em; }
.sh-who.hide { visibility: hidden; }
.sh-view { flex: 1; min-height: 0; position: relative; border-radius: calc(18px * var(--k)); overflow: hidden; background: #EAF2F9; }
.sh-view img, .sh-view iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border: 0; background: #EAF2F9; }
.sh-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.editing .sh-view iframe { pointer-events: none; }
.sh-audio { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(20px * var(--k)); font-size: calc(30px * var(--k)); font-weight: 700; padding: 20px; text-align: center; word-break: break-all; }
.sh-audio audio { width: 80%; }
.sh-bar { display: flex; align-items: center; gap: calc(10px * var(--k)); margin-top: calc(12px * var(--k)); }
.sh-bar .t-sm { padding: calc(6px * var(--k)) calc(12px * var(--k)); font-size: calc(18px * var(--k)); display: inline-flex; align-items: center; }
.sh-bar .t-sm svg { width: calc(22px * var(--k)); height: calc(22px * var(--k)); }
.sh-count { font-family: var(--font-number); font-weight: 800; font-size: calc(20px * var(--k)); color: var(--point); white-space: nowrap; }
.sh-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(20px * var(--k)); font-weight: 600; }
.sh-bar .sh-del { color: var(--state-help); }

/* ---------- 발표자 뽑기 ---------- */
.pk-left { font-family: var(--font-body); font-size: calc(24px * var(--k)); font-weight: 600; color: var(--ui-muted); white-space: nowrap; }
.pk-left b { font-family: var(--font-number); color: var(--point); }
.pk-stage { flex: 1; display: flex; align-items: center; justify-content: center; container-type: size; min-height: 0; }
.pk-name { font-family: var(--font-title); color: var(--text); font-size: min(17cqw, 60cqh); text-align: center; line-height: 1.15; word-break: keep-all; }
.pk-name.idle { font-size: min(8cqw, 30cqh); color: var(--ui-muted); }
.pk-name.rolling { color: var(--point); }
.pk-ctrl { display: flex; gap: calc(12px * var(--k)); align-items: center; }
.pk-draw { border: 0; background: var(--point); color: #fff; font-family: var(--font-title); font-size: calc(40px * var(--k)); padding: calc(14px * var(--k)) calc(48px * var(--k)); border-radius: 999px; }
.pk-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; justify-content: flex-end; max-width: 60%; }
.pk-chips span { background: var(--pastel-lemon); font-size: calc(20px * var(--k)); font-weight: 600; padding: 4px 12px; border-radius: 8px; }

/* ---------- QR ---------- */
.qr-box { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; container-type: size; }
.qr-img { position: relative; width: min(100cqw, 100cqh); height: min(100cqw, 100cqh); }
.qr-img svg { width: 100%; height: 100%; display: block; }
.qr-badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 24%; height: 24%; border-radius: 22%; display: grid; place-items: center; font-family: var(--font-body); font-weight: 900; font-size: min(6cqw, 6cqh); letter-spacing: -0.02em; box-shadow: 0 0 0 max(4px, 1.6cqw) #fff; }
.qr-cap { margin-top: calc(14px * var(--k)); display: flex; flex-direction: column; align-items: center; gap: calc(8px * var(--k)); text-align: center; font-weight: 700; font-size: calc(30px * var(--k)); word-break: keep-all; }
.qr-type { font-size: .7em; font-weight: 800; padding: .2em .8em; border-radius: 999px; }
.qr-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qr-opt { display: flex; align-items: center; gap: 8px; border: 1px solid var(--ui-line); background: #fff; border-radius: 10px; padding: 8px 10px; font-size: 14px; font-weight: 700; color: var(--text); text-align: left; }
.qr-opt.on { border-color: var(--point); box-shadow: 0 0 0 2px var(--point) inset; }
.qr-dot { width: 34px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 900; flex: none; }
.qr-url { font-size: calc(22px * var(--k)); color: var(--ui-muted); word-break: break-all; text-align: center; }

/* ---------- 대기 화면 ---------- */
#waiting { background: var(--bg); }
.blob { position: absolute; border-radius: 50%; will-change: transform; }
.blob.b1 { width: 900px; height: 900px; right: -260px; top: -380px; background: var(--pastel-sky); animation: drift1 14s ease-in-out infinite alternate; }
.blob.b2 { width: 620px; height: 620px; left: -220px; bottom: -280px; background: var(--pastel-mint); animation: drift2 12s ease-in-out infinite alternate; }
.blob.b3 { width: 260px; height: 260px; right: 240px; bottom: 120px; background: var(--pastel-lilac); animation: drift1 10s ease-in-out infinite alternate-reverse; }
.blob.b4 { width: 170px; height: 170px; left: 760px; top: 40px; background: var(--pastel-lemon); animation: drift2 9s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(-60px, 50px); } }
@keyframes drift2 { to { transform: translate(50px, -40px); } }
.w-brand { position: absolute; left: 96px; top: 72px; display: flex; align-items: center; gap: 14px; font-family: var(--font-title); font-size: 40px; color: var(--text); }
.w-brand .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--point); }
.w-center { position: absolute; left: 160px; right: 160px; top: 250px; }
.w-org { font-family: var(--font-number); font-weight: 700; font-size: 38px; color: var(--point); margin-bottom: 18px; }
.w-title { font-family: var(--font-title); font-weight: normal; font-size: 120px; line-height: 1.15; margin: 0; word-break: keep-all; }
.w-sub { font-size: 46px; font-weight: 500; margin-top: 22px; color: var(--text); }
.w-clock { font-family: var(--font-number); font-weight: 800; font-size: 92px; color: var(--point); margin-top: 70px; letter-spacing: 0.02em; }
.w-soon { font-size: 34px; color: var(--ui-muted); margin-top: 6px; font-weight: 600; }
.w-actions { position: absolute; left: 160px; bottom: 110px; display: flex; gap: 20px; align-items: center; }
.btn-start { border: 0; background: var(--point); color: #fff; font-family: var(--font-title); font-size: 48px; padding: 24px 72px; border-radius: 999px; box-shadow: 0 10px 30px rgba(44,116,168,.3); }
.btn-start:hover { filter: brightness(1.08); }
.btn-ghost { border: 3px solid var(--text); background: transparent; color: var(--text); font-weight: 700; font-size: 30px; padding: 18px 40px; border-radius: 999px; }
.w-hint { position: absolute; right: 96px; bottom: 60px; font-size: 24px; color: var(--ui-muted); font-weight: 600; }

/* ---------- 인트로 (코드 모션) ---------- */
#intro { background: var(--bg); }
.i-circle { position: absolute; border-radius: 50%; }
.c-sky { background: var(--pastel-sky); } .c-mint { background: var(--pastel-mint); }
.c-lilac { background: var(--pastel-lilac); } .c-lemon { background: var(--pastel-lemon); }
.i-content { position: absolute; left: 180px; right: 180px; top: 270px; }
.i-brand { font-family: var(--font-number); font-weight: 700; font-size: 42px; color: var(--point); letter-spacing: .02em; }
.i-title { font-family: var(--font-title); font-weight: normal; font-size: 136px; line-height: 1.15; margin: 26px 0 0; word-break: keep-all; }
.i-title .ch { display: inline-block; }
.i-line { width: 420px; height: 12px; border-radius: 99px; background: var(--point); margin: 44px 0 34px; transform-origin: left center; }
.i-sub { font-size: 52px; font-weight: 600; }
.i-meta { display: flex; align-items: center; gap: 24px; margin-top: 30px; font-family: var(--font-number); font-weight: 700; font-size: 38px; color: var(--point); }
.i-meta .sep { width: 10px; height: 10px; border-radius: 50%; background: var(--point); opacity: .5; }
.i-skip { position: absolute; right: 60px; bottom: 50px; border: 0; background: rgba(31,51,70,.08); color: var(--ui-muted); font-size: 24px; font-weight: 600; padding: 12px 26px; border-radius: 99px; }

/* ---------- 화면 밖 UI (확대/축소 안 됨) ---------- */
.chrome { position: fixed; z-index: 50; font-size: 14px; }
#topbar { left: 0; right: 0; top: 0; height: 60px; background: #fff; border-bottom: 1px solid var(--ui-line); display: flex; align-items: center; gap: 8px; padding: 0 14px; }
#topbar .logo { font-family: var(--font-title); font-size: 20px; margin-right: 10px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
#topbar .logo i { width: 12px; height: 12px; border-radius: 50%; background: var(--point); display: inline-block; }
#topbar .sep { width: 1px; height: 28px; background: var(--ui-line); margin: 0 6px; }
#topbar .grow { flex: 1; }
.ub { height: 38px; border: 1px solid var(--ui-line); background: #fff; color: var(--text); border-radius: 10px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.ub:hover { background: var(--bg); }
.ub svg { width: 18px; height: 18px; }
.ub.icon { width: 38px; padding: 0; justify-content: center; }
.ub.primary { background: var(--point); border-color: var(--point); color: #fff; }
.ub.primary:hover { filter: brightness(1.08); background: var(--point); }
.ub:disabled { opacity: .4; cursor: default; }
.scr-label { font-family: var(--font-number); font-weight: 700; font-size: 15px; min-width: 74px; text-align: center; }
select.ub { padding-right: 8px; }

#dock { left: 50%; bottom: 14px; transform: translateX(-50%); background: #fff; border-radius: 18px; box-shadow: 0 8px 30px rgba(15,27,41,.25); display: flex; gap: 4px; padding: 8px 10px; }
#dock button { width: 78px; height: 66px; border: 0; background: transparent; border-radius: 12px; color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 12px; font-weight: 600; }
#dock button:hover { background: var(--bg); }
#dock svg { width: 26px; height: 26px; color: var(--point); }

#hud { right: 16px; bottom: 16px; background: rgba(255,255,255,.95); border-radius: 14px; box-shadow: 0 6px 24px rgba(15,27,41,.25); display: flex; align-items: center; gap: 4px; padding: 6px; transition: opacity .3s; }
#hud.fade { opacity: 0; pointer-events: none; }
#hud .ub { border: 0; }

body.panel-open #topbar { right: 380px; }
body.panel-open #dock { left: calc((100% - 380px) / 2); }
#panel { position: fixed; right: 0; top: 0; bottom: 0; width: 380px; background: #fff; z-index: 60; box-shadow: -8px 0 30px rgba(15,27,41,.18); display: flex; flex-direction: column; }
.pn-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--ui-line); }
.pn-head h3 { margin: 0; font-size: 18px; }
.pn-body { flex: 1; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld-l { font-size: 13px; font-weight: 700; color: var(--ui-muted); }
.fld input[type=text], .fld input[type=number], .fld input[type=url], .fld input[type=email], .fld input[type=password], .fld textarea, .fld select { width: 100%; border: 1px solid var(--ui-line); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 15px; color: var(--text); background: #fff; }
.fld textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.fld input:focus, .fld textarea:focus, .fld select:focus { outline: 2px solid var(--pastel-sky); border-color: var(--point); }
.fld-row { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.fld-row input { width: 18px; height: 18px; accent-color: var(--point); }
.fld-help { font-size: 12px; color: var(--ui-muted); line-height: 1.5; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatches .sw { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--ui-line); cursor: pointer; padding: 0; }
.swatches .sw.on { box-shadow: 0 0 0 3px var(--point); }
.swatches input[type=color] { width: 40px; height: 34px; border: 1px solid var(--ui-line); border-radius: 8px; background: #fff; padding: 2px; cursor: pointer; }
.swatches .sw-l { font-size: 12px; color: var(--ui-muted); margin-left: 2px; }
.media-pick { display: flex; flex-direction: column; gap: 8px; }
.media-item { display: flex; align-items: center; gap: 8px; border: 1px solid var(--ui-line); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.media-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-item button { border: 0; background: transparent; color: var(--state-help); font-weight: 700; font-size: 13px; }
.pn-actions { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--ui-line); padding-top: 16px; }
.credit { font-size: 12px; color: var(--ui-muted); line-height: 1.7; border-top: 1px solid var(--ui-line); padding-top: 14px; }
.keys { width: 100%; border-collapse: collapse; font-size: 14px; }
.keys td { padding: 7px 4px; border-bottom: 1px solid var(--ui-line); }
.keys td:first-child { font-family: var(--font-number); font-weight: 700; color: var(--point); white-space: nowrap; width: 110px; }

/* 클라우드 */
.ub.cloud-saved { color: var(--state-done); }
.ub.cloud-saving, .ub.cloud-dirty { color: var(--state-doing); }
.ub.cloud-error { color: var(--state-help); border-color: var(--state-help); }
.ub.cloud-off { color: var(--ui-muted); }
.cl-box { border: 1px solid var(--ui-line); border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.6; }
.cl-box b { color: var(--point); }
.cl-err { color: var(--state-help); font-size: 13px; font-weight: 600; line-height: 1.5; }
.lec-list { display: flex; flex-direction: column; gap: 8px; }
.lec-item { display: flex; align-items: center; gap: 8px; border: 1px solid var(--ui-line); border-radius: 10px; padding: 10px 12px; }
.lec-item.current { border-color: var(--point); background: #F3F8FC; }
.lec-item .lec-t { flex: 1; min-width: 0; }
.lec-item .lec-t div:first-child { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lec-item .lec-t div:last-child { font-size: 12px; color: var(--ui-muted); font-family: var(--font-number); }
.lec-item button { height: 32px; border: 1px solid var(--ui-line); background: #fff; border-radius: 8px; padding: 0 10px; font-size: 13px; font-weight: 600; color: var(--text); }
.lec-item button.del { color: var(--state-help); }
.pn-sub { font-size: 13px; font-weight: 800; color: var(--text); margin-top: 4px; }

#blackout { position: fixed; inset: 0; background: #000; z-index: 100; cursor: none; }
#toast { position: fixed; left: 50%; bottom: 100px; transform: translate(-50%, 20px); background: var(--text); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 15px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 200; max-width: 80vw; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
