/* === module: monitoring_room === */
.monitoring-room {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 280px;
  grid-template-rows: 1fr;
  gap: 8px;
  padding: 8px;
  min-height: 0;
  overflow: hidden;
}
.monitor-main-screen {
  position: relative;
  border: 2px solid #2a2a3a;
  border-radius: 10px;
  overflow: hidden;
  background: #0d0d18;
  display: flex;
  flex-direction: column;
  transition: border-color 0.8s ease;
}
.monitor-main-screen .cinema-stage {
  flex: 1;
  min-height: 0;
}
.monitor-screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: #111118;
  border-bottom: 1px solid #222;
  flex-shrink: 0;
}
.monitor-room-label {
  font-size: 12px;
  font-weight: 600;
  color: #9ec5ff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.monitor-vibe-emoji {
  font-size: 18px;
  transition: transform 0.3s ease;
}
.monitor-vibe-emoji.pulse {
  animation: vibeEmojiBounce 0.6s ease;
}
@keyframes vibeEmojiBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.4); }
}

.monitor-sub-screens {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow: hidden;
}
.monitor-sub-screen {
  position: relative;
  flex: 1;
  min-height: 0;
  border: 1.5px solid #222;
  border-radius: 8px;
  background: #0d0d15;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: border-color 0.5s ease, background 1.2s ease;
}
.monitor-sub-screen:hover {
  border-color: #444;
}
.monitor-sub-screen .monitor-screen-header {
  padding: 4px 8px;
}
.monitor-sub-screen .monitor-room-label {
  font-size: 10px;
}
.monitor-sub-screen .monitor-vibe-emoji {
  font-size: 14px;
}
.monitor-sub-body {
  padding: 6px 8px;
  font-size: 11px;
  color: #888;
}
.sub-screen-participants {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.sub-participant-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid #333;
  color: #aaa;
}
.sub-screen-vibe-text {
  font-size: 10px;
  color: #666;
  line-height: 1.3;
}
.sub-screen-highlight {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  padding: 4px 8px;
  background: #e8a04020;
  border-top: 1px solid #e8a04050;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: highlightPulse 1.5s ease-in-out infinite;
}
@keyframes highlightPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
.highlight-icon { font-size: 12px; }
.highlight-text { font-size: 10px; color: #e8a040; }

.sub-screen-click-zone {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.monitor-sub-screen .monitor-log-btn {
  z-index: 2;
}

/* Vibe color overlays on screens */
.monitor-main-screen[data-vibe="pink"]   { border-color: #e8789050; background: linear-gradient(135deg, #1a0d15 0%, #0d0d18 40%); }
.monitor-main-screen[data-vibe="red"]    { border-color: #cc444450; background: linear-gradient(135deg, #1a0d0d 0%, #0d0d18 40%); }
.monitor-main-screen[data-vibe="purple"] { border-color: #9b59b650; background: linear-gradient(135deg, #150d1a 0%, #0d0d18 40%); }
.monitor-main-screen[data-vibe="blue"]   { border-color: #3498db50; background: linear-gradient(135deg, #0d1218 0%, #0d0d18 40%); }

.monitor-sub-screen[data-vibe="pink"]   { border-color: #e8789040; background: #1a0d1508; }
.monitor-sub-screen[data-vibe="red"]    { border-color: #cc444440; background: #1a0d0d08; }
.monitor-sub-screen[data-vibe="purple"] { border-color: #9b59b640; background: #150d1a08; }
.monitor-sub-screen[data-vibe="blue"]   { border-color: #3498db40; background: #0d121808; }

/* Log button (per screen) */
.monitor-log-btn {
  position: absolute;
  bottom: 6px;
  right: 6px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #333;
  border-radius: 6px;
  background: #111118cc;
  color: #888;
  cursor: pointer;
  z-index: 3;
  transition: color 0.2s, border-color 0.2s;
}
.monitor-log-btn:hover {
  color: #ccc;
  border-color: #555;
}
.monitor-log-btn.mini {
  font-size: 9px;
  padding: 2px 6px;
}

/* Action Bar */
.monitor-action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #0c0c14;
  border-top: 1px solid #1a1a2a;
  flex-shrink: 0;
}
.monitor-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid #2a2a3a;
  border-radius: 8px;
  background: #151520;
  color: #ccc;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.15s, border-color 0.15s;
}
.monitor-action-btn:hover {
  background: #1a1a2a;
  border-color: #444;
}
.monitor-action-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.monitor-action-btn {
  position: relative;
}
.monitor-action-btn.pending {
  border-color: #e8a040;
  background: linear-gradient(180deg, #241808 0%, #151520 100%);
  color: #f4d79a;
  animation: actionBtnPulse 1.6s ease-in-out infinite;
}
.monitor-action-btn.active {
  border-color: #5a8ed6;
  background: #1a2438;
  color: #cfe0ff;
}
@keyframes actionBtnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 160, 64, 0.0); }
  50%      { box-shadow: 0 0 0 4px rgba(232, 160, 64, 0.22); }
}
.action-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #e85a5a;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(232, 90, 90, 0.6);
}
.action-icon { font-size: 16px; }

/* Framework integration: top screen wall + bottom physical console. */
.right-panel {
  background:
    linear-gradient(180deg, rgba(232, 232, 224, 0.06), rgba(0,0,0,0.18)),
    #050506;
  perspective: 1200px;
}
.monitoring-room {
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
  padding: 18px 18px 10px;
  background:
    linear-gradient(180deg, #d9d7d1 0%, #c8c6c0 68%, #8b7a78 69%, #766766 100%);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 0 0 18px 18px;
  box-shadow:
    inset 0 -70px 80px rgba(40, 24, 22, 0.18),
    0 18px 44px rgba(0,0,0,0.38);
  transform: rotateX(1.5deg);
  transform-origin: 50% 0%;
}
.monitor-main-screen,
.monitor-sub-screen {
  background: #7f1716;
  border-color: rgba(70, 8, 8, 0.55);
  box-shadow:
    inset 0 0 48px rgba(0,0,0,0.18),
    0 10px 22px rgba(0,0,0,0.22);
}
.monitor-main-screen {
  border-radius: 4px;
}
.monitor-sub-screen {
  border-radius: 4px;
}
.monitor-screen-header {
  background: rgba(70, 8, 8, 0.32);
  border-bottom-color: rgba(0,0,0,0.12);
}
.monitor-room-label {
  color: rgba(28, 18, 18, 0.72);
}
.monitor-action-bar {
  position: relative;
  min-height: 104px;
  padding: 18px 28px 24px;
  justify-content: center;
  gap: 18px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 230, 200, 0.12), transparent 44%),
    linear-gradient(180deg, #9b8a89, #6d5f5f 72%, #4f4546);
  border-top: 1px solid rgba(255, 235, 220, 0.12);
  box-shadow:
    inset 0 10px 20px rgba(255,255,255,0.06),
    inset 0 -24px 38px rgba(0,0,0,0.18);
  transform: perspective(900px) rotateX(10deg);
  transform-origin: 50% 0%;
}
.monitor-action-bar::before {
  content: "DIRECTOR CONSOLE";
  position: absolute;
  top: 8px;
  left: 24px;
  color: rgba(34, 24, 24, 0.42);
  font-size: 10px;
  letter-spacing: 0.26em;
}
.monitor-action-btn {
  min-width: 92px;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 13px 16px 11px;
  border-radius: 18px 18px 12px 12px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255,255,255,0.18), transparent 42%),
    linear-gradient(180deg, #2d3136, #111316 72%, #08090a);
  border-color: rgba(255,255,255,0.10);
  color: #d6d2c8;
  box-shadow:
    0 14px 22px rgba(0,0,0,0.34),
    inset 0 1px 0 rgba(255,255,255,0.14);
}
.monitor-action-btn:hover {
  background:
    radial-gradient(circle at 50% 20%, rgba(255,255,255,0.22), transparent 42%),
    linear-gradient(180deg, #373d43, #15181c 72%, #08090a);
  border-color: rgba(255,230,190,0.24);
  transform: translateY(-2px);
}
.monitor-action-btn.pending {
  border-color: rgba(232, 160, 64, 0.88);
  background:
    radial-gradient(circle at 50% 18%, rgba(232,160,64,0.24), transparent 44%),
    linear-gradient(180deg, #3d2c18, #14100d 72%, #080706);
}
.monitor-action-btn.active {
  border-color: rgba(116, 222, 232, 0.74);
  background:
    radial-gradient(circle at 50% 18%, rgba(116,222,232,0.20), transparent 44%),
    linear-gradient(180deg, #24343a, #101518 72%, #08090a);
}
.monitor-wiretap-cue {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 42px;
  z-index: 8;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "dot main"
    "dot sub";
  align-items: center;
  gap: 2px 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 226, 190, 0.34);
  border-radius: 999px;
  background:
    radial-gradient(circle at 18% 50%, rgba(255, 214, 142, 0.24), transparent 38%),
    rgba(245, 238, 222, 0.86);
  color: #3d2118;
  text-align: left;
  cursor: pointer;
  box-shadow:
    0 10px 22px rgba(0,0,0,0.28),
    0 0 24px rgba(232, 160, 64, 0.22);
  animation: wiretapCuePulse 1.4s ease-in-out infinite;
}
.wiretap-cue-dot {
  grid-area: dot;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #df3d2f;
  box-shadow: 0 0 0 5px rgba(223,61,47,0.16), 0 0 16px rgba(223,61,47,0.62);
}
.wiretap-cue-main {
  grid-area: main;
  font-size: 12px;
  font-weight: 800;
}
.wiretap-cue-sub {
  grid-area: sub;
  font-size: 10px;
  color: rgba(61, 33, 24, 0.62);
}
.monitor-sub-screen.wiretap-cued,
.monitor-main-screen.wiretap-cued {
  border-color: #e8a040 !important;
  box-shadow:
    inset 0 0 48px rgba(232, 160, 64, 0.12),
    0 0 26px rgba(232, 160, 64, 0.18);
}
.monitor-main-screen.wiretap-projected {
  border-color: #74dee8 !important;
  box-shadow:
    inset 0 0 60px rgba(116, 222, 232, 0.10),
    0 0 30px rgba(116, 222, 232, 0.16);
}
@keyframes wiretapCuePulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
.action-label { font-weight: 600; }

/* Room Log Popup */
.room-log-popup {
  position: absolute;
  bottom: 60px;
  right: 12px;
  width: 360px;
  max-height: 400px;
  background: #111118;
  border: 1px solid #2a2a3a;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.room-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #222;
  flex-shrink: 0;
}
.room-log-title {
  font-size: 13px;
  font-weight: 600;
  color: #9ec5ff;
}
.room-log-close {
  background: none;
  border: none;
  color: #666;
  font-size: 16px;
  cursor: pointer;
}
.room-log-close:hover { color: #ccc; }
.room-log-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
}
.room-log-empty {
  text-align: center;
  color: #555;
  font-size: 12px;
  padding: 20px 0;
}
.room-log-entry {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: flex-start;
}
.room-log-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  background: #222;
}
.room-log-msg {
  flex: 1;
  min-width: 0;
}
.room-log-speaker {
  font-size: 10px;
  font-weight: 600;
  color: #888;
  margin-bottom: 2px;
}
.room-log-text {
  font-size: 12px;
  color: #ccc;
  line-height: 1.4;
  word-wrap: break-word;
}

/* Move Character Modal */
.move-char-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.move-char-panel {
  background:
    radial-gradient(circle at 20% 0%, rgba(232,160,64,0.16), transparent 34%),
    linear-gradient(180deg, #171720 0%, #0b0b12 100%);
  border: 1px solid #343244;
  border-radius: 18px;
  width: 560px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  overflow: hidden;
}
.move-char-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #222;
}
.move-char-header h3 {
  font-size: 15px;
  color: #e0e0e0;
  margin: 0;
}
.move-char-close {
  background: none;
  border: none;
  color: #666;
  font-size: 18px;
  cursor: pointer;
}
.move-char-body {
  padding: 16px 18px;
}
.move-char-hint {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(232,160,64,0.22);
  border-radius: 10px;
  background: rgba(232,160,64,0.08);
  color: #c9b18a;
  font-size: 12px;
  line-height: 1.5;
}
.move-char-section {
  margin-bottom: 14px;
}
.move-char-section label {
  display: block;
  font-size: 11px;
  color: #888;
  margin-bottom: 8px;
  font-weight: 600;
}
.move-char-grid, .move-room-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.move-room-placeholder {
  width: 100%;
  padding: 14px 12px;
  border: 1px dashed rgba(232,160,64,0.25);
  border-radius: 10px;
  color: #7c7468;
  background: rgba(255,255,255,0.025);
  font-size: 12px;
  text-align: center;
}
.move-char-option, .move-room-option {
  padding: 8px 12px;
  font-size: 12px;
  border: 1px solid #2a2a3a;
  border-radius: 8px;
  background: #0d0d18;
  color: #aaa;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
  user-select: none;
}
.move-char-option {
  min-width: 96px;
}
.move-char-option span, .move-room-option span {
  display: block;
  font-weight: 700;
}
.move-char-option small, .move-room-option small {
  display: block;
  margin-top: 3px;
  color: #666;
  font-size: 10px;
  font-weight: 500;
}
.move-char-option:hover, .move-room-option:hover {
  border-color: #555;
  transform: translateY(-1px);
}
.move-char-option.selected, .move-room-option.selected {
  border-color: #e8a040;
  color: #e8a040;
  background: #e8a04015;
  box-shadow: 0 0 0 1px rgba(232,160,64,0.2), 0 0 18px rgba(232,160,64,0.12);
}
.move-room-option.drop-ready {
  border-style: dashed;
  border-color: rgba(232,160,64,0.5);
}
.move-room-option.drop-hover {
  border-color: #74d680;
  background: rgba(116,214,128,0.12);
  color: #a5efad;
  transform: translateY(-2px) scale(1.02);
}
.move-console {
  margin-top: 16px;
  border: 1px solid rgba(102, 197, 220, 0.26);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(83, 209, 230, 0.08), rgba(232, 160, 64, 0.08)),
    #080d13;
  box-shadow: inset 0 0 22px rgba(70, 190, 220, 0.08);
  padding: 12px;
}
.move-console-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
}
.move-console-label {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(92, 222, 230, 0.14);
  border: 1px solid rgba(92, 222, 230, 0.28);
  color: #77dfe8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}
.move-console-command {
  color: #d9f6f7;
  font-size: 13px;
  font-weight: 700;
}
.move-wave {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 10px 0;
}
.move-wave span {
  display: block;
  width: 6px;
  height: 8px;
  border-radius: 999px;
  background: rgba(116, 222, 232, 0.32);
}
.move-wave.active span {
  animation: moveWave 0.72s ease-in-out infinite;
}
.move-wave.active span:nth-child(2n) { animation-delay: 0.08s; }
.move-wave.active span:nth-child(3n) { animation-delay: 0.16s; }
.move-wave.active span:nth-child(4n) { animation-delay: 0.24s; }
@keyframes moveWave {
  0%, 100% { height: 8px; background: rgba(116, 222, 232, 0.32); }
  50% { height: 28px; background: rgba(116, 222, 232, 0.92); }
}
.move-dice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.move-dice-cube {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  background: linear-gradient(145deg, #202334, #090a10);
  color: #d8dff0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 12px 24px rgba(0,0,0,0.28);
}
.move-dice-copy {
  color: #7f8ea0;
  font-size: 12px;
}
.move-dice.rolling .move-dice-cube {
  animation: moveDiceRoll 0.42s linear infinite;
  color: #ffd38c;
}
.move-dice.success .move-dice-cube {
  border-color: rgba(116, 214, 128, 0.7);
  color: #a5efad;
}
.move-dice.failed .move-dice-cube {
  border-color: rgba(255, 115, 115, 0.65);
  color: #ff9a9a;
}
.move-dice.success .move-dice-copy { color: #a5efad; }
.move-dice.failed .move-dice-copy { color: #ff9a9a; }
@keyframes moveDiceRoll {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(9deg) scale(1.06); }
  100% { transform: rotate(0deg) scale(1); }
}
.move-char-footer {
  padding: 12px 18px;
  border-top: 1px solid #222;
  text-align: right;
}
.move-char-confirm {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: #e8a040;
  color: #0d1420;
  cursor: pointer;
}
.move-char-confirm:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Director desk layout pass — match the 3D mockup: left preview stack, center main monitor, right notes, bottom console. */
.right-panel {
  background:
    linear-gradient(180deg, rgba(108, 129, 176, 0.72) 0%, rgba(111, 125, 160, 0.72) 62%, rgba(99, 84, 92, 0.88) 63%, rgba(76, 56, 61, 0.96) 100%),
    #161721;
  padding: 14px 16px 18px;
  gap: 0;
  perspective: 1400px;
}
.monitoring-room {
  flex: 1;
  display: grid;
  grid-template-columns: clamp(132px, 15vw, 190px) minmax(420px, 1fr) clamp(150px, 16vw, 210px);
  grid-template-areas: "subs main info";
  grid-template-rows: minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  padding: 18px 18px 12px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(132, 150, 198, 0.32), rgba(82, 91, 124, 0.22)),
    transparent;
  border: 0;
  border-radius: 18px 18px 0 0;
  box-shadow: none;
  transform: none;
}
.monitor-sub-screens {
  grid-area: subs;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  background: linear-gradient(180deg, #26304b, #151a2a);
  border: 2px solid rgba(35, 38, 58, 0.95);
  box-shadow: 0 14px 28px rgba(0,0,0,0.24);
}
.monitor-main-screen {
  grid-area: main;
  border: 8px solid #25304c;
  border-radius: 8px;
  background: #151426;
  box-shadow:
    0 22px 40px rgba(0,0,0,0.28),
    inset 0 0 0 2px rgba(255,255,255,0.06);
}
.monitor-main-screen::after {
  content: "";
  position: absolute;
  left: 42%;
  right: 42%;
  bottom: -30px;
  height: 30px;
  background: linear-gradient(180deg, #283149, #1c2236);
  border-radius: 0 0 8px 8px;
  pointer-events: none;
}
.monitor-sub-screen {
  border: 4px solid #202842;
  border-radius: 4px;
  background: #151426;
  box-shadow:
    inset 0 0 30px rgba(0,0,0,0.2),
    0 8px 16px rgba(0,0,0,0.18);
}
.monitor-screen-header {
  min-height: 25px;
  background: rgba(24, 27, 42, 0.84);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.monitor-room-label {
  color: #d9def4;
}
.monitor-info-board {
  grid-area: info;
  display: grid;
  grid-template-rows: 1fr 1.12fr;
  gap: 18px;
  min-height: 0;
  padding: 6px;
  border-radius: 8px;
  background: linear-gradient(180deg, #212944, #151b2e);
  border: 2px solid rgba(35, 38, 58, 0.86);
  box-shadow: 0 14px 28px rgba(0,0,0,0.22);
}
.info-note {
  position: relative;
  min-height: 0;
  padding: 18px 14px 14px;
  color: #3b312b;
  box-shadow:
    0 8px 18px rgba(0,0,0,0.18),
    inset 0 0 24px rgba(255,255,255,0.16);
  overflow: hidden;
}
.impression-note {
  background: #f3e5df;
}
.insight-note {
  background: #f0d878;
}
.info-note-title {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.03em;
  color: rgba(39, 31, 25, 0.84);
}
.info-note-body {
  margin-top: 20px;
  font-size: 12px;
  line-height: 1.55;
}
.info-empty,
.insight-line.muted {
  color: rgba(50, 40, 32, 0.52);
}
.insight-line {
  padding: 6px 0;
  border-bottom: 1px solid rgba(60, 45, 25, 0.12);
}
.monitor-rel-row {
  display: grid;
  grid-template-columns: auto 14px auto 1fr;
  align-items: center;
  gap: 5px;
  padding: 5px 0;
  border-bottom: 1px dashed rgba(60, 45, 25, 0.13);
}
.monitor-rel-name {
  font-weight: 800;
  color: rgba(45, 34, 28, 0.9);
}
.monitor-rel-arrow {
  color: rgba(80, 60, 45, 0.55);
  text-align: center;
}
.monitor-rel-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}
.monitor-rel-tags span {
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(85, 65, 45, 0.1);
  color: rgba(48, 36, 28, 0.78);
  font-size: 10px;
  font-weight: 700;
}
.monitor-action-bar {
  display: grid;
  grid-template-columns: 130px minmax(320px, 1fr) clamp(260px, 28vw, 420px);
  align-items: end;
  gap: 18px;
  min-height: 146px;
  padding: 20px 28px 18px;
  margin: 0 18px;
  border-radius: 16px 16px 26px 26px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 219, 189, 0.22), transparent 52%),
    linear-gradient(180deg, #9e8fa0 0%, #77666f 64%, #4e4047 100%);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow:
    inset 0 18px 28px rgba(255,255,255,0.08),
    inset 0 -26px 42px rgba(0,0,0,0.22),
    0 20px 38px rgba(0,0,0,0.28);
  transform: perspective(980px) rotateX(8deg);
  transform-origin: 50% 0%;
}
.monitor-action-bar::before {
  top: 12px;
  left: 30px;
  color: rgba(42, 31, 34, 0.34);
}
.console-mic-stand {
  position: relative;
  height: 106px;
  cursor: pointer;
  display: flex;
  align-items: end;
  justify-content: center;
  color: #2b2526;
}
.console-mic-head {
  position: absolute;
  left: 58px;
  top: 10px;
  width: 17px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(90deg, #22252a, #61646a 45%, #17191d);
  transform: rotate(-18deg);
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}
.console-mic-stem {
  width: 7px;
  height: 74px;
  border-radius: 99px;
  background: linear-gradient(90deg, #17191d, #595d64, #15171a);
  transform: rotate(11deg);
  transform-origin: bottom;
}
.console-mic-base {
  position: absolute;
  bottom: 0;
  width: 82px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, #32343a, #111216);
  color: #928b83;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.18em;
  box-shadow: 0 10px 18px rgba(0,0,0,0.28);
}
.director-console-screen {
  min-height: 96px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 5px solid #e2b8d7;
  background:
    linear-gradient(180deg, rgba(18, 35, 43, 0.96), rgba(5, 11, 18, 0.98));
  box-shadow:
    0 14px 26px rgba(0,0,0,0.26),
    inset 0 0 34px rgba(63, 206, 232, 0.12);
}
.director-console-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(189, 238, 244, 0.56);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.console-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #69e27c;
  box-shadow: 0 0 12px rgba(105,226,124,0.62);
}
.console-mode-value {
  margin-left: auto;
  color: #8be7f2;
}
.director-console-command {
  min-height: 28px;
  margin-top: 8px;
  color: #dffcff;
  font-size: clamp(13px, 1.2vw, 17px);
  font-weight: 800;
}
.director-console-wave {
  height: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 7px 0 8px;
}
.director-console-wave span {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(67, 205, 230, 0.34);
}
.director-console-wave.active span {
  animation: directorConsoleWave 0.72s ease-in-out infinite;
}
.director-console-wave.active span:nth-child(3n) { animation-delay: 0.12s; }
.director-console-wave.active span:nth-child(4n) { animation-delay: 0.22s; }
@keyframes directorConsoleWave {
  0%, 100% { height: 4px; background: rgba(67, 205, 230, 0.34); }
  50% { height: 24px; background: rgba(67, 205, 230, 0.96); }
}
.director-console-result {
  display: flex;
  align-items: center;
  gap: 10px;
}
.director-console-dice {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(145deg, #f4efe6, #a6a1a1);
  color: #31292a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.director-console-copy {
  color: rgba(221, 250, 255, 0.68);
  font-size: 12px;
}
.director-console-screen.rolling .director-console-dice {
  animation: moveDiceRoll 0.42s linear infinite;
}
.director-console-screen.success {
  border-color: #b7e3bd;
}
.director-console-screen.failed {
  border-color: #e9a0a0;
}
.console-device-bank {
  display: grid;
  grid-template-columns: repeat(4, minmax(56px, 1fr));
  gap: 10px;
}
.console-device-bank .monitor-action-btn {
  min-width: 0;
  padding: 11px 10px 10px;
}
@media (max-width: 1180px) {
  .monitoring-room {
    grid-template-columns: 128px minmax(320px, 1fr);
    grid-template-areas:
      "subs main"
      "info info";
    grid-template-rows: minmax(320px, 1fr) 130px;
  }
  .monitor-info-board {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
  }
  .monitor-action-bar {
    grid-template-columns: 90px 1fr;
  }
  .console-device-bank {
    grid-column: 1 / -1;
  }
}

/* ================================================
   Scene-based character stage (replaces subtitle UI)
   ================================================ */
.room-scene {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 80%, rgba(255,255,255,0.04) 0%, transparent 60%),
    linear-gradient(180deg, #0f0f1a 0%, #080810 100%);
}
.room-scene.mini {
  min-height: 0;
}
.room-scene::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 38%;
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.025) 100%);
  pointer-events: none;
}
.monitor-subtitle-bar {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 22px;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(5, 7, 14, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  pointer-events: none;
}
.monitor-subtitle-speaker {
  flex: 0 0 auto;
  min-width: 64px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.03em;
}
.monitor-subtitle-text {
  flex: 1;
  color: #f6f1df;
  font-size: 18px;
  line-height: 1.55;
  font-weight: 650;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}
.room-scene-characters {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 0 8% 8% 8%;
  gap: 4%;
}
.room-scene.mini .room-scene-characters {
  padding: 0 6% 10% 6%;
}
.room-scene-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3a3a4a;
  font-size: 13px;
  letter-spacing: 2px;
  pointer-events: none;
}

/* Character figure - avatar + name + optional speech bubble */
.char-figure {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2;
}
.char-figure.speaking {
  transform: translateY(-6px) scale(1.04);
  z-index: 5;
}
.char-figure.dimmed {
  opacity: 0.55;
  filter: saturate(0.7);
}

.char-avatar {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 700;
  color: #fff;
  border: 3px solid rgba(255,255,255,0.15);
  background: #2a2a3a;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5), inset 0 2px 0 rgba(255,255,255,0.1);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}
.char-figure.speaking .char-avatar {
  border-color: rgba(255,255,255,0.9);
  box-shadow:
    0 6px 24px rgba(0,0,0,0.6),
    0 0 0 4px rgba(255,255,255,0.12),
    0 0 24px var(--char-color, #fff);
  animation: charSpeakPulse 1.2s ease-in-out infinite;
}
@keyframes charSpeakPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}

.room-scene.mini .char-avatar {
  width: 44px;
  height: 44px;
  font-size: 18px;
  border-width: 2px;
}

/* Character name plate */
.char-name {
  font-size: 11px;
  font-weight: 600;
  color: #ddd;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  letter-spacing: 0.5px;
}
.room-scene.mini .char-name {
  font-size: 9px;
  padding: 1px 5px;
}

/* Emotion/vibe emoji floating above avatar */
.char-mood-emoji {
  position: absolute;
  top: -8px;
  right: -4px;
  font-size: 22px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
  animation: charMoodFloat 2.8s ease-in-out infinite;
  pointer-events: none;
}
.room-scene.mini .char-mood-emoji {
  font-size: 14px;
  top: -4px;
  right: -2px;
}
@keyframes charMoodFloat {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-4px) rotate(4deg); }
}

/* Solo idle action indicator */
.char-action-label {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #aaa;
  white-space: nowrap;
  background: rgba(15,15,26,0.85);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  opacity: 0.85;
  pointer-events: none;
}
.room-scene.mini .char-action-label {
  font-size: 8px;
  top: -16px;
  padding: 1px 5px;
}

/* Soliloquy indicator — talking to self */
.char-figure.soliloquy .char-avatar::after {
  content: "💭";
  position: absolute;
  top: -14px;
  left: -14px;
  font-size: 20px;
  animation: charMoodFloat 3s ease-in-out infinite;
}

/* Speech bubble - main screen only (high-energy) */
.char-speech-bubble {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 160px;
  max-width: 280px;
  padding: 10px 14px;
  background: #fff;
  color: #1a1a2a;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  z-index: 10;
  animation: bubbleIn 360ms cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
}
.char-speech-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: #fff;
  border-bottom: 0;
}
.char-speech-bubble.highlight {
  background: linear-gradient(135deg, #fff9e8 0%, #fff 100%);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.5),
    0 0 0 2px #e8a040,
    0 0 24px rgba(232, 160, 64, 0.35);
}
.char-speech-bubble.highlight::after {
  border-top-color: #fff;
}
@keyframes bubbleIn {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.85); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* Sub-screen bubbles - only shown on highlight */
.room-scene.mini .char-speech-bubble {
  min-width: 100px;
  max-width: 140px;
  padding: 6px 10px;
  font-size: 11px;
  bottom: calc(100% + 8px);
  border-radius: 10px;
}

/* Thought bubble variant (hidden_feeling, mismatch) */
.char-thought-bubble {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 140px;
  max-width: 240px;
  padding: 8px 12px;
  background: rgba(45, 40, 60, 0.95);
  color: #c8b8e0;
  font-style: italic;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.4;
  border: 1px dashed #6a5a8a;
  z-index: 9;
  animation: bubbleIn 360ms cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
}
.char-thought-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(45, 40, 60, 0.95);
  box-shadow: -8px -4px 0 -2px rgba(45, 40, 60, 0.95);
}

/* Ambient activity animation on avatars (idle breathing) */
.char-figure:not(.speaking) .char-avatar {
  animation: charIdleBreath 4s ease-in-out infinite;
}
@keyframes charIdleBreath {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

/* Highlight badge in header */
.monitor-highlight-badge {
  font-size: 10px;
  font-weight: 700;
  color: #0d0d18;
  background: linear-gradient(135deg, #ffd97a 0%, #e8a040 100%);
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
  animation: badgePulse 1.2s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(232, 160, 64, 0.5);
}
@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.monitor-sub-screen .monitor-highlight-badge {
  font-size: 8px;
  padding: 1px 5px;
}

/* Whole screen "high-energy mode" — subtle border glow */
.monitor-main-screen.is-highlight {
  border-color: #e8a040 !important;
  box-shadow: inset 0 0 60px rgba(232, 160, 64, 0.08);
}
.monitor-sub-screen.is-highlight {
  border-color: #e8a040 !important;
  animation: subscreenHighlight 1.5s ease-in-out infinite;
}
@keyframes subscreenHighlight {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 160, 64, 0); }
  50% { box-shadow: 0 0 12px 2px rgba(232, 160, 64, 0.4); }
}

/* Mini highlight snippets — small "glimpse" bubbles in the top-left of a sub-screen
   during a high-energy window. Never shows full dialogue (that's main-screen territory);
   only abbreviated peeks so peripheral awareness stays ambient. */
.mini-highlight-snippets {
  position: absolute;
  top: 24px;
  left: 6px;
  right: 40%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  pointer-events: none;
  z-index: 5;
}
.mini-highlight-snippet {
  background: rgba(12, 10, 6, 0.82);
  border: 1px solid rgba(232, 160, 64, 0.45);
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 9.5px;
  line-height: 1.3;
  color: #f4e0b8;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 0 8px rgba(232, 160, 64, 0.22);
  animation: miniSnipIn 0.25s ease-out;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.mini-highlight-snippet.fading {
  opacity: 0;
  transform: translateY(-4px);
}
.mini-highlight-snippet .snip-speaker {
  font-weight: 700;
  margin-right: 3px;
  letter-spacing: 0.5px;
}
@keyframes miniSnipIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Unity Flow Log Panel */
.unity-flow-log-panel {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 280px;
  max-height: 220px;
  background: rgba(10, 14, 20, 0.92);
  border: 1px solid #2a3a50;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  z-index: 100;
  font-family: "SF Mono", "Fira Code", monospace;
  overflow: hidden;
}
.unity-flow-log-header {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #6aafff;
  border-bottom: 1px solid #1a2a3a;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.unity-flow-log-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1.6;
  color: #8899aa;
}
.flow-log-entry {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.flow-log-start { color: #7799bb; }
.flow-log-done  { color: #6be68c; }
.flow-log-error { color: #ff6b6b; }

/* === end module: monitoring_room === */
