/* Hero terminal and API-sample rules, moved verbatim from css/riskernel.css (lines 18 to 164, 991 to 1012, 1120 to 1123)
   for site v2 (SPEC 8.1). Do not restyle: css/live-score.css and js/live-score.js build on these. */

/* Terminal / API response block */
.rk-terminal {
  background: #0F172A;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 100%;
}

.rk-terminal-header {
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rk-terminal-dots {
  display: flex;
  gap: 6px;
}

.rk-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.rk-dot-red { background: #EF4444; }
.rk-dot-yellow { background: #F59E0B; }
.rk-dot-green { background: #10B981; }

.rk-terminal-title {
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.75rem;
  color: #94A3B8;
}

.rk-code {
  padding: 20px;
  margin: 0;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.8rem;
  line-height: 1.7;
  color: #E2E8F0;
  overflow-x: auto;
  white-space: pre;
}

.rk-key { color: #93C5FD; }
.rk-str { color: #86EFAC; }
.rk-num { color: #FCD34D; }
.rk-danger { color: #FCA5A5; }
.rk-kw { color: #C4B5FD; }
.rk-cmt { color: #94A3B8; }

.rk-score-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 20px;
}

.rk-score-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981 0%, #F59E0B 50%, #EF4444 100%);
  border-radius: 2px;
  transition: width 1s ease;
}

.rk-score-labels {
  display: flex;
  justify-content: space-between;
  padding: 8px 20px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.rk-score-low { color: #10B981; }
.rk-score-med { color: #F59E0B; }
.rk-score-high { color: #EF4444; }

/* Code tabs */
.rk-code-tabs {
  display: flex;
  gap: 0;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rk-tab {
  padding: 10px 20px;
  background: none;
  border: none;
  color: #94A3B8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.rk-tab.active {
  color: #60A5FA;
  border-bottom-color: #3B82F6;
  background: rgba(59, 130, 246, 0.1);
}

.rk-tab:hover { color: #FFFFFF; }

/* SHAP explanation bars */
.rk-explanations {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 1.5rem;
}

.rk-explanation-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow: hidden;
}

.rk-explanation-bar {
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 3px solid #3B82F6;
}

.rk-explanation-label {
  font-size: 0.875rem;
  font-weight: 600;
}

.rk-explanation-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  opacity: 0.7;
}


@media screen and (max-width: 767px) {
  .rk-terminal {
    margin-top: 0.25rem;
  }

  .rk-terminal-header {
    padding: 10px 14px;
  }

  .rk-code {
    padding: 16px;
    font-size: 0.72rem;
    line-height: 1.55;
  }

  .rk-score-bar {
    margin-left: 16px;
    margin-right: 16px;
  }

  .rk-score-labels {
    padding: 8px 16px 14px;
  }
}

@media screen and (max-width: 479px) {
  .rk-code {
    font-size: 0.68rem;
    line-height: 1.5;
  }
}
