/* ============================================================================
   온프레미스 AI 위젯 — 추가 스타일 (밝은 톤, 기존 OZO AI Agent 위젯과 조화)
   ozo-agent-root/results/input-form 등 기본 골격은 index.html의 ai-agent CSS 재사용.
   여기서는 모드 탭·소스 선택·메시지 버블·실행 카드만 정의.
   ============================================================================ */
/* OZO AI Agent · OZO Onpromise AI 두 버튼 높이 통일 (2줄 라벨 기준) */
.dash-edge-icon.ozo-ai-agent { min-height: 64px; }

/* 온프레미스 위젯이 열릴 때만 패널 폭 50% 확대 (380px → 570px). 다른 위젯 무영향 */
.dash-widget-panel:has(.dash-widget-slot[data-widget="onprem-ai"]:not([hidden])) {
  width: 570px;
}

/* 온프레미스 위젯 제목 — 브랜드 그라데이션 텍스트 (다른 위젯 제목 무영향) */
.dash-widget-panel:has(.dash-widget-slot[data-widget="onprem-ai"]:not([hidden])) .dash-widget-panel-title {
  background: linear-gradient(90deg, #1d4ed8 0%, #0891b2 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
  letter-spacing: 0.3px;
}

/* 모드 탭 — 세그먼트 컨트롤 (모드별 활성 색으로 구분) */
.onprem-mode-tabs { display: flex; gap: 0; padding: 10px 12px 8px; }
.onprem-tab {
  flex: 1; padding: 8px 4px; border: 1px solid #d5dbe6; background: #f5f7fb;
  color: #5a6a82; font-size: 12.5px; font-weight: 600; cursor: pointer;
  text-align: center; white-space: nowrap; transition: all .15s;
}
.onprem-tab + .onprem-tab { border-left: none; }
.onprem-tab:first-child { border-radius: 9px 0 0 9px; }
.onprem-tab:last-child { border-radius: 0 9px 9px 0; }
.onprem-tab:hover { background: #e9eef7; color: #2a3a55; }
.onprem-tab.active { color: #fff; box-shadow: inset 0 1px 3px rgba(0,0,0,.12); }
.onprem-tab.active[data-mode="general"] { background: #2563eb; border-color: #2563eb; }
.onprem-tab.active[data-mode="doc_qa"]  { background: #059669; border-color: #059669; }
.onprem-tab.active[data-mode="db_qa"]   { background: #d97706; border-color: #d97706; }
.onprem-tab.active[data-mode="agent"]   { background: linear-gradient(135deg, #7c3aed, #22a7d0); border-color: #7c3aed; }

/* 음성 입력 활성 상태 — 빨간 펄스 */
#onprem-mic.mic-on { color: #dc2626 !important; animation: onprem-pulse 1.1s infinite; }
@keyframes onprem-pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

.onprem-source-bar { padding: 0 10px 6px; }
.onprem-source-bar select { width: 100%; padding: 6px 8px; border: 1px solid #d5dbe6; border-radius: 7px; font-size: 12.5px; color: #2a3446; background: #fff; }

.onprem-msg { margin-bottom: 12px; }
.onprem-user { text-align: right; }
.onprem-bubble { display: inline-block; text-align: left; padding: 9px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; max-width: 94%; }
.onprem-user .onprem-bubble { background: #e7f0ff; color: #1a3350; }
.onprem-ai .onprem-bubble { background: #f4f6fa; color: #2a3446; border: 1px solid #e5e9f0; }
.onprem-bubble b { color: #111; }
.onprem-typing { color: #8b98a9; font-style: italic; }

.onprem-meta { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.onprem-tag, .onprem-tag-green, .onprem-tag-amber { font-size: 10.5px; padding: 2px 7px; border-radius: 10px; border: 1px solid #e0e0e0; color: #7a879a; font-family: Consolas, monospace; }
.onprem-tag-green { color: #1a9e54; border-color: #b6e3c8; background: #eafaf0; }
.onprem-tag-amber { color: #b7791f; border-color: #f0dcae; background: #fdf6e3; }

.onprem-card { margin-top: 8px; background: #fff; border: 1px solid #e5e9f0; border-radius: 8px; padding: 9px 11px; }
.onprem-card-t { font-size: 12px; font-weight: 600; color: #2563eb; margin-bottom: 6px; }
.onprem-tblwrap { overflow-x: auto; }
.onprem-tbl { width: 100%; border-collapse: collapse; font-size: 11px; }
.onprem-tbl th, .onprem-tbl td { border: 1px solid #e5e9f0; padding: 3px 6px; white-space: nowrap; text-align: left; }
.onprem-tbl th { background: #f5f7fb; color: #7a879a; }
.onprem-new { color: #1a9e54; font-weight: 600; }
.onprem-task { font-size: 12px; padding: 2px 0; color: #2a3446; }
.onprem-err { color: #d64545; }
.onprem-undo { padding: 4px 11px; background: #f59e0b; color: #fff; border: none; border-radius: 12px; font-size: 11px; font-weight: 700; cursor: pointer; }
.onprem-undo:disabled { opacity: .6; cursor: default; }
