:root {
  --bg: #00030a;
  --surface: rgba(10, 15, 30, 0.6);
  --surface2: rgba(15, 20, 45, 0.7);
  --surface3: rgba(20, 30, 60, 0.8);
  --border: rgba(150, 200, 255, 0.08);
  --border-strong: rgba(150, 200, 255, 0.15);
  --accent: #3b82f6;
  --accent-light: rgba(59, 130, 246, 0.15);
  --accent-glow: rgba(59, 130, 246, 0.4);
  --green: #10b981;
  --green-light: rgba(16, 185, 129, 0.15);
  --amber: #f59e0b;
  --amber-light: rgba(245, 158, 11, 0.15);
  --red: #ef4444;
  --red-light: rgba(239, 68, 68, 0.15);
  --purple: #8b5cf6;
  --purple-light: rgba(139, 92, 246, 0.15);
  --text: #fdfcff;
  --text-secondary: #94a3b8;
  --muted: #64748b;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 14px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, sans-serif;
  letter-spacing: -0.015em;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.app-shell::before {
  content: "";
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 1200px;
  height: 800px;
  background: radial-gradient(ellipse at top center, rgba(59, 130, 246, 0.12) 0%, rgba(14, 165, 233, 0.06) 40%, transparent 70%);
  pointer-events: none;
  z-index: -1;
  filter: blur(40px);
}

.topbar {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}

.brand-wordmark,
.hero-title,
.results-header h2,
.explainability-section h3,
.consensus-card strong {
  font-family: "Inter", -apple-system, sans-serif;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.brand-wordmark {
  font-size: 22px;
  color: var(--text);
}

.brand-wordmark span,
.hero-title span {
  color: var(--accent);
}

.topbar-status,
.status-pill,
.example-pill,
.badge,
.model-chip,
.mono,
.mono-label {
  font-family: "JetBrains Mono", monospace;
}

.topbar-status,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
  color: var(--text-secondary);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

.workspace {
  display: grid;
  grid-template-columns: 38% 62%;
}

.input-panel,
.results-panel {
  min-width: 0;
  background: var(--surface);
}

.input-panel {
  border-right: 1px solid var(--border);
}

.panel-inner {
  padding: 32px;
}

.results-tabs-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.results-tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(150, 200, 255, 0.15);
  border-radius: 999px;
  background: rgba(5, 10, 25, 0.4);
  backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}

.results-tab {
  position: relative;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #666666;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: all 150ms ease;
}

.results-tab:hover {
  color: #bfdbfe;
}

.results-tab:active {
  transform: scale(0.95);
}

.results-tab.active {
  color: var(--white);
  background: var(--accent);
  box-shadow: 0 2px 12px var(--accent-glow);
}

.results-tab.active::after {
  display: none;
}

.hero-title {
  margin: 0;
  font-size: 36px;
  line-height: 1.05;
  color: var(--text);
}

.hero-copy {
  max-width: 340px;
  margin: 10px 0 24px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.section-label,
label,
th,
.insight-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.example-section {
  margin-bottom: 24px;
}

.example-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.example-pill {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
  color: var(--text-secondary);
  font-size: 11px;
  transition: all 150ms ease;
}

.example-pill.active {
  opacity: 1;
  background: var(--surface2);
  border-color: var(--text-secondary);
  color: var(--text);
}

.example-pill:active {
  transform: scale(0.95);
}

.example-pill.toxicity:hover,
.example-pill.violent-threats:hover,
.example-pill.hate-speech:hover {
  background: var(--red-light);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ffb3b3;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.3);
}

.example-pill.harassment:hover,
.example-pill.misinformation:hover,
.example-pill.doxxing:hover {
  background: var(--amber-light);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fcd34d;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.3);
}

.example-pill.spam:hover,
.example-pill.impersonation:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.3);
}

.example-pill.bias:hover,
.example-pill.radicalization:hover {
  background: var(--accent-light);
  border-color: var(--accent-glow);
  color: #e9d5ff;
  box-shadow: 0 0 16px var(--accent-glow);
}

.input-form,
.context-grid,
.button-row,
.results-content,
.explainability-section {
  display: grid;
  gap: 20px;
}

.field-block {
  display: grid;
  gap: 8px;
}

.custom-select {
  position: relative;
}

textarea,
select {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
  color: var(--text);
  padding: 12px 14px;
  font-size: 14px;
  transition: all 150ms ease;
}

option {
  background: #0f172a;
  background: var(--surface2);
  color: #ffffff;
}

.custom-select-trigger {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px 0 14px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
  color: var(--text);
  font-size: 14px;
  text-align: left;
  transition: all 150ms ease;
}

.custom-select-trigger:focus {
  outline: none;
  border-color: rgba(255,255,255,0.2);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.2);
}

.custom-select-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 200;
  max-height: 240px;
  overflow-y: auto;
  padding: 6px 0;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface2);
  backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 150ms ease, transform 150ms ease;
}

.custom-select-panel.hidden {
  display: block !important;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  visibility: hidden;
}

.custom-select-panel.drop-up {
  top: auto;
  bottom: calc(100% + 8px);
  transform: translateY(0);
}

.custom-select-panel.drop-up.hidden {
  transform: translateY(4px);
}

.custom-select-option {
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.custom-select-option:hover {
  background: var(--surface3);
}

.custom-select-option.selected {
  background: var(--accent-light);
  border-left-color: var(--accent);
}

.custom-select-name {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.custom-select-description {
  display: block;
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
}

textarea {
  min-height: 188px;
  resize: vertical;
  line-height: 1.6;
}

textarea.example-loaded {
  animation: fade-in 200ms ease;
}

textarea:focus,
select:focus,
.primary-button:focus,
.secondary-button:focus,
.section-toggle:focus {
  outline: none;
  border-color: rgba(255,255,255,0.2);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.2);
}

.counter-wrap {
  display: flex;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 12px;
}

.collapsible {
  display: grid;
  gap: 10px;
}

.section-toggle {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 150ms ease, background 150ms ease;
}

.chevron {
  font-size: 14px;
  transition: transform 150ms ease;
}

.section-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.section-content {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 200ms ease, opacity 150ms ease;
}

.section-content.expanded {
  overflow: visible;
  opacity: 1;
}

.policy-guidelines {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.policy-guidelines li + li {
  margin-top: 6px;
}

.policy-citation {
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--border-strong);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.policy-citation a {
  color: inherit;
}

.button-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.primary-button,
.secondary-button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, opacity 150ms ease;
}

.primary-button {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.15);
  background: linear-gradient(135deg, var(--accent) 0%, #2563eb 100%);
  color: var(--white);
  box-shadow: 0 4px 16px var(--accent-light), inset 0 1px 0 rgba(255,255,255,0.2);
}

.primary-button:hover {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  box-shadow: 0 6px 24px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.3);
  transform: translateY(-1px);
}

.primary-button:active,
.secondary-button:active {
  transform: scale(0.97);
}

.primary-button.loading {
  color: rgba(0, 0, 0, 0.6);
}

.primary-button.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.02) 100%);
  animation: shimmer 1.2s linear infinite;
}

.secondary-button {
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: var(--text-secondary);
}

.secondary-button:hover {
  background: rgba(255,255,255,0.05);
}

.results-header,
.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.section-heading.stacked {
  justify-content: flex-start;
}

.results-header h2 {
  margin: 6px 0 0;
  font-size: 22px;
  color: var(--text);
}

.explainability-section h3 {
  margin: 6px 0 0;
  font-size: 18px;
  color: var(--text);
}

.status-pill.success {
  background: rgba(74, 222, 128, 0.05);
  border-color: rgba(74, 222, 128, 0.2);
  color: var(--green);
}

.status-pill.error {
  background: rgba(248, 113, 113, 0.05);
  border-color: rgba(248, 113, 113, 0.2);
  color: var(--red);
}

.batch-summary {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text-secondary);
  font-size: 13px;
}

.disagreement-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-radius: 8px;
  background: var(--white);
  color: #050505;
  font-size: 13px;
  font-weight: 600;
  transform: translateY(-8px);
  opacity: 0;
  transition: transform 200ms ease, opacity 200ms ease;
}

.disagreement-banner.visible {
  transform: translateY(0);
  opacity: 1;
}

.results-view {
  display: grid;
  gap: 20px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 150ms ease, transform 150ms ease;
  scroll-behavior: smooth;
}

.results-view.fading {
  opacity: 0;
  transform: translateY(5px);
}

.warning-icon {
  color: var(--amber);
  font-size: 14px;
}

.empty-state {
  min-height: 440px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.empty-state h3 {
  margin: 0;
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 500;
}

.empty-state p {
  max-width: 320px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.skeleton-state {
  display: grid;
  gap: 18px;
}

.skeleton-heading {
  display: grid;
  gap: 10px;
}

.skeleton-line,
.skeleton-row {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.skeleton-line::after,
.skeleton-row::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 100%);
  transform: translateX(-100%);
  animation: shimmer 1.4s linear infinite;
}

.skeleton-line {
  height: 14px;
  border-radius: 6px;
}

.skeleton-line.large {
  width: 220px;
}

.skeleton-line.short {
  width: 120px;
}

.skeleton-table {
  display: grid;
  gap: 10px;
}

.skeleton-row {
  height: 56px;
  border-radius: 8px;
}

.results-content {
  animation: fade-in 200ms ease;
}

.insights-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.insight-card {
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.03);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0) 100%);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
  position: relative;
  overflow: hidden;
}

.insight-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0; width: 3px;
  background: var(--card-color, var(--border-strong));
}

.insight-card em {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
  line-height: 1.5;
}

.insight-card strong {
  display: block;
  margin-top: 14px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.consensus-card strong {
  font-size: 28px;
  line-height: 1.1;
}

.insight-card[data-tone="allow"] {
  --card-color: var(--green);
}

.insight-card[data-tone="review"] {
  --card-color: var(--amber);
}

.insight-card[data-tone="remove"] {
  --card-color: var(--red);
}

.matrix-section {
  display: grid;
  gap: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border-strong);
  text-align: left;
}

tbody tr {
  opacity: 0;
  animation: fade-up 200ms ease forwards;
}

tbody td {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  vertical-align: top;
}

.model-primary {
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.model-subtitle {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.model-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface3);
  color: var(--text-secondary);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.metric-soft {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.action-cell,
.alignment-cell {
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
}

.badge.allow,
.badge.aligned {
  color: var(--green);
  border-color: rgba(74, 222, 128, 0.2);
  box-shadow: inset 0 0 8px rgba(74, 222, 128, 0.05);
}

.badge.review {
  color: var(--amber);
  border-color: rgba(251, 191, 36, 0.2);
  box-shadow: inset 0 0 8px rgba(251, 191, 36, 0.05);
}

.badge.remove,
.badge.misaligned {
  color: var(--red);
  border-color: rgba(248, 113, 113, 0.2);
  box-shadow: inset 0 0 8px rgba(248, 113, 113, 0.05);
}

.alignment-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.alignment-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.alignment-icon.aligned {
  background: var(--green-light);
  color: var(--green);
}

.alignment-icon.misaligned {
  background: var(--red-light);
  color: var(--red);
}

.severity-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  border-radius: 999px;
  color: var(--text);
}

.severity-value.low {
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.18);
}

.severity-value.medium {
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.18);
}

.severity-value.high {
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.2);
}

.empty-row td {
  text-align: center;
  color: var(--muted);
}

.explainability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.methodology-hero {
  display: grid;
  gap: 10px;
}

.methodology-hero h2 {
  margin: 0;
  font-family: "DM Serif Display", serif;
  font-size: 22px;
  color: var(--text);
}

.methodology-intro,
.methodology-copy,
.limitations-grid p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.7;
}

.methodology-section {
  display: grid;
  gap: 16px;
}

.methodology-card,
.methodology-subcard,
.limitation-card {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(17, 17, 20, 0.88);
  backdrop-filter: blur(8px);
}

.architecture-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.flow-node {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface3);
  color: var(--text-secondary);
  font-size: 12px;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.06), 0 0 20px rgba(37, 99, 235, 0.12);
}

.flow-arrow {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
}

.methodology-code {
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 8px;
  background: #020202;
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.code-key {
  color: #ff79c6;
}

.code-string {
  color: #f1fa8c;
}

.code-type {
  color: #8be9fd;
}

.code-comment {
  color: #6272a4;
}

.code-punctuation {
  color: var(--text-secondary);
}

.methodology-grid,
.limitations-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.formula-hero {
  padding: 4px 0;
  text-align: center;
  font-family: "DM Serif Display", serif;
  font-size: 28px;
  line-height: 1.3;
  color: var(--text);
}

.methodology-table {
  width: 100%;
  border-collapse: collapse;
}

.methodology-table td {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  vertical-align: top;
  font-family: "JetBrains Mono", monospace;
}

.methodology-table td + td {
  padding-left: 12px;
}

.modifier-negative {
  color: rgba(16, 185, 129, 0.7) !important;
}

.modifier-positive {
  color: rgba(245, 158, 11, 0.7) !important;
}

.editorial-quote {
  margin: 0;
  padding-left: 20px;
  border-left: 2px solid var(--accent);
  font-family: "DM Serif Display", serif;
  font-size: 24px;
  line-height: 1.45;
  font-style: italic;
  color: var(--text);
}

.model-rationale-table tr td:first-child {
  padding-left: 14px;
}

.model-rationale-table tr.dimension-toxic td:first-child {
  box-shadow: inset 2px 0 0 0 var(--red);
}

.model-rationale-table tr.dimension-offensive td:first-child {
  box-shadow: inset 2px 0 0 0 var(--amber);
}

.model-rationale-table tr.dimension-hate td:first-child {
  box-shadow: inset 2px 0 0 0 var(--accent);
}

.model-rationale-table tr.dimension-spam td:first-child {
  box-shadow: inset 2px 0 0 0 var(--green);
}

.model-rationale-table tr.dimension-bias td:first-child {
  box-shadow: inset 2px 0 0 0 var(--purple);
}

.model-rationale-table strong {
  color: var(--text);
  font-weight: 600;
}

.limitation-card {
  display: grid;
  gap: 10px;
}

.limitation-card h4 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.limitations-grid p {
  color: #a0a0a0;
}

.limitations-grid .limitation-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  max-width: calc(50% - 8px);
  justify-self: center;
}

.explanation-card {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(17, 17, 20, 0.88);
  backdrop-filter: blur(8px);
}

.explanation-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.explanation-head h4 {
  margin: 0;
}

.explanation-text {
  margin: 12px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.error-text {
  color: var(--red);
}

.hidden {
  display: none !important;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.65;
    transform: scale(1.12);
  }
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Model Cards (Models tab) === */
.model-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.model-cards-grid .model-detail-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  max-width: calc(50% - 8px);
  justify-self: center;
}

.model-detail-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left-width: 3px;
  border-radius: 10px;
  background: rgba(17, 17, 20, 0.88);
  backdrop-filter: blur(8px);
}

.model-detail-card.dim-red    { border-left-color: var(--red); }
.model-detail-card.dim-amber  { border-left-color: var(--amber); }
.model-detail-card.dim-blue   { border-left-color: var(--accent); }
.model-detail-card.dim-purple { border-left-color: var(--purple); }

.model-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.model-card-title {
  margin: 0;
  font-family: "DM Serif Display", serif;
  font-size: 20px;
  color: var(--text);
  line-height: 1.2;
}

.model-card-arch {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface3);
  color: var(--text-secondary);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.model-card-creator {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.model-card-detects {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.model-card-trained {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.model-card-trained strong {
  color: var(--muted);
  font-weight: 500;
}

.model-card-section {
  display: grid;
  gap: 6px;
}

.model-card-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.6;
}

.model-card-list li + li {
  margin-top: 3px;
}

.model-card-link {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  text-decoration: none;
  transition: opacity 150ms ease;
}

.model-card-link:hover {
  opacity: 0.7;
}

/* === Modal Select Overlay === */
.select-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
}

.select-modal-panel {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  max-width: 420px;
  width: 90%;
}

.select-modal-panel.animating-open {
  animation: modal-open 200ms ease forwards;
}

.select-modal-panel.animating-close {
  animation: modal-close 150ms ease forwards;
}

.select-modal-heading {
  margin: 0 0 16px;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.select-modal-option {
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.select-modal-option:hover {
  background: var(--surface3);
}

.select-modal-option.selected {
  background: var(--accent-light);
  border-left-color: var(--accent);
}

.select-modal-name {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.select-modal-description {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
  line-height: 1.4;
}

@keyframes modal-open {
  from {
    opacity: 0;
    transform: translate(var(--modal-from-x, 0px), var(--modal-from-y, 0px)) scale(0.5);
  }
  to {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

@keyframes modal-close {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .input-panel {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .panel-inner,
  .topbar-inner {
    padding: 20px;
  }

  .insights-strip,
  .explainability-grid,
  .button-row,
  .methodology-grid,
  .limitations-grid {
    grid-template-columns: 1fr;
  }

  .limitations-grid .limitation-card:last-child:nth-child(odd) {
    max-width: none;
  }
}
