/* chat 캐스케이드 3/6 — 루틴 리포트 카드·음성 입력(+ 메뉴 아이템/상태 바)·thinking 블록.
   chat-composer.css 바로 다음에 로드된다. 로드 순서가 곧 캐스케이드다. */

/* ===== Routine Report Card ===== */
.routine-card {
  border-left: 3px solid var(--accent);
  background: var(--bg-elevated, rgba(0,0,0,0.03)); /* token-exempt: one-off */
  padding: 12px 14px;
}

.routine-card.routine-success {
  border-left-color: var(--status-online);
}

.routine-card.routine-failed {
  border-left-color: var(--danger-500);
}

.routine-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.routine-icon {
  font-size: 14px;
}

.routine-title {
  font-weight: 600;
  font-size: 14px;
}

.routine-status {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.routine-detail {
  margin-top: 8px;
}

.routine-detail.collapsed .routine-detail-body {
  display: none;
}

.routine-toggle {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-family);
}

.routine-toggle:hover {
  text-decoration: underline;
}

.routine-detail-body {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.routine-retry-btn {
  margin-top: 8px;
  background: var(--danger-500);
  color: var(--neutral-white);
  border: none;
  border-radius: var(--radius-sm, 6px);
  padding: 4px 12px;
  font-size: 12px;
  font-family: var(--font-family);
  cursor: pointer;
}

.routine-retry-btn:hover {
  background: var(--danger-600);
}

.routine-retry-btn:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
}

/* ===== Voice Input (Plus Menu Item + Status) ===== */

/* 녹음 중: + 메뉴 아이템 강조 */
#voiceMicBtn.voice-active {
  color: var(--danger-500);
  font-weight: 600;
}

/* 미지원 브라우저 */
#voiceMicBtn.voice-unsupported {
  opacity: 0.3;
  cursor: not-allowed;
}

/* 전사 건수 배지 (메뉴 아이템 내 인라인) */
.voice-badge {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent-pink);
  color: var(--neutral-white);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  margin-left: 6px;
}

/* 음성 상태 바 (입력창 하단) */
.voice-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--danger-500);
  animation: fadeIn 200ms ease;
}

.voice-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger-500);
  flex-shrink: 0;
  animation: recordBlink 1s ease-in-out infinite;
}

.voice-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  flex-shrink: 0;
}

.voice-interim {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-style: italic;
}

/* 상태바 정지 버튼 */
.voice-stop-btn {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--danger-500);
  color: var(--neutral-white);
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 200ms ease;
}

.voice-stop-btn:hover {
  background: var(--danger-600);
}

/* 녹음 중: + 버튼 강조 */
.plus-btn.voice-recording {
  color: var(--danger-500);
  animation: voicePulse 1.5s ease-in-out infinite;
}

@keyframes voicePulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--danger-glow-40); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); /* token-exempt: one-off */ }
}

/* 모바일 */
@media (max-width: 767px) {
  .voice-stop-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }

  .voice-status-bar {
    padding: 4px 10px;
  }
}

/* ===== Thinking Block (qwen <think> 추론 영역) ===== */
.thinking-block {
  display: none;
  margin-bottom: 4px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  border-radius: var(--radius-md);
  font-size: 0.85em;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.thinking-block summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-secondary);
  user-select: none;
  list-style: none;
}

.thinking-block summary::before {
  content: "▶ ";
  font-size: 0.8em;
}

.thinking-block[open] summary::before {
  content: "▼ ";
}

.thinking-block .thinking-content {
  margin-top: 6px;
  white-space: pre-wrap;
  font-family: ui-monospace, monospace;
  font-size: 0.95em;
  color: var(--text-secondary);
}

/* 글로벌 토글 ON일 때만 표시 */
body.show-thinking .thinking-block {
  display: block;
}

