:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1d2330;
  --muted: #6b7280;
  --line: #e2e5ea;
  --accent: #2f6fde;
  --accent-ink: #ffffff;
  --user: #e8f0ff;
  --code-bg: #1e2430;
  --code-text: #e6e9ef;
  --warn-bg: #fff6e0;
  --warn-line: #f0c36a;
  --err: #c0392b;
  --ok: #1e8e5a;
  --sidebar-w: 260px;
  --panel-w: 380px;
  --header-h: 56px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  overflow-x: hidden;
}
button { font: inherit; cursor: pointer; }
textarea, input, select { font: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }

.btn {
  border: 0; border-radius: 10px; padding: 9px 16px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .15s ease;
}
.btn:hover:not(:disabled) { filter: brightness(1.06); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn.ghost:hover:not(:disabled) { background: rgba(47, 111, 222, 0.08); }
.btn.danger { background: #d93025 !important; color: #ffffff !important; border: 1px solid #d93025 !important; font-weight: 700; }
.btn.danger:hover:not(:disabled) { background: #b3261e !important; border-color: #b3261e !important; color: #ffffff !important; }
.btn.ghost.danger {
  background: #fdf2f2 !important; color: #d93025 !important; border: 1px solid #f5c2c7 !important; font-weight: 700;
}
.btn.ghost.danger:hover:not(:disabled) {
  background: #d93025 !important; color: #ffffff !important; border-color: #d93025 !important;
}
.btn.small { padding: 5px 11px; font-size: 13px; border-radius: 8px; }

.btn-icon {
  background: transparent; border: 0; padding: 6px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); cursor: pointer;
}
.btn-icon:hover { background: var(--bg); }

/* ---------- 입장 화면 ---------- */
.join {
  max-width: 420px; margin: 12vh auto 0; padding: 32px 24px;
  background: var(--panel); border-radius: 16px; border: 1px solid var(--line); text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}
.join-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
  margin-bottom: 8px;
  display: inline-block;
}
.join h1 { margin: 0 0 8px; font-size: 26px; }
.code-input {
  width: 100%; margin: 20px 0 12px; padding: 14px; text-align: center;
  font-size: 30px; letter-spacing: .4em; text-transform: uppercase;
  border: 2px solid var(--line); border-radius: 12px;
}
.code-input:focus { outline: none; border-color: var(--accent); }
.join .btn { width: 100%; padding: 14px; font-size: 17px; }
.join .err { color: var(--err); min-height: 1.4em; margin: 8px 0 0; }
.join ul { text-align: left; color: var(--muted); font-size: 14px; padding-left: 20px; }

/* ---------- 3단 메인 레이아웃 (T13) ---------- */
.chat {
  width: 100vw; height: 100vh; display: flex; flex-direction: column;
  overflow: hidden; background: var(--bg);
}

/* 2-1. 상단 바 */
.app-header {
  height: var(--header-h); min-height: var(--header-h);
  background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; gap: 12px; z-index: 20;
}
.header-left {
  display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1;
}
.app-header-logo {
  height: 22px;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
}
.app-title { font-weight: 700; font-size: 16px; white-space: nowrap; }
.header-divider { user-select: none; opacity: 0.5; margin: 0 2px; }
.lecture-name {
  font-size: 14px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px;
}
.badge {
  background: var(--user); color: var(--accent); border-radius: 999px;
  padding: 3px 10px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-version {
  background: #f0f4f8; color: #475569; border: 1px solid #cbd5e1;
}
.header-badges {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.header-right {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.pip-box {
  display: flex; align-items: center; gap: 6px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 2px 4px 2px 10px;
}
.pip-box code {
  font-family: "D2Coding", Consolas, monospace; font-size: 12px; color: #334155;
  white-space: nowrap;
}
.pip-box .btn { padding: 3px 8px; font-size: 12px; }
.panel-toggle-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600;
}

#btn-sidebar-toggle { display: none; }

/* 2-2. 3단 본문 컨테이너 */
.app-body {
  flex: 1; display: flex; overflow: hidden; position: relative;
}

/* 왼쪽 사이드바 (260px) */
.app-sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow-y: auto; padding: 14px 12px;
  z-index: 10; gap: 16px;
}
.btn-new-chat {
  width: 100%; border: 1px solid var(--line); background: var(--bg);
  color: var(--text); border-radius: 10px; padding: 9px 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all .15s; font-size: 14px;
}
.btn-new-chat:hover {
  background: var(--user); border-color: var(--accent); color: var(--accent);
}
.sidebar-section-title {
  font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.sidebar-tabs {
  display: flex; flex-direction: column; gap: 6px; padding: 0;
}
.sidebar-tabs .tab {
  width: 100%; text-align: left; border: 1px solid var(--line); background: transparent;
  border-radius: 8px; padding: 8px 12px; font-size: 14px; font-weight: 500;
  color: var(--text); transition: all .15s;
}
.sidebar-tabs .tab.active {
  background: var(--user); color: var(--accent); border-color: var(--accent); font-weight: 700;
}
.sidebar-examples {
  display: flex; flex-direction: column; gap: 6px; padding: 0;
}
.sidebar-examples button {
  width: 100%; text-align: left; border: 1px solid var(--line); background: var(--bg);
  border-radius: 8px; padding: 8px 10px; font-size: 13px; color: var(--text);
  line-height: 1.4; transition: all .15s; word-break: break-all;
}
.sidebar-examples button:hover {
  border-color: var(--accent); color: var(--accent); background: #ffffff;
}
.sidebar-info-card {
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 12px;
}
.info-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.info-label { color: var(--muted); font-size: 12px; flex-shrink: 0; }
.info-val { font-weight: 600; color: var(--text); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer {
  margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line);
}
.sidebar-footer p { margin: 0; font-size: 12px; line-height: 1.4; }

/* 2-3. 가운데 채팅 메인 영역 */
.app-chat-main {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); position: relative;
}
.messages {
  flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column;
  gap: 14px;
}
.msg {
  max-width: 760px; width: 100%; margin: 0 auto; padding: 14px 18px;
  border-radius: 14px; line-height: 1.6; white-space: normal; word-break: break-word;
}
.msg.user {
  align-self: center; background: var(--user); border: 1px solid #d4e3fc;
}
.msg.bot {
  align-self: center; background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
.msg.notice {
  align-self: center; background: transparent; color: var(--muted); font-size: 13px;
  padding: 4px; text-align: center;
}
.msg .warn {
  margin-top: 10px; padding: 10px 12px; background: var(--warn-bg);
  border: 1px solid var(--warn-line); border-radius: 10px; font-size: 13px;
}
.msg .error { color: var(--err); }

.code {
  position: relative;
  margin: 10px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--code-bg);
}
.code.streaming pre {
  padding-top: 14px;
}
.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 10px;
  background: #1e2638;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 36px;
}
.code-toolbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.code-toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}
.code pre {
  margin: 0;
  padding: 10px 0;
  overflow-x: auto;
  background: transparent;
  color: var(--code-text);
  border-radius: 0;
  font-family: "D2Coding", Consolas, "Courier New", monospace;
  font-size: 13.5px;
  line-height: 1.6;
}
.code code { font-family: inherit; }
.code code.code-body {
  display: block;
  min-width: 100%;
}

/* 코드 줄 레이아웃 및 줄 번호 (Line Numbers) */
.code-line {
  display: flex;
  align-items: flex-start;
  min-width: 100%;
  width: max-content;
  padding: 0 16px 0 0;
  transition: background 0.12s ease;
}
.code-line:hover {
  background: rgba(255, 255, 255, 0.04);
}
.code-ln {
  flex-shrink: 0;
  width: 40px;
  padding-right: 12px;
  text-align: right;
  color: #64748b;
  font-size: 11.5px;
  line-height: 1.8;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0.75;
}
.code-text {
  flex: 1;
  white-space: pre;
  word-break: normal;
}

/* 파이썬 문법 강조 (Syntax Highlighting) */
/* from, import, as */
.token-import {
  color: #c084fc;
  font-weight: 600;
}
/* if, else, elif, for, while, in, return, break, continue 등 제어문 */
.token-control {
  color: #f43f5e;
  font-weight: 600;
}
/* def, class 함수/클래스 정의 */
.token-def {
  color: #38bdf8;
  font-weight: 600;
}
/* print, input, len, range, enumerate 등 빌트인 함수 */
.token-builtin {
  color: #fbbf24;
  font-weight: 600;
}
/* RoboDog, sleep, time 등 라이브러리 객체/모듈 */
.token-robodog {
  color: #2dd4bf;
  font-weight: 600;
}
/* 함수 호출 (connect, walk 등) */
.token-fn {
  color: #60a5fa;
}
/* 문자열 ("...", '...') */
.token-string {
  color: #4ade80;
}
/* 숫자 (10, 3.14 등) */
.token-number {
  color: #fb923c;
}
/* 주석 (#...) */
.token-comment {
  color: #94a3b8;
  font-style: italic;
}
/* True, False, None, and, or, not 등 논리/상수 */
.token-const {
  color: #22d3ee;
  font-weight: 600;
}

.code button {
  border: 0;
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.3;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.code .copy { background: #334155; color: #f1f5f9; }
.code .copy:hover { background: #475569; }
.code .run { background: var(--accent); color: var(--accent-ink); }
.code .run:hover { filter: brightness(1.1); }
.code .edit { background: #0284c7; color: #ffffff; }
.code .edit:hover { background: #0369a1; }
.code .edit-done { background: var(--ok); color: #ffffff; }
.code .edit-done:hover { filter: brightness(1.1); }
.code .edit-reset { background: #64748b; color: #ffffff; }
.code .edit-reset:hover { background: #475569; }
.code .ask-ai { background: #d97706; color: #ffffff; }
.code .ask-ai:hover { background: #b45309; }
.code .to-dance { background: #6366f1; color: #ffffff; }
.code .to-dance:hover { background: #4f46e5; }

.code-badge-edited {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  background: #f59e0b;
  color: #1e293b;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.code-edit {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: #0f1422;
  color: #e2e8f0;
  border: 0;
  border-radius: 0;
  padding: 12px 14px;
  font-family: "D2Coding", Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  outline: none;
  min-height: 120px;
  max-height: 480px;
  overflow-y: auto;
}
.code-edit:focus {
  background: #0a0e18;
}

.code-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
  background: var(--warn-bg);
  border-top: 1px solid var(--warn-line);
  font-size: 12px;
  color: var(--warn);
}
.code-footer .ask-ai-btn {
  align-self: flex-start;
  border: 1px solid var(--warn-line);
  background: #ffffff;
  color: #b45309;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 12px;
}
.code-footer .ask-ai-btn:hover {
  background: #fef3c7;
}

.msg-actions { margin-top: 8px; display: flex; justify-content: flex-end; }
.btn-report {
  border: 1px solid var(--line); background: var(--bg); border-radius: 999px;
  padding: 4px 10px; font-size: 12px; color: var(--muted); cursor: pointer;
  transition: all .15s;
}
.btn-report:hover:not(:disabled) { border-color: var(--err); color: var(--err); background: #fff5f5; }
.btn-report.reported { border-color: var(--ok); color: var(--ok); cursor: default; }

.composer {
  background: var(--panel); border-top: 1px solid var(--line); padding: 14px 20px 16px;
  z-index: 5;
  transition: outline .15s, background-color .15s;
}
.composer.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: -3px;
  background: #f0f7ff;
}
.composer.drag-over textarea {
  border-color: var(--accent);
  background: #ffffff;
}
.composer form {
  max-width: 760px; margin: 0 auto; width: 100%;
}
.composer .row { display: flex; gap: 10px; align-items: flex-end; }
.composer textarea {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px;
  resize: none; font-size: 15px; line-height: 1.5; background: var(--bg);
  box-sizing: border-box;
  transition: border-color .15s, background-color .15s;
}
.composer .row textarea {
  flex: 1;
  min-height: 44px; max-height: min(384px, 35vh);
  min-width: 0;
}
.composer textarea:focus { outline: none; border-color: var(--accent); background: #ffffff; }
.composer .row .btn {
  height: 44px; padding: 0 18px; border-radius: 12px; font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.composer .mono { font-family: "D2Coding", Consolas, monospace; font-size: 13.5px; }

/* ---------- 에러 해결 탭 전용 폼 (#fix-form) ---------- */
#fix-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}
#fix-form label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 6px 0 2px;
  display: block;
}
#fix-form label:first-child {
  margin-top: 0;
}
#fix-form textarea {
  width: 100%;
  resize: vertical;
  line-height: 1.45;
}
#fix-form #fix-code {
  min-height: 110px;
  max-height: 260px;
}
#fix-form #fix-error {
  min-height: 64px;
  max-height: 160px;
}
#fix-form .foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  gap: 12px;
}
#fix-form .foot .muted {
  font-size: 13px;
  color: var(--muted);
}
#fix-form .foot .btn {
  height: 42px;
  padding: 0 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 첨부 '+' 버튼 & 팝업 메뉴 */
.attach-wrap {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.btn-attach {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 300;
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
  box-sizing: border-box;
}
.btn-attach:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #ffffff;
}
.btn-attach[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
  background: #ffffff;
  transform: rotate(45deg);
}
.attach-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 210px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 6px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.attach-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  transition: background .12s;
}
.attach-menu-item:hover,
.attach-menu-item:focus {
  background: var(--bg-hover, #f1f5f9);
  outline: none;
}
.attach-menu-item .menu-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.attach-menu-item .menu-text {
  flex: 1;
  font-weight: 500;
}
.attach-menu-note {
  font-size: 11px;
  color: var(--muted);
  padding: 6px 10px 4px;
  border-top: 1px solid var(--line);
  margin-top: 3px;
  line-height: 1.35;
}

/* 채팅 음원 첨부 칩 바 */
.chat-attachment-bar {
  max-width: 760px;
  margin: 0 auto 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.audio-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  max-width: 100%;
  box-sizing: border-box;
  flex-wrap: wrap;
}
.audio-chip .chip-icon {
  flex-shrink: 0;
}
.audio-chip .chip-name {
  max-width: 220px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  font-weight: 600;
  color: #166534;
}
.audio-chip .chip-duration {
  color: #15803d;
  font-size: 12px;
  flex-shrink: 0;
}
.audio-chip .chip-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.btn-chip {
  border: 1px solid #86efac;
  background: #ffffff;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
  color: #15803d;
  font-weight: 600;
  transition: background .12s;
  white-space: nowrap;
}
.btn-chip:hover {
  background: #dcfce7;
}
.btn-chip-close {
  border: 0;
  background: transparent;
  font-size: 14px;
  cursor: pointer;
  color: #15803d;
  padding: 0 4px;
  line-height: 1;
  border-radius: 4px;
}
.btn-chip-close:hover {
  color: #b91c1c;
}
.chat-attachment-bar .chip-note {
  font-size: 11px;
  color: var(--muted);
  padding-left: 6px;
}

/* 코드 첨부 칩 (#chat-code-chip) */
.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  max-width: 100%;
  box-sizing: border-box;
  flex-wrap: wrap;
}
.code-chip .chip-icon {
  flex-shrink: 0;
}
.code-chip .chip-name {
  max-width: 240px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  font-weight: 600;
  color: #1e40af;
}
.code-chip .chip-meta {
  color: #3b82f6;
  font-size: 12px;
  flex-shrink: 0;
}
.code-chip .chip-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.code-chip .btn-chip-close {
  border: 0;
  background: transparent;
  font-size: 14px;
  cursor: pointer;
  color: #1e40af;
  padding: 0 4px;
  line-height: 1;
  border-radius: 4px;
}
.code-chip .btn-chip-close:hover {
  color: #b91c1c;
}

/* 유저 말풍선 안의 첨부 칩 및 텍스트 레이아웃 */
.msg.user .user-msg-text {
  margin-top: 8px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.user .chat-sent-audio-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #bbf7d0;
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 13px;
  color: #166534;
  margin-bottom: 6px;
}
.msg.user .chat-sent-audio-chip .chip-name {
  font-weight: 600;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg.user .chat-sent-audio-chip .chip-duration {
  font-size: 12px;
  color: #15803d;
}

/* 2-4. 오른쪽 패널 (약 380px) */
.app-right-panel {
  width: var(--panel-w); min-width: var(--panel-w);
  background: var(--panel); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
  z-index: 15;
}
.panel-sheet-handle { display: none; }
.panel-header {
  height: 48px; border-bottom: 1px solid var(--line); display: flex;
  align-items: center; justify-content: space-between; padding: 0 8px;
  background: var(--panel); flex-shrink: 0; gap: 4px;
}
.panel-tabs {
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  min-width: 0; flex: 1;
}
.panel-tabs::-webkit-scrollbar { display: none; }
.panel-tab-btn, .panel-tabs .panel-tab {
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  padding: 8px 6px; font-size: 12.5px; font-weight: 600; color: var(--muted);
  cursor: pointer; transition: all .15s; white-space: nowrap; flex-shrink: 0;
}
.panel-tab-btn:hover, .panel-tabs .panel-tab:hover {
  color: var(--text);
}
.panel-tab-btn.active, .panel-tabs .panel-tab.active {
  color: var(--accent); border-bottom-color: var(--accent);
}
.panel-close-btn {
  background: transparent; border: 0; padding: 6px; border-radius: 6px;
  color: var(--muted); cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; flex-shrink: 0; font-size: 15px;
}
.panel-close-btn:hover { background: var(--bg); color: var(--text); }

.panel-content {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column;
}
.panel-view, .app-right-panel .panel-tab {
  flex: 1; display: flex; flex-direction: column;
}
.app-right-panel .panel-tab.hidden, .panel-view.hidden {
  display: none !important;
}

/* AI 카메라 탭 (T18b) */
#panel-camera {
  padding: 14px; gap: 12px; overflow-y: auto;
}
.panel-mount {
  width: 100%;
}
.camera-panel {
  display: flex; flex-direction: column; gap: 10px; width: 100%;
}
.camera-preview-box {
  width: 100%; aspect-ratio: 4 / 3; background: #000;
  border-radius: 10px; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
}
.camera-preview-img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.camera-preview-empty {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 16px; background: var(--bg); color: var(--muted);
  gap: 8px;
}
.camera-preview-icon {
  font-size: 28px; line-height: 1;
}
.camera-preview-empty p {
  margin: 0; font-size: 13px; line-height: 1.4; word-break: keep-all;
}
.camera-connection-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.camera-status-text {
  font-size: 12px; flex: 1; min-width: 120px; line-height: 1.4;
  word-break: keep-all;
}
.camera-status-text.text-danger {
  color: var(--err, #ef4444); font-weight: 600;
}
.camera-form-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 2px;
}
.camera-form-row label {
  font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap;
}
.camera-select {
  flex: 1; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text); font-size: 13px; outline: none;
}
.camera-select:disabled {
  opacity: 0.6; cursor: not-allowed;
}
.camera-classes-container {
  padding: 10px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; display: flex; flex-direction: column; gap: 6px;
}
.camera-classes-header {
  font-size: 12px; color: var(--muted); margin-bottom: 2px;
}
.camera-class-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px; flex-wrap: wrap; padding: 4px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.camera-class-row:last-child {
  border-bottom: none;
}
.camera-class-label {
  font-size: 12px; font-weight: 600; color: var(--text); min-width: 52px;
}
.camera-class-actions {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.camera-class-actions .btn {
  padding: 3px 8px; font-size: 11px;
}
.camera-result-row {
  padding: 8px 12px; background: rgba(59, 130, 246, 0.08);
  border-radius: 8px; display: flex; align-items: center; gap: 8px;
  font-size: 13px; border: 1px solid rgba(59, 130, 246, 0.2);
}
.camera-result-label {
  font-size: 12px; color: var(--muted); white-space: nowrap;
}
.camera-result-value {
  font-size: 13px; color: var(--text); word-break: break-all;
}
.camera-led-row {
  display: flex; justify-content: flex-end;
}
.camera-led-row .btn.active {
  background: #fef08a; border-color: #facc15; color: #854d0e;
}
.camera-guide-box {
  padding: 10px 12px; background: var(--bg); border-radius: 8px;
  font-size: 11px; line-height: 1.45; border: 1px solid var(--line);
}
.camera-guide-box p {
  margin: 0;
}

/* 사이드바 로보독 연결 (T16) */
.sidebar-robot-section {
  display: flex; flex-direction: column;
}
.sidebar-robot-card {
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px; display: flex; flex-direction: column; gap: 8px;
}
.sidebar-robot-status {
  display: flex; align-items: center; gap: 6px; font-size: 13px;
}
.sidebar-robot-status strong {
  font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; display: inline-block; flex-shrink: 0;
}
.dot.on { background: var(--ok); box-shadow: 0 0 6px rgba(30, 142, 90, 0.4); }
.dot.virtual { background: #3b82f6; box-shadow: 0 0 6px rgba(59, 130, 246, 0.4); }

.sidebar-robot-btns {
  display: flex; gap: 6px;
}
.sidebar-robot-btns .btn {
  flex: 1; padding: 6px 4px; font-size: 12px; white-space: nowrap;
}
.sidebar-robot-subbtns {
  display: flex; justify-content: space-between; align-items: center; padding: 0 2px;
}
.btn-link {
  background: none; border: 0; padding: 2px 4px; font-size: 11px;
  color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.btn-link:hover { color: var(--accent); }
.btn-link.danger { color: var(--err); }
.btn-link.danger:hover { filter: brightness(0.9); }

.robot-note {
  margin: 0; font-size: 11px; line-height: 1.4; color: var(--err);
}
.robot-list {
  display: flex; flex-direction: column; gap: 4px; margin-top: 2px; max-height: 160px; overflow-y: auto;
}
.robot-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px; padding: 4px 6px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; font-size: 12px;
}
.robot-row-info {
  display: flex; align-items: center; gap: 5px; min-width: 0; flex: 1; overflow: hidden;
}
.robot-num { font-size: 12px; font-weight: 700; flex-shrink: 0; }
.robot-kind { font-size: 11px; flex-shrink: 0; }
.robot-status-chips {
  display: flex; align-items: center; gap: 3px; overflow: hidden; white-space: nowrap; flex: 1;
}
.robot-status-chips .chip {
  background: var(--bg); border: 1px solid var(--line); border-radius: 4px;
  padding: 1px 5px; font-size: 10px; white-space: nowrap;
}
.robot-status-chips .chip.sound { background: var(--warn-bg); border-color: var(--warn-line); color: #8a5a00; }
.robot-status-chips .swatch { width: 8px; height: 8px; border-radius: 50%; display: inline-block; vertical-align: -1px; }
.robot-row-actions {
  display: flex; align-items: center; gap: 3px; flex-shrink: 0;
}
.btn-robot-action {
  padding: 2px 6px; font-size: 11px; border-radius: 4px;
}
.btn-more-robots {
  width: 100%; padding: 4px; font-size: 11px; font-weight: 600;
  color: var(--accent); background: var(--panel); border: 1px dashed var(--line);
  border-radius: 6px; cursor: pointer; margin-top: 2px;
}
.btn-more-robots:hover {
  background: var(--user); border-color: var(--accent);
}

/* 2-3 가운데 채팅 하단 접고 펴는 실행 결과 (T16) */
.chat-console-area {
  border-top: 1px solid var(--line); background: var(--panel);
  display: flex; flex-direction: column; z-index: 6; flex-shrink: 0;
}
.console-toggle-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; cursor: pointer; user-select: none;
  background: var(--panel); font-size: 13px; min-height: 38px; gap: 8px;
  transition: background .15s;
}
.console-toggle-bar:hover { background: var(--bg); }
.console-toggle-left {
  display: flex; align-items: center; gap: 8px; flex: 0 1 auto;
}
.console-toggle-icon {
  font-size: 12px; color: var(--muted); width: 12px; display: inline-block; text-align: center;
  flex: 0 0 auto;
}
.console-toggle-title {
  font-weight: 700; color: var(--text); white-space: nowrap; font-size: 13px;
  flex: 0 0 auto;
}
.console-summary {
  font-size: 12px; color: var(--muted); white-space: nowrap;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; max-width: 380px;
  flex: 0 1 auto;
}
.console-toggle-right {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; flex: 1 1 auto;
}
.console-toggle-right #btn-stop {
  flex-shrink: 0; white-space: nowrap;
}
#robot-progress {
  font-size: 12px; color: var(--accent); font-weight: 600; white-space: nowrap;
  min-width: 0; overflow: hidden; text-overflow: ellipsis;
  flex: 0 1 auto;
}
.console-wrap {
  padding: 0 16px 12px; background: var(--panel);
}
.console-wrap .console {
  margin: 0; background: var(--code-bg); color: var(--code-text); border-radius: 8px;
  padding: 10px 12px; font-family: "D2Coding", Consolas, monospace; font-size: 12px;
  line-height: 1.45; max-height: 200px; min-height: 60px; overflow-y: auto;
}
.console-wrap .console .err { color: #f87171; }

/* 군무 스튜디오 탭 뷰 */
.dance-pane {
  padding: 12px; display: flex; flex-direction: column; gap: 10px;
}
.dance-pane-desc p { margin: 0; font-size: 12px; line-height: 1.4; }
.dance-grid { display: flex; flex-direction: column; gap: 8px; }
.dance-card {
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px;
}
.dance-card-title {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 13px;
}
.dance-file-row { display: flex; gap: 5px; flex-wrap: wrap; }
.dance-file-row .btn { padding: 5px 8px; font-size: 12px; }
.dance-local-note { margin: 4px 0 0; font-size: 11px; }
.dance-bpm-hint {
  font-size: 12px; color: var(--ok); font-weight: 600; margin: 4px 0 0;
}
.dance-textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px;
  font-family: "D2Coding", Consolas, monospace; font-size: 12px; line-height: 1.4;
  background: var(--panel); resize: vertical; max-height: 140px; margin-top: 6px;
}
.dance-controls {
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px; display: flex; flex-direction: column; gap: 8px;
}
.dance-status {
  display: flex; align-items: center; gap: 6px; font-size: 13px;
}
.dance-btns { display: flex; gap: 6px; }
.dance-btns .btn { flex: 1; padding: 8px 12px; font-size: 13px; }

/* 오버레이 백드롭 */
.panel-backdrop, .sidebar-backdrop {
  position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 30;
}

/* ---------- 모달 다이얼로그 (안무 생성 / 오류 신고) ---------- */
.choreo-dialog, .report-dialog {
  border: 1px solid var(--line); border-radius: 16px; padding: 0;
  max-width: 580px; width: 92%; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  background: var(--panel);
}
.choreo-dialog::backdrop, .report-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(2px);
}
.choreo-box, .report-box { padding: 20px; }
.choreo-head, .report-head {
  display: flex; justify-content: space-between; align-items: flex-start;
}
.choreo-head h3, .report-head h3 { margin: 0; font-size: 18px; }
.btn-close {
  background: transparent; border: 0; font-size: 18px; cursor: pointer; color: var(--muted);
}
.form-grid { display: grid; gap: 10px; }
.form-grid label { font-size: 13px; font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.form-grid input, .form-grid select {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px;
}
.choreo-preview-box {
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; margin-top: 12px;
}
.report-dialog-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px;
}
.report-type-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.report-chip {
  border: 1px solid var(--line); background: var(--bg); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; cursor: pointer;
}
.report-chip.active {
  background: var(--user); border-color: var(--accent); color: var(--accent); font-weight: 700;
}
.report-situation-input {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px;
  margin-top: 4px; font-size: 13px; resize: vertical;
}

/* ---------- 반응형 미디어 쿼리 (2-5) ---------- */

/* 1. 900px ~ 1279px: 사이드바 폭 축소(220px), 오른쪽 패널은 드로어 오버레이 */
@media (max-width: 1279px) {
  :root {
    --sidebar-w: 220px;
  }
  .app-right-panel {
    position: absolute; right: 0; top: 0; bottom: 0; z-index: 40;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  }
}

/* 2. 899px 이하: 사이드바 숨김(햄버거 버튼 토글), 상단 바 2줄 배치, 오른쪽 패널은 바텀시트 */
@media (max-width: 899px) {
  #btn-sidebar-toggle { display: inline-flex; }
  .header-divider, .pip-box { display: none; }

  /* 햄버거 토글 버튼의 로보독 연결 상태 배지 */
  .sidebar-robot-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--muted);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    margin-left: 2px;
    line-height: 1;
  }
  .sidebar-robot-badge.on { background: var(--ok); }
  .sidebar-robot-badge.virtual { background: #3b82f6; }

  /* 2줄 상단 바: 1줄(≡, 코딩 도우미, 강의 제목 / 정지 버튼, 패널 토글), 2줄(프로젝트·버전 배지) */
  .app-header {
    height: auto;
    min-height: 54px;
    padding: 6px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 8px;
  }
  .header-left {
    flex: 1 1 auto;
    min-width: 0;
    order: 1;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .app-title {
    font-size: 15px;
    flex-shrink: 0;
  }
  .lecture-name {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
  }
  .header-right {
    flex-shrink: 0;
    order: 2;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .header-badges {
    width: 100%;
    order: 3;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 1px;
    margin-bottom: 2px;
    padding-left: 2px;
  }
  .badge {
    padding: 2px 8px;
    font-size: 11px;
  }

  #btn-stop-bar {
    padding: 4px 8px;
    font-size: 12px;
    white-space: nowrap;
  }
  .panel-toggle-btn {
    padding: 4px 8px;
    font-size: 12px;
  }

  .app-sidebar {
    position: absolute; left: -280px; top: 0; bottom: 0; z-index: 50;
    width: 260px; box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    transition: left .2s ease-in-out;
  }
  .app-sidebar.open {
    left: 0;
  }

  .app-right-panel {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: 100%; min-width: 100%; max-height: 80vh; z-index: 50;
    border-radius: 18px 18px 0 0; border-left: 0; border-top: 1px solid var(--line);
    box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.18);
  }
  .panel-sheet-handle {
    display: block; width: 40px; height: 4px; background: #cbd5e1;
    border-radius: 999px; margin: 8px auto 4px; flex-shrink: 0;
  }
  .panel-header { height: 44px; }

  .messages { padding: 14px 12px; }
  .composer { padding: 10px 12px 14px; }
  .composer .row {
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
  }
  .composer .attach-wrap {
    flex: 0 0 auto;
  }
  .composer textarea {
    flex: 1;
    min-width: 0;
  }
  .composer .row .btn {
    width: 100%;
    flex: 0 0 100%;
    margin-top: 2px;
  }
  #fix-form .foot {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  #fix-form .foot .btn {
    width: 100%;
    margin-left: 0;
  }

  /* 899px 이하에서 진행 문구가 있으면 요약은 숨김 (375px 글자 겹침 방지) */
  .console-toggle-bar.has-progress .console-summary,
  .console-toggle-bar:has(#robot-progress:not(:empty)) .console-summary {
    display: none;
  }
}

@media (max-width: 420px) {
  .app-header {
    padding: 5px 8px;
    gap: 3px 6px;
  }
  .app-title {
    display: none;
  }
  .panel-toggle-btn {
    padding: 4px 6px;
  }
}

@media (max-width: 380px) {
  .panel-toggle-text {
    font-size: 11px;
  }
  .lecture-name {
    max-width: 90px;
  }
  .code-toolbar-actions {
    gap: 4px;
  }
  .code button {
    padding: 3px 6px;
    font-size: 11px;
  }
  .audio-chip .chip-name {
    max-width: 140px;
  }
  .attach-menu {
    min-width: 190px;
  }
}

/* 3. 낮은 세로 높이 노트북 (760px 이하) 대응 */
@media (max-height: 760px) {
  :root {
    --header-h: 48px;
  }
  .app-header { padding: 0 12px; }
  .messages { padding: 10px 14px; gap: 10px; }
  .composer { padding: 8px 14px 10px; }
  .composer textarea { padding: 6px 10px; font-size: 14px; }
  .sidebar-section { margin-bottom: 0; }
  .sidebar-info-card { padding: 6px 10px; }
  .console-wrap .console { max-height: 100px; }
}

/* ---------- 관리자 대시보드 (T06) ---------- */
.admin-body { background: #f4f6fa; }
.admin { max-width: 1200px; margin: 0 auto; padding: 24px 20px 48px; }

.dash-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-bottom: 20px; margin-bottom: 22px; border-bottom: 1px solid var(--line);
}
.dash-brand { display: flex; align-items: center; gap: 14px; }
.dash-header-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}
.dash-logo {
  font-size: 32px; width: 48px; height: 48px; background: #e8f0fe;
  display: flex; align-items: center; justify-content: center; border-radius: 14px;
}
.dash-brand h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.dash-subtitle { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.dash-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- 관리자 로그인 카드 스타일 ---------- */
.login-card {
  max-width: 440px;
  margin: 40px auto 60px;
  padding: 32px 28px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  background: var(--panel);
  border: 1px solid var(--line);
}
.login-head {
  text-align: center;
  margin-bottom: 20px;
}
.login-lock-icon {
  font-size: 34px;
  width: 58px;
  height: 58px;
  background: #eef3fc;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  margin-bottom: 12px;
}
.login-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.rate-setting-box {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 4px 10px; font-size: 13px; font-weight: 600; color: var(--text);
}
.rate-setting-box label { font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
.rate-setting-box input {
  width: 68px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 13px; font-weight: 700; text-align: right; background: var(--bg);
}
.rate-setting-box span { font-size: 12px; color: var(--muted); }
.rate-setting-box .btn { padding: 4px 8px; font-size: 12px; }

.live-status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; font-size: 13px; font-weight: 600; color: var(--text);
}
.live-pulse {
  width: 9px; height: 9px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 rgba(15, 157, 88, 0.7);
  animation: pulse-ring 2s infinite;
}
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(15, 157, 88, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(15, 157, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 157, 88, 0); }
}

/* ---------- 대시보드 날짜 범위 필터 바 (T06 디테일) ---------- */
.dash-date-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
  flex-wrap: wrap;
}
.date-filter-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.date-filter-icon { font-size: 16px; }
.date-filter-title { font-size: 13px; font-weight: 700; color: var(--text); }
.date-preset-group {
  display: inline-flex;
  gap: 4px;
  background: var(--bg);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.date-preset-btn {
  border: 0;
  background: transparent;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.date-preset-btn:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
}
.date-preset-btn.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(10, 102, 194, 0.3);
}
.date-filter-custom {
  display: flex;
  align-items: center;
  gap: 6px;
}
.date-filter-custom input[type="date"] {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}
.date-sep { font-size: 13px; color: var(--muted); }
.date-filter-info {
  margin-left: auto;
}
.date-summary-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: #eef3fc;
  padding: 3px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.dash-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.metric-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
}
.metric-top { display: flex; justify-content: space-between; align-items: center; }
.metric-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.metric-icon { font-size: 18px; opacity: 0.8; }
.metric-value { font-size: 28px; font-weight: 800; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.metric-value.highlight { color: var(--accent); }
.metric-value.ok { color: var(--ok); }
.metric-value.accent { color: #b07000; }
.metric-sub { font-size: 12px; color: var(--muted); }
.metric-sub-badge {
  display: inline-block; font-size: 11px; font-weight: 600; color: var(--accent);
  background: #eef3fc; padding: 2px 8px; border-radius: 6px; width: fit-content;
}

.metric-meter {
  width: 100%; height: 6px; background: #eaedf4; border-radius: 999px; overflow: hidden; margin: 4px 0 8px;
}
.meter-bar {
  height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.4s ease;
}
.meter-bar.ok { background: var(--ok); }
.meter-bar.accent { background: #b07000; }

.admin-tabs {
  display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 2px solid var(--line);
  overflow-x: auto;
}
.admin-tab {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; background: transparent; padding: 12px 18px; font-size: 15px; font-weight: 700;
  color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px;
  white-space: nowrap; transition: color 0.15s ease, border-color 0.15s ease;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-badge {
  background: #eaedf4; color: var(--muted); font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px;
}
.admin-tab.active .tab-badge { background: #e0ecff; color: var(--accent); }

.card-head-toggle, .card-head-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.card-head-toggle h2, .card-head-bar h2 { margin: 0; font-size: 18px; }
.sessions-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.new-code-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-top: 14px; padding: 14px 18px; background: #eef6fd; border: 1px solid #c8e1fb; border-radius: 12px;
}
.new-code-banner .label { font-size: 14px; font-weight: 600; color: var(--accent); margin-right: 8px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
.form-grid input, .form-grid select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: #fbfcfe; }
.table-wrap { overflow-x: auto; }
.table-wrap table { min-width: 860px; }  /* 좁은 화면에서는 좌우 스크롤 */
.table-wrap th, .table-wrap td { white-space: nowrap; }
.table-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.table-tools input[type="search"] {
  flex: 1 1 240px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px;
}
.table-tools select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; margin: 0 4px; }
.table-tools label { font-size: 14px; white-space: nowrap; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 14px; }
.pager button {
  min-width: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--text); font-size: 14px;
}
.pager button[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.pager button:disabled { opacity: .4; cursor: default; }
.pager .gap { padding: 6px 4px; color: var(--muted); }
.usage-total { margin: 0 0 10px; font-size: 14px; font-weight: 500; }
tr.inactive td { color: var(--muted); }
td.code-cell { font-family: Consolas, monospace; font-size: 16px; font-weight: 700; letter-spacing: .1em; }
.new-code { font-size: 26px; font-weight: 800; letter-spacing: .2em; color: var(--accent); }

/* ---------- 좌석 모니터링 시각화 (T06 디테일) ---------- */
.sessions-visual-box {
  margin-top: 14px; padding: 18px; background: #fbfcfe; border: 1px solid #dce4f2; border-radius: 14px;
}
.seat-stats-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px dashed var(--line);
}
.seat-stat-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stat-pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; background: var(--panel); border: 1px solid var(--line);
}
.stat-pill.ok { background: #e6f4ea; border-color: #ceead6; color: #137333; }
.stat-pill.empty { background: #f1f3f4; border-color: #dadce0; color: #5f6368; }
.stat-pill.warn { background: #fce8e6; border-color: #fad2cf; color: #c5221f; }

.seat-occupancy-bar { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.occupancy-label { font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.occupancy-track { flex: 1; height: 8px; background: #eaedf4; border-radius: 999px; overflow: hidden; }
.occupancy-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.4s ease; }

.seat-map-title { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.seat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
}
.seat-tile {
  background: var(--panel); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 8px 6px; text-align: center; cursor: pointer; transition: transform 0.1s, border-color 0.15s, box-shadow 0.15s;
  display: flex; flex-direction: column; justify-content: space-between; min-height: 56px;
}
.seat-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}
.seat-tile.online {
  background: #f0f7ff; border-color: #b9d8ff;
}
.seat-tile.online:hover { border-color: var(--accent); }
.seat-tile.offline {
  background: #f8f9fa; border-color: #e2e4e8; opacity: 0.7;
}
.seat-tile.empty {
  background: transparent; border: 1.5px dashed #dadce0; cursor: default;
  display: flex; align-items: center; justify-content: center;
}
.seat-tile.empty:hover { transform: none; box-shadow: none; }
.seat-tile.reported {
  border-color: #ea4335 !important; background: #fff5f5 !important;
  animation: pulse-border 1.5s infinite;
}
@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(234, 67, 53, 0.5); }
  70% { box-shadow: 0 0 0 5px rgba(234, 67, 53, 0); }
  100% { box-shadow: 0 0 0 0 rgba(234, 67, 53, 0); }
}

.seat-top-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.seat-num { font-weight: 800; color: var(--text); }
.seat-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.seat-tile.offline .seat-status-dot { background: var(--muted); }
.seat-body-info { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; font-size: 11px; }
.seat-q-badge { background: #e1ebfa; color: var(--accent); padding: 1px 5px; border-radius: 4px; font-weight: 700; }
.seat-err-badge { background: #fee7e6; color: #d93025; padding: 1px 4px; border-radius: 4px; font-weight: 800; }
.seat-empty-label { font-size: 11px; color: #80868b; }
.seat-empty-icon { font-size: 11px; opacity: 0.5; }

.row-pulse-highlight {
  animation: row-flash 2s ease-out;
}
@keyframes row-flash {
  0% { background: #fff2cc !important; }
  100% { background: transparent; }
}

/* ---------- 사용량 & 비용 일자별 트렌드 차트 (T06 디테일) ---------- */
.usage-chart-card {
  margin-top: 14px; padding: 18px; background: #ffffff; border: 1px solid #dce4f2; border-radius: 14px;
}
.usage-chart-header {
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px;
}
.usage-chart-header h3 { margin: 0; font-size: 15px; font-weight: 700; }
.chart-legend { display: flex; align-items: center; gap: 14px; font-size: 12px; flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-color { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend-ai { background: #1a73e8; }
.legend-saved { background: #34a853; }
.legend-cost { background: #f9ab00; border-radius: 50%; width: 8px; height: 8px; }

.usage-chart-wrap { min-height: 160px; position: relative; }
.chart-empty-msg {
  text-align: center; padding: 48px 16px; color: var(--muted); font-size: 13px;
}
.trend-bars-box {
  display: flex; justify-content: space-around; align-items: flex-end; gap: 12px; height: 170px;
  padding: 10px 10px 0; border-bottom: 2px solid #eaedf4;
}
.trend-col {
  flex: 1; max-width: 72px; height: 100%; display: flex; flex-direction: column;
  justify-content: flex-end; align-items: center; cursor: pointer; position: relative;
}
.trend-total-val { font-size: 12px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.trend-track {
  width: 28px; background: #edf2fa; border-radius: 6px 6px 0 0; overflow: hidden;
  display: flex; flex-direction: column-reverse; transition: height 0.4s ease;
}
.trend-col:hover .trend-track { filter: brightness(0.92); }
.trend-bar-segment { width: 100%; transition: height 0.3s ease; }
.trend-bar-segment.trend-ai { background: #1a73e8; }
.trend-bar-segment.trend-saved { background: #34a853; }
.trend-day-label { font-size: 12px; font-weight: 700; color: var(--text); margin-top: 6px; }
.trend-cost-label { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- 단체 군무 스튜디오 (T07) ---------- */
.dance-dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  max-width: 680px;
  width: 92%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  background: var(--panel);
}
.dance-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}
.dance-box { padding: 22px; }
.dance-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.dance-head h3 { margin: 0; font-size: 20px; }
.dance-grid { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.dance-card {
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.dance-card-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 14px; }
.dance-file-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.dance-local-note { margin: 4px 0 0; font-size: 12px; }
.dance-bpm-hint {
  margin: 6px 0 0; padding: 5px 10px; border-radius: 8px;
  background: var(--user); color: var(--accent); font-size: 13px; font-weight: 600;
}
.dance-textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  background: var(--panel); font-size: 13px; line-height: 1.45; resize: vertical;
}
.dance-controls {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; background: #f0f4fc; border: 1px solid #d4e1f7; border-radius: 12px; margin-top: 8px;
}
.dance-status { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.dance-btns { display: flex; gap: 8px; }
.dance-btns .btn { padding: 10px 22px; font-size: 15px; }

/* ---------- 좁은 화면 및 낮은 세로 해상도 반응형 (T02) ---------- */
@media (max-height: 760px) {
  .chat header { padding: 8px 16px; }
  .tabs { padding: 6px 16px 0; }
  .tab { padding: 5px 14px; font-size: 14px; }
  .examples { padding: 0 16px 4px; }
  .examples button { padding: 4px 10px; font-size: 13px; }
  .composer { padding: 8px 16px 12px; }
  .composer textarea { padding: 8px 10px; font-size: 14px; }
  .dance-box { padding: 14px 16px; }
  .dance-head { margin-bottom: 8px; }
  .dance-grid { gap: 8px; margin-bottom: 8px; }
  .dance-card { padding: 8px 12px; }
  .dance-textarea { max-height: 130px; }
  .dance-controls { padding: 8px 12px; margin-top: 6px; }
}

@media (max-width: 640px) {
  .chat header { padding: 8px 12px; font-size: 13px; }
  .tabs { padding: 8px 12px 0; gap: 6px; }
  .tab { padding: 6px 12px; font-size: 13px; }
  .messages { padding: 12px; min-height: 140px; }
  .msg { max-width: 96%; padding: 10px 12px; font-size: 15px; }
  .code pre { font-size: 13px; padding: 12px; padding-top: 36px; }
  .code .copy, .code .run, .code .to-dance { padding: 4px 10px; font-size: 12px; }
  .code .run { right: 65px; }
  .code .to-dance { right: 130px; }
  .composer { padding: 10px 12px; }
  .dance-dialog { width: 96%; max-height: 94vh; }
  .dance-box { padding: 12px; }
  .dance-head { margin-bottom: 8px; }
  .dance-head h3 { font-size: 17px; }
  .dance-grid { gap: 8px; margin-bottom: 8px; }
  .dance-card { padding: 10px; }
  .dance-card-title { flex-wrap: wrap; gap: 4px; margin-bottom: 6px; font-size: 13px; }
  .dance-file-row .btn.small { padding: 5px 8px; font-size: 12px; }
  .dance-textarea { font-size: 12px; padding: 6px 8px; max-height: 130px; }
  .dance-controls { padding: 10px; gap: 8px; margin-top: 6px; }
  .dance-status { font-size: 13px; flex-wrap: wrap; width: 100%; }
  .dance-btns { width: 100%; }
  .dance-btns .btn { width: 100%; padding: 9px 14px; font-size: 14px; }
  .dash-date-filter-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .date-filter-left { width: 100%; justify-content: space-between; }
  .date-filter-custom { width: 100%; justify-content: space-between; }
  .date-filter-info { margin-left: 0; text-align: right; width: 100%; }
}

/* ---------- 강의 코드 QR 모달 (T03) ---------- */
.qr-dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
  background: var(--panel);
}
.qr-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}
.qr-box { padding: 24px; text-align: center; }
.qr-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.qr-head h3 { margin: 0; font-size: 20px; }
.btn-close {
  background: transparent; border: 0; font-size: 20px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.btn-close:hover { color: var(--text); background: var(--bg); }
.qr-display {
  display: inline-flex;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 10px auto 12px;
}
.qr-display svg { display: block; max-width: 100%; height: auto; }
.qr-display canvas { display: block; max-width: 240px; width: 100%; height: auto; }
.qr-code-text {
  font-family: Consolas, monospace;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: .25em;
  color: var(--accent);
  margin-bottom: 14px;
}
.qr-url-row {
  display: flex; gap: 6px; margin-bottom: 16px; align-items: center;
}
.qr-url-row input {
  flex: 1; min-width: 0; padding: 8px 10px; font-size: 13px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
  font-family: Consolas, monospace;
}
.qr-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.qr-actions .btn { padding: 8px 14px; font-size: 13px; }

@media print {
  body * { visibility: hidden; }
  .qr-dialog, .qr-dialog * { visibility: visible; }
  .qr-dialog {
    position: absolute; left: 0; top: 0; width: 100%; max-width: none;
    border: 0; box-shadow: none; margin: 0 auto;
  }
  .qr-head .btn-close, .qr-actions, .qr-url-row { display: none !important; }
  .qr-display { border: 0; transform: scale(1.3); transform-origin: center top; margin-top: 20px; }
  .qr-code-text { font-size: 48px; margin-top: 40px; }
}

/* ---------- 오류 신고 분석실 모달 (T08 / 1단계) ---------- */
.reports-dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  max-width: 880px;
  width: 92%;
  max-height: 88vh;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  background: var(--panel);
}
.reports-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}
.reports-box {
  padding: 24px;
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  box-sizing: border-box;
}
.reports-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.reports-head h3 {
  margin: 0;
  font-size: 19px;
  color: var(--text);
}
.reports-list-wrap {
  flex: 1;
  overflow-y: auto;
  margin-top: 14px;
  padding-right: 4px;
  max-height: 58vh;
}
.report-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
.report-card.resolved {
  opacity: 0.6;
}
.report-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.report-head-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.report-tags {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.report-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.report-tag.lecture {
  background: #e0f2fe;
  color: #0369a1;
}
.report-tag.seq {
  background: #f3e8ff;
  color: #7e22ce;
}
.report-tag.reason {
  background: #fee2e2;
  color: #b91c1c;
}
.report-tag.resolved {
  background: #dcfce7;
  color: #15803d;
}
.report-time {
  font-size: 12px;
  color: var(--muted);
}
.report-section {
  margin-top: 8px;
}
.report-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.report-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.report-question-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
}
.report-code-box {
  margin: 0;
  padding: 12px 14px;
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: 8px;
  font-family: Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  overflow-x: auto;
  max-height: 220px;
}
.report-code-box code {
  color: inherit;
  background: transparent;
  padding: 0;
}
.reports-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.report-reason-box {
  background: #fff8eb;
  border: 1px solid #fed7aa;
  border-left: 4px solid #f97316;
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #7c2d12;
  font-weight: 600;
  word-break: break-word;
  white-space: pre-wrap;
}

/* ---------- 학생용 코드 오류 신고 모달 ---------- */
.report-dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  max-width: 520px;
  width: 92%;
  max-height: 90vh;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  background: var(--panel);
}
.report-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}
.report-box {
  padding: 22px;
}
.report-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.report-head h3 {
  margin: 0;
  font-size: 19px;
  color: var(--text);
}
.report-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}
.report-type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.report-chip {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}
.report-chip:hover {
  background: #f0f4fc;
}
.report-chip.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 1px 3px rgba(10, 102, 194, 0.3);
}
.report-situation-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}
.report-situation-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(10, 102, 194, 0.15);
}
.report-privacy-note {
  font-size: 12px;
  line-height: 1.45;
  margin: 8px 0 0;
  color: var(--muted);
}
.report-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.report-dialog-actions .btn {
  padding: 9px 18px;
  font-size: 14px;
}

/* 음원 맞춤 안무 코드 생성 모달 */
.choreo-dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  max-width: 580px;
  width: 92vw;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
  background: var(--card-bg, #ffffff);
}
.choreo-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}
.choreo-box {
  padding: 22px 24px;
}
.choreo-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.choreo-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.choreo-preview-box {
  margin-top: 14px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.choreo-preview-box strong {
  color: var(--accent);
}

/* ---------- 클로드 스타일 파일 첨부 요약 카드 (T19 리파인) ---------- */
.file-attachment-card {
  margin: 8px 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  max-width: 540px;
  transition: border-color .15s, box-shadow .15s;
}
.file-attachment-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.file-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
}
.file-card-icon {
  font-size: 24px;
  flex-shrink: 0;
  line-height: 1;
}
.file-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.file-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-card-meta {
  font-size: 12px;
  color: var(--muted);
}
.file-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.btn-card-action {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.btn-card-action:hover {
  background: var(--bg-hover, #f1f5f9);
  border-color: var(--accent);
  color: var(--accent);
}
.btn-card-action.run {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}
.btn-card-action.run:hover {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}
.file-card-preview {
  border-top: 1px solid var(--line);
  background: var(--code-bg);
  max-height: 280px;
  overflow-y: auto;
}
.file-card-preview pre {
  margin: 0;
  padding: 10px 0;
  font-family: "D2Coding", Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--code-text);
}

/* ---------- 세련된 팝업 토스트 알림 (에러 및 안내) ---------- */
.app-toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 90vw;
  width: 420px;
}
.app-toast {
  pointer-events: auto;
  background: #ffffff;
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: toastSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.2s, transform 0.2s;
}
.app-toast.toast-error {
  border-left: 4px solid #ef4444;
}
.app-toast.toast-warning {
  border-left: 4px solid #f59e0b;
}
.app-toast.toast-info {
  border-left: 4px solid var(--accent);
}
.app-toast.toast-success {
  border-left: 4px solid #10b981;
}
.toast-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}
.toast-body {
  flex: 1;
  min-width: 0;
}
.toast-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.toast-msg {
  font-size: 13px;
  color: #475569;
  line-height: 1.45;
  word-break: break-word;
}
.toast-close {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.toast-close:hover {
  color: var(--text);
}
@keyframes toastSlideDown {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

