/* Lumen 테마: 메인 페이지 */
body.bg-light { background-color: #f8fafc !important; }

.caption-box{
  height: 260px;
  overflow-y: auto;
  background: #1e293b;
  color: #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
  line-height: 1.5;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.caption-line{
  padding: 6px 8px;
  border-radius: 8px;
  margin-bottom: 6px;
  background: rgba(255,255,255,0.06);
}

.caption-line.danger{
  background: rgba(239,68,68,0.22);
  border: 1px solid rgba(239,68,68,0.4);
}

/* 마이크 상태 인디케이터 (아이콘 기반) */
.mic-status-indicator {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.mic-status-indicator.mic-off {
  background: #e5e7eb;
  color: #9ca3af;
}
.mic-status-indicator.mic-on {
  background: rgba(6, 182, 212, 0.15);
  color: var(--lumen-teal);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.3);
  animation: mic-pulse 2s ease-in-out infinite;
}
.mic-status-indicator .mic-status-icon {
  font-size: 1.1rem;
}
.mic-status-indicator.mic-status-card {
  width: 56px;
  height: 56px;
  margin-left: auto;
  margin-right: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mic-status-indicator.mic-status-card:hover {
  filter: brightness(0.97);
}
.mic-status-indicator.mic-status-card:focus-visible {
  outline: 2px solid var(--lumen-teal, #06b6d4);
  outline-offset: 2px;
}
.mic-status-indicator.mic-status-card .mic-status-icon {
  font-size: 1.5rem;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.3); }
  50% { box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.15); }
}

/* Hero 상태 배지: 대기중 (기존 유지) */
#heroBadge.bg-secondary-subtle {
  background-color: rgba(30, 64, 175, 0.12) !important;
  color: var(--lumen-primary) !important;
  border-color: rgba(30, 64, 175, 0.3) !important;
}

/* Hero 알림 상태: 카드 배경 틴트 + 배지 색상 (눈 편한 연한 배경) */
#heroCard.hero-alert-danger .card-body {
  background: rgba(239, 68, 68, 0.06) !important;
  border-radius: 0 0 12px 12px;
}
#heroCard.hero-alert-caution .card-body {
  background: rgba(249, 115, 22, 0.08) !important;
  border-radius: 0 0 12px 12px;
}
#heroCard.hero-alert-alert .card-body {
  background: rgba(30, 64, 175, 0.06) !important;
  border-radius: 0 0 12px 12px;
}

/* 상단 경고 카드: 맞아요/아니에요는 항상 가로 한 줄·라벨 줄바꿈 없음 */
#heroCard .card-body {
  flex-wrap: nowrap;
}
#heroCard .hero-feedback-btns {
  flex-shrink: 0;
  flex-wrap: nowrap;
}
#heroCard .hero-feedback-btns .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.hero-badge {
  font-weight: 700 !important;
  border: none !important;
}

/* 위험/경고·생활알림: PC는 한 줄, 모바일만 두 줄 스택 */
.hero-badge .hero-badge-stack {
  display: inline;
}
.hero-badge .hero-badge-line {
  display: inline;
}

@media (max-width: 767.98px) {
  .hero-badge .hero-badge-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.12;
    text-align: center;
  }
  .hero-badge .hero-badge-line {
    display: block;
  }
}
.hero-badge-danger {
  background: rgba(220, 38, 38, 0.2) !important;
  color: #b91c1c !important;
}
.hero-badge-caution {
  background: rgba(234, 88, 12, 0.2) !important;
  color: #c2410c !important;
}
.hero-badge-alert {
  background: rgba(30, 64, 175, 0.18) !important;
  color: #1e40af !important;
}

.hero-title-danger { color: #b91c1c !important; }
.hero-title-caution { color: #c2410c !important; }
.hero-title-alert { color: #1e40af !important; }
.hero-desc-danger { color: #991b1b !important; }
.hero-desc-caution { color: #9a3412 !important; }
.hero-desc-alert { color: #1e3a8a !important; }

/* 카드 헤더 포인트 */
.card-header.fw-semibold {
  color: var(--lumen-primary-dark);
  border-bottom-color: rgba(6, 182, 212, 0.2);
}

/* 최근 감지 로그 테이블 컬럼 균형 조정 */
#logTable {
  table-layout: fixed;
  width: 100%;
}
#logTable th {
  text-align: left;
  background: var(--lumen-bg-subtle) !important;
  color: var(--lumen-primary-dark);
  font-weight: 600;
  white-space: nowrap;
}
#logTable th:first-child,
#logTable td:first-child { padding-left: 1rem; }
#logTable .col-time { width: 12%; min-width: 2.5em; }
#logTable .col-type { width: 12%; }
#logTable .col-content { width: 48%; }
#logTable .col-prob { width: 10%; }
#logTable .col-action { width: 18%; }
#logTable td:nth-child(4) { text-align: left; }
#logTable td:nth-child(5) {
  text-align: right;
  white-space: nowrap;
}

/* 모바일: 최근 감지 로그 카드형 레이아웃 */
@media (max-width: 576px) {
  #logSection .table-responsive {
    padding: 0 1rem;
  }
  #logSection .card-body {
    padding: 0.75rem 0 !important;
  }
  #logTable thead { display: none; }
  #logTable,
  #logTable tbody { display: block; }
  #logTable tr {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(6, 182, 212, 0.12);
    background: transparent;
  }
  #logTable tbody tr:nth-of-type(odd) {
    background: rgba(6, 182, 212, 0.03);
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  #logTable tr:last-child { border-bottom: 0; }
  #logTable td {
    display: block;
    padding: 0;
    border: none;
    font-size: 0.85rem;
  }
  #logTable td::before {
    font-weight: 600;
    font-size: 0.7rem;
    color: var(--lumen-primary-dark);
    margin-right: 0.25rem;
  }
  #logTable td:nth-child(1) { order: 1; }
  #logTable td:nth-child(1)::before { content: "시간 "; }
  #logTable td:nth-child(2) { order: 2; }
  #logTable td:nth-child(2)::before { content: "종류 "; }
  #logTable td:nth-child(4) { order: 3; }
  #logTable td:nth-child(4)::before { content: "확률 "; }
  #logTable td:nth-child(3) {
    order: 4;
    flex: 1 1 100%;
    margin-top: 0.3rem;
    padding-top: 0.25rem;
    border-top: 1px solid rgba(6, 182, 212, 0.08);
  }
  #logTable td:nth-child(3)::before {
    content: "내용";
    display: block;
    margin-bottom: 0.15rem;
  }
  #logTable td:nth-child(5) {
    order: 5;
    flex: 1 1 100%;
    margin-top: 0.35rem;
    text-align: right;
  }
  #logTable td:nth-child(5)::before {
    content: "";
    display: none;
  }
}

/* 게스트 전용 CTA 카드 */
.guest-cta-card {
  background: var(--lumen-bg-subtle);
  border-radius: 16px;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.guest-cta-icon {
  font-size: 3rem;
  line-height: 1;
}

.guest-cta-card .btn-primary {
  padding: 0.5rem 1.5rem;
  border-radius: 10px;
  font-weight: 500;
}

/* 메인 카드 섹션 */
.card.shadow-sm {
  border-color: rgba(6, 182, 212, 0.15);
  border-radius: 12px;
}

.card.shadow-sm .card-body {
  border-radius: 0 0 12px 12px;
}

/* 모바일 400px: 좁은 폭 보정 */
@media (max-width: 400px) {
  #heroCard .card-body {
    gap: 0.5rem;
    padding: 0.75rem 1rem;
  }
  #heroCard .hero-feedback-btns {
    gap: 0.35rem;
  }
  #heroCard .hero-feedback-btns .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }
  #heroCard #heroBadge {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.7rem;
  }
  #heroCard #heroTitle {
    font-size: 1rem !important;
  }
  #heroCard #heroDesc {
    font-size: 0.75rem !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #btnCaptionTestAll {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }
}

/* 최근 감지 로그: 피드백 선택 가능한 행 */
#logTable tbody tr.log-row-clickable {
  cursor: pointer;
  transition: background-color 0.15s ease;
}
#logTable tbody tr.log-row-clickable:hover {
  background-color: rgba(6, 182, 212, 0.12) !important;
}
#logTable tbody tr.log-row-clickable.table-active {
  box-shadow: inset 3px 0 0 0 var(--lumen-teal, #0891b2);
}