/* =========================================================
   RACK — 스타일
   패널은 흑색 아노다이징 알루미늄 + 흰 실크스크린, 노브는 널링된 플라스틱,
   잭·나사·토글은 니켈 도금 금속. 빛은 항상 왼쪽 위에서 온다.
   화려한 색은 케이블과 모듈 고유색(이름 아래 한 줄, LED)에만 쓴다.
   ========================================================= */
/* 글꼴은 앱에 함께 들어 있어 인터넷 없이도 같은 모습으로 보인다 (SIL Open Font License, core/fonts/OFL-*.txt) */
@font-face { font-family: 'Michroma'; src: url('fonts/Michroma-Regular.woff2') format('woff2'); font-weight: 400; font-display: block; }
@font-face { font-family: 'Barlow'; src: url('fonts/Barlow-Regular.woff2') format('woff2'); font-weight: 400; font-display: block; }
@font-face { font-family: 'Barlow'; src: url('fonts/Barlow-Medium.woff2') format('woff2'); font-weight: 500; font-display: block; }
@font-face { font-family: 'Barlow'; src: url('fonts/Barlow-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: block; }
@font-face { font-family: 'Barlow'; src: url('fonts/Barlow-Bold.woff2') format('woff2'); font-weight: 700; font-display: block; }
@font-face { font-family: 'Barlow Semi Condensed'; src: url('fonts/BarlowSemiCondensed-Medium.woff2') format('woff2'); font-weight: 500; font-display: block; }
@font-face { font-family: 'Barlow Semi Condensed'; src: url('fonts/BarlowSemiCondensed-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: block; }
@font-face { font-family: 'Barlow Semi Condensed'; src: url('fonts/BarlowSemiCondensed-Bold.woff2') format('woff2'); font-weight: 700; font-display: block; }

:root {
  --case: #17181a;
  --case-deep: #0d0e0f;
  --bar: #151618;
  --line: #26282c;
  --ink: #e8e6e0;
  --ink-dim: #8d9096;
  --anod: #1c1d1f;          /* 흑색 아노다이징 */
  --silk-ink: #ebe7dc;      /* 실크스크린 흰 잉크 */
  --signal: #f0b429;
  --danger: #e5484d;
  --ok: #30c48d;
  --accent: #8a8f96;
  --grain-light: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.15' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 .24 0 0 0 -.075'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
  --grain-dark: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='2' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .5 0 0 -.14'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
  --grain-ink: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.3' numOctaves='2' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .16 0 0 -.05'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
  --ui: 'Barlow', system-ui, -apple-system, 'Segoe UI', 'Malgun Gothic', sans-serif;
  --silk: 'Barlow Semi Condensed', 'Arial Narrow', sans-serif;
  --name: 'Michroma', 'Eurostile', 'Arial', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
@supports (height: 100dvh) { html, body { height: 100dvh; } }   /* iOS 사파리: 주소창을 뺀 실제 보이는 높이 */
body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--case-deep);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

/* ---------- 상단 바 ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transform: translateY(-100%);
  transition: transform .22s ease, box-shadow .22s ease;
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 54px;
  padding: 0 16px;
  background: var(--bar);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 400 19px/1 var(--name);
  letter-spacing: .12em;
}
.brand-jacks { display: flex; gap: 3px; }
.brand-ver { font: 600 10px/1 var(--silk); letter-spacing: .16em; color: #ebe7dc80; }
.brand-jacks i {
  width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle, #0a0a0b 0 2px, transparent 2.5px), #9ea2a8;
}
.brand-jacks i:nth-child(1) { box-shadow: 0 0 0 2px #e5484d; }
.brand-jacks i:nth-child(2) { box-shadow: 0 0 0 2px #f0b429; }
.brand-jacks i:nth-child(3) { box-shadow: 0 0 0 2px #3e8ef7; }

.topbar.open { transform: none; box-shadow: 0 14px 34px #000000b0; }

/* 메뉴를 부르는 작은 탭 (화면 위 가운데) */
.menu-tab {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 49;
  display: grid;
  place-items: center;
  width: auto;
  height: 18px;
  padding: 0 10px 1px;
  border: 0;
  border-radius: 0 0 9px 9px;
  background: #1c1d20e0;
  box-shadow: 0 0 0 1px #2c2e33, 0 4px 12px #0009;
  opacity: .5;
  cursor: pointer;
  transform: translateX(-50%);
  transition: opacity .15s, transform .22s ease;
}
.menu-tab:hover, .menu-tab:focus-visible { opacity: 1; }

.menu-tab.hidden { transform: translate(-50%, -110%); }
.menu-tab { grid-auto-flow: column; gap: 7px; }
.menu-tab .menu-word { font: 600 8.5px/1 var(--silk); letter-spacing: .22em; color: #ebe7dcc0; }
.menu-tab .brand-jacks { gap: 4px; }
.menu-tab .brand-jacks i { width: 6px; height: 6px; background: radial-gradient(circle, #0a0a0b 0 1.4px, transparent 1.8px), #9ea2a8; }
.menu-tab .brand-jacks i:nth-child(1) { box-shadow: 0 0 0 1.5px #e5484d; }
.menu-tab .brand-jacks i:nth-child(2) { box-shadow: 0 0 0 1.5px #f0b429; }
.menu-tab .brand-jacks i:nth-child(3) { box-shadow: 0 0 0 1.5px #3e8ef7; }

.tb-group { display: flex; gap: 6px; padding-left: 14px; border-left: 1px solid var(--line); }
.tb-btn {
  padding: 7px 12px;
  background: #222428;
  border: 1px solid #303338;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.tb-btn:hover { background: #2a2d32; border-color: #3b3f45; }
.tb-btn.primary { background: var(--signal); border-color: transparent; color: #1c1403; font-weight: 700; }
.tb-btn.primary:hover { background: #f5c143; }
.tb-spacer { flex: 1; }

.status { font-size: 12px; color: var(--ink-dim); white-space: nowrap; }
.status.live::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--ok);
  vertical-align: 1px;
}

/* ---------- 랙 ---------- */
/* 방: 벽에 스탠드 빛이 떨어지고, 그 앞에 케이스가 놓여 있다 */
.rack-scroll {
  flex: 1;
  position: relative;
  display: flex;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 20px 12px 12px;
  background:
    radial-gradient(ellipse 70% 60% at 50% 38%, #2a2927 0%, #1a1a1a 55%, #0e0e0f 100%);
}
.case-stage { position: relative; flex: none; margin: auto; }

/* ---------- 케이스 ---------- */
.case {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  border-radius: 9px;
  background: #0a0a0b;
  box-shadow:
    0 2px 0 #ffffff0a,
    0 40px 60px -20px #000000e0,
    0 18px 30px -10px #000000a0,
    0 0 0 1px #000;
}
.case.patching { cursor: crosshair; }

/* 옆판: 두꺼운 알루미늄, 모서리를 둥글게 깎고 나사 두 개 */
.cheek {
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--cheek);
  background:
    radial-gradient(circle at 50% 30px, #0a0a0b 0 3px, #2c2d30 3.6px, transparent 4.4px),
    radial-gradient(circle at 50% calc(100% - 30px), #0a0a0b 0 3px, #2c2d30 3.6px, transparent 4.4px),
    var(--grain-light),
    linear-gradient(90deg, #1b1c1e, #2a2b2e 30%, #232426 70%, #151618);
  box-shadow: inset 0 1px 0 #ffffff1a, inset 0 -1px 0 #000;
}
.cheek.left { left: 0; border-radius: 9px 0 0 9px; box-shadow: inset 1px 0 0 #ffffff14, inset -2px 0 3px -1px #000, inset 0 1px 0 #ffffff1a; }
.cheek.right { right: 0; border-radius: 0 9px 9px 0; box-shadow: inset -1px 0 0 #00000080, inset 2px 0 3px -1px #000, inset 0 1px 0 #ffffff1a; }

/* 위·아래 유틸리티 패널 */
.case-strip {
  position: absolute;
  left: var(--cheek);
  right: var(--cheek);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  --etch: none;
  color: var(--silk-ink);
  background-color: var(--anod);
  background-image:
    var(--etch),
    var(--grain-light),
    var(--grain-dark),
    linear-gradient(180deg, #ffffff0c, transparent 40%, #0000002a);
  box-shadow: inset 0 1px 0 #ffffff1a, inset 0 -1px 0 #000, 0 0 0 1px #000;
  user-select: none;
  -webkit-user-select: none;
}
.case-top { top: 0; height: var(--strip-top); }
.case-bottom { bottom: 0; height: var(--strip-bottom); }

.case-brand { display: flex; align-items: baseline; gap: 14px; }
.case-brand b { font: 400 20px/1 var(--name); letter-spacing: .16em; }
.case-brand span { font: 600 10px/1 var(--silk); letter-spacing: .2em; color: #ebe7dc8c; }

/* 마스터 볼륨 노브 + 불이 들어오는 뮤트 버튼 */
.master-slot { display: flex; align-items: center; }
.master { display: flex; align-items: center; gap: 20px; }
.master-cell { display: flex; flex-direction: column; align-items: center; }
.master-label { margin-top: -4px; font: 600 10.5px/1 var(--silk); letter-spacing: .16em; }
.master-knob { cursor: ns-resize; border-radius: 50%; touch-action: none; }
.master-knob:hover .k-light, .master-knob.active .k-light { filter: brightness(1.35); }

.mute-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 8px 0 11px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: conic-gradient(from 20deg, #eef0f2, #8f949a, #dfe2e5, #6f747a, #eef0f2, #8f949a, #dfe2e5, #6f747a, #eef0f2);
  box-shadow: 0 0 0 1px #000, 1px 3px 5px #000d;
  cursor: pointer;
}
.mute-btn:focus-visible { outline-offset: 3px; }
.mute-cap {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #6e3531 0, #451714 45%, #260807 100%);
  box-shadow: inset 0 2px 3px #ffffff2a, inset 0 -3px 6px #000c, 0 0 0 2.5px #0b0b0c;
  transition: transform .06s, box-shadow .15s, background .15s;
}
.mute-btn:active .mute-cap { transform: translateY(1px) scale(.96); }
.master.muted .mute-cap {
  background: radial-gradient(circle at 40% 34%, #fff5f1 0, #ff9a88 13%, #ff3b2e 42%, #c8170d 78%, #7d0a04 100%);
  box-shadow:
    inset 0 2px 3px #ffffff90, inset 0 -3px 6px #7d0a04, 0 0 0 2.5px #0b0b0c,
    0 0 16px 4px #ff3b2ea0, 0 0 46px 12px #ff3b2e45;
}
.master.muted .master-cell:last-child .master-label { color: #ff8f84; }
@keyframes mute-call { 50% { filter: brightness(.72); } }

.power-led i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #000, 0 0 0 2px #ffffff10;
}
.case-left { display: flex; align-items: center; gap: 22px; }
.undo-btn { display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: none; color: var(--silk-ink); cursor: pointer; }
.undo-cap {
  display: grid;
  place-items: center;
  width: 36px;
  height: 27px;
  border-radius: 5px;
  background: linear-gradient(180deg, #4b4d52, #27282b 55%, #1b1c1e);
  box-shadow: 0 0 0 1px #000, 0 0 0 2.5px #8f949a, 0 0 0 3.5px #000, 1px 3px 6px #000c, inset 0 1px 0 #ffffff30;
  transition: transform .06s;
}
.undo-cap svg { width: 16px; height: 16px; fill: none; stroke: #ebe7dc; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.undo-btn:active:not(:disabled) .undo-cap { transform: translateY(1px); box-shadow: 0 0 0 1px #000, 0 0 0 2.5px #8f949a, 0 0 0 3.5px #000, 0 1px 2px #000c; }
.undo-label { font: 600 10px/1 var(--silk); letter-spacing: .16em; white-space: pre; }
.undo-btn:disabled { cursor: default; }
.undo-btn:disabled .undo-cap svg { stroke: #ebe7dc55; }
.undo-btn:disabled .undo-label { color: #ebe7dc70; }
.case.locked .module { cursor: default; }
/* MIDI LEARN */
.midi-btn { position: relative; }
.midi-btn .undo-cap svg { fill: none; stroke: #ebe7dc; stroke-width: 1.6; }
.midi-btn .undo-cap svg circle:not(:first-child) { fill: #ebe7dc; stroke: none; }
.midi-led { width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #4a4020, #1c180c); box-shadow: 0 0 0 1px #000, 0 0 0 2px #ffffff10; }
.midi-btn.armed .midi-led { background: radial-gradient(circle at 40% 35%, #fff, #ffb02e 50%, #b8740e); box-shadow: 0 0 0 1px #000, 0 0 10px #ffb02e; animation: led-call .8s ease-in-out infinite; }
.midi-btn.armed .undo-cap { box-shadow: 0 0 0 1px #000, 0 0 0 2.5px #ffb02e, 0 0 0 3.5px #000, 0 0 14px 2px #ffb02e88; }
.midi-btn.armed .undo-label { color: #ffcf7a; }
.midi-btn.linked .midi-led { animation: none; background: radial-gradient(circle at 40% 35%, #fff, #3ee08f 50%, #1d9a5a); box-shadow: 0 0 0 1px #000, 0 0 14px #3ee08f; }
.midi-btn.linked .undo-cap { box-shadow: 0 0 0 1px #000, 0 0 0 2.5px #3ee08f, 0 0 0 3.5px #000, 0 0 18px 4px #3ee08f99; }
.midi-btn.linked .undo-label { color: #9cf5c6; }
/* 퍼지는 빛 */
.midi-ripple {
  position: absolute; left: 50%; top: 42%; width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border-radius: 50%; border: 2px solid #3ee08f; box-shadow: 0 0 12px #3ee08f, inset 0 0 8px #3ee08f;
  pointer-events: none; z-index: 5; animation: midi-spread 1.1s ease-out forwards;
}
.midi-ripple.btn { left: 18px; top: 50%; }
@keyframes midi-spread { from { transform: scale(.4); opacity: 1; } to { transform: scale(4.5); opacity: 0; } }
/* 장전 중 고른 노브 */
.knob-cell, .slider-cell, .switch-cell, .button-cell, .step-cell { position: relative; }
.midi-target-ring {
  position: absolute; inset: -3px; border-radius: 10px; border: 2px solid #ffb02e;
  box-shadow: 0 0 10px #ffb02e99; pointer-events: none; z-index: 5; animation: led-call .8s ease-in-out infinite;
}
/* 컨트롤러가 연결된 노브: 작은 초록 점 */
.midi-mapped::after {
  content: ''; position: absolute; right: 1px; top: 1px; width: 5px; height: 5px; border-radius: 50%;
  background: #3ee08f; box-shadow: 0 0 5px #3ee08f; pointer-events: none;
}
/* 케이스 줄 수 + / − (맨 왼쪽) */
.rows-ctl { display: flex; align-items: center; gap: 6px; }
.rows-btn {
  width: 24px; height: 24px; padding: 0; border: 0; border-radius: 5px;
  font: 700 15px/1 var(--ui); color: #ebe7dc;
  background: linear-gradient(180deg, #4b4d52, #27282b 55%, #1b1c1e);
  box-shadow: 0 0 0 1px #000, 0 0 0 2.5px #8f949a, 0 0 0 3.5px #000, 1px 3px 6px #000c, inset 0 1px 0 #ffffff30;
  cursor: pointer;
}
.rows-btn:active { transform: translateY(1px); }
.rows-label { min-width: 46px; text-align: center; font: 600 10px/1 var(--silk); letter-spacing: .14em; color: var(--silk-ink); }
/* 선택지가 많은 스위치(버튼 + LED 목록)는 줄 높이를 목록에 맞춘다 */
.sw-row:has(.sw-list.leds) { height: auto; }
/* 녹화 버튼 */
.rec-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #8a3a34, #3a0f0c);
  box-shadow: 0 0 0 1px #000;
}
.rec-btn.on .rec-dot {
  background: radial-gradient(circle at 40% 35%, #fff, #ff3b2e 50%, #c2160c);
  box-shadow: 0 0 0 1px #000, 0 0 10px #ff3b2e, 0 0 3px #ff3b2e;
  animation: led-call 1s ease-in-out infinite;
}
.rec-btn.on .undo-label { color: #ff8f84; font-variant-numeric: tabular-nums; }
.lock-btn .undo-cap svg rect { fill: currentColor; stroke: none; }
.lock-btn .undo-cap { color: #ebe7dc; }
.lock-btn .shackle-closed { display: none; }
.lock-btn[aria-pressed="true"] .shackle-open { display: none; }
.lock-btn[aria-pressed="true"] .shackle-closed { display: inline; }
.lock-led {
  width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #5a4520, #221a0c);
  box-shadow: 0 0 0 1px #000, 0 0 0 2px #ffffff10;
}
.lock-btn[aria-pressed="true"] .lock-led {
  background: radial-gradient(circle at 40% 35%, #fff, #ffb02e 50%, #b8740e);
  box-shadow: 0 0 0 1px #000, 0 0 10px #ffb02e, 0 0 3px #ffb02e;
}
.lock-btn[aria-pressed="true"] .undo-cap { color: #ffcf7a; }
.lock-btn[aria-pressed="true"] .undo-label { color: #ffcf7a; }

.power-led { display: flex; align-items: center; gap: 8px; }
.power-led span { font: 600 9.5px/1 var(--silk); letter-spacing: .16em; color: #ebe7dc8c; }
.power-led i { background: radial-gradient(circle at 40% 35%, #3f5a4b, #16241c); }
.power-led.on i {
  background: radial-gradient(circle at 40% 35%, #fff, #3ee08f 50%, #1d9a5a);
  box-shadow: 0 0 0 1px #000, 0 0 10px #3ee08f, 0 0 3px #3ee08f;
}

/* 라인 출력 단자 (오른쪽 아래) */
.case-out { display: flex; align-items: center; gap: 12px; }
.case-out-label { font: 600 11px/1 var(--silk); letter-spacing: .16em; }
.case-out .mod-out { margin: 0; padding: 6px 12px 5px; grid-template-columns: repeat(2, auto) !important; gap: 0 14px; }

.rack {
  position: absolute;
  /* 케이스 안쪽 + 강철 레일(나사 구멍, 슬라이딩 너트 홈, 헤어라인 결) */
  background-color: var(--case-deep);
  background-image:
    radial-gradient(circle at 7.5px 11px, #050506 0 1.9px, #2a2c30 2.2px, #0000 2.9px),
    radial-gradient(circle at 7.5px calc(100% - 11px), #050506 0 1.9px, #2a2c30 2.2px, #0000 2.9px),
    linear-gradient(to bottom,
      #c9cdd2 0, #8d9298 1.5px, #6f747a 5px, #7d8288 9px, #5f6369 13px, #6e7379 17px, #3b3e42 21px, #0d0e0f 22px, #0000 22px,
      #0000 calc(100% - 22px), #0d0e0f calc(100% - 22px), #6e7379 calc(100% - 21px), #5f6369 calc(100% - 17px),
      #7d8288 calc(100% - 13px), #6f747a calc(100% - 9px), #8d9298 calc(100% - 5px), #b5b9be calc(100% - 1px), #2b2d30 100%),
    linear-gradient(180deg, #0000 22px, #ffffff05 60px, #0000 50%, #00000040 calc(100% - 22px), #0000 calc(100% - 22px));
  background-size: 15px var(--row), 15px var(--row), 100% var(--row), 100% var(--row);
}

.snap-ghost {
  position: absolute;
  height: 380px;
  border: 2px dashed #f0b42999;
  border-radius: 3px;
  background: #f0b42912;
  pointer-events: none;
}

/* ---------- 모듈 패널: 흑색 아노다이징 알루미늄 + 실크스크린 ---------- */
.module {
  position: absolute;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 380px;
  --etch: none;
  color: var(--silk-ink);
  background-color: var(--anod);
  background-image:
    var(--etch),
    var(--grain-light),
    var(--grain-dark),
    linear-gradient(180deg, #ffffff0d 0, #ffffff03 22%, transparent 50%, #0000001f 100%),
    linear-gradient(90deg, #ffffff08, transparent 12%, transparent 88%, #00000030);
  background-position: 0 0, var(--grain-x) var(--grain-y), calc(var(--grain-x) * -1) var(--grain-y), 0 0, 0 0;
  border-radius: 1.5px;
  box-shadow:
    inset 0 1px 0 #ffffff1c,
    inset 1px 0 0 #ffffff0d,
    inset -1px 0 0 #00000080,
    inset 0 -1px 0 #000000a0,
    0 0 0 1px #000,
    0 12px 22px -12px #000;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.module.dragging {
  z-index: 3;
  cursor: grabbing;
  box-shadow: inset 0 1px 0 #ffffff1c, 0 0 0 1px #000, 0 28px 44px -14px #000;
}

/* 신호 흐름 인쇄 (입력 → 출력). 부품 뒤, 패널 위에 */
.mod-ports.has-group { padding-top: 17px; }
.mod-portgroups { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.mod-portgroups .pg-text { font: 600 7.5px/1 var(--silk); letter-spacing: .14em; fill: #ebe7dc; text-anchor: middle; }
.mod-portgroups .pg-line { fill: none; stroke: #ebe7dc; stroke-width: 1; stroke-opacity: .8; }
.mod-portgroups .ink { fill: #1c1d1f; }
.mod-portgroups .pg-line.ink { fill: none; stroke: #1c1d1f; }
.mod-flow { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.mod-flow .fl-line { fill: none; stroke: #ebe7dc; stroke-opacity: .8; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.mod-flow .fl-head { fill: #ebe7dc; fill-opacity: .9; }

/* 나사: 둥근 머리 + 십자 홈, 패널 구멍 그림자 */
.screw {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #fbfcfd, #c3c7cc 34%, #7f848a 68%, #474a4f 100%);
  box-shadow: 0 0 0 1.5px #050506, 0 0 0 2.2px #ffffff12, 0 1.5px 2px 1px #000000b0;
  pointer-events: none;
}
.screw::after {
  content: '';
  position: absolute;
  inset: 1.6px;
  background:
    linear-gradient(#34363a, #1c1d20) center / 1.5px 100% no-repeat,
    linear-gradient(90deg, #34363a, #1c1d20) center / 100% 1.5px no-repeat;
  transform: rotate(var(--r));
  filter: drop-shadow(0.4px 0.6px 0 #ffffff70);
}
.screw.tl { left: 3px; top: 3px; }
.screw.tr { right: 3px; top: 3px; }
.screw.bl { left: 3px; bottom: 3px; }
.screw.br { right: 3px; bottom: 3px; }

.mod-head { position: relative; padding: 19px 6px 2px; text-align: center; }
.mod-name {
  font: 400 13px/1 var(--name);
  letter-spacing: .06em;
  white-space: nowrap;
}
.mod-sub {
  margin-top: 6px;
  font: 600 10px/1 var(--silk);
  letter-spacing: .2em;
  color: #ebe7dcd9;
  white-space: nowrap;
}
.mod-del {
  position: absolute;
  top: -10px;
  right: -8px;
  z-index: 2;
  width: 20px; height: 20px;
  padding: 0;
  border: 2px solid var(--case-deep);
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s;
}
.module:hover .mod-del, .mod-del:focus-visible { opacity: 1; }

/* 디스플레이: 패널 속으로 파인 유리창 */
.mod-screen {
  position: relative;
  margin: 10px auto 2px;
  padding: 3px;
  border-radius: 3px;
  background: #060708;
  box-shadow: inset 0 2px 5px #000, 0 0 0 1px #000, 0 1px 0 1px #ffffff12;
}
.mod-screen canvas { display: block; }
.mod-screen::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 1px;
  background: linear-gradient(162deg, #ffffff17 0, #ffffff05 38%, transparent 38.5%, transparent 100%);
  pointer-events: none;
}

.mod-params {
  display: grid;
  gap: 4px 0;
  padding: 8px 6px 0;
  justify-items: center;
  align-items: start;
}
.mod-spacer { flex: 1; }
.mod-spacer.has-display { display: flex; align-items: center; justify-content: center; }
.mod-canvas { display: flex; justify-content: center; }
.mod-canvas canvas { display: block; }

.knob-label {
  font: 600 10px/1.1 var(--silk);
  letter-spacing: .08em;
  text-align: center;
  white-space: nowrap;
}

/* ---------- 노브 ---------- */
.knob-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: ns-resize;
  touch-action: none;
}
.knob-cell.big { grid-column: 1 / -1; margin-bottom: 2px; }
.knob-cell.big .knob-label { font-size: 11px; margin-top: -2px; }
.knob { position: relative; width: var(--box); height: var(--box); }
.k-scale {
  position: absolute;
  inset: 0;
  overflow: visible;
  fill: none;
  stroke: var(--silk-ink);
  stroke-width: 1.1;
  stroke-linecap: butt;
}
.k-shadow, .k-body, .k-light {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--d);
  height: var(--d);
  margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2);
  border-radius: 50%;
}
/* 패널에 떨어지는 그림자 (광원: 왼쪽 위) */
.k-shadow {
  background: #000;
  transform: translate(2px, 3.5px) scale(1.04);
  filter: blur(3px);
  opacity: .85;
}
/* 널링 몸체: 윗면(캡) + 테두리의 가는 홈 */
.k-body {
  background:
    radial-gradient(circle closest-side, #252629 0, #1d1e21 60%, #18191b 70.5%, #070708 72%, transparent 74%),
    repeating-conic-gradient(#35373b 0deg 2.6deg, #0b0b0c 3.6deg 6.2deg, #35373b 7.2deg);
  box-shadow: 0 0 0 .5px #000;
}
.big .k-body {
  background:
    radial-gradient(circle closest-side, #26272a 0, #1c1d20 64%, #17181a 66.5%, #060607 68%, transparent 70%),
    radial-gradient(circle closest-side, transparent 0 88%, #0c0c0d 89%, #1a1b1d 93%, #0f1011 100%),
    repeating-conic-gradient(#393b3f 0deg 2deg, #0a0a0b 2.8deg 4.6deg, #393b3f 5.4deg);
}
/* 지시선 */
.k-line {
  position: absolute;
  left: 50%;
  top: 6%;
  width: 2px;
  height: 38%;
  margin-left: -1px;
  border-radius: 1px;
  background: #f1eee6;
  box-shadow: 0 0 1px #0008;
}
.big .k-line { top: 4%; width: 2.4px; margin-left: -1.2px; height: 34%; }
/* 고정 조명: 캡 반사광 + 전체 음영 + 캡/바깥 테두리의 빛 */
.k-light {
  pointer-events: none;
  background:
    radial-gradient(ellipse 34% 26% at 38% 32%, #ffffff30, #ffffff00),
    linear-gradient(150deg, #ffffff26 0%, #ffffff00 42%, #00000000 55%, #00000073 100%);
}
.k-light::before, .k-light::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 300deg, #ffffff66, #ffffff00 80deg, #000000a0 180deg, #ffffff00 280deg, #ffffff66);
}
.k-light::before { -webkit-mask: radial-gradient(circle closest-side, transparent 68%, #000 70.5% 73%, transparent 75%); mask: radial-gradient(circle closest-side, transparent 68%, #000 70.5% 73%, transparent 75%); }
.big .k-light::before { -webkit-mask: radial-gradient(circle closest-side, transparent 64%, #000 66.5% 69%, transparent 71%); mask: radial-gradient(circle closest-side, transparent 64%, #000 66.5% 69%, transparent 71%); }
.k-light::after { -webkit-mask: radial-gradient(circle closest-side, transparent 94%, #000 97% 100%); mask: radial-gradient(circle closest-side, transparent 94%, #000 97% 100%); opacity: .7; }
.knob-cell:hover .k-light, .knob-cell.active .k-light { filter: brightness(1.35); }

/* ---------- 로터리 스위치 ---------- */
.selector-cell { display: flex; flex-direction: column; align-items: center; margin-top: -6px; }
.selector { position: relative; width: var(--box); height: var(--box); cursor: ns-resize; touch-action: none; }
.selector-cell .knob-label { margin-top: -7px; }
.sel-scale { position: absolute; inset: 0; overflow: visible; }
.sel-scale path { stroke: var(--silk-ink); stroke-width: 1; }
.sel-scale text {
  font: 600 6.8px var(--silk);
  fill: #ebe7dc99;
  text-anchor: middle;
  cursor: pointer;
}
.sel-scale text.on { fill: var(--silk-ink); }
.selector .k-shadow, .selector .k-light, .sel-body {
  position: absolute; left: 50%; top: 50%;
  width: var(--d); height: var(--d);
  margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2);
  border-radius: 50%;
}
/* 포인터 노브: 매끈한 검은 몸체 + 끝이 뾰족한 흰 지침 */
.sel-body {
  background:
    radial-gradient(circle closest-side, #2a2b2e 0, #1b1c1e 70%, #0c0c0d 96%, transparent 100%);
  box-shadow: 0 0 0 .5px #000;
  transition: transform .08s ease-out;
}
.sel-pointer {
  position: absolute;
  left: 50%;
  top: -2px;
  width: 0;
  height: 0;
  margin-left: -3px;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-bottom: 9px solid #f1eee6;
  filter: drop-shadow(0 1px 1px #000a);
}
.sel-pointer::after {
  content: '';
  position: absolute;
  left: -1px;
  top: 8px;
  width: 2px;
  height: 5px;
  background: #f1eee6;
}
.selector:hover .k-light { filter: brightness(1.35); }

/* 작은 노브·버튼 (size: 'mini') — 한 줄의 높이를 줄일 때 */
.knob-cell.mini .knob-label { font-size: 9px; margin-top: -1px; }
.button-cell.mini { padding-top: 1px; gap: 3px; }
.button-cell.mini .lit-btn { width: 28px; height: 28px; }
.button-cell.mini .lit-cap { width: 21px; height: 21px; }
.button-cell.mini .knob-label { font-size: 9px; }

/* LED 선택 노브의 목록 */
.led-list { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.led-row { display: flex; align-items: center; gap: 5px; cursor: pointer; font: 600 9px/1 var(--silk); letter-spacing: .06em; color: #ebe7dc99; }
.led-row i { width: 6px; height: 6px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #3a4a44, #111a16); box-shadow: 0 0 0 1px #000; }
.led-row.on { color: var(--silk-ink); }
.led-row.on i { background: radial-gradient(circle at 40% 35%, #fff, var(--lit) 55%); box-shadow: 0 0 0 1px #000, 0 0 7px var(--lit); }

/* ---------- 스텝 키 (드럼 시퀀서) ---------- */
.step-cell { display: flex; justify-content: center; padding: 2px 0; }
.step-key {
  width: 30px;
  height: 24px;
  border-radius: 4px;
  background: linear-gradient(180deg, #4a4c50, #2b2c30 55%, #222326);
  box-shadow: 0 0 0 1px #000, 1px 2px 3px #000c, inset 0 1px 0 #ffffff2a;
  cursor: pointer;
  touch-action: none;
  transition: background .08s, box-shadow .08s;
}
.step-key.alt { background: linear-gradient(180deg, #5d5f64, #3a3c40 55%, #2e2f33); }
.step-key:hover { filter: brightness(1.25); }
.step-key.on {
  background: radial-gradient(ellipse at 50% 40%, #fff 0, color-mix(in srgb, var(--lit) 65%, #fff) 25%, var(--lit) 70%, color-mix(in srgb, var(--lit) 60%, #000) 100%);
  box-shadow: 0 0 0 1px #000, 0 0 8px color-mix(in srgb, var(--lit) 70%, transparent), 0 0 18px 2px color-mix(in srgb, var(--lit) 30%, transparent), inset 0 1px 0 #ffffff80;
}
/* 줄 이름을 왼쪽에 가로로 (드럼 시퀀서) */
.module.side-captions .mod-row { padding-left: 50px; padding-top: 1px; }
.module.side-captions .row-caption {
  left: 10px;
  width: 38px;
  font-size: 8.5px;
  letter-spacing: .12em;
  text-align: left;
  writing-mode: horizontal-tb;
  transform: translateY(-50%);
}

/* ---------- 큰 조명 버튼 (예: STAGES 의 PLAY) ---------- */
.button-cell { display: flex; flex-direction: column; align-items: center; gap: 5px; padding-top: 4px; }
.lit-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: conic-gradient(from 20deg, #eef0f2, #8f949a, #dfe2e5, #6f747a, #eef0f2, #8f949a, #dfe2e5, #6f747a, #eef0f2);
  box-shadow: 0 0 0 1px #000, 1px 3px 5px #000d;
  cursor: pointer;
}
.lit-cap {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #3c4a42 0, #1c2620 50%, #0d130f 100%);
  box-shadow: inset 0 2px 3px #ffffff2a, inset 0 -3px 6px #000c, 0 0 0 2px #0b0b0c;
  transition: transform .06s, box-shadow .15s, background .15s;
}
.lit-btn:active .lit-cap { transform: translateY(1px) scale(.96); }
.lit-btn.on .lit-cap {
  background: radial-gradient(circle at 40% 34%, #fff 0, color-mix(in srgb, var(--lit) 60%, #fff) 16%, var(--lit) 48%, color-mix(in srgb, var(--lit) 55%, #000) 100%);
  box-shadow:
    inset 0 2px 3px #ffffff90, inset 0 -3px 6px #00000060, 0 0 0 2px #0b0b0c,
    0 0 14px 3px color-mix(in srgb, var(--lit) 65%, transparent), 0 0 36px 8px color-mix(in srgb, var(--lit) 28%, transparent);
}
.button-cell .knob-label { min-width: 40px; }

/* ---------- 세로 슬라이더 ---------- */
.slider-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.slider { position: relative; width: 30px; height: calc(var(--len) + 12px); cursor: ns-resize; touch-action: none; }
.sl-ticks {
  position: absolute;
  left: 0;
  top: 6px;
  width: 30px;
  height: var(--len);
  overflow: visible;
  fill: none;
  stroke: var(--silk-ink);
  stroke-width: 1;
}
.sl-slot {
  position: absolute;
  left: 13px;
  top: 3px;
  bottom: 3px;
  width: 4px;
  border-radius: 2px;
  background: #030304;
  box-shadow: inset 0 1px 2px #000, 0 0 0 .5px #000, 0 1px 0 #ffffff1c;
}
.sl-cap {
  position: absolute;
  left: 6px;
  top: 0;
  width: 18px;
  height: 12px;
  border-radius: 2px;
  background:
    repeating-linear-gradient(90deg, #ffffff12 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #55575c 0%, #2c2d31 42%, #1b1c1f 58%, #303136 100%);
  box-shadow: 0 0 0 .5px #000, 1px 3px 3px #000000d0, inset 0 1px 0 #ffffff38;
}
.sl-cap::after {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  top: 5.25px;
  height: 1.5px;
  background: #f1eee6;
}
.slider:hover .sl-cap, .slider.active .sl-cap { filter: brightness(1.3); }

/* 같은 줄 파라미터 묶음 (예: 스텝 8칸). 왼쪽 여백에 세로로 줄 이름을 인쇄 */
.mod-row { position: relative; padding: 3px 14px 0; gap: 2px 0; }
.row-caption {
  position: absolute;
  left: 3px;
  top: 50%;
  font: 600 7.5px/1 var(--silk);
  letter-spacing: .22em;
  color: #ebe7dcb0;
  writing-mode: vertical-rl;
  transform: translateY(-50%) rotate(180deg);
  white-space: nowrap;
  pointer-events: none;
}

/* 넓은 모듈: 입력과 출력을 한 줄에 */
.mod-jackrow { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin: 0 6px 3px; }
.mod-jackrow .mod-ports { margin: 0; }

/* ---------- 스위치 ---------- */
.switch-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding-top: 5px;
}
.sw-row { display: flex; align-items: stretch; gap: 3px; height: 38px; }
.sw-list { display: flex; flex-direction: column; justify-content: space-between; }
.sw-list.n1 { justify-content: center; }
.sw-opt {
  display: flex;
  align-items: center;
  gap: 4px;
  font: 600 9.5px/1 var(--silk);
  letter-spacing: .06em;
  color: #ebe7dc8c;
  cursor: pointer;
}
.sw-opt i { display: none; }
.sw-opt.on { color: var(--silk-ink); }
.sw-opt:hover { color: var(--silk-ink); }

/* 미니 토글: 육각 너트 + 크롬 레버 */
.toggle { position: relative; width: 20px; cursor: pointer; }
.tg-nut {
  position: absolute;
  left: 50%; top: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
  background:
    radial-gradient(circle, #1a1b1d 0 3.4px, #d9dce0 3.9px, #8c9197 5px, transparent 5.4px),
    conic-gradient(from 20deg, #e9ebee, #8b9096, #d4d7db, #6f747a, #e9ebee, #8b9096, #d4d7db, #6f747a, #e9ebee);
  transform: rotate(var(--r));
  filter: drop-shadow(1px 2px 1px #000);
}
.tg-bat {
  position: absolute;
  left: 50%; top: 50%;
  width: 5.5px; height: 16px;
  margin-left: -2.75px;
  border-radius: 2px;
  background: linear-gradient(90deg, #5b5f65, #f7f8f9 38%, #c4c8cd 58%, #62666c);
  box-shadow: 1px 2px 2px #000a;
  transform-origin: 50% 0;
  transform: rotate(180deg);
  transition: transform .09s ease-out, height .09s ease-out;
}
.tg-bat::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -3px;
  width: 8px; height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #fff, #c9cdd2 40%, #6b7075 85%);
  box-shadow: 1px 2px 2px #000b;
}
.toggle[data-pos="down"] .tg-bat { transform: rotate(0deg); }
.toggle[data-pos="mid"] .tg-bat { height: 0; }
.toggle[data-pos="mid"] .tg-bat::after { bottom: -4px; width: 8px; height: 8px; }

/* 푸시버튼 + LED (선택지가 4개 이상) */
.push {
  align-self: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #4a4c50, #232427 60%, #151618);
  box-shadow: 0 0 0 2px #0a0a0b, 0 0 0 3px #7c8187, 1px 2.5px 3px 1px #000;
  cursor: pointer;
}
.push.down { transform: translateY(.5px); box-shadow: 0 0 0 2px #0a0a0b, 0 0 0 3px #7c8187, 0 1px 1px #000; }
.sw-list.leds { gap: 3px; justify-content: center; }
.sw-list.leds .sw-opt i {
  display: block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #5a4a42, #2a1f1a);
  box-shadow: 0 0 0 .6px #000;
}
.sw-list.leds .sw-opt.on i {
  background: radial-gradient(circle at 40% 35%, #fff, var(--accent) 55%);
  box-shadow: 0 0 0 .6px #000, 0 0 6px var(--accent);
}

/* ---------- 잭: 육각 너트 + 슬리브 + 구멍 ---------- */
.mod-ports { display: grid; gap: 6px 0; justify-items: center; padding: 8px 4px 7px; }
.mod-in { margin: 0 6px 3px; }
.mod-out {
  margin: 0 6px 3px;
  border-radius: 3px;
  color: var(--anod);
  background-color: var(--silk-ink);
  background-image: var(--grain-ink), linear-gradient(180deg, #ffffff30, #0000 40%, #00000010);
  background-position: var(--grain-y) var(--grain-x), 0 0;
  box-shadow: inset 0 0 0 .5px #00000040;
}
.module.no-foot .mod-ports:last-child { margin-bottom: 18px; }
.port { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.port span { font: 600 10px/1 var(--silk); letter-spacing: .08em; white-space: nowrap; }
.port-icon {
  width: 16px;
  height: 7px;
  margin-top: -1px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.jack {
  position: relative;
  width: 22px; height: 22px;
  border-radius: 50%;
  cursor: crosshair;
  touch-action: none;
  transition: box-shadow .12s;
}
.jack::before, .jack::after { content: ''; position: absolute; pointer-events: none; }
.jack::before {
  inset: 0;
  clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
  background:
    linear-gradient(150deg, #ffffff40, transparent 45%, #00000050),
    conic-gradient(from 10deg, #eef0f2, #9ca1a7, #dde0e3, #7a7f85, #eef0f2, #9ca1a7, #dde0e3, #7a7f85, #eef0f2);
  transform: rotate(var(--r));
  filter: drop-shadow(1px 2px 1.2px #000c);
}
.jack::after {
  inset: 4px;
  border-radius: 50%;
  background:
    radial-gradient(circle closest-side, #000 0 44%, #0d0e0f 52%, #3b3d41 58%, #cfd2d6 63%, #fafbfc 70%, #a2a6ac 80%, #5c6065 90%, #1a1b1d 100%);
  box-shadow: 0 0 0 1px #00000070;
}
.jack:hover { box-shadow: 0 0 0 3px #ffffff55; }
.case.want-in .jack[data-kind="in"],
.case.want-out .jack[data-kind="out"] { box-shadow: 0 0 0 3px var(--signal); }

.mod-foot {
  height: 17px;
  padding-top: 1px;
  font: 400 6.5px/16px var(--name);
  letter-spacing: .32em;
  text-align: center;
  color: #ebe7dc80;
}

/* 설치되지 않은 모듈: 빈 패널 */
.module.missing { box-shadow: 0 0 0 1px #000, 0 0 0 2px #e5484d80; }
.module.missing .mod-name { text-transform: uppercase; }
.missing-body {
  word-break: keep-all;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 10px;
  font-size: 11.5px;
  line-height: 1.5;
  text-align: center;
  color: #ebe7dcb0;
}
.missing-body strong { font: 600 12px/1.2 var(--silk); letter-spacing: .08em; text-transform: uppercase; color: var(--silk-ink); }

/* ---------- 케이블 ---------- */
.cables { position: absolute; inset: 0; z-index: 5; overflow: visible; pointer-events: none; }
.cable path { fill: none; stroke-linecap: round; }
.cable .c-shadow { stroke: #000; stroke-opacity: .34; stroke-width: 6; }
.cable .c-body { stroke-width: 5.6; }
.cable .c-shine { stroke: #fff; stroke-opacity: .22; stroke-width: 1.3; }
/* 신호가 흐를 때: 케이블 속 밝은 심 + 부드럽게 번지는 후광 세 겹 (값은 cables.js 가 매 프레임 정함) */
.cable .c-core { stroke-width: 1.7; opacity: 0; }
.cable .c-glow { opacity: 0; }
.cable .c-pulse { opacity: 0; stroke-linecap: round; }

.cable .c-glow.g1 { stroke-width: 22; }
.cable .c-glow.g2 { stroke-width: 13; }
.cable .c-glow.g3 { stroke-width: 8; }
/* 금속 플러그 */
.cable .p-shadow { fill: #000; opacity: .6; filter: url(#rack-soft); }
.cable .p-knurl { fill: none; stroke: #00000080; stroke-width: 2.6; stroke-dasharray: .85 .85; }
.cable .p-knurl-hi { fill: none; stroke: #ffffffa0; stroke-width: 2.6; stroke-dasharray: .35 1.35; stroke-dashoffset: -.2; }
.cable .p-bevel { fill: none; stroke: url(#rack-plug-bevel); stroke-width: 1.1; }
.cable .p-well { fill: #0a0a0b; }
.cable .p-ring { fill: none; stroke-width: 1.5; opacity: 0; }
.cable .p-halo { fill: none; stroke-width: 8; opacity: 0; }
.cable .p-spec { fill: #fff; opacity: .8; }
.cable .p-edge { fill: none; stroke: #000000b0; stroke-width: .7; }
.cable.dragging { opacity: .85; }

/* ---------- 빈 랙 안내 ---------- */
.rack-empty {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.rack-empty p {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 360px;
  margin: 0;
  padding: 18px 22px;
  border-radius: 8px;
  background: #16171acc;
  color: var(--ink-dim);
  line-height: 1.55;
  text-align: center;
}
.rack-empty strong { color: var(--ink); font-size: 16px; }

/* ---------- 말풍선 ---------- */
.tip {
  position: fixed;
  z-index: 80;
  padding: 4px 8px;
  border-radius: 4px;
  background: #0c0d0e;
  color: #f2f2ee;
  font: 600 13px/1.2 var(--silk);
  font-variant-numeric: tabular-nums;
  letter-spacing: .03em;
  white-space: pre;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 8px));
  box-shadow: 0 6px 16px #0009;
}

@keyframes led-call { 50% { opacity: .35; } }

/* ---------- 첫 클릭 안내 (브라우저가 자동 재생을 막았을 때만) ---------- */
.start-hint {
  position: fixed;
  left: 50%;
  bottom: 22%;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  background: #121315e8;
  box-shadow: 0 0 0 1px #34373c, 0 14px 40px #000c;
  color: var(--ink);
  font: 600 15px/1 var(--ui);
  letter-spacing: .02em;
  transform: translateX(-50%);
  pointer-events: none;
}
.start-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3ee08f;
  box-shadow: 0 0 10px #3ee08f;
  animation: led-call 1.4s ease-in-out infinite;
}

/* ---------- 알림 ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  max-width: 440px;
  padding: 10px 14px;
  border: 1px solid #33363c;
  border-left: 3px solid var(--signal);
  border-radius: 6px;
  background: #1f2124;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-line;
  box-shadow: 0 12px 30px #0009;
  animation: toast-in .18s ease-out;
}
.toast.ok { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--danger); }
.toast.out { opacity: 0; transition: opacity .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- 모듈 브라우저 ---------- */
.mb-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: start center;
  padding-top: 9vh;
  background: #0a0b0ccc;
}
.mb {
  display: flex;
  flex-direction: column;
  width: min(780px, 92vw);
  max-height: 78vh;
  overflow: hidden;
  border: 1px solid #303338;
  border-radius: 10px;
  background: #1a1b1e;
  box-shadow: 0 30px 80px #000;
}
.mb-head { display: flex; gap: 8px; padding: 14px; border-bottom: 1px solid var(--line); }
.mb-search {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #33363c;
  border-radius: 6px;
  background: #121315;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  outline: none;
}
.mb-search:focus { border-color: var(--signal); }
.mb-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
}
.mb-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px 12px 16px;
  border: 1px solid #2f3237;
  border-left: 4px solid var(--c);
  border-radius: 6px;
  background: #212327;
  text-align: left;
  cursor: pointer;
}
.mb-card:hover { background: #272a2f; border-color: #3d4148; border-left-color: var(--c); }
.mb-card-top { display: flex; align-items: baseline; gap: 8px; }
/* 카드: 왼쪽 패널 미리보기 + 오른쪽 설명 */
.mb-card { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 14px; }
.mb-thumb { flex: none; position: relative; overflow: hidden; border-radius: 3px; box-shadow: 0 0 0 1px #000, 0 6px 14px #0008; background: #0d0e0f; }
.mb-thumb .mb-panel { position: absolute !important; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; box-shadow: none; }
.mb-thumb .mb-panel .mod-del { display: none; }
.mb-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.mb-name { font: 400 15px/1.1 var(--name); letter-spacing: .05em; }
.mb-sub { display: block; margin-top: 5px; font: 600 10px/1 var(--silk); letter-spacing: .2em; color: var(--ink-dim); }
.mb-hp { margin-left: auto; font: 600 12px var(--silk); color: var(--ink-dim); letter-spacing: .04em; }
.mb-desc { margin: 0; font-size: 12.5px; line-height: 1.55; color: #b5b8bd; }
.mb-file { font-size: 11px; color: #6c7077; }
.mb-empty { grid-column: 1 / -1; margin: 12px 0; color: var(--ink-dim); text-align: center; }
.mb-errors {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border: 1px solid #e5484d55;
  border-radius: 6px;
  background: #e5484d12;
  font-size: 12.5px;
}
.mb-errors strong { color: #ff8f93; }
.mb-errors p { margin: 6px 0 0; color: #d0c4c5; line-height: 1.5; }
.mb-errors code { color: #fff; }
.mb-foot {
  margin: 0;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 12.5px;
}
.mb-foot code { color: var(--signal); font-family: inherit; font-weight: 700; }

/* ---------- file:// 로 연 경우 ---------- */
.file-warning {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--case-deep);
}
.file-warning > div { max-width: 460px; line-height: 1.7; }
.file-warning strong { font-size: 20px; }
.file-warning code { color: var(--signal); }

@media (max-width: 760px) {
  .topbar { gap: 8px; padding: 0 10px; overflow-x: auto; }
  .status { display: none; }
  .rack-scroll { padding: 10px 6px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .start-dot { animation: none; }
  .toast { animation: none; }
}

/* ---------- 외부 모니터 (케이스 오른쪽, 영상 모듈이 있을 때만) ----------
   검은 베젤 + 16:9 화면, 아래 턱에 VIDEO IN 단자와 버튼, 알루미늄 목과 받침 */
.monitor {
  position: absolute;
  z-index: 1;
  display: none;
  flex-direction: column;
  align-items: center;
  user-select: none;
  -webkit-user-select: none;
}
.monitor.on { display: flex; }
.mon-bezel {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  padding: 13px 13px 0;
  border-radius: 11px;
  background-color: #151618;
  background-image:
    var(--grain-light),
    linear-gradient(180deg, #2a2b2f 0, #18191b 10%, #111214 100%);
  box-shadow:
    inset 0 1px 0 #ffffff24,
    inset 0 -2px 0 #00000090,
    0 0 0 1px #000,
    0 30px 46px -16px #000,
    0 10px 18px -8px #000000c0;
}
.mon-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 3px;
  background: #000;
  overflow: hidden;
  box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #000, 0 0 0 2px #26282c;
  cursor: zoom-in;
}
.mon-screen canvas { display: block; width: 100%; height: 100%; }
.mon-screen::after {                       /* 유리 반사 */
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(158deg, #ffffff14 0, #ffffff05 34%, transparent 34.4%),
    radial-gradient(ellipse 120% 90% at 50% 50%, transparent 60%, #00000055 100%);
  pointer-events: none;
}
.mon-screen:fullscreen { cursor: none; aspect-ratio: auto; border-radius: 0; display: flex; align-items: center; justify-content: center; }
.mon-screen:fullscreen canvas { object-fit: contain; }
.mon-screen:fullscreen::after { display: none; }
.mon-chin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 4px;
  color: var(--silk-ink);
}
.mon-brand { display: flex; align-items: baseline; gap: 7px; min-width: 110px; }
.mon-brand b { font: 400 12px/1 var(--name); letter-spacing: .16em; }
.mon-brand span { font: 600 9.5px/1 var(--silk); letter-spacing: .28em; color: #ebe7dc8c; }
.mon-ports { margin: 0; padding: 4px 10px 3px; }
.mon-tools { display: flex; align-items: center; gap: 7px; min-width: 110px; justify-content: flex-end; }
.mon-btn {
  padding: 5px 7px 4px;
  border: 0;
  border-radius: 3px;
  font: 600 9px/1 var(--silk);
  letter-spacing: .14em;
  color: var(--silk-ink);
  background: linear-gradient(180deg, #34363a, #1d1e21);
  box-shadow: 0 0 0 1px #000, inset 0 1px 0 #ffffff26, 0 2px 3px #000a;
  cursor: pointer;
}
.mon-btn:hover { filter: brightness(1.25); }
.mon-btn:active { transform: translateY(1px); box-shadow: 0 0 0 1px #000, inset 0 1px 2px #000; }
.mon-led {
  width: 7px; height: 7px;
  margin-left: 3px;
  border-radius: 50%;
  background: #6b4a12;
  box-shadow: 0 0 0 1px #000, inset 0 1px 1px #ffffff30, 0 0 6px #f0b42966;
}
.mon-led.live { background: #52f0a8; box-shadow: 0 0 0 1px #000, inset 0 1px 1px #ffffff80, 0 0 9px #30c48d; }
.mon-neck {
  width: 46px;
  height: 64px;
  background:
    var(--grain-light),
    linear-gradient(90deg, #4c4f54, #a3a8ae 28%, #d3d7db 42%, #8a8f95 62%, #3e4145);
  box-shadow: 0 0 0 1px #000, inset 0 10px 10px -6px #000000c0;
}
.mon-foot {
  width: 230px;
  height: 14px;
  border-radius: 9px 9px 3px 3px;
  background:
    var(--grain-light),
    linear-gradient(180deg, #d4d8dc, #8f949a 40%, #55595e);
  box-shadow: 0 0 0 1px #000, 0 16px 22px -8px #000;
}

/* ---------- 프리셋 (케이스 아래 가운데): 형광 표시창 + 위로 열리는 목록 ---------- */
.preset-slot { position: relative; display: flex; align-items: center; }
.preset-sel {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--silk-ink);
  cursor: pointer;
}
.preset-label { font: 600 10px/1 var(--silk); letter-spacing: .16em; }
.preset-win {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 230px;
  height: 30px;
  padding: 0 10px 0 9px;
  border-radius: 4px;
  background-color: #04100e;
  background-image: repeating-linear-gradient(90deg, rgba(127, 245, 220, .035) 0 1px, transparent 1px 3px);
  box-shadow: inset 0 2px 5px #000, 0 0 0 1px #000, 0 1px 0 1px #ffffff14;
  color: #7ff5dc;
  text-shadow: 0 0 6px rgba(127, 245, 220, .55);
  transition: box-shadow .12s;
}
.preset-sel:hover .preset-win, .preset-sel.open .preset-win { box-shadow: inset 0 2px 5px #000, 0 0 0 1px #000, 0 0 0 3px #7ff5dc40; }
.preset-num { font: 400 13px/1 var(--name); letter-spacing: .08em; }
.preset-name { flex: 1; font: 600 12px/1 var(--silk); letter-spacing: .14em; text-align: left; white-space: nowrap; }
.preset-tag { font: 600 8.5px/1 var(--silk); font-style: normal; letter-spacing: .14em; color: #f0b429; text-shadow: 0 0 5px #f0b42980; }
.preset-tag[hidden] { display: none; }
.preset-caret { font-size: 8px; opacity: .7; transition: transform .15s; }
.preset-sel.open .preset-caret { transform: rotate(180deg); }

.preset-pop {
  position: absolute;
  z-index: 40;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  width: 460px;
  max-height: 640px;
  overflow-y: auto;
  padding: 16px 12px 12px;
  border-radius: 9px;
  background-color: #17181b;
  background-image: var(--grain-light), linear-gradient(180deg, #212226, #141517);
  box-shadow: 0 0 0 1px #000, inset 0 1px 0 #ffffff1c, 0 26px 50px -10px #000, 0 10px 20px -6px #000c;
  color: var(--silk-ink);
  cursor: default;
}
.preset-pop[hidden] { display: none; }
.preset-pop::after {                         /* 창을 가리키는 꼬리 */
  content: '';
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 14px;
  height: 14px;
  background: #141517;
  transform: translateX(-50%) rotate(45deg);
  box-shadow: 1px 1px 0 #000;
}
.preset-pop-head { padding: 0 6px; font: 400 13px/1 var(--name); letter-spacing: .16em; }
.preset-pop-hint { margin: 7px 6px 12px; font: 500 12.5px/1.4 var(--silk); color: #ebe7dcaa; }
.preset-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  margin-top: 5px;
  padding: 9px 12px 9px 9px;
  border: 1px solid #2c2e33;
  border-radius: 6px;
  background: #1d1f22;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.preset-item:hover, .preset-item:focus-visible { background: #25282c; border-color: #7ff5dc70; outline: none; }
.preset-item[aria-selected="true"] { border-color: #7ff5dc; }
.preset-item-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 30px;
  border-radius: 4px;
  background: #04100e;
  box-shadow: inset 0 1px 4px #000, 0 0 0 1px #000;
  font: 400 13px/1 var(--name);
  color: #7ff5dc;
  text-shadow: 0 0 6px rgba(127, 245, 220, .55);
}
.preset-item-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.preset-item-name { font: 400 13px/1.2 var(--name); letter-spacing: .08em; }
.preset-item-desc { font: 500 12.5px/1.35 var(--silk); color: #ebe7dcc2; }
.preset-item-top { display: flex; align-items: baseline; gap: 9px; }
.preset-hero {
  padding: 2px 5px 1px;
  border-radius: 3px;
  font: 600 9px/1.2 var(--silk);
  letter-spacing: .14em;
  color: #0d1715;
  background: #7ff5dccc;
}
.preset-group {
  margin: 14px 6px 2px;
  font: 600 9.5px/1 var(--silk);
  letter-spacing: .26em;
  color: #ebe7dc80;
}
.preset-item-mods { font: 600 9.5px/1.3 var(--silk); letter-spacing: .14em; color: #7ff5dcb0; }
.preset-back { align-items: center; background: none; border-style: dashed; }
.preset-back .preset-item-num { color: #ebe7dc; text-shadow: none; background: #26282c; }

/* ---------- 수업 카드 (화면 오른쪽 위) ---------- */
.lesson {
  position: fixed;
  z-index: 45;
  top: 18px;
  right: 14px;
  width: 346px;
  max-width: calc(100vw - 28px);
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  box-sizing: border-box;
  padding: 12px 16px 14px;
  border-radius: 10px;
  background-color: #17181b;
  background-image: var(--grain-light), linear-gradient(180deg, #202125, #141517);
  box-shadow: 0 0 0 1px #000, inset 0 1px 0 #ffffff1c, 0 24px 46px -12px #000;
  color: var(--silk-ink);
  font: 500 13.5px/1.5 var(--silk);
}
.lesson[hidden] { display: none; }
.lesson.folded { width: auto; padding: 8px 12px; }
.lesson-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lesson-count {
  display: flex; align-items: baseline; gap: 6px;
  padding: 0; border: 0; background: none; color: inherit; cursor: pointer;
  font: 600 10px/1 var(--silk); letter-spacing: .2em;
}
.lesson-count b { font-weight: 600; color: #7ff5dc; text-shadow: 0 0 6px rgba(127, 245, 220, .5); }
.lesson-count span { color: #ebe7dc80; }
.lesson-count .lesson-fold-name { margin-left: 6px; color: var(--silk-ink); letter-spacing: .14em; }
.lesson-x {
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  background: #2a2c30; color: #ebe7dcb0; font-size: 15px; line-height: 1; cursor: pointer;
}
.lesson-x:hover { background: #3a3d42; color: #fff; }
.lesson-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 12px 0 4px; }
.lesson-title h2 { margin: 0; font: 400 16px/1.25 var(--name); letter-spacing: .08em; }
.lesson-hero-label { font: 600 10px/1 var(--silk); letter-spacing: .16em; color: #7ff5dc; }
.lesson-sec { margin-top: 12px; }
.lesson-sec h3 { margin: 0 0 4px; font: 600 9.5px/1 var(--silk); letter-spacing: .24em; text-transform: uppercase; color: #ebe7dc80; }
.lesson-sec p { margin: 0; color: #ebe7dcdd; word-break: keep-all; }
.lesson-sec ol { margin: 4px 0 0; padding-left: 20px; color: #ebe7dcdd; word-break: keep-all; }
.lesson-sec li { margin-top: 6px; padding-left: 2px; }
.lesson-sec li::marker { color: #7ff5dc; font-weight: 600; }
.lesson-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; }
.lesson-go {
  padding: 7px 10px 6px; border: 0; border-radius: 4px;
  font: 600 9.5px/1 var(--silk); letter-spacing: .16em; color: var(--silk-ink);
  background: linear-gradient(180deg, #34363a, #1d1e21);
  box-shadow: 0 0 0 1px #000, inset 0 1px 0 #ffffff26, 0 2px 3px #000a;
  cursor: pointer;
}
.lesson-go:last-child { color: #0d1715; background: linear-gradient(180deg, #9ff8e6, #5fd9c2); box-shadow: 0 0 0 1px #000, inset 0 1px 0 #ffffffa0, 0 2px 3px #000a; }
.lesson-go:disabled { opacity: .35; cursor: default; }
.lesson-go:not(:disabled):hover { filter: brightness(1.15); }

/* 지금 과의 주인공 모듈: 패널 둘레에 은은한 빛 */
.module.lesson-hero {
  box-shadow:
    inset 0 1px 0 #ffffff1c, inset 1px 0 0 #ffffff0d, inset -1px 0 0 #00000080, inset 0 -1px 0 #000000a0,
    0 0 0 1px #000, 0 0 0 3px #7ff5dccc, 0 0 26px 4px #7ff5dc55, 0 12px 22px -12px #000;
  animation: hero-breathe 2.6s ease-in-out infinite;
}
@keyframes hero-breathe { 50% { box-shadow: inset 0 1px 0 #ffffff1c, 0 0 0 1px #000, 0 0 0 3px #7ff5dc80, 0 0 14px 2px #7ff5dc30, 0 12px 22px -12px #000; } }
@media (prefers-reduced-motion: reduce) { .module.lesson-hero { animation: none; } }
.lesson:lang(ko) .lesson-sec h3 { letter-spacing: .06em; font-size: 11px; }

/* 잭 위 커서: 빈 잭은 ＋(케이블 새로), 꽂힌 잭은 잡기(옮기기), Ctrl/⌘ 을 누르면 출력 잭은 ＋(한 가닥 더) */
.jack { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%23111' fill-opacity='.72' stroke='%237ff5dc' stroke-width='1.5'/%3E%3Cpath d='M12 6.5v11M6.5 12h11' stroke='%23fff' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") 12 12, copy; }
.jack.plugged { cursor: grab; }
body.ctrl-down .jack[data-kind="out"] { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%23111' fill-opacity='.72' stroke='%237ff5dc' stroke-width='1.5'/%3E%3Cpath d='M12 6.5v11M6.5 12h11' stroke='%23fff' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") 12 12, copy; }

/* 휴대폰: 수업 카드는 아래쪽에 작게 (앞의 기본 규칙보다 뒤에 두어야 이긴다) */
@media (max-width: 760px) {
  .lesson { top: auto; bottom: 10px; right: 10px; left: auto; max-height: 55dvh; font-size: 13px; }
}

/* 이용자 수 (오른쪽 아래, 눈에 잘 안 띄게) */
.visits {
  position: fixed;
  z-index: 5;
  right: 8px;
  bottom: 5px;
  font: 600 9px/1 var(--silk);
  letter-spacing: .12em;
  color: #ebe7dc40;
  pointer-events: none;
  user-select: none;
}
.visits[hidden] { display: none; }

/* ---------- 개발자 스킨 (정의의 skin) 과 자유 배치 (layout: 'free') ---------- */
.module.skinned .mod-flow .fl-line, .module.skinned .mod-portgroups .pg-line { stroke: var(--silk-ink); }
.module.skinned .mod-flow .fl-head, .module.skinned .mod-portgroups .pg-text { fill: var(--silk-ink); }
/* 그림에 글자가 이미 인쇄된 스킨: 앱이 쓰는 글자를 모두 숨긴다 (말풍선은 그대로) */
.module.skin-nolabels .mod-name, .module.skin-nolabels .mod-sub, .module.skin-nolabels .knob-label,
.module.skin-nolabels .port > span, .module.skin-nolabels .port-icon, .module.skin-nolabels .row-caption,
.module.skin-nolabels .sw-opt, .module.skin-nolabels .mod-foot { display: none; }
.module.skin-noscrews .screw { display: none; }
.module.skin-noboxes .mod-ports { background: none; box-shadow: none; color: inherit; }
/* 개발자 노브 그림: 그림 자체가 돌아간다 */
.k-body.k-art { box-shadow: none; border-radius: 50%; }
.knob.k-custom .k-shadow { opacity: .55; }

/* 자유 배치: x·y 는 컨트롤·잭의 가운데 (화면은 왼쪽 위) */
.module.free-layout .mod-spacer { flex: 1; }
.module .free { position: absolute; z-index: 2; margin: 0; }
.module .free-knob { transform: translate(-50%, calc(var(--box) / -2)); }   /* 노브 가운데가 x·y (글자는 그 아래) */
.module .free-jack { transform: translate(-50%, -11px); }                   /* 잭 가운데가 x·y */
.module .free-cell { transform: translate(-50%, -50%); }
.module .free-display { margin: 0; }
.module.free-layout .port.free-out > span { color: var(--silk-ink); }

/* ---------- PATCHES 창 ---------- */
.pd-overlay { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: #000000a8; }
.pd-overlay[hidden] { display: none; }
.pd {
  width: min(540px, 100%);
  max-height: min(720px, calc(100dvh - 32px));
  overflow-y: auto;
  box-sizing: border-box;
  padding: 16px 18px 18px;
  border-radius: 10px;
  background-color: #17181b;
  background-image: var(--grain-light), linear-gradient(180deg, #212226, #141517);
  box-shadow: 0 0 0 1px #000, inset 0 1px 0 #ffffff1c, 0 30px 60px -12px #000;
  color: var(--silk-ink);
  font: 500 14px/1.5 var(--ui);
}
.pd-head { display: flex; align-items: center; justify-content: space-between; }
.pd-head h2 { margin: 0; font: 400 15px/1 var(--name); letter-spacing: .16em; }
.pd-x { width: 26px; height: 26px; border: 0; border-radius: 50%; background: #2a2c30; color: #ebe7dcb0; font-size: 17px; line-height: 1; cursor: pointer; }
.pd-x:hover { background: #3a3d42; color: #fff; }
.pd-note { margin: 10px 0 14px; font-size: 13px; color: #ebe7dcb0; }
.pd-save { display: flex; gap: 8px; }
.pd-name {
  flex: 1; min-width: 0; padding: 9px 11px; border: 0; border-radius: 5px;
  font: 500 14px/1.2 var(--ui); color: #7ff5dc; background: #04100e;
  box-shadow: inset 0 2px 5px #000, 0 0 0 1px #000; outline: none;
}
.pd-name:focus { box-shadow: inset 0 2px 5px #000, 0 0 0 1px #000, 0 0 0 3px #7ff5dc55; }
.pd-btn {
  padding: 9px 12px 8px; border: 0; border-radius: 5px; white-space: nowrap;
  font: 600 10.5px/1 var(--silk); letter-spacing: .14em; color: var(--silk-ink);
  background: linear-gradient(180deg, #34363a, #1d1e21);
  box-shadow: 0 0 0 1px #000, inset 0 1px 0 #ffffff26, 0 2px 3px #000a; cursor: pointer;
}
.pd-btn.primary { color: #0d1715; background: linear-gradient(180deg, #9ff8e6, #5fd9c2); box-shadow: 0 0 0 1px #000, inset 0 1px 0 #ffffffa0, 0 2px 3px #000a; }
.pd-btn:hover { filter: brightness(1.12); }
.pd-tools { display: flex; gap: 8px; margin-top: 10px; }
.pd-list { margin-top: 18px; }
.pd-list-head { margin: 0 0 6px; font: 600 9.5px/1 var(--silk); letter-spacing: .26em; color: #ebe7dc80; }
.pd-empty { margin: 8px 0 0; font-size: 13px; color: #ebe7dc80; }
.pd-item {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%;
  margin-top: 5px; padding: 10px 12px; border: 1px solid #2c2e33; border-radius: 6px;
  background: #1d1f22; color: inherit; text-align: left; cursor: pointer;
}
.pd-item:hover, .pd-item:focus-visible { background: #25282c; border-color: #7ff5dc70; outline: none; }
.pd-item-name { font: 500 14px/1.3 var(--ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-item-meta { flex: none; font: 600 10px/1 var(--silk); letter-spacing: .08em; color: #ebe7dc70; }

/* ---------- 파일을 끌어다 놓을 때 ---------- */
.drop-hint { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: #0a0b0cd0; pointer-events: none; }
.drop-hint[hidden] { display: none; }
.drop-hint > div {
  display: flex; flex-direction: column; gap: 10px; align-items: center; padding: 34px 48px;
  border: 2px dashed #7ff5dc; border-radius: 14px; color: var(--silk-ink); text-align: center;
}
.drop-hint b { font: 400 18px/1 var(--name); letter-spacing: .14em; color: #7ff5dc; }
.drop-hint span { font: 500 14px/1.6 var(--ui); color: #ebe7dcc0; }

/* 동작 버튼 (type: 'action'): 누르는 순간만 빛남 */
.action-btn .lit-cap { transition: filter .15s; }
.action-btn.on .lit-cap { filter: brightness(1.6); }

/* DECKS: 덱 화면 안의 유튜브 창 */
.decks-yt { position: absolute; z-index: 3; overflow: hidden; border-radius: 3px; background: #000; box-shadow: 0 0 0 1px #000; }
.decks-yt iframe { display: block; width: 100%; height: 100%; border: 0; }
/* 줄(row) 안의 큰 노브는 줄을 통째로 차지하지 않고 한 칸에 (DECKS 의 X-FADE 처럼) */
.mod-row .knob-cell.big { grid-column: auto; }

/* Add module 창: 외부 모듈 표시 */
.mb-summary { margin: 0; font: 600 13px/1.4 var(--ui); color: #e6e3db; }
.mb-desc { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.mb-badge { margin-left: auto; margin-right: 8px; padding: 2px 6px 1px; border-radius: 3px; font: 600 9px/1.3 var(--silk); letter-spacing: .14em; color: #0d1715; background: #7ff5dccc; }
.mb-home { font-size: 11px; color: #7ff5dc; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-home:hover { text-decoration: underline; }
/* WINDOW(화면 속 화면)의 원본 영상: 문서 안에 두되 보이지 않게 */
.mon-pip-src { position: fixed; left: 0; bottom: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; }

/* ---------- 모듈 가져오기 진행 창 ---------- */
.im-overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: #000000b0; }
.im-overlay[hidden] { display: none; }
.im {
  display: flex; flex-direction: column;
  width: min(620px, 100%); max-height: min(760px, calc(100dvh - 32px));
  box-sizing: border-box; border-radius: 10px; overflow: hidden;
  background-color: #17181b; background-image: var(--grain-light), linear-gradient(180deg, #212226, #141517);
  box-shadow: 0 0 0 1px #000, inset 0 1px 0 #ffffff1c, 0 30px 60px -12px #000;
  color: var(--silk-ink); font: 500 13.5px/1.45 var(--ui);
}
.im-head { padding: 16px 18px 6px; }
.im-head h2 { margin: 0; font: 400 15px/1 var(--name); letter-spacing: .16em; }
.im-list { flex: 1; overflow-y: auto; padding: 6px 18px 12px; }
.im-file { margin-top: 10px; padding: 10px 12px 10px; border: 1px solid #2c2e33; border-radius: 7px; background: #1b1d20; }
.im-file.is-ok { border-color: #30c48d70; }
.im-file.is-bad { border-color: #e5484d90; }
.im-file-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.im-file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-verdict { flex: none; font: 600 9.5px/1 var(--silk); letter-spacing: .16em; padding: 3px 7px 2px; border-radius: 3px; }
.im-verdict.wait { color: #f0b429; background: #f0b42922; }
.im-verdict.run { color: #7ff5dc; background: #7ff5dc1c; }
.im-verdict.ok { color: #0d1715; background: #30c48d; }
.im-verdict.skip { color: #ebe7dcaa; background: #ffffff12; }
.im-verdict.bad { color: #fff; background: #e5484d; }
.im-steps { list-style: none; margin: 8px 0 0; padding: 0; }
.im-step { display: grid; grid-template-columns: 16px 150px 1fr; gap: 8px; align-items: baseline; padding: 2px 0; font-size: 12.5px; }
.im-step b { font-weight: 500; color: #ebe7dcb0; }
.im-detail { color: #ebe7dc99; word-break: break-word; }
.im-icon { font-style: normal; text-align: center; }
.im-step.todo .im-icon::before { content: '○'; color: #ebe7dc40; }
.im-step.todo b { color: #ebe7dc50; }
.im-step.run .im-icon::before { content: '◐'; color: #7ff5dc; display: inline-block; animation: im-spin 1s linear infinite; }
.im-step.wait .im-icon::before { content: '?'; color: #f0b429; font-weight: 700; }
.im-step.wait .im-detail { color: #f0b429; }
.im-step.ok .im-icon::before { content: '✓'; color: #30c48d; font-weight: 700; }
.im-step.ok b { color: #ebe7dcdd; }
.im-step.bad .im-icon::before { content: '✕'; color: #e5484d; font-weight: 700; }
.im-step.bad b, .im-step.bad .im-detail { color: #ff8a8d; }
.im-step.off .im-icon::before { content: '–'; color: #ebe7dc30; }
.im-step.off b, .im-step.off .im-detail { color: #ebe7dc40; }
@keyframes im-spin { to { transform: rotate(360deg); } }
.im-ask { margin-top: 8px; padding: 10px 12px; border-radius: 6px; background: #f0b42914; border: 1px solid #f0b42955; }
.im-ask p { margin: 0 0 8px; color: #ebe7dcdd; }
.im-ask-bar, .im-foot-bar { display: flex; gap: 8px; justify-content: flex-end; }
.im-btn {
  padding: 8px 12px 7px; border: 0; border-radius: 5px; white-space: nowrap;
  font: 600 10.5px/1 var(--silk); letter-spacing: .14em; color: var(--silk-ink);
  background: linear-gradient(180deg, #34363a, #1d1e21); box-shadow: 0 0 0 1px #000, inset 0 1px 0 #ffffff26, 0 2px 3px #000a; cursor: pointer;
}
.im-btn.primary { color: #0d1715; background: linear-gradient(180deg, #9ff8e6, #5fd9c2); box-shadow: 0 0 0 1px #000, inset 0 1px 0 #ffffffa0, 0 2px 3px #000a; }
.im-btn:disabled { opacity: .4; cursor: default; }
.im-foot { padding: 12px 18px 16px; border-top: 1px solid #2c2e33; display: flex; flex-direction: column; gap: 10px; }
.im-summary { margin: 0; color: #ebe7dcc0; }
.im-summary.bad { color: #ff8a8d; }
.im-done { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 6px; background: #30c48d1f; border: 1px solid #30c48d77; }
.im-done b { color: #52f0a8; font: 400 13px/1.2 var(--name); letter-spacing: .08em; }
.im-done span { color: #ebe7dccc; }
@media (max-width: 560px) { .im-step { grid-template-columns: 16px 1fr; } .im-step .im-detail { grid-column: 2; } }

/* ---------- REC 목록 (무엇을 녹화할지) ---------- */
.rec-menu {
  position: absolute; z-index: 40; bottom: calc(100% + 12px); left: 0; width: 290px;
  padding: 10px; border-radius: 8px;
  background-color: #17181b; background-image: var(--grain-light), linear-gradient(180deg, #212226, #141517);
  box-shadow: 0 0 0 1px #000, inset 0 1px 0 #ffffff1c, 0 20px 40px -10px #000;
}
.rec-menu[hidden] { display: none; }
.rec-menu-head { padding: 2px 4px 8px; font: 600 9.5px/1 var(--silk); letter-spacing: .26em; color: #ebe7dc80; }
.rec-item {
  display: flex; flex-direction: column; gap: 3px; width: 100%; margin-top: 5px; padding: 9px 10px;
  border: 1px solid #2c2e33; border-radius: 6px; background: #1d1f22; color: var(--silk-ink); text-align: left; cursor: pointer;
}
.rec-item b { font: 600 11px/1 var(--silk); letter-spacing: .14em; color: #ff8a8d; }
.rec-item span { font: 500 12px/1.35 var(--ui); color: #ebe7dcb0; }
.rec-item:hover:not(:disabled) { border-color: #e5484d99; background: #25282c; }
.rec-item:disabled { opacity: .45; cursor: default; }

/* ---------- 수업 목록 이름 (LESSONS) — 눈에 띄게 ---------- */
.preset-label { display: inline-flex; align-items: center; gap: 5px; font: 700 11.5px/1 var(--silk); letter-spacing: .2em; color: #7ff5dc; text-shadow: 0 0 8px rgba(127, 245, 220, .6); }
.preset-label i { font-style: normal; font-size: 12px; color: #ffd08a; text-shadow: 0 0 8px rgba(255, 190, 90, .8); }
.preset-sel:hover .preset-label { color: #b8fff0; }

/* 처음 온 사람에게 한 번: 빛나는 창 + 말풍선 */
.preset-slot.preset-spot .preset-win { animation: preset-glow 1.6s ease-in-out infinite; }
@keyframes preset-glow {
  0%, 100% { box-shadow: inset 0 2px 5px #000, 0 0 0 1px #000, 0 0 0 3px #7ff5dc66, 0 0 18px 4px #7ff5dc55; }
  50%      { box-shadow: inset 0 2px 5px #000, 0 0 0 1px #000, 0 0 0 4px #7ff5dccc, 0 0 36px 10px #7ff5dcaa; }
}
.preset-tip {
  position: absolute; z-index: 41; bottom: calc(100% + 16px); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 6px; width: 330px; padding: 14px 16px;
  border: 0; border-radius: 9px; text-align: left; cursor: pointer;
  color: #0d1715; background: linear-gradient(180deg, #a8fbe9, #62dcc5);
  box-shadow: 0 0 0 1px #000, 0 0 30px 6px #7ff5dc77, 0 14px 30px -8px #000;
  animation: preset-bob 1.6s ease-in-out infinite;
}
.preset-tip[hidden] { display: none; }
.preset-tip b { font: 400 16px/1 var(--name); letter-spacing: .14em; }
.preset-tip span { font: 600 14px/1.45 var(--ui); word-break: keep-all; }
.preset-tip::after { content: ''; position: absolute; left: 50%; bottom: -8px; width: 16px; height: 16px; transform: translateX(-50%) rotate(45deg); background: #62dcc5; box-shadow: 1px 1px 0 #000; }
@keyframes preset-bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -6px); } }
@media (prefers-reduced-motion: reduce) { .preset-slot.preset-spot .preset-win, .preset-tip { animation: none; } }

/* ---------- NOTE (LESSONS 오른쪽) ---------- */
.note-btn {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 14px; padding: 7px 11px 6px;
  border: 0; border-radius: 5px; cursor: pointer;
  font: 700 10.5px/1 var(--silk); letter-spacing: .18em; color: #ebe7dc99;
  background: linear-gradient(180deg, #2c2e32, #1a1b1e); box-shadow: 0 0 0 1px #000, inset 0 1px 0 #ffffff1c;
}
.note-btn i { font-style: normal; font-size: 12px; }
.note-btn .note-dot { width: 6px; height: 6px; border-radius: 50%; background: #3a3c40; box-shadow: 0 0 0 1px #000; }
.note-btn.has-note { color: #ffd08a; }
.note-btn.has-note .note-dot { background: #ffd08a; box-shadow: 0 0 0 1px #000, 0 0 8px #ffb454; }
.note-btn:hover { filter: brightness(1.2); }
/* 노트 카드: 수업 카드와 같은 모양, 호박색 표시 */
.note-card .lesson-count b { color: #ffd08a; text-shadow: 0 0 6px #ffb45488; }
.note-field { display: flex; flex-direction: column; gap: 4px; margin-top: 11px; }
.note-field > span { font: 600 9.5px/1 var(--silk); letter-spacing: .2em; color: #ebe7dc80; }
.note-field input, .note-field textarea, .note-field select {
  box-sizing: border-box; width: 100%; padding: 8px 10px; border: 0; border-radius: 5px;
  font: 500 13.5px/1.45 var(--ui); color: #ebe7dc; background: #0e0f11;
  box-shadow: inset 0 1px 3px #000, 0 0 0 1px #2c2e33; outline: none; resize: vertical;
}
.note-field input:focus, .note-field textarea:focus, .note-field select:focus { box-shadow: inset 0 1px 3px #000, 0 0 0 2px #ffd08a88; }
.note-del { color: #ff8a8d !important; background: linear-gradient(180deg, #34363a, #1d1e21) !important; box-shadow: 0 0 0 1px #000, inset 0 1px 0 #ffffff26 !important; }

/* MODULE LOCK 이 켜져 있으면 (모듈을 옮길 수 없으니) 패널을 짚고 두 손가락으로 확대, 한 손가락으로 화면 이동.
   노브·잭·스위치·슬라이더는 그대로 손가락으로 조작 (그 부품들은 따로 touch-action: none) */
.case.locked, .case.locked .rack, .case.locked .module, .case.locked .mod-screen, .case.locked .mod-canvas { touch-action: pan-x pan-y pinch-zoom; }
.case.locked .module { cursor: default; }

/* Add module 창: 가로 넘침·글자 겹침 고침 */
.mb-list { overflow-x: hidden; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); }
.mb-card { min-width: 0; }
.mb-card-top { flex-wrap: wrap; align-items: center; row-gap: 4px; }
.mb-card-top > :first-child { min-width: 0; flex: 1 1 auto; }
.mb-name { overflow-wrap: anywhere; }
.mb-badge { margin-left: 0; margin-right: 0; white-space: nowrap; }
.mb-hp { white-space: nowrap; }
.mb-summary { overflow-wrap: anywhere; }
.mb-desc { flex: none; max-height: calc(1.55em * 4); overflow-wrap: anywhere; }
.mb-file { overflow-wrap: anywhere; line-height: 1.4; }
@media (max-width: 480px) {
  .mb-list { padding: 10px; gap: 10px; }
  .mb-card { gap: 10px; padding: 10px 10px 10px 12px; }
}
.mb-head { flex-wrap: wrap; row-gap: 8px; }
.mb-search { min-width: 0; }
@media (max-width: 480px) {
  .mb-head .mb-search { flex: 1 1 100%; }
  .mb-head .mb-import { flex: 1 1 auto; }
  .mb-foot { font-size: 11.5px; }
}

/* ---------- 휠 확대 · 끌어서 화면 이동 ---------- */
.rack-scroll.zoomed { overflow: auto; cursor: grab; }
.rack-scroll.zoomed .module { cursor: grab; }
.case.locked .module { cursor: default; }
.rack-scroll.zoomed .case.locked .module { cursor: grab; }
.rack-scroll.panning, .rack-scroll.panning * { cursor: grabbing !important; user-select: none; }
.zoom-badge {
  position: fixed; z-index: 30; left: 14px; top: 44px;
  display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 10px; border-radius: 6px;
  font: 600 10.5px/1 var(--silk); letter-spacing: .16em; color: #ebe7dcc0;
  background: #17181bdd; box-shadow: 0 0 0 1px #000, inset 0 1px 0 #ffffff14;
}
.zoom-badge[hidden] { display: none; }
.zoom-badge button {
  padding: 5px 8px 4px; border: 0; border-radius: 4px; cursor: pointer;
  font: 600 10px/1 var(--silk); letter-spacing: .16em; color: #0d1715; background: #7ff5dc;
}

/* ---------- 가벼운 모드 (MENU → Light mode) ---------- */
html.lite .case *, html.lite .case *::before, html.lite .case *::after { filter: none !important; }
html.lite .cable .p-shadow { display: none; }
html.lite .case { box-shadow: none; }
.tb-btn.on { color: #0d1715; background: linear-gradient(180deg, #9ff8e6, #5fd9c2); box-shadow: 0 0 0 1px #000, inset 0 1px 0 #ffffffa0; }

/* ---------- 메뉴 줄 균형 (글자가 두 줄로 꺾이거나 삐져나오지 않게) ---------- */
.topbar .brand { white-space: nowrap; flex: none; }
.topbar .brand-ver { white-space: nowrap; }
.tb-btn { white-space: nowrap; flex: none; font-size: 12.5px; padding: 7px 11px; }
#btn-lite { font-size: 11px; letter-spacing: .02em; padding: 8px 10px; }
.topbar .status { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1100px) {
  .topbar { gap: 10px; }
  .topbar .brand { font-size: 16px; }
  .topbar .status { display: none; }
}
@media (max-width: 760px) {
  .topbar { overflow-x: auto; }
  .topbar .brand-ver { display: none; }
  .topbar .brand { font-size: 14px; }
}

/* ---------- 영상 잭 (BNC 모양): 둥근 은색 고리 + 양옆 걸쇠 두 개 + 보라 테 — 오디오·CV 잭(육각 너트)과 구분 ---------- */
.jack.video {
  --vid: #a58bff;
  background:
    radial-gradient(circle at 1.5px 50%, #d9dce0 0 1.6px, #555a60 2.1px, transparent 2.6px),
    radial-gradient(circle at calc(100% - 1.5px) 50%, #d9dce0 0 1.6px, #555a60 2.1px, transparent 2.6px);
}
.jack.video::before {
  clip-path: none;
  inset: 1px;
  border-radius: 50%;
  background:
    radial-gradient(circle closest-side, transparent 0 62%, #1a1b1d 64%, transparent 66%),
    linear-gradient(150deg, #ffffff50, transparent 45%, #00000055),
    conic-gradient(from 20deg, #f3f4f6, #a4a9af, #e3e5e8, #80858b, #f3f4f6);
  box-shadow: 0 0 0 1.6px var(--vid), 0 0 6px #a58bff55;
  transform: none;
}
.jack.video::after { inset: 5px; }
.port.video > span { color: #c6b6ff; }
html.lite .jack.video::before { box-shadow: 0 0 0 1.6px var(--vid); }
/* 끌고 있는 케이블이 소리·CV 면 영상 입력은 흐리게 (꽂을 수 없음), 영상이면 영상 입력을 보라색으로 강조 */
.case.want-in:not(.drag-video) .jack.video[data-kind="in"] { box-shadow: none; opacity: .45; }
.case.want-in.drag-video .jack.video[data-kind="in"] { box-shadow: 0 0 0 3px var(--vid); }
.case.want-out:not(.drag-video) .jack.video[data-kind="out"] { box-shadow: 0 0 0 3px var(--signal); }
.case.want-out.drag-video .jack[data-kind="out"]:not(.video) { box-shadow: none; opacity: .45; }
.case.want-out.drag-video .jack.video[data-kind="out"] { box-shadow: 0 0 0 3px var(--vid); }

/* ---------- 영상 케이블: 감긴 스프링 띠 (그림이 흐르는 케이블만) ---------- */
.cable .c-coil { display: none; fill: none; }
.cable.video .c-coil {
  display: inline;
  stroke: #e7e0ff; stroke-opacity: .5; stroke-width: 5.6;
  stroke-dasharray: 1.2 3.4; stroke-linecap: butt;
}
.cable.video .c-body { stroke-width: 6.4; }
.mod-out .port.video > span { color: #5b3fcf; }          /* 크림색 출력 칸 위에서도 잘 보이게 */

/* REC 목록: VISUALS 저장 형식 고르기 */
.rec-format { display: flex; align-items: center; gap: 6px; margin: 10px 0 6px; padding: 8px 8px; border-radius: 6px; background: #0e0f11; box-shadow: inset 0 1px 3px #000, 0 0 0 1px #2c2e33; }
.rec-format > span { flex: 1; font: 700 10.5px/1 var(--silk); letter-spacing: .18em; color: #ebe7dcd0; }
.rec-format button {
  min-width: 58px; padding: 8px 12px 7px; border: 0; border-radius: 5px; cursor: pointer;
  font: 700 12px/1 var(--silk); letter-spacing: .12em; color: #ebe7dcd0; background: #2a2c30; box-shadow: 0 0 0 1px #000, inset 0 1px 0 #ffffff1c;
}
.rec-format button.on { color: #0d1715; background: #7ff5dc; }
.rec-format button.unavail { cursor: help; color: #ebe7dc70; background: repeating-linear-gradient(135deg, #2a2c30 0 6px, #232528 6px 12px); text-decoration: line-through; }
.rec-format-note { margin: 0 2px 8px; font: 500 12px/1.45 var(--ui); color: #ebe7dcb0; }
.rec-format-note.warn { color: #f0c46a; }

/* FILE FORMAT: 왼쪽에 동그란 선택 표시(라디오) — 어느 쪽이 선택됐는지 분명하게 */
.rec-format button { display: inline-flex; align-items: center; gap: 7px; }
.rec-format button i { width: 12px; height: 12px; border-radius: 50%; flex: none; box-sizing: border-box; border: 2px solid #ebe7dc90; background: transparent; }
.rec-format button.on i { border-color: #0d1715; background: radial-gradient(circle, #0d1715 0 3px, transparent 3.5px); }
.rec-format button.unavail i { border-color: #ebe7dc50; }
.rec-format-note[hidden] { display: none; }

/* 녹화 방식: 왼쪽에 동그란 선택 표시, 고른 쪽 강조 */
.rec-modes { display: flex; flex-direction: column; }
.rec-item { flex-direction: row !important; align-items: center; gap: 10px !important; }
.rec-item > i { width: 14px; height: 14px; border-radius: 50%; flex: none; box-sizing: border-box; border: 2px solid #ebe7dc80; }
.rec-item.on { border-color: #e5484d; background: #2a1d1f; }
.rec-item.on > i { border-color: #ff8a8d; background: radial-gradient(circle, #ff8a8d 0 3.5px, transparent 4px); }
.rec-item-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rec-start {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 6px; padding: 11px 12px 10px;
  border: 0; border-radius: 6px; cursor: pointer; font: 700 11.5px/1 var(--silk); letter-spacing: .16em;
  color: #fff; background: linear-gradient(180deg, #e5484d, #b8343a); box-shadow: 0 0 0 1px #000, inset 0 1px 0 #ffffff40;
}
.rec-start .dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px #fff; }
.rec-start:hover { filter: brightness(1.1); }
.rec-start:disabled { opacity: .4; cursor: default; filter: none; }
