/* ============================================================
   Clawpathy -- Custom Styles
   Black & Red theme, clean, elegant, modern.
   ============================================================ */

/* ---- Scrollbars ---- */
.custom-scrollbar::-webkit-scrollbar {
  width: 5px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(239, 68, 68, 0.15);
  border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(239, 68, 68, 0.35);
}

/* ---- Animations ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse-dot {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.animate-fade-up {
  animation: fadeUp 0.5s ease-out both;
}
.animate-fade-up-delay {
  animation: fadeUp 0.5s ease-out 0.15s both;
}
.animate-fade-in {
  animation: fadeIn 0.3s ease-out both;
}

/* ---- Glass panels ---- */
.input-glass {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
}

/* ---- Quick action chips ---- */
.chip-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #9CA3AF;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
  cursor: pointer;
}
.chip-btn:hover {
  color: #E5E7EB;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(239, 68, 68, 0.25);
  transform: translateY(-1px);
}

/* ---- Chat messages ---- */
.msg-user {
  animation: fadeUp 0.25s ease-out both;
}
.msg-assistant {
  animation: fadeUp 0.3s ease-out both;
}

/* ---- Typing indicator ---- */
.typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
}
.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #EF4444;
}
.typing-dots span:nth-child(1) { animation: pulse-dot 1.2s ease-in-out 0s infinite; }
.typing-dots span:nth-child(2) { animation: pulse-dot 1.2s ease-in-out 0.2s infinite; }
.typing-dots span:nth-child(3) { animation: pulse-dot 1.2s ease-in-out 0.4s infinite; }

/* ---- Status pill ---- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #9CA3AF;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.12);
  animation: fadeIn 0.2s ease-out both;
}
.status-pill .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #EF4444;
  animation: pulse-dot 1.2s ease-in-out infinite;
}

/* ---- Thinking stream panel ---- */
.thinking-panel {
  background: #0A0A0A;
  border: 1px solid #1A1A1A;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 0.25rem;
  transition: border-color 0.3s ease;
}
.thinking-panel:hover {
  border-color: #222;
}
.thinking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}
.thinking-header:hover {
  background: rgba(255, 255, 255, 0.015);
}
.thinking-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  overflow: hidden;
}
.thinking-current-text {
  font-size: 0.75rem;
  font-family: "JetBrains Mono", monospace;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s ease;
}
.thinking-current-text.thinking-finalized {
  color: #555;
}
.thinking-chevron {
  font-size: 1rem;
  color: #444;
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}
.thinking-header:hover .thinking-chevron {
  color: #888;
}

/* Live pulsing dot */
.thinking-dot-live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #EF4444;
  flex-shrink: 0;
  animation: pulse-dot 1.2s ease-in-out infinite;
}
/* Completed checkmark dot */
.thinking-dot-done {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34D399;
  flex-shrink: 0;
}
/* Error dot */
.thinking-dot-error {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #EF4444;
  flex-shrink: 0;
}

/* Collapsible body */
.thinking-body {
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border-top: 1px solid #141414;
  padding: 0.25rem 0;
}
.thinking-body:empty {
  border-top: none;
  padding: 0;
  max-height: 0;
}

/* Individual step */
.thinking-step {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  padding: 0.25rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.015);
}
.thinking-step:last-child {
  border-bottom: none;
}
.thinking-time {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.625rem;
  color: #333;
  flex-shrink: 0;
  min-width: 3rem;
  text-align: right;
}
.thinking-text {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6875rem;
  color: #555;
  line-height: 1.6;
}
.thinking-step:last-child .thinking-text {
  color: #888;
}

/* ---- Markdown rendering in messages ---- */
.msg-content {
  line-height: 1.7;
  font-size: 0.9375rem;
}
.msg-content p {
  margin-bottom: 0.75rem;
}

/* ============================================================
   Auth overlay (multi-user)
   ============================================================ */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.auth-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(900px 600px at 50% 10%, rgba(239,68,68,0.14), transparent 55%),
              rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
}
.auth-window {
  position: relative;
  width: min(720px, 100%);
  border: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(180deg, rgba(12,12,12,0.94), rgba(6,6,6,0.94));
  border-radius: 16px;
  box-shadow: 0 20px 80px rgba(0,0,0,0.6);
  overflow: hidden;
}
.auth-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.auth-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem 0;
}
.auth-tab {
  flex: 1;
  padding: 0.65rem 0.9rem;
  border-radius: 9999px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  color: #9CA3AF;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all 0.15s ease;
}
.auth-tab:hover {
  border-color: rgba(239,68,68,0.25);
  color: #E5E7EB;
}
.auth-tab-active {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.25);
  color: #fff;
}
.auth-panel {
  padding: 1.25rem;
}
.auth-section {
  padding: 1rem 0;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.auth-section:first-child {
  border-top: none;
  padding-top: 0;
}
.auth-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
.auth-label {
  display: block;
  font-size: 0.75rem;
  color: #6B7280;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.auth-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  color: #E5E7EB;
  padding: 0.75rem 0.9rem;
  outline: none;
  font-size: 0.9rem;
}
.auth-input:focus {
  border-color: rgba(239,68,68,0.28);
  box-shadow: 0 0 0 4px rgba(239,68,68,0.08);
}
.auth-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.15s ease;
  cursor: pointer;
  text-decoration: none;
}
.auth-btn-primary {
  background: linear-gradient(135deg, rgba(239,68,68,0.95), rgba(185,28,28,0.95));
  border-color: rgba(239,68,68,0.4);
  color: #fff;
  box-shadow: 0 10px 30px rgba(239,68,68,0.12);
}
.auth-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 40px rgba(239,68,68,0.18);
}
.auth-btn-secondary {
  background: rgba(255,255,255,0.03);
  color: #D1D5DB;
}
.auth-btn-secondary:hover {
  border-color: rgba(239,68,68,0.25);
  background: rgba(255,255,255,0.05);
}
.auth-error {
  margin-top: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(239,68,68,0.25);
  background: rgba(239,68,68,0.07);
  color: #FCA5A5;
  font-size: 0.8rem;
  line-height: 1.5;
}
.auth-kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
}
.auth-k {
  color: #6B7280;
  font-size: 0.75rem;
  font-weight: 700;
}
.auth-v {
  color: #D1D5DB;
  font-size: 0.8rem;
}
.auth-template {
  margin-top: 0.75rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  color: #9CA3AF;
  font-size: 0.85rem;
  white-space: pre-wrap;
}
.auth-callout {
  padding: 0.9rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}
.auth-api-key {
  margin-top: 0.5rem;
  color: #fff;
  font-size: 0.9rem;
  word-break: break-all;
}
.msg-content p:last-child {
  margin-bottom: 0;
}
.msg-content h1, .msg-content h2, .msg-content h3 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  color: white;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}
.msg-content h1 { font-size: 1.375rem; }
.msg-content h2 { font-size: 1.125rem; }
.msg-content h3 { font-size: 1rem; }

.msg-content strong {
  color: #E5E7EB;
  font-weight: 600;
}
.msg-content code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8125rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.12);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  color: #FCA5A5;
}
.msg-content pre {
  background: #0A0A0A;
  border: 1px solid #1F1F1F;
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  margin: 0.75rem 0;
}
.msg-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: #D1D5DB;
  font-size: 0.8125rem;
}

.msg-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.8125rem;
}
.msg-content thead th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #2A2A2A;
  color: #9CA3AF;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.msg-content tbody td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #141414;
  color: #D1D5DB;
}
.msg-content tbody tr:hover td {
  background: rgba(239, 68, 68, 0.03);
}

.msg-content ul, .msg-content ol {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}
.msg-content li {
  margin-bottom: 0.25rem;
}

.msg-content blockquote {
  border-left: 3px solid #EF4444;
  padding-left: 1rem;
  margin: 0.75rem 0;
  color: #9CA3AF;
}
.msg-content a {
  color: #FCA5A5;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.msg-content hr {
  border-color: #1F1F1F;
  margin: 1rem 0;
}

/* ---- Dataset cards (detail view) ---- */
.dataset-card {
  background: #0E0E0E;
  border: 1px solid #1F1F1F;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  transition: all 0.2s ease;
  cursor: default;
}
.dataset-card:hover {
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.04);
}

/* ---- Recommendation table ---- */
.rec-container {
  border: 1px solid #1A1A1A;
  border-radius: 10px;
  overflow: hidden;
  background: #090909;
}
.rec-header {
  padding: 0.875rem 1.25rem 0.5rem;
  border-bottom: 1px solid #141414;
}
.rec-table {
  width: 100%;
}
.rec-row {
  display: grid;
  grid-template-columns: 36px 1fr 1.4fr 52px 74px 56px 72px;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid #111;
  transition: background 0.15s ease;
}
.rec-row-header {
  background: #0C0C0C;
}
.rec-row-header .rec-cell {
  font-size: 0.625rem;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.625rem 0.75rem;
  font-family: "Space Grotesk", sans-serif;
}
.rec-row-data {
  cursor: pointer;
}
.rec-row-data:hover {
  background: rgba(239, 68, 68, 0.03);
}
.rec-row-data:active {
  background: rgba(239, 68, 68, 0.06);
}
.rec-cell {
  padding: 0.75rem 0.75rem;
  font-size: 0.8125rem;
  color: #9CA3AF;
  min-width: 0;
}
.rec-rank {
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: #555;
}
.rec-name-main {
  font-weight: 500;
  color: #E5E7EB;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.8125rem;
}
.rec-name-meta {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  color: #555;
}
.rec-reason {
  font-size: 0.75rem;
  line-height: 1.5;
  color: #777;
}
.rec-score {
  text-align: center;
}
.rec-method {
  text-align: center;
}
.rec-overlap {
  text-align: center;
}

/* Pretraining overlap risk badge */
.overlap-badge {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}
.overlap-low {
  color: #34D399;
  background: rgba(52, 211, 153, 0.08);
  border-color: rgba(52, 211, 153, 0.18);
}
.overlap-med {
  color: #FBBF24;
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.18);
}
.overlap-high {
  color: #EF4444;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.18);
}
.overlap-unknown {
  color: #6B7280;
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}

/* Score badges */
.score-badge {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}
.score-high {
  color: #34D399;
  background: rgba(52, 211, 153, 0.08);
}
.score-mid {
  color: #FBBF24;
  background: rgba(251, 191, 36, 0.08);
}
.score-low {
  color: #9CA3AF;
  background: rgba(156, 163, 175, 0.06);
}

/* Method tag */
.method-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.625rem;
  font-weight: 600;
  color: #EF4444;
  background: rgba(239, 68, 68, 0.08);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

/* Credibility / type badges */
.cred-badge, .type-badge {
  display: inline-block;
  font-size: 0.5625rem;
  font-weight: 600;
  padding: 0.0625rem 0.375rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cred-high {
  color: #34D399;
  background: rgba(52, 211, 153, 0.1);
}
.cred-mid {
  color: #60A5FA;
  background: rgba(96, 165, 250, 0.08);
}
.type-real {
  color: #34D399;
  background: rgba(52, 211, 153, 0.08);
}
.type-synth {
  color: #FBBF24;
  background: rgba(251, 191, 36, 0.06);
}
.type-mixed {
  color: #60A5FA;
  background: rgba(96, 165, 250, 0.06);
}

/* Use button */
.use-btn {
  font-size: 0.6875rem;
  font-weight: 500;
  color: #EF4444;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  padding: 0.3125rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.use-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.4);
  color: #F87171;
}

/* Search deeper */
.search-deeper-btn {
  font-size: 0.75rem;
  color: #555;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.search-deeper-btn:hover {
  color: #EF4444;
}

/* Rec footer */
.rec-footer {
  padding: 0.625rem 1.25rem;
  border-top: 1px solid #141414;
}

/* Responsive: stack on small screens */
@media (max-width: 768px) {
  .rec-row {
    grid-template-columns: 28px 1fr 52px;
    gap: 0;
  }
  .rec-reason, .rec-overlap, .rec-method, .rec-action {
    display: none;
  }
}

/* ---- Training progress ---- */
.progress-bar-bg {
  background: #1A1A1A;
  border-radius: 999px;
  overflow: hidden;
  height: 6px;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #EF4444, #DC2626);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
  transition: width 0.5s ease;
}

/* ---- Metric card ---- */
.metric-card {
  background: #0A0A0A;
  border: 1px solid #1F1F1F;
  border-radius: 8px;
  padding: 0.75rem;
}

/* ---- Training Phase Indicator ---- */
.phase-track {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0.75rem 0;
  width: 100%;
}
.phase-step {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 1;
  min-width: 0;
}
.phase-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2A2A2A;
  border: 1.5px solid #333;
  transition: all 0.3s ease;
  flex-shrink: 0;
}
.phase-dot.active {
  background: #EF4444;
  border-color: #EF4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
  animation: breathe 1.5s ease-in-out infinite;
}
.phase-dot.completed {
  background: #34D399;
  border-color: #34D399;
}
.phase-dot.error {
  background: #EF4444;
  border-color: #EF4444;
}
.phase-label {
  font-size: 8px;
  color: #444;
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: color 0.3s ease;
  white-space: nowrap;
}
.phase-label.active {
  color: #EF4444;
}
.phase-label.completed {
  color: #34D399;
}
.phase-connector {
  flex: 1 1 6px;
  min-width: 4px;
  max-width: 14px;
  height: 1px;
  background: #2A2A2A;
  margin: 0 1px;
}
.phase-connector.completed {
  background: #34D399;
}

/* ---- Loss sparkline ---- */
.loss-display {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #0A0A0A;
  border: 1px solid #1F1F1F;
  border-radius: 8px;
  margin-top: 0.5rem;
}
.loss-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
  line-height: 1;
}
.loss-label {
  font-size: 0.625rem;
  color: #555;
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
}
.loss-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 24px;
  flex: 1;
}
.loss-sparkline-bar {
  flex: 1;
  min-width: 2px;
  max-width: 4px;
  background: #EF4444;
  border-radius: 1px 1px 0 0;
  opacity: 0.6;
  transition: height 0.3s ease;
}

/* ---- Eval results table ---- */
.eval-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
}
.eval-table th {
  text-align: left;
  padding: 0.375rem 0.5rem;
  border-bottom: 1px solid #2A2A2A;
  color: #666;
  font-weight: 600;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: "Space Grotesk", sans-serif;
}
.eval-table td {
  padding: 0.375rem 0.5rem;
  border-bottom: 1px solid #141414;
  font-size: 0.75rem;
  color: #9CA3AF;
  font-family: "JetBrains Mono", monospace;
}
.eval-table .eval-correct {
  color: #34D399;
}
.eval-table .eval-wrong {
  color: #EF4444;
}

/* ---- Eval card in chat ---- */
.eval-card {
  background: #0A0A0A;
  border: 1px solid #1F1F1F;
  border-radius: 10px;
  padding: 1rem;
  margin-top: 0.75rem;
}
.eval-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.eval-metric-big {
  font-family: "JetBrains Mono", monospace;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}
.eval-metric-big.good {
  color: #34D399;
}
.eval-metric-big.ok {
  color: #FBBF24;
}
.eval-metric-big.bad {
  color: #EF4444;
}

/* ---- Push result ---- */
.push-result {
  background: #0A0A0A;
  border: 1px solid #1F1F1F;
  border-radius: 10px;
  padding: 1rem;
  margin-top: 0.75rem;
}
.push-result a {
  color: #FCA5A5;
  text-decoration: underline;
}

/* ---- Action buttons inside chat ---- */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
}
.action-btn-primary {
  background: #EF4444;
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}
.action-btn-primary:hover {
  background: #DC2626;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}
.action-btn-secondary {
  background: transparent;
  color: #9CA3AF;
  border: 1px solid #2A2A2A;
}
.action-btn-secondary:hover {
  color: #E5E7EB;
  border-color: #3A3A3A;
  background: rgba(255, 255, 255, 0.03);
}

/* ---- Training action bar (after completion) ---- */
.training-actions {
  display: flex;
  gap: 0.375rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.training-actions .action-btn {
  font-size: 0.6875rem;
  padding: 0.375rem 0.75rem;
  flex: 1;
  justify-content: center;
  min-width: 0;
}

/* ---- Shimmer loading ---- */
.shimmer {
  background: linear-gradient(90deg, #1A1A1A 25%, #222 50%, #1A1A1A 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

/* ---- Sidebar responsive ---- */
@media (max-width: 1023px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    z-index: 50;
  }
  .sidebar.open {
    transform: translateX(0);
  }
}

/* ---- Gradient text ---- */
.gradient-text {
  background: linear-gradient(135deg, #EF4444, #F87171);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Inference result box ---- */
.inference-box {
  background: #0A0A0A;
  border: 1px solid #1F1F1F;
  border-radius: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8125rem;
  color: #D1D5DB;
  padding: 1rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---- Tag ---- */
.tag {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-family: "JetBrains Mono", monospace;
  color: #6B7280;
  background: #141414;
}

/* ---- ETA Timer ---- */
.eta-timer {
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
  color: #EF4444;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Agent Skill Callout + Modal
   ============================================================ */

.agent-callout {
  border-radius: 14px;
  border: 1px solid rgba(239, 68, 68, 0.18);
  background:
    radial-gradient(1200px 220px at 10% 0%, rgba(239, 68, 68, 0.18), transparent 60%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012));
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.06);
}
.agent-callout-inner {
  padding: 1.125rem 1.25rem;
}
.agent-callout-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}
.agent-callout-text {
  margin-top: 0.375rem;
  font-size: 0.875rem;
  color: #9CA3AF;
  line-height: 1.55;
}
.agent-callout-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.875rem;
}

/* Modal overlay */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
}
.modal-window {
  position: relative;
  width: min(980px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background:
    radial-gradient(900px 240px at 12% 0%, rgba(239, 68, 68, 0.12), transparent 55%),
    #0A0A0A;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.modal-close {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #6B7280;
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.03);
  color: #E5E7EB;
}
.modal-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.01);
}
.modal-body {
  padding: 0.75rem 1rem 1rem;
  overflow: hidden;
  flex: 1;
}
.skill-pre {
  height: 100%;
  max-height: calc(86vh - 170px);
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.55);
  padding: 1rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  line-height: 1.6;
  color: #D1D5DB;
  white-space: pre;
  word-break: break-word;
}
.modal-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.01);
}

@media (max-width: 640px) {
  .skill-pre {
    font-size: 0.7rem;
  }
  .modal-actions {
    flex-wrap: wrap;
  }
}
