/* Monitor Hub — Claude Code panel
 * Matches the existing mh-* dark theme in monitor-hub.css
 * Mobile-first, thumb-reachable tap targets
 */

.mh-zone-claude {
  margin-bottom: 1.5rem;
}

.cc-infra-container {
  margin-bottom: 0.5rem;
}

.cc-infra {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.5rem 0.75rem;
  background: var(--mh-zone-bg, #15151a);
  border: 1px solid var(--mh-border, #2a2a35);
  border-radius: 6px;
  font-size: 0.78rem;
}

.cc-infra-server {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 auto;
  min-width: 0;
}

.cc-infra-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cc-infra-dot.ok { background: #22c55e; box-shadow: 0 0 6px #22c55e60; }
.cc-infra-dot.bad { background: #ef4444; box-shadow: 0 0 6px #ef444480; }
.cc-infra-dot.unknown { background: #6b6b80; }

.cc-infra-label {
  font-weight: 600;
  color: #d0d0d8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-infra-meta {
  color: var(--mh-muted, #8a8a9a);
  margin-left: auto;
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-session-container {
  margin-bottom: 1rem;
}

.cc-session {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--mh-zone-bg, #1a1a1f);
  border: 1px solid var(--mh-border, #2a2a35);
  border-radius: 8px;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.cc-session-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6b6b80;
  flex-shrink: 0;
}

.cc-session-live .cc-session-dot {
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e80;
  animation: cc-pulse 1.5s ease-in-out infinite;
}

.cc-session-idle .cc-session-dot {
  background: #6b6b80;
}

@keyframes cc-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.cc-session-meta {
  color: var(--mh-muted, #8a8a9a);
  font-size: 0.85rem;
}

/* ── Questions (NEEDS YOU) ─────────────────────────────────────────── */

.cc-questions-container:empty {
  display: none;
}

.cc-question {
  background: #2a1820;
  border: 2px solid #dc2626;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.2);
}

.cc-question.cc-priority-critical {
  border-color: #ef4444;
  background: #321618;
}

.cc-question-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.cc-needs-you-badge {
  background: #dc2626;
  color: white;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.cc-question-workitem {
  font-size: 0.75rem;
  color: var(--mh-muted, #a0a0b0);
  padding: 0.2rem 0.5rem;
  background: var(--mh-zone-bg, #1a1a1f);
  border-radius: 4px;
}

.cc-question-age {
  font-size: 0.75rem;
  color: var(--mh-muted, #8a8a9a);
  margin-left: auto;
}

.cc-question-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: #f5f5f5;
}

.cc-question-body {
  color: #c8c8d0;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.cc-question-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.cc-option-btn {
  background: #1e40af;
  color: white;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 120px;
  min-height: 44px; /* iOS tap target */
  transition: background 0.15s;
}

.cc-option-btn:hover:not(:disabled) {
  background: #2563eb;
}

.cc-option-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.cc-option-desc {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.85;
  margin-top: 0.2rem;
}

.cc-question-freetext {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.cc-freetext-input {
  flex: 1;
  background: var(--mh-zone-bg, #1a1a1f);
  color: #e0e0e8;
  border: 1px solid var(--mh-border, #2a2a35);
  border-radius: 6px;
  padding: 0.5rem;
  font-family: inherit;
  font-size: 0.85rem;
  resize: vertical;
}

.cc-freetext-submit {
  background: #4b5563;
  color: white;
  border: none;
  padding: 0 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  min-height: 44px;
}

.cc-freetext-submit:hover:not(:disabled) {
  background: #6b7280;
}

/* ── Panel body (Backlog + Worklog columns) ────────────────────────── */

.cc-panel-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 900px) {
  .cc-panel-body {
    grid-template-columns: 1.5fr 1fr;
  }
}

.cc-panel-column {
  background: var(--mh-zone-bg, #15151a);
  border: 1px solid var(--mh-border, #2a2a35);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.cc-panel-heading {
  margin: 0 0 0.5rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--mh-muted, #a0a0b0);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Backlog ───────────────────────────────────────────────────────── */

.cc-backlog-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  align-items: center;
}

.cc-backlog-state-filter,
.cc-backlog-cat-filter {
  background: var(--mh-zone-bg, #1a1a1f);
  color: #d0d0d8;
  border: 1px solid var(--mh-border, #2a2a35);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
}

.cc-backlog-count {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--mh-muted, #8a8a9a);
}

.cc-backlog-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.cc-backlog-item {
  background: #15151c;
  border: 1px solid #2a2a35;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  transition: border-color 0.15s;
}

.cc-backlog-item:hover {
  border-color: #3b82f6;
}

.cc-backlog-item.cc-state-in_progress {
  border-left: 4px solid #22c55e;
}

.cc-backlog-item.cc-state-selected {
  border-left: 4px solid #3b82f6;
}

.cc-backlog-item.cc-state-done {
  opacity: 0.5;
  border-left: 4px solid #6b7280;
}

.cc-backlog-item.cc-state-blocked {
  border-left: 4px solid #f59e0b;
}

.cc-backlog-item-head {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.9rem;
}

.cc-item-key {
  background: #1e40af;
  color: white;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 30px;
  text-align: center;
  flex-shrink: 0;
}

.cc-item-title {
  flex: 1;
  color: #e0e0e8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-item-effort {
  font-size: 0.7rem;
  color: var(--mh-muted, #8a8a9a);
  background: #1a1a22;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  flex-shrink: 0;
}

.cc-backlog-item-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.7rem;
  color: var(--mh-muted, #6a6a78);
  margin-top: 0.25rem;
  margin-left: 2.2rem;
}

.cc-backlog-item-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.5rem;
  margin-left: 2.2rem;
  flex-wrap: wrap;
}

.cc-btn-small {
  background: #1a1a22;
  color: #c0c0c8;
  border: 1px solid #2a2a35;
  border-radius: 4px;
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  cursor: pointer;
  min-height: 32px;
  transition: all 0.15s;
}

.cc-btn-small:hover:not(:disabled) {
  background: #25252f;
  border-color: #3b82f6;
  color: white;
}

/* ── Worklog ───────────────────────────────────────────────────────── */

.cc-worklog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
}

.cc-worklog-entry {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid #20202a;
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.cc-worklog-entry:last-child {
  border-bottom: none;
}

.cc-log-time {
  color: var(--mh-muted, #6a6a78);
  font-size: 0.7rem;
  min-width: 3ch;
  flex-shrink: 0;
}

.cc-log-type {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.cc-log-progress .cc-log-type { background: #1e40af; color: white; }
.cc-log-milestone .cc-log-type { background: #7c3aed; color: white; }
.cc-log-done .cc-log-type { background: #059669; color: white; }
.cc-log-blocker .cc-log-type { background: #dc2626; color: white; }
.cc-log-deferred .cc-log-type { background: #d97706; color: white; }
.cc-log-commit .cc-log-type { background: #0891b2; color: white; }
.cc-log-deploy .cc-log-type { background: #7c2d12; color: white; }
.cc-log-session_start .cc-log-type,
.cc-log-session_end .cc-log-type { background: #4b5563; color: white; }
.cc-log-question_asked .cc-log-type,
.cc-log-question_answered .cc-log-type { background: #db2777; color: white; }
.cc-log-note .cc-log-type { background: #4b5563; color: white; }

.cc-log-item {
  background: #1e40af;
  color: white;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
}

.cc-log-title {
  flex: 1;
  color: #d0d0d8;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-log-commit {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 0.7rem;
  color: #22c55e;
  background: #0a1a0e;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

.cc-muted {
  color: var(--mh-muted, #8a8a9a);
  font-size: 0.85rem;
}

/* ── Detail modal ──────────────────────────────────────────────────── */

.cc-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cc-detail-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.cc-detail-content {
  position: relative;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  background: #15151c;
  border: 1px solid #2a2a35;
  border-radius: 12px;
  padding: 2rem;
  margin: 1rem;
  color: #e0e0e8;
}

.cc-detail-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: #8a8a9a;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}

.cc-detail-content h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

.cc-detail-meta {
  font-size: 0.8rem;
  color: var(--mh-muted, #8a8a9a);
  margin-bottom: 1rem;
}

.cc-detail-desc {
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  background: #0f0f14;
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.cc-detail-risk {
  background: #1c1a15;
  border-left: 3px solid #f59e0b;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.cc-detail-source {
  font-size: 0.75rem;
  color: var(--mh-muted, #6a6a78);
}
