/* NeuroLynk CSS - placeholder */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-color:       #0d1117;
  --card-color:     #131c2e;
  --surface2-color: #1a2540;
  --border-color:   #1e2d45;
  --accent-color:   #0ea5e9;
  --accent2-color:  #38bdf8;
  --danger-color:   #f87171;
  --success-color:  #34d399;
  --text-color:     #f0f4f8;
  --muted-color:    #7a90a8;
  --radius:         12px;
  --shadow-color:   rgba(0,0,0,0.35);
  --card-shadow:    0 2px 16px rgba(0,0,0,0.3);
  --space-section:  32px;
  --space-block:    24px;
  --ease-out:       cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast:  0.18s;
  --duration-med:   0.3s;

  --bg: var(--bg-color);
  --surface: var(--card-color);
  --surface2: var(--surface2-color);
  --border: var(--border-color);
  --accent: var(--accent-color);
  --accent2: var(--accent2-color);
  --danger: var(--danger-color);
  --success: var(--success-color);
  --text: var(--text-color);
  --muted: var(--muted-color);
  --shadow: var(--shadow-color);
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ── Header ── */
.header {
  background: #0d1117;
  border-bottom: 2px solid var(--accent-color);
  padding: 18px 40px 14px;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  font-size: 2.2rem;
}

.logo h1 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--accent2-color);
  letter-spacing: -0.01em;
}

.logo p {
  font-size: 0.78rem;
  color: var(--muted-color);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.badge {
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.35);
  color: var(--accent2-color);
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Authors ── */
.authors-section {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--muted-color);
}

.authors-label { opacity: 0.7; }

.authors-section a {
  color: var(--muted-color);
  text-decoration: none;
  transition: color var(--duration-fast);
}

.authors-section a:hover { color: var(--accent2-color); }

.dot-separator {
  color: var(--border-color);
  font-size: 0.75rem;
}

/* ── Tab Nav ── */
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  row-gap: 10px;
  padding: 20px 20px 10px;
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 18px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--card-color);
  color: var(--muted-color);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color var(--duration-fast), background var(--duration-fast), color var(--duration-fast);
}

.tab-btn:hover {
  border-color: var(--accent-color);
  color: var(--text-color);
  background: rgba(14, 165, 233, 0.07);
}

.tab-btn:active { opacity: 0.85; }

.tab-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
  font-weight: 600;
}

.tab-btn.active:hover {
  background: var(--accent2-color);
  border-color: var(--accent2-color);
  color: #fff;
}

.tab-btn:focus-visible {
  outline: 2px solid var(--accent2-color);
  outline-offset: 2px;
}

/* ── Main ── */
.main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: var(--space-section) auto 40px;
  padding: 0 clamp(16px, 4vw, 28px);
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tabcontent { display: none; opacity: 0; }

.tabcontent.active {
  display: block;
  animation: tabFadeIn var(--duration-med) var(--ease-out) both;
}

/* ── Card ── */
.card {
  background: var(--card-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: clamp(22px, 4vw, 36px);
  box-shadow: var(--card-shadow);
}

.card-header {
  margin-bottom: clamp(18px, 3vw, 28px);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
}

.card-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.card-header p {
  color: var(--muted-color);
  font-size: 0.88rem;
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.6;
}

.card-header .card-desc { margin-top: 8px; }

/* ── Images ── */
.img-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 8px;
  background: var(--surface2-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: clamp(14px, 3vw, 22px);
  overflow: hidden;
}

.img-wrapper img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* ── Input Section ── */
.input-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 680px;
  margin: 0 auto var(--space-block);
}

.input-section label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted-color);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.input-section textarea {
  background: var(--surface2-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 0.88rem;
  font-family: 'Courier New', monospace;
  padding: 12px 14px;
  resize: vertical;
  transition: border-color 0.18s;
  line-height: 1.6;
}

.input-section textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.prediction-helper-text {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted-color);
  margin: 0 0 6px;
  max-width: 620px;
}

.prediction-tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 6px;
}

.prediction-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem; height: 1.3rem;
  padding: 0;
  border: 1px solid rgba(14, 165, 233, 0.4);
  border-radius: 50%;
  background: rgba(14, 165, 233, 0.1);
  color: var(--accent2-color);
  font-size: 0.7rem;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
  line-height: 1;
  cursor: help;
  transition: background var(--duration-fast), border-color var(--duration-fast);
}

.prediction-help-btn:hover,
.prediction-help-btn:focus-visible {
  background: rgba(14, 165, 233, 0.2);
  border-color: var(--accent2-color);
  outline: none;
}

.prediction-tooltip-bubble {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  min-width: 200px;
  max-width: min(300px, 90vw);
  padding: 10px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-color);
  background: var(--surface2-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--duration-fast), visibility var(--duration-fast);
}

.prediction-tooltip-bubble::after {
  content: "";
  position: absolute;
  top: 100%; left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: var(--border-color);
}

.prediction-tooltip-wrap:hover .prediction-tooltip-bubble,
.prediction-tooltip-wrap:focus-within .prediction-tooltip-bubble {
  visibility: visible;
  opacity: 1;
}

/* ── Prediction Fields ── */
.prediction-input-section { width: 100%; }

.prediction-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.prediction-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 200px);
  align-items: center;
  gap: 8px 16px;
}

.prediction-field-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted-color);
  font-family: 'Courier New', monospace;
  word-break: break-word;
  line-height: 1.35;
}

.input-section .prediction-field-label {
  text-transform: none;
  letter-spacing: 0.01em;
}

.prediction-field-input {
  width: 100%;
  min-width: 0;
  background: var(--surface2-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 0.92rem;
  font-family: inherit;
  padding: 0.5rem 0.8rem;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.prediction-field-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.prediction-field-input::placeholder {
  color: var(--muted-color);
  opacity: 0.7;
}

.prediction-fields-loading,
.prediction-fields-error {
  text-align: center;
  color: var(--muted-color);
  font-size: 0.88rem;
  padding: 12px 16px;
}

.prediction-fields-error { color: var(--danger-color); }

/* ── Feature Grid (Prediction tab) ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 0 auto 22px;
  max-width: 680px;
}

.feat-card {
  background: var(--surface2-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color var(--duration-fast);
}

.feat-card:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.feat-card-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.feat-tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--border-color);
  color: var(--muted-color);
  font-size: 0.62rem;
  font-style: normal;
  cursor: help;
  flex-shrink: 0;
}

.feat-card-input {
  background: var(--card-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 0.92rem;
  font-family: 'Courier New', monospace;
  padding: 7px 10px;
  width: 100%;
  transition: border-color 0.18s;
}

.feat-card-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.feat-range {
  font-size: 0.7rem;
  color: #4a6080;
  margin-top: 2px;
}

@media (max-width: 520px) {
  .feature-grid { grid-template-columns: 1fr; }
}

/* ── Predict Button ── */
.predict-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 12px 28px;
  background: var(--accent-color);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  align-self: flex-start;
}

.predict-btn:hover:not(:disabled) {
  background: var(--accent2-color);
  transform: translateY(-1px);
}

.predict-btn:active:not(:disabled) {
  transform: translateY(0);
  opacity: 0.9;
}

.predict-btn:focus-visible {
  outline: 2px solid var(--accent2-color);
  outline-offset: 3px;
}

.predict-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Spinner ── */
.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Result Card ── */
.result-card {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 680px;
  margin: 0 auto var(--space-block);
  padding: 18px 22px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  border-left-width: 4px;
  background: var(--surface2-color);
  transition: border-color var(--duration-med);
}

.result-card.parkinson {
  border-left-color: var(--danger-color);
  background: rgba(248, 113, 113, 0.05);
}

.result-card.healthy {
  border-left-color: var(--success-color);
  background: rgba(52, 211, 153, 0.05);
}

.result-icon { font-size: 2.2rem; }
.result-details { flex: 1; }

.result-label {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.result-card.parkinson .result-label { color: var(--danger-color); }
.result-card.healthy .result-label { color: var(--success-color); }

.prob-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.prob-bar-track {
  flex: 1;
  height: 7px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.prob-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.result-card.parkinson .prob-bar { background: var(--danger-color); }
.result-card.healthy .prob-bar { background: var(--success-color); }

.prob-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted-color);
  white-space: nowrap;
}

/* ── SHAP Section ── */
.shap-section {
  max-width: 680px;
  margin: 0 auto;
}

.shap-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-color);
}

.shap-desc {
  font-size: 0.8rem;
  color: var(--muted-color);
  margin-bottom: 16px;
}

.chart-wrapper {
  background: var(--surface2-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 18px;
}

.shap-img-wrapper {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

.shap-img-wrapper img {
  border-radius: 6px;
  max-width: 100%;
  border: 1px solid var(--border-color);
}

/* ── Top Features List ── */
.top-features-section {
  margin-top: var(--space-block);
  padding-top: 6px;
  text-align: left;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

.top-features-section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 12px;
}

.top-features-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.top-features-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface2-color);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-color);
  border-radius: 6px;
  padding: 9px 14px;
  font-size: 0.85rem;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}

.top-features-list li:hover {
  border-color: var(--accent-color);
  background: rgba(14, 165, 233, 0.05);
}

.feat-rank {
  font-weight: 700;
  color: var(--accent2-color);
  min-width: 26px;
  font-size: 0.82rem;
}

.feat-name {
  flex: 1;
  color: var(--text-color);
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
}

.feat-score {
  color: var(--muted-color);
  font-size: 0.78rem;
}

.top-feature-loading {
  color: var(--muted-color);
  font-style: italic;
}

/* ── Legend List ── */
.legend-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legend-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  color: var(--text-color);
}

.legend-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Feature Insights ── */
.insights-summary-highlight {
  font-size: 0.88rem;
  color: var(--muted-color);
  text-align: center;
  font-style: italic;
  margin: 4px auto 18px;
  max-width: 660px;
  line-height: 1.6;
}

.insights-footer-note {
  font-size: 0.7rem;
  color: #3a5070;
  text-align: center;
  margin-top: 24px;
  font-style: italic;
}

.wavelet-insight {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(14, 165, 233, 0.06);
  border-left: 3px solid var(--accent-color);
  padding: 16px 20px;
  margin: 24px auto 0;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-color);
  line-height: 1.6;
  max-width: 800px;
}

.wavelet-insight-icon { font-size: 1.1rem; line-height: 1.3; }
.wavelet-insight-content { flex: 1; }
.wavelet-insight strong { color: var(--accent2-color); }

.unifying-insight {
  background: rgba(14, 165, 233, 0.05);
  border-left: 3px solid var(--accent-color);
  padding: 16px 20px;
  margin: 20px auto 0;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-color);
  line-height: 1.6;
  max-width: 800px;
}

.unifying-insight strong { color: var(--accent2-color); }

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  margin-top: 8px;
  align-items: stretch;
}

.insights-loading {
  color: var(--muted-color);
  font-style: italic;
  text-align: center;
  padding: 20px;
}

.insight-card {
  background: var(--surface2-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--duration-fast);
}

.insight-card:hover {
  border-color: var(--accent-color);
}

.insight-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.insight-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-color);
  line-height: 1.35;
}

.insight-feature-id {
  font-size: 0.68rem;
  font-family: 'Courier New', monospace;
  color: var(--muted-color);
  margin-top: -8px;
}

.insight-trend {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

.trend-high {
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.trend-low {
  background: rgba(52, 211, 153, 0.1);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.insight-means {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  background: rgba(13, 17, 23, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
}

.insight-mean {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
}

.mean-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted-color);
  font-weight: 600;
}

.parkinson-mean .mean-value {
  color: #fc8181;
  font-weight: 800;
  font-size: 1rem;
  font-family: 'Courier New', monospace;
}

.healthy-mean .mean-value {
  color: #68d391;
  font-weight: 800;
  font-size: 1rem;
  font-family: 'Courier New', monospace;
}

.insight-diff {
  font-size: 0.72rem;
  color: var(--muted-color);
  text-align: center;
  flex-shrink: 0;
  font-family: 'Courier New', monospace;
}

.insight-reason {
  font-size: 0.82rem;
  color: var(--muted-color);
  line-height: 1.65;
  margin: 0;
  flex: 1;
}

/* ── Model Comparison Table ── */
.table-wrapper {
  overflow-x: auto;
  margin-top: 12px;
  margin-bottom: var(--space-block);
  -webkit-overflow-scrolling: touch;
}

.comparison-table-panel {
  background: var(--surface2-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 6px 10px 10px;
}

.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  font-size: 0.95rem;
  font-weight: 500;
}

.comparison-table thead tr { box-shadow: none; }

.comparison-table th {
  padding: 12px 14px 10px;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent2-color);
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  vertical-align: bottom;
}

.comparison-table .th-model { text-align: left; }
.comparison-table .th-metric { text-align: center; }

.comparison-table tbody td {
  padding: 13px 16px;
  color: var(--text-color);
  font-variant-numeric: tabular-nums;
  background: rgba(13, 17, 23, 0.4);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.comparison-table tbody td:first-child {
  border-left: 1px solid var(--border-color);
  border-radius: 8px 0 0 8px;
}

.comparison-table tbody td:last-child {
  border-right: 1px solid var(--border-color);
  border-radius: 0 8px 8px 0;
}

.comparison-table tbody td:not(:first-child) {
  border-left: 1px solid rgba(30, 45, 69, 0.5);
}

.comparison-table tbody td.col-metric { text-align: center; }

.comparison-table tbody tr:hover td {
  background: rgba(14, 165, 233, 0.07);
  border-color: rgba(14, 165, 233, 0.25);
}

.comparison-table .col-model {
  text-align: left;
  font-weight: 500;
}

.comparison-table .col-model .model-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  color: #fbbf24;
  font-size: 0.95rem;
  line-height: 1;
  vertical-align: middle;
}

.comparison-table .model-name { font-weight: 500; }

.row-selected td {
  background: rgba(14, 165, 233, 0.08) !important;
  border-color: rgba(14, 165, 233, 0.3) !important;
}

.row-selected:hover td {
  background: rgba(14, 165, 233, 0.13) !important;
}

.row-selected .col-model {
  box-shadow: inset 3px 0 0 var(--accent-color);
}

.cell-best-roc {
  color: #6ee7b7 !important;
  font-weight: 600;
  background: rgba(52, 211, 153, 0.1) !important;
  border-color: rgba(52, 211, 153, 0.3) !important;
}

.cell-best-f1 {
  color: #7dd3fc !important;
  font-weight: 600;
  background: rgba(14, 165, 233, 0.1) !important;
  border-color: rgba(14, 165, 233, 0.3) !important;
}

.table-loading {
  text-align: center;
  color: var(--muted-color);
  font-style: italic;
  padding: 22px 16px;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
}

.table-error {
  text-align: center;
  color: var(--danger-color);
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 20px 16px;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
}

.comparison-note {
  margin-top: 8px;
  padding: 12px 16px;
  background: rgba(52, 211, 153, 0.07);
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 6px;
  font-size: 0.86rem;
  color: var(--text-color);
  line-height: 1.6;
}

.model-selection-insight {
  margin-top: clamp(18px, 3vw, 24px);
  padding: 18px 20px 20px;
  background: rgba(14, 165, 233, 0.06);
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-left: 3px solid var(--accent-color);
  border-radius: 8px;
}

.model-selection-insight-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent2-color);
  margin: 0 0 12px;
}

.model-selection-insight-body p {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-color);
  margin: 0 0 10px;
}

.model-selection-insight-body p:last-child { margin-bottom: 0; }

/* ── Drift Monitor ── */
.drift-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--surface2-color);
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.drift-banner--loading {
  border-color: var(--border-color);
  background: var(--surface2-color);
}

.drift-note {
  padding: 10px 16px;
  background: rgba(14, 165, 233, 0.07);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 6px;
  font-size: 0.84rem;
  color: var(--text-color);
  margin-bottom: 18px;
}

.drift-filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--surface2-color);
  color: var(--muted-color);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--duration-fast), color var(--duration-fast), background var(--duration-fast);
}

.drift-filter-btn:hover {
  border-color: var(--accent-color);
  color: var(--text-color);
}

.drift-filter-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}

.drift-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.drift-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent2-color);
  border-bottom: 1px solid var(--border-color);
}

.drift-table td {
  padding: 9px 14px;
  color: var(--text-color);
  border-bottom: 1px solid rgba(30, 45, 69, 0.5);
  font-variant-numeric: tabular-nums;
}

.drift-table tr:hover td {
  background: rgba(14, 165, 233, 0.04);
}

.dt-row-drifted td { color: #fca5a5; }

.dt-col-feature { min-width: 180px; }
.dt-col-pval, .dt-col-ks { text-align: right; min-width: 90px; }
.dt-col-status { min-width: 120px; }

.dt-feat-name {
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
}

.drift-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.drift-badge--drifted {
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.drift-badge--stable {
  background: rgba(52, 211, 153, 0.1);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.drift-badge--important {
  background: rgba(251, 191, 36, 0.1);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.25);
  margin-right: 4px;
}

.drift-gauge-bar {
  background: var(--accent-color);
  height: 100%;
  border-radius: 4px;
  transition: width 0.7s ease;
}

.drift-error {
  padding: 14px 18px;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: 6px;
  color: var(--danger-color);
  font-size: 0.88rem;
}

.inline-code {
  font-family: 'Courier New', monospace;
  font-size: 0.82em;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--accent2-color);
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: clamp(18px, 4vw, 24px) 20px;
  font-size: 0.76rem;
  color: var(--muted-color);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.footer-disclaimer {
  margin-top: 5px;
  font-size: 0.7rem;
  color: #5d7599;
}

.footer a {
  color: var(--accent2-color);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--duration-fast);
}

.footer a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .header-inner { gap: 10px; }
  .logo h1 { font-size: 1.2rem; }
  .tab-nav { padding-left: 12px; padding-right: 12px; }
  .tab-btn { padding: 8px 14px; font-size: 0.82rem; }
}

@media (max-width: 640px) {
  :root {
    --space-section: 20px;
    --space-block: 18px;
  }

  .header { padding: 12px 16px; }
  .header-inner { flex-wrap: wrap; }
  .badge { display: none; }
  .logo-icon { font-size: 1.9rem; }
  .logo h1 { font-size: 1.1rem; }
  .logo p { font-size: 0.7rem; }

  .tab-nav {
    justify-content: center;
    gap: 7px;
    row-gap: 8px;
    padding-top: 14px;
  }

  .tab-btn {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
    max-width: calc(50% - 4px);
    padding: 8px 10px;
    font-size: 0.76rem;
  }

  .tab-btn span { display: none; }

  .main { margin-top: 18px; margin-bottom: 24px; }
  .card { padding: 18px 14px; }
  .card-header h2 { font-size: 1.15rem; }
  .img-wrapper { padding: 10px; }

  .comparison-table-panel { padding: 4px 6px 8px; }
  .comparison-table { font-size: 0.88rem; border-spacing: 0 6px; }
  .comparison-table th,
  .comparison-table td { padding: 10px 8px; font-size: 0.86rem; }

  .model-selection-insight { padding: 14px 12px 16px; }
  .model-selection-insight-title { font-size: 0.95rem; }
  .model-selection-insight-body p { font-size: 0.85rem; }

  .predict-btn { width: 100%; align-self: stretch; }
  .input-section { max-width: 100%; }

  .prediction-field-row {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 5px;
  }

  .result-card { flex-direction: column; align-items: flex-start; gap: 12px; }
  .result-icon { font-size: 1.8rem; }

  .insights-grid { grid-template-columns: 1fr; }

  .drift-banner { flex-direction: column; align-items: flex-start; }
}

/* ══════════════════════════════════════════════════════
   NEW COMPONENTS — NeuroLynk AI Redesign
   ══════════════════════════════════════════════════════ */

/* ── Logo mark ── */
.logo-mark {
  width: 42px; height: 42px;
  background: var(--accent-color);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 800; color: #fff;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.logo-ai {
  color: var(--accent2-color);
  font-weight: 800;
}

/* ── Header badges ── */
.header-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hbadge {
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hbadge--fhir {
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.3);
  color: var(--accent2-color);
}

.hbadge--shap {
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.25);
  color: #6ee7b7;
}

.hbadge--live {
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.25);
  color: #6ee7b7;
  animation: pulse-live 2s ease-in-out infinite;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ── Hero statement ── */
.hero-statement {
  text-align: center;
  padding: 20px 24px 8px;
  margin-bottom: 20px;
}

.hero-statement p {
  font-size: 1rem;
  color: var(--muted-color);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.65;
  font-style: italic;
}

/* ── Section label ── */
.section-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent2-color);
  margin-bottom: 12px;
}

/* ── Confidence badge ── */
.confidence-badge {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Status badges ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-badge--ok {
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #6ee7b7;
}

.status-badge--warn {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fcd34d;
}

.status-badge--danger {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fca5a5;
}

/* ── Pipeline visualization ── */
.pipeline-card {
  background: var(--card-color);
  border: 1px solid var(--border-color);
  border-top: 2px solid var(--accent-color);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.pipeline-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-color);
  margin-bottom: 16px;
}

.pipeline-steps {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  justify-content: space-between;
  overflow-x: auto;
  padding-bottom: 8px;
}

.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
  background: var(--surface2-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  min-width: 110px;
  text-align: center;
  transition: border-color var(--duration-fast), background var(--duration-fast);
  position: relative;
}

.pipeline-step.active {
  border-color: var(--accent-color);
  background: rgba(14, 165, 233, 0.08);
}

.pipeline-step.done {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.05);
}

.pipeline-step-icon { font-size: 1.4rem; line-height: 1; }

.pipeline-step-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-color);
  line-height: 1.2;
}

.pipeline-step-sub {
  font-size: 0.65rem;
  color: var(--muted-color);
  line-height: 1.2;
}

.pipeline-arrow {
  color: var(--muted-color);
  font-size: 1.1rem;
  flex-shrink: 0;
  opacity: 0.5;
}

@media (max-width: 700px) {
  .pipeline-steps { gap: 6px; }
  .pipeline-step { min-width: 80px; padding: 10px 10px; }
  .pipeline-step-name { font-size: 0.7rem; }
  .pipeline-arrow { font-size: 0.9rem; }
}

/* ── Agent run section ── */
.agent-run-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 28px;
}

.agent-run-btn {
  font-size: 1rem;
  padding: 13px 32px;
  gap: 10px;
}

.agent-run-hint {
  font-size: 0.78rem;
  color: var(--muted-color);
  margin: 0;
}

/* ── Agent results layout ── */
.agent-results {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.agent-result-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: stretch;
}

@media (max-width: 640px) {
  .agent-result-row { grid-template-columns: 1fr; }
}

.agent-result-main {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  border-left-width: 4px;
  background: var(--surface2-color);
}

.agent-result-main.parkinson {
  border-left-color: var(--danger-color);
  background: rgba(248, 113, 113, 0.05);
}

.agent-result-main.healthy {
  border-left-color: var(--success-color);
  background: rgba(52, 211, 153, 0.05);
}

.agent-result-icon { font-size: 2.4rem; flex-shrink: 0; }

.agent-result-label {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.agent-result-main.parkinson .agent-result-label { color: var(--danger-color); }
.agent-result-main.healthy .agent-result-label { color: var(--success-color); }

.agent-meta-card {
  background: var(--surface2-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 200px;
}

.agent-meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.agent-meta-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-color);
  white-space: nowrap;
}

.agent-meta-value {
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  color: var(--accent2-color);
  text-align: right;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-left: 10px;
}

/* ── Agent sections ── */
.agent-section {
  background: var(--surface2-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px 22px;
}

.agent-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.agent-section-icon { font-size: 1.1rem; }

.agent-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-color);
  flex: 1;
}

.agent-section-sub {
  font-size: 0.72rem;
  color: var(--muted-color);
}

/* ── Clinical bullets ── */
.clinical-bullets {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.clinical-bullet {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(13, 17, 23, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-color);
}

.clinical-bullet-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.clinical-bullet-text { flex: 1; }

.clinical-bullet-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-color);
  display: block;
  margin-bottom: 2px;
}

.clinical-bullet--risk .clinical-bullet-label { color: var(--danger-color); }
.clinical-bullet--confidence .clinical-bullet-label { color: var(--accent2-color); }
.clinical-bullet--finding .clinical-bullet-label { color: #fcd34d; }
.clinical-bullet--recommendation .clinical-bullet-label { color: var(--success-color); }
.clinical-bullet--disclaimer .clinical-bullet-label { color: var(--muted-color); }

.clinical-bullet--disclaimer {
  background: transparent;
  border-color: transparent;
  padding: 6px 14px;
}

.clinical-bullet--disclaimer .clinical-bullet-text {
  font-size: 0.78rem;
  color: var(--muted-color);
  font-style: italic;
}

/* ── FHIR section ── */
.fhir-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: rgba(14, 165, 233, 0.05);
  border: 1px solid rgba(14, 165, 233, 0.15);
  border-radius: 8px;
}

.fhir-meta-item {
  font-size: 0.78rem;
  color: var(--muted-color);
}

.fhir-meta-item strong {
  color: var(--accent2-color);
  font-weight: 600;
}

.fhir-details {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.fhir-summary {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted-color);
  background: rgba(13, 17, 23, 0.4);
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color var(--duration-fast), background var(--duration-fast);
}

.fhir-summary:hover {
  color: var(--text-color);
  background: rgba(14, 165, 233, 0.06);
}

.fhir-summary::before {
  content: "▶";
  font-size: 0.6rem;
  transition: transform var(--duration-fast);
}

details[open] .fhir-summary::before {
  transform: rotate(90deg);
}

.fhir-pre {
  background: #080d14;
  padding: 16px;
  overflow-x: auto;
  font-size: 0.76rem;
  color: #7dd3fc;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  border-top: 1px solid var(--border-color);
  max-height: 400px;
  overflow-y: auto;
}

/* ── Footer link ── */
.footer a {
  color: var(--muted-color);
  text-decoration: none;
  transition: color var(--duration-fast);
}

.footer a:hover { color: var(--accent2-color); }
