:root { --bar: #e8e6e1; --bar-text: #222; --face: #d4d0c8; --page: #18181c; --page-text: #eee; color-scheme: light dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bar: #2b2b2b; --bar-text: #ddd; } }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--page); color: var(--page-text); font: 14px -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; }
body { display: flex; flex-direction: column; }
#bar { flex: none; display: flex; align-items: center; gap: 10px; height: 28px; padding: 0 10px; background: var(--bar); color: var(--bar-text); user-select: none; }
#brand-icon { image-rendering: pixelated; flex: none; }
#brand { font-weight: 600; white-space: nowrap; }
#status { margin-left: auto; opacity: .75; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#audio-btn { flex: none; height: 22px; padding: 0 8px; border: 1px solid #8886; border-radius: 4px; background: transparent; color: inherit; font: 12px inherit; cursor: pointer; }
#audio-btn:hover { background: #8883; }
#menubar { display: flex; height: 100%; }
#menubar > .top { position: relative; padding: 0 10px; display: flex; align-items: center; cursor: default; }
#menubar > .top:hover, #menubar > .top.open { background: #3478f6; color: #fff; }
.menu { position: absolute; top: 100%; left: 0; min-width: 220px; background: #fbfbfb; color: #111; border: 1px solid #999; box-shadow: 0 6px 18px #0006; padding: 4px 0; z-index: 100000; }
.menu .item { padding: 3px 22px; white-space: nowrap; position: relative; }
.menu .item:hover:not(.off) { background: #3478f6; color: #fff; }
.menu .item.off { color: #999; }
.menu .item.checked::before { content: "✓"; position: absolute; left: 7px; }
.menu .sep { height: 1px; margin: 4px 0; background: #ccc; }
.menu .menu { top: -5px; left: 100%; }
#stage { flex: 1; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
#screen { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: #000; overflow: hidden; touch-action: none; }
#screen[hidden] { display: none; }
#screen canvas { position: absolute; image-rendering: pixelated; }
#screen .nc { position: absolute; background: var(--face); border: 1px solid #808080; }
#screen .nc .caption { height: 19px; padding: 0 6px; background: linear-gradient(90deg, #0a246a, #a6caf0); color: #fff; font: bold 12px Gulim, Dotum, "Apple SD Gothic Neo", sans-serif; line-height: 19px; white-space: nowrap; overflow: hidden; }
#screen .client-bg { position: absolute; background: var(--face); }
#screen .mdiclient { position: absolute; background: #808080; }
#screen .ctl { position: absolute; color: #000; font-family: GulimChe, Gulim, Dotum, "Apple SD Gothic Neo", sans-serif; display: flex; align-items: center; white-space: pre; overflow: hidden; touch-action: auto; }
#screen .ctl.button { justify-content: center; background: var(--face); border: 2px outset #fff; padding: 0; color: #000; }
#screen .ctl.button:active:not(:disabled) { border-style: inset; }
#screen .ctl.button.default { outline: 1px solid #000; }
#screen .ctl.check { gap: 4px; }
#screen .ctl.check input { margin: 0 2px 0 0; }
#screen .ctl.group { border: 1px solid #808080; border-radius: 0; align-items: flex-start; overflow: visible; pointer-events: none; }
#screen .ctl.group span { position: relative; top: -0.7em; left: 6px; padding: 0 2px; background: var(--face); }
#screen .ctl.edit { background: #fff; border: 2px inset #ddd; padding: 0 2px; font-size: inherit; color: #000; }
#screen .ctl.list { background: #fff; border: 2px inset #ddd; overflow-y: auto; display: block; }
#screen .ctl.list div { padding-left: 2px; cursor: default; }
#screen .ctl.list div.sel { background: #0a246a; color: #fff; }
#screen .ctl.updown { flex-direction: column; border: 1px solid #808080; background: var(--face); user-select: none; }
#screen .ctl.updown div { flex: 1; width: 100%; border: 1px outset #fff; display: flex; align-items: center; justify-content: center; font-size: 8px; }
#screen .ctl.disabled { color: #808080; }
#screen.nocursor, #screen.nocursor canvas { cursor: none; }
#loading { width: min(420px, 88vw); padding: 28px 24px; border-radius: 10px; background: #24252c; border: 1px solid #ffffff1a; box-shadow: 0 12px 36px #0008; text-align: center; }
#loading[hidden] { display: none; }
#loading .crest { image-rendering: pixelated; margin-bottom: 10px; }
#loading h1 { margin: 0 0 18px; font-size: 18px; font-weight: 600; color: #f2f2f5; }
#progress-track { height: 8px; border-radius: 4px; background: #ffffff18; overflow: hidden; }
#progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #3478f6, #64a8ff); transition: width 0.12s ease-out; }
#loading-text { margin: 12px 0 0; font-size: 13px; color: #b8bac4; }
#modal { position: fixed; inset: 0; background: #0006; display: flex; align-items: center; justify-content: center; z-index: 200000; }
#modal[hidden] { display: none; }
#modal .box { background: var(--face); color: #000; min-width: 320px; max-width: 560px; border: 2px outset #fff; }
#modal h2 { margin: 0; padding: 3px 8px; font-size: 13px; color: #fff; background: linear-gradient(90deg, #0a246a, #a6caf0); }
#modal p { margin: 18px 16px; white-space: pre-wrap; }
#modal-buttons { display: flex; justify-content: center; gap: 10px; padding: 0 0 14px; }
#modal button { min-width: 80px; }
