/**
 * Mission Control (Table view) styles.
 *
 * Three-column "holy grail" layout: Board | Stream | SeatDeck.
 * Dark theme, consistent with watchtower.css design tokens.
 * Design source: docs/tasca-web-uiux-v0.1.md (Table View / Mission Control spec)
 */

/* =============================================================================
   Design Tokens (Mission Control-specific)
   ============================================================================= */

:root {
  --mc-bg: #1a1a1a;
  --mc-surface: #2a2a2a;
  --mc-surface-hover: #333;
  --mc-border: #3a3a3a;
  --mc-text: rgba(255, 255, 255, 0.87);
  --mc-text-muted: rgba(255, 255, 255, 0.45);
  --mc-text-dim: rgba(255, 255, 255, 0.6);
  --mc-accent: #60a5fa;
  --mc-accent-hover: #3b82f6;

  /* Status pill colors — shared with watchtower */
  --mc-status-open: #22c55e;
  --mc-status-open-bg: rgba(34, 197, 94, 0.15);
  --mc-status-paused: #eab308;
  --mc-status-paused-bg: rgba(234, 179, 8, 0.15);
  --mc-status-closed: #6b7280;
  --mc-status-closed-bg: rgba(107, 114, 128, 0.15);

  /* Speaker colors */
  --mc-speaker-agent-bg: rgba(96, 165, 250, 0.08);
  --mc-speaker-agent-border: rgba(96, 165, 250, 0.4);
  --mc-speaker-human-border: rgba(255, 255, 255, 0.7);
  --mc-speaker-patron-bg: rgba(168, 85, 247, 0.08);
  --mc-speaker-patron-border: rgba(168, 85, 247, 0.4);

  /* Seat state colors */
  --mc-seat-joined: #22c55e;
  --mc-seat-joined-bg: rgba(34, 197, 94, 0.15);
  --mc-seat-left: #6b7280;
  --mc-seat-left-bg: rgba(107, 114, 128, 0.15);

  --mc-radius: 6px;
  --mc-radius-sm: 4px;

  /* Monospace font stack */
  --mc-font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace;
}

/* =============================================================================
   Screen Reader Only (shared utility — redeclared for independence)
   ============================================================================= */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* =============================================================================
   Page Layout
   ============================================================================= */

.mc {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* =============================================================================
   HUD Header
   ============================================================================= */

.mc-hud {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--mc-border);
  flex-wrap: wrap;
}

.mc-hud-back {
  padding: 0.375rem 0.75rem;
  background: transparent;
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius);
  color: var(--mc-text-dim);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}

.mc-hud-back:hover {
  border-color: var(--mc-text-dim);
  color: var(--mc-text);
}

.mc-hud-back:focus-visible {
  outline: 2px solid var(--mc-accent);
  outline-offset: 2px;
}

.mc-hud-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--mc-text);
  margin: 0;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mc-hud-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.mc-hud-action {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--mc-text-muted);
}

.mc-hud-action code {
  font-family: var(--mc-font-mono);
  font-size: 0.75rem;
  color: var(--mc-text-dim);
  background: var(--mc-surface);
  padding: 0.125rem 0.375rem;
  border-radius: var(--mc-radius-sm);
}

/* =============================================================================
   Status Pill (scoped to Mission Control)
   ============================================================================= */

.mc-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.mc-status-pill--open {
  color: var(--mc-status-open);
  background: var(--mc-status-open-bg);
}

.mc-status-pill--paused {
  color: var(--mc-status-paused);
  background: var(--mc-status-paused-bg);
}

.mc-status-pill--closed {
  color: var(--mc-status-closed);
  background: var(--mc-status-closed-bg);
}

/* =============================================================================
   Copy Button (scoped to Mission Control)
   ============================================================================= */

.mc-copy-btn {
  padding: 0.125rem 0.375rem;
  background: transparent;
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius-sm);
  color: var(--mc-text-muted);
  font-size: 0.6875rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  font-family: inherit;
  text-transform: lowercase;
}

.mc-copy-btn:hover {
  border-color: var(--mc-text-dim);
  color: var(--mc-text-dim);
}

.mc-copy-btn:focus-visible {
  outline: 2px solid var(--mc-accent);
  outline-offset: 2px;
}

/* =============================================================================
   Three-Column Layout
   ============================================================================= */

.mc-columns {
  display: grid;
  grid-template-columns: 250px 1fr 220px;
  gap: 1px;
  flex: 1;
  min-height: 0;
  /* Fixed height: viewport minus HUD header and root padding */
  height: calc(100vh - 8rem);
}

/* =============================================================================
   Left Column — Context Rail (Board)
   ============================================================================= */

.mc-col-left {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  border-right: 1px solid var(--mc-border);
  padding-right: 0.75rem;
}

/* Board Component */
.mc-board {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.75rem;
}

.mc-board-section {
  padding: 0;
}

.mc-board-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mc-text-muted);
  margin: 0 0 0.5rem;
}

.mc-board-empty {
  font-size: 0.8125rem;
  color: var(--mc-text-muted);
  font-style: italic;
  padding: 0.5rem 0;
}

/* Metadata list within board */
.mc-meta-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.mc-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.mc-meta-label {
  font-size: 0.6875rem;
  color: var(--mc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mc-meta-value {
  font-size: 0.8125rem;
  color: var(--mc-text-dim);
  word-break: break-all;
}

.mc-meta-value--mono {
  font-family: var(--mc-font-mono);
  font-size: 0.75rem;
}

/* =============================================================================
   Center Column — Stream + Console
   ============================================================================= */

.mc-col-center {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Stream panel — fills remaining space within the center column */
.mc-stream-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Header row: label left, connection badge right */
.mc-stream-header {
  padding: 0.75rem 0.75rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mc-text-muted);
  border-bottom: 1px solid var(--mc-border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* Connection status badge — design source: task spec web.long_poll_stream */
.mc-stream-conn {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  border-radius: 999px;
  padding: 0.125rem 0.5rem 0.125rem 0.375rem;
  flex-shrink: 0;
}

.mc-stream-conn-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mc-stream-conn--live {
  color: var(--mc-status-open);
  background: var(--mc-status-open-bg);
}

.mc-stream-conn--live .mc-stream-conn-dot {
  background: var(--mc-status-open);
}

.mc-stream-conn--connecting {
  color: var(--mc-status-paused);
  background: var(--mc-status-paused-bg);
}

.mc-stream-conn--connecting .mc-stream-conn-dot {
  background: var(--mc-status-paused);
  opacity: 0.7;
}

.mc-stream-conn--offline {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.mc-stream-conn--offline .mc-stream-conn-dot {
  background: #ef4444;
}

/* Stream body: wraps the scrollable list and the floating jump button */
.mc-stream-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.mc-stream {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  flex: 1;
  padding: 0 0.75rem;
  scroll-behavior: smooth;
}

/* Stream empty/no sayings state */
.mc-stream-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: var(--mc-text-muted);
  font-size: 0.875rem;
  text-align: center;
  flex: 1;
}

/* Floating "N new sayings" button — shown when user has scrolled up */
.mc-stream-jump {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.375rem 0.875rem;
  background: var(--mc-accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: background 0.15s, transform 0.15s;
  z-index: 10;
}

.mc-stream-jump:hover {
  background: var(--mc-accent-hover);
}

.mc-stream-jump:focus-visible {
  outline: 2px solid var(--mc-accent);
  outline-offset: 3px;
}

/* New-entry highlight animation — briefly fades out a blue tint */
@keyframes mc-log-new-flash {
  from {
    background-color: rgba(96, 165, 250, 0.18);
  }
  to {
    background-color: transparent;
  }
}

.mc-log-block--new {
  animation: mc-log-new-flash 1.4s ease-out forwards;
}

/* =============================================================================
   Log Block (single saying)
   ============================================================================= */

.mc-log-block {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--mc-border);
  border-left: 3px solid transparent;
  transition: background 0.1s;
}

.mc-log-block:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Speaker-kind borders and tints */
.mc-log-block--agent {
  background: var(--mc-speaker-agent-bg);
  border-left-color: var(--mc-speaker-agent-border);
}

.mc-log-block--agent:hover {
  background: rgba(96, 165, 250, 0.12);
}

.mc-log-block--human {
  border-left-color: var(--mc-speaker-human-border);
}

.mc-log-block--patron {
  background: var(--mc-speaker-patron-bg);
  border-left-color: var(--mc-speaker-patron-border);
}

.mc-log-block--patron:hover {
  background: rgba(168, 85, 247, 0.12);
}

/* Log block header row: seq + speaker + badges + timestamp */
.mc-log-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  flex-wrap: wrap;
}

.mc-log-seq {
  font-family: var(--mc-font-mono);
  font-size: 0.6875rem;
  color: var(--mc-text-muted);
  min-width: 2rem;
}

.mc-log-speaker {
  font-weight: 600;
  color: var(--mc-text);
}

.mc-log-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.0625rem 0.375rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mc-log-badge--agent {
  color: var(--mc-accent);
  background: rgba(96, 165, 250, 0.15);
}

.mc-log-badge--human {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.mc-log-badge--patron {
  color: #a855f7;
  background: rgba(168, 85, 247, 0.15);
}

.mc-log-pin {
  font-size: 0.625rem;
  color: var(--mc-status-paused);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mc-log-time {
  margin-left: auto;
  font-size: 0.6875rem;
  color: var(--mc-text-muted);
  white-space: nowrap;
}

/* Log block content */
.mc-log-content {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--mc-text);
  white-space: pre-wrap;
  word-break: break-word;
}

.mc-log-content--mono {
  font-family: var(--mc-font-mono);
  font-size: 0.8125rem;
}

/* =============================================================================
   Seat Deck (right column)
   ============================================================================= */

.mc-col-right {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  border-left: 1px solid var(--mc-border);
  padding-left: 0.75rem;
}

.mc-seat-deck {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 0.75rem;
}

.mc-seat-deck-header {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mc-text-muted);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--mc-border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mc-seat-deck-count {
  font-size: 0.625rem;
  color: var(--mc-text-muted);
  background: var(--mc-surface);
  padding: 0.0625rem 0.375rem;
  border-radius: 999px;
  font-weight: 500;
}

.mc-seat-deck-empty {
  padding: 1.5rem 0.5rem;
  text-align: center;
  color: var(--mc-text-muted);
  font-size: 0.8125rem;
  font-style: italic;
}

/* Seat Deck Stats (presence counts) */
.mc-seat-deck-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.6875rem;
  color: var(--mc-text-muted);
  border-bottom: 1px solid var(--mc-border);
}

.mc-seat-deck-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.mc-seat-deck-stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mc-seat-deck-stat--active .mc-seat-deck-stat-dot {
  background: var(--mc-status-open);
}

.mc-seat-deck-stat--idle .mc-seat-deck-stat-dot {
  background: var(--mc-status-paused);
}

.mc-seat-deck-stat--offline .mc-seat-deck-stat-dot {
  background: var(--mc-status-closed);
}

/* Seat Card */
.mc-seat-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--mc-border);
  transition: background 0.15s;
}

.mc-seat-card:last-child {
  border-bottom: none;
}

.mc-seat-card--current {
  background: rgba(96, 165, 250, 0.08);
  margin: 0 -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: var(--mc-radius);
  border-left: 2px solid var(--mc-accent);
}

.mc-seat-card--interactive {
  cursor: pointer;
}

.mc-seat-card--interactive:hover {
  background: var(--mc-surface-hover);
}

.mc-seat-card--interactive:focus-visible {
  outline: 2px solid var(--mc-accent);
  outline-offset: 2px;
}

.mc-seat-card--offline {
  opacity: 0.5;
}

.mc-seat-card--offline.mc-seat-card--interactive {
  cursor: not-allowed;
}

/* Seat Position (order number) */
.mc-seat-position {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--mc-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--mc-text-muted);
  flex-shrink: 0;
}

/* Seat Avatar */
.mc-seat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--mc-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--mc-text-dim);
  flex-shrink: 0;
  text-transform: uppercase;
}

/* Agent avatar - blue tint */
.mc-seat-avatar--agent {
  background: rgba(96, 165, 250, 0.15);
  color: var(--mc-accent);
}

/* Human avatar - white tint */
.mc-seat-avatar--human {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.mc-seat-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
}

.mc-seat-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--mc-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.mc-seat-you-badge {
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--mc-accent);
  background: rgba(96, 165, 250, 0.15);
  padding: 0.0625rem 0.25rem;
  border-radius: var(--mc-radius-sm);
}

.mc-seat-meta {
  font-size: 0.6875rem;
  color: var(--mc-text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Presence indicator dot */
.mc-seat-presence {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mc-seat-presence--active {
  background: var(--mc-status-open);
}

.mc-seat-presence--idle {
  background: var(--mc-status-paused);
}

.mc-seat-presence--offline {
  background: var(--mc-status-closed);
}

/* Seat presence badge with dot + label (ONLINE/IDLE/OFFLINE) */
.mc-seat-presence-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.4375rem;
  border-radius: 999px;
  font-size: 0.5625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mc-seat-presence-badge-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.mc-seat-presence-badge--active {
  color: var(--mc-status-open);
  background: var(--mc-status-open-bg);
}

.mc-seat-presence-badge--active .mc-seat-presence-badge-dot {
  background: var(--mc-status-open);
  box-shadow: 0 0 4px var(--mc-status-open);
}

.mc-seat-presence-badge--idle {
  color: var(--mc-status-paused);
  background: var(--mc-status-paused-bg);
}

.mc-seat-presence-badge--idle .mc-seat-presence-badge-dot {
  background: var(--mc-status-paused);
}

.mc-seat-presence-badge--offline {
  color: var(--mc-status-closed);
  background: var(--mc-status-closed-bg);
}

.mc-seat-presence-badge--offline .mc-seat-presence-badge-dot {
  background: var(--mc-status-closed);
}

/* Seat badges container */
.mc-seat-badges {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

/* Seat kind badge (AGENT/HUMAN) */
.mc-seat-kind {
  display: inline-flex;
  align-items: center;
  padding: 0.0625rem 0.375rem;
  border-radius: 999px;
  font-size: 0.5625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mc-seat-kind--agent {
  color: var(--mc-accent);
  background: rgba(96, 165, 250, 0.15);
}

.mc-seat-kind--human {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

/* Seat state badge */
.mc-seat-state {
  display: inline-flex;
  align-items: center;
  padding: 0.0625rem 0.375rem;
  border-radius: 999px;
  font-size: 0.5625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mc-seat-state--joined {
  color: var(--mc-seat-joined);
  background: var(--mc-seat-joined-bg);
}

.mc-seat-state--left {
  color: var(--mc-seat-left);
  background: var(--mc-seat-left-bg);
}

/* Legacy heartbeat class (kept for backward compatibility) */
.mc-seat-heartbeat {
  font-size: 0.6875rem;
  color: var(--mc-text-muted);
}

/* =============================================================================
   Mention Picker
   ============================================================================= */

.mc-mention-picker-wrapper {
  position: absolute;
  z-index: 100;
  min-width: 200px;
  max-width: 280px;
}

.mc-mention-picker {
  background: var(--mc-surface);
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  max-height: 240px;
  overflow-y: auto;
}

.mc-mention-picker--empty {
  padding: 0.75rem;
}

.mc-mention-picker-empty {
  font-size: 0.8125rem;
  color: var(--mc-text-muted);
  text-align: center;
  padding: 0.75rem;
}

.mc-mention-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--mc-border);
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}

.mc-mention-item:last-child {
  border-bottom: none;
}

.mc-mention-item:hover {
  background: var(--mc-surface-hover);
}

.mc-mention-item:focus-visible {
  outline: 2px solid var(--mc-accent);
  outline-offset: -2px;
}

.mc-mention-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 600;
  flex-shrink: 0;
  text-transform: uppercase;
}

.mc-mention-avatar--agent {
  background: rgba(96, 165, 250, 0.15);
  color: var(--mc-accent);
}

.mc-mention-avatar--human {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.mc-mention-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.mc-mention-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--mc-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mc-mention-meta {
  font-size: 0.6875rem;
  color: var(--mc-text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.mc-mention-presence {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mc-mention-presence--active {
  background: var(--mc-status-open);
}

.mc-mention-presence--idle {
  background: var(--mc-status-paused);
}

/* =============================================================================
   Mention Input
   ============================================================================= */

.mc-mention-input-container {
  position: relative;
  width: 100%;
}

.mc-mention-input-wrapper {
  position: relative;
  background: var(--mc-surface);
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius);
  transition: border-color 0.15s;
}

.mc-mention-input-wrapper:focus-within {
  border-color: var(--mc-accent);
}

.mc-mention-input {
  width: 100%;
  min-height: 44px;
  max-height: 120px;
  padding: 0.75rem;
  background: transparent;
  border: none;
  color: var(--mc-text);
  font-size: 0.875rem;
  line-height: 1.5;
  font-family: inherit;
  resize: vertical;
}

.mc-mention-input::placeholder {
  color: var(--mc-text-muted);
}

.mc-mention-input:focus {
  outline: none;
}

.mc-mention-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mc-mention-input-disabled-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(26, 26, 26, 0.9);
  border-radius: var(--mc-radius);
  z-index: 1;
  padding: 0.75rem;
}

.mc-mention-input-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
}

.mc-mention-input-readonly {
  font-size: 0.8125rem;
  color: var(--mc-text-muted);
  font-style: italic;
}

/* =============================================================================
   Mention Error
   ============================================================================= */

.mc-mention-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--mc-radius);
  padding: 0.75rem;
  margin: 0.5rem 0;
}

.mc-mention-error-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mc-mention-error-icon {
  font-size: 1rem;
}

.mc-mention-error-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #f87171;
}

.mc-mention-error-dismiss {
  margin-left: auto;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--mc-text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: var(--mc-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mc-mention-error-dismiss:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--mc-text);
}

.mc-mention-error-body {
  margin-top: 0.5rem;
}

.mc-mention-error-help {
  font-size: 0.8125rem;
  color: var(--mc-text-muted);
  margin: 0 0 0.5rem;
}

.mc-mention-error-candidates {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.mc-mention-error-candidate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--mc-surface);
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius-sm);
  cursor: pointer;
  transition: background 0.1s;
}

.mc-mention-error-candidate:hover {
  background: var(--mc-surface-hover);
}

.mc-mention-error-candidate-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--mc-text);
}

.mc-mention-error-candidate-kind {
  font-size: 0.6875rem;
  color: var(--mc-text-muted);
  text-transform: uppercase;
}

/* =============================================================================
   Log Block — Reply anchor + Mention chips
   ============================================================================= */

.mc-log-reply-anchor {
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--mc-accent);
  background: rgba(96, 165, 250, 0.1);
  padding: 0.0625rem 0.375rem;
  border-radius: var(--mc-radius-sm);
  text-decoration: none;
  cursor: default;
}

.mc-log-mentions-warn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
  padding: 0.25rem 0.375rem;
  background: rgba(234, 179, 8, 0.08);
  border-left: 2px solid rgba(234, 179, 8, 0.5);
  border-radius: 0 var(--mc-radius-sm) var(--mc-radius-sm) 0;
}

.mc-log-mentions-warn-icon {
  font-size: 0.75rem;
  color: #eab308;
  flex-shrink: 0;
}

.mc-log-mention-chip {
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 999px;
}

.mc-log-mention-chip--unresolved {
  color: #eab308;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.3);
}

/* Markdown content inside log blocks */
.mc-log-content p {
  margin: 0 0 0.25em;
}

.mc-log-content p:last-child {
  margin-bottom: 0;
}

.mc-log-content code {
  font-family: var(--mc-font-mono);
  font-size: 0.8125em;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.125em 0.3em;
  border-radius: 3px;
}

.mc-log-content pre {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.625rem;
  border-radius: var(--mc-radius-sm);
  overflow-x: auto;
  margin: 0.25rem 0;
}

.mc-log-content pre code {
  background: none;
  padding: 0;
}

.mc-log-content ul,
.mc-log-content ol {
  margin: 0.25rem 0;
  padding-left: 1.25rem;
}

.mc-log-content li {
  margin: 0.125rem 0;
}

.mc-log-content blockquote {
  border-left: 3px solid var(--mc-border);
  margin: 0.25rem 0;
  padding-left: 0.625rem;
  color: var(--mc-text-muted);
}

/* =============================================================================
   Command Console (footer input)
   ============================================================================= */

.mc-console {
  flex-shrink: 0;
  border-top: 1px solid var(--mc-border);
  padding: 0.625rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.mc-console-error {
  font-size: 0.75rem;
  color: #f87171;
  margin: 0;
  padding: 0.25rem 0.375rem;
  background: rgba(239, 68, 68, 0.1);
  border-radius: var(--mc-radius-sm);
}

.mc-console-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.mc-console-input {
  flex: 1;
}

.mc-console-send-btn {
  flex-shrink: 0;
  padding: 0.5rem 0.875rem;
  background: var(--mc-accent);
  color: #fff;
  border: none;
  border-radius: var(--mc-radius);
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  min-height: 44px;
}

.mc-console-send-btn:hover:not(:disabled) {
  background: var(--mc-accent-hover);
}

.mc-console-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mc-console-send-btn:focus-visible {
  outline: 2px solid var(--mc-accent);
  outline-offset: 2px;
}

/* Console controls row (Pause/Resume in footer) */
.mc-console-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--mc-border);
  margin-top: 0.25rem;
}

/* =============================================================================
   Mention Input — Active Prefix Label
   ============================================================================= */

.mc-mention-input-prefix {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mc-accent);
  pointer-events: none;
  z-index: 1;
  white-space: nowrap;
}

/* When prefix is shown, indent the textarea (uses wrapper class for Safari 15 compatibility) */
.mc-mention-input-wrapper--active .mc-mention-input {
  padding-left: 4.5rem;
}

/* =============================================================================
   State Displays (loading, error)
   ============================================================================= */

.mc-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--mc-text-muted);
  gap: 0.5rem;
  flex: 1;
}

.mc-state p {
  margin: 0;
}

.mc-state--error {
  color: #ef4444;
}

.mc-state-title {
  font-weight: 600;
  font-size: 1rem;
}

.mc-state-detail {
  font-size: 0.875rem;
  opacity: 0.7;
}

.mc-retry-btn {
  margin-top: 0.75rem;
  padding: 0.5rem 1.25rem;
  background: transparent;
  border: 1px solid #ef4444;
  border-radius: var(--mc-radius);
  color: #ef4444;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}

.mc-retry-btn:hover {
  background: rgba(239, 68, 68, 0.1);
}

.mc-retry-btn:focus-visible {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
}

/* Loading spinner */
.mc-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--mc-border);
  border-top-color: var(--mc-accent);
  border-radius: 50%;
  animation: mc-spin 0.6s linear infinite;
}

@keyframes mc-spin {
  to {
    transform: rotate(360deg);
  }
}

/* =============================================================================
   Responsive — Tablet (columns stack)
   ============================================================================= */

@media (max-width: 1024px) {
  .mc-columns {
    grid-template-columns: 1fr;
    height: auto;
  }

  .mc-col-left {
    border-right: none;
    border-bottom: 1px solid var(--mc-border);
    padding-right: 0;
    padding-bottom: 0.75rem;
  }

  .mc-col-center {
    min-height: 50vh;
  }

  .mc-col-right {
    border-left: none;
    border-top: 1px solid var(--mc-border);
    padding-left: 0;
    padding-top: 0.75rem;
  }
}

/* =============================================================================
   Responsive — Mobile
   ============================================================================= */

@media (max-width: 640px) {
  .mc-hud {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .mc-hud-title {
    white-space: normal;
    font-size: 0.9375rem;
  }

  .mc-hud-actions {
    flex-wrap: wrap;
    gap: 0.375rem;
  }

  .mc-log-header {
    gap: 0.375rem;
  }

  .mc-log-time {
    margin-left: 0;
    flex-basis: 100%;
  }
}

/* =============================================================================
   Reduced Motion
   ============================================================================= */

@media (prefers-reduced-motion: reduce) {
  .mc-spinner {
    animation: none;
    opacity: 0.5;
  }

  .mc-log-block,
  .mc-hud-back,
  .mc-copy-btn,
  .mc-retry-btn,
  .mc-stream-jump {
    transition: none;
  }

  .mc-stream {
    scroll-behavior: auto;
  }

  /* Suppress highlight flash for users who prefer reduced motion */
  .mc-log-block--new {
    animation: none;
  }
}

/* =============================================================================
   Mode Indicator (Dark Theme Override)
   ============================================================================= */

.mc-hud .mode-indicator {
  background-color: var(--mc-surface);
  margin-left: auto;
}

.mc-hud .mode-badge--viewer {
  background-color: rgba(96, 165, 250, 0.15);
  color: var(--mc-accent);
}

.mc-hud .mode-badge--admin {
  background-color: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.mc-hud .mode-btn--enter-admin {
  background-color: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}

.mc-hud .mode-btn--enter-admin:hover {
  background-color: rgba(251, 191, 36, 0.25);
}

.mc-hud .mode-btn--viewer {
  background-color: rgba(96, 165, 250, 0.15);
  color: var(--mc-accent);
  border-color: rgba(96, 165, 250, 0.3);
}

.mc-hud .mode-btn--viewer:hover {
  background-color: rgba(96, 165, 250, 0.25);
}

.mc-hud .mode-btn--logout {
  background-color: transparent;
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.mc-hud .mode-btn--logout:hover {
  background-color: rgba(239, 68, 68, 0.1);
}

/* =============================================================================
   Table Controls
   ============================================================================= */

.mc-table-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mc-table-controls-status {
  display: flex;
  align-items: center;
}

.mc-table-controls-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.mc-table-controls-closed {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--mc-text-muted);
}

.mc-table-closed-label {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mc-table-closed-time {
  font-family: var(--mc-font-mono);
  font-size: 0.6875rem;
}

/* Control button base styles */
.mc-control-btn {
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--mc-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: inherit;
  white-space: nowrap;
}

.mc-control-btn:focus-visible {
  outline: 2px solid var(--mc-accent);
  outline-offset: 2px;
}

.mc-control-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Pause button */
.mc-control-btn--pause {
  background: rgba(234, 179, 8, 0.15);
  border-color: rgba(234, 179, 8, 0.3);
  color: #eab308;
}

.mc-control-btn--pause:hover:not(:disabled) {
  background: rgba(234, 179, 8, 0.25);
  border-color: rgba(234, 179, 8, 0.4);
}

/* Resume button */
.mc-control-btn--resume {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.3);
  color: #22c55e;
}

.mc-control-btn--resume:hover:not(:disabled) {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(34, 197, 94, 0.4);
}

/* Request Summary button */
.mc-control-btn--summary {
  background: rgba(96, 165, 250, 0.15);
  border-color: rgba(96, 165, 250, 0.3);
  color: var(--mc-accent);
}

.mc-control-btn--summary:hover:not(:disabled) {
  background: rgba(96, 165, 250, 0.25);
  border-color: rgba(96, 165, 250, 0.4);
}

/* Close button */
.mc-control-btn--close {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.mc-control-btn--close:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.4);
}

/* =============================================================================
   Request Summary Patron Picker
   ============================================================================= */

.mc-summary-picker-wrapper {
  position: relative;
}

.mc-summary-picker {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 0.375rem;
  background: var(--mc-surface);
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  min-width: 200px;
  max-width: 280px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
}

.mc-summary-picker-header {
  padding: 0.5rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mc-text-muted);
  border-bottom: 1px solid var(--mc-border);
}

.mc-summary-picker-empty {
  padding: 0.75rem;
  font-size: 0.8125rem;
  color: var(--mc-text-muted);
  text-align: center;
}

.mc-summary-picker-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--mc-border);
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}

.mc-summary-picker-item:last-child {
  border-bottom: none;
}

.mc-summary-picker-item:hover {
  background: var(--mc-surface-hover);
}

.mc-summary-picker-item:focus-visible {
  outline: 2px solid var(--mc-accent);
  outline-offset: -2px;
}

.mc-summary-picker-item--default {
  background: rgba(96, 165, 250, 0.08);
}

.mc-summary-picker-item--default:hover {
  background: rgba(96, 165, 250, 0.12);
}

.mc-summary-picker-item-badge {
  font-size: 0.5625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mc-accent);
  background: rgba(96, 165, 250, 0.15);
  padding: 0.0625rem 0.375rem;
  border-radius: 999px;
  margin-left: auto;
}
