/* ==========================================================================
   Sentiment Analyzer v2.0.0 — Design System: Studio Slate & Nordic Minimalist
   Refined, subtle, tactile UI. Gradients and harsh neons eliminated.
   ========================================================================== */

:root {
  /* Surface & Base Palette */
  --bg-base: #0b0f15;
  --bg-surface: #121821;
  --bg-card: #171f2c;
  --bg-card-hover: #1c2636;
  --bg-inset: #0e141c;

  /* Borders & Dividers */
  --border-subtle: #232f42;
  --border-light: #2e3d55;
  --border-focus: #3b82f6;

  /* Typography */
  --text-main: #f3f6fa;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Accent & Action Colors */
  --accent-primary: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-active: #1e40af;
  --accent-subtle: rgba(37, 99, 235, 0.12);

  /* Sentiment State Accents (Tactile & Muted) */
  --positive-base: #10b981;
  --positive-bg: rgba(16, 185, 129, 0.1);
  --positive-border: rgba(16, 185, 129, 0.28);
  --positive-text: #34d399;

  --negative-base: #f43f5e;
  --negative-bg: rgba(244, 63, 94, 0.1);
  --negative-border: rgba(244, 63, 94, 0.28);
  --negative-text: #fb7185;

  /* Elevation & Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);

  /* Geometry */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Background Structure (Subtle Architectural Grid)
   -------------------------------------------------------------------------- */
.matte-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: var(--bg-base);
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--border-subtle) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.4;
}

/* --------------------------------------------------------------------------
   Container & Layout
   -------------------------------------------------------------------------- */
.container {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 20px 60px 20px;
}

/* --------------------------------------------------------------------------
   Top Bar
   -------------------------------------------------------------------------- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

.status-indicator {
  width: 8px;
  height: 8px;
  background-color: var(--positive-base);
  border-radius: var(--radius-full);
}

.brand-name {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-main);
}

.version-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-inset);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.api-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-full);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #eab308;
  transition: background-color 0.25s ease;
}

.status-dot.online {
  background: var(--positive-base);
}

.status-dot.offline {
  background: var(--negative-base);
}

.benchmark-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.benchmark-toggle-btn:hover {
  background: var(--bg-card);
  border-color: var(--border-light);
  color: var(--text-main);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.header {
  text-align: center;
  margin-bottom: 28px;
}

.title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 6px;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   Character / Robot Section (Tactile, Matte Industrial Aesthetic)
   -------------------------------------------------------------------------- */
.character-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.character {
  position: relative;
  width: 140px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.robot {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: robotIdle 4s ease-in-out infinite;
}

@keyframes robotIdle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Robot Head */
.robot-head {
  position: relative;
  width: 82px;
  height: 64px;
  background: #252e3e;
  border: 2px solid var(--border-light);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  z-index: 2;
  transition: transform 0.2s ease;
}

.robot-head:hover {
  transform: rotate(2deg);
}

/* Antenna */
.antenna {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 16px;
  background: #39475c;
  display: flex;
  justify-content: center;
}

.antenna-ball {
  position: absolute;
  top: -6px;
  width: 10px;
  height: 10px;
  background: #64748b;
  border-radius: 50%;
  border: 1px solid #94a3b8;
}

.antenna-ball.happy-ball {
  background: var(--positive-base);
  border-color: #34d399;
}

.antenna-ball.sad-ball {
  background: #60a5fa;
  border-color: #93c5fd;
}

/* Visor / Face Screen */
.robot-face {
  position: relative;
  width: 66px;
  height: 46px;
  background: #111620;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Eyes */
.robot-eyes {
  display: flex;
  gap: 16px;
}

.robot-eye {
  position: relative;
  width: 11px;
  height: 11px;
  background: #94a3b8;
  border-radius: 50%;
}

.eye-shine {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 3px;
  height: 3px;
  background: #ffffff;
  border-radius: 50%;
}

.happy-eye {
  background: var(--positive-base);
  height: 7px;
  border-radius: 8px 8px 0 0;
}

.sad-eye {
  background: #60a5fa;
  height: 8px;
  border-radius: 0 0 8px 8px;
}

/* Tears & Cheeks */
.tear {
  position: absolute;
  bottom: -9px;
  left: 3px;
  width: 5px;
  height: 7px;
  background: #93c5fd;
  border-radius: 0 50% 50% 50%;
  transform: rotate(45deg);
  animation: tearDrip 2s ease-in-out infinite;
}

@keyframes tearDrip {
  0% { transform: rotate(45deg) translateY(0); opacity: 1; }
  100% { transform: rotate(45deg) translateY(12px); opacity: 0; }
}

.cheeks {
  position: absolute;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
}

.cheek {
  width: 7px;
  height: 4px;
  background: rgba(16, 185, 129, 0.45);
  border-radius: 50%;
}

/* Mouth */
.robot-mouth {
  display: flex;
  justify-content: center;
}

.mouth-line {
  width: 14px;
  height: 2px;
  background: #64748b;
  border-radius: 2px;
}

.smile-arc {
  width: 16px;
  height: 7px;
  border: 2px solid var(--positive-base);
  border-top: none;
  border-radius: 0 0 10px 10px;
}

.frown-arc {
  width: 14px;
  height: 6px;
  border: 2px solid #60a5fa;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
}

/* Robot Body */
.robot-body {
  position: relative;
  width: 66px;
  height: 52px;
  background: #1f2735;
  border: 2px solid var(--border-light);
  border-top: none;
  border-radius: 0 0 16px 16px;
  margin-top: -4px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.body-panel {
  width: 38px;
  height: 22px;
  background: #131922;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.body-light {
  position: absolute;
  top: 8px;
  width: 6px;
  height: 6px;
  background: #64748b;
  border-radius: 50%;
}

.happy-light {
  background: var(--positive-base);
}

.sad-light {
  background: #60a5fa;
}

.heart-burst {
  position: absolute;
  top: -12px;
  right: -24px;
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: floatHeart 2.5s ease-in-out infinite;
}

@keyframes floatHeart {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50% { transform: translateY(-6px); opacity: 1; }
}

.rain-drops {
  position: absolute;
  top: -8px;
  left: -20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drop {
  width: 3px;
  height: 6px;
  background: #60a5fa;
  border-radius: 50%;
  animation: rainFall 1.8s ease-in infinite;
}

@keyframes rainFall {
  0% { transform: translateY(-4px); opacity: 0; }
  50% { opacity: 0.8; }
  100% { transform: translateY(16px); opacity: 0; }
}

/* Character Message Pill */
.character-message {
  margin-top: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  text-align: center;
  max-width: 380px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

/* --------------------------------------------------------------------------
   Quick Test Prompt Chips
   -------------------------------------------------------------------------- */
.chips-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding: 0 4px;
}

.chips-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  background: var(--bg-card);
  border-color: var(--border-light);
  color: var(--text-main);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Input Card Section
   -------------------------------------------------------------------------- */
.input-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}

.input-wrapper {
  position: relative;
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

textarea#text-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  resize: vertical;
  min-height: 88px;
  outline: none;
  line-height: 1.5;
}

textarea#text-input::placeholder {
  color: var(--text-dim);
}

.input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.text-action-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.text-action-btn:hover {
  color: var(--text-muted);
}

.kbd-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.kbd-hint kbd {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

.counters-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-dim);
}

.counter-divider {
  color: var(--border-light);
}

.button-bar {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.predict-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-primary);
  color: #ffffff;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.predict-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.predict-btn:active {
  background: var(--accent-active);
  transform: translateY(0);
}

.predict-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* --------------------------------------------------------------------------
   Results Section
   -------------------------------------------------------------------------- */
.results-section {
  margin-bottom: 24px;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  transition: border-color 0.25s ease;
}

.result-card.positive {
  border-color: var(--positive-border);
}

.result-card.negative {
  border-color: var(--negative-border);
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.result-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.result-label {
  font-size: 0.82rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.result-badge.positive {
  background: var(--positive-bg);
  color: var(--positive-text);
  border: 1px solid var(--positive-border);
}

.result-badge.negative {
  background: var(--negative-bg);
  color: var(--negative-text);
  border: 1px solid var(--negative-border);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.confidence-pill {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-inset);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.copy-result-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-result-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  color: var(--text-main);
}

/* Safe Input Preview */
.input-quote-box {
  background: var(--bg-inset);
  border-left: 3px solid var(--border-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.quote-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.result-text {
  font-size: 0.92rem;
  color: var(--text-main);
  word-break: break-word;
}

/* Probability Distribution Track */
.prob-distribution {
  margin-bottom: 16px;
}

.prob-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.polarity-tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-dim);
  background: var(--bg-inset);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.prob-bar-track {
  height: 6px;
  background: var(--negative-base);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.prob-bar-fill {
  height: 100%;
  background: var(--positive-base);
  width: 50%;
  transition: width 0.4s ease;
}

/* Meta Data Items */
.result-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-label {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.meta-value {
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Live Statistics Grid
   -------------------------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 500;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
}

.stat-positive .stat-value {
  color: var(--positive-text);
}

.stat-negative .stat-value {
  color: var(--negative-text);
}

/* --------------------------------------------------------------------------
   History Section
   -------------------------------------------------------------------------- */
.history-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 32px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.history-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-title-wrap h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.history-count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.clear-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.clear-btn:hover {
  border-color: var(--border-light);
  color: var(--text-muted);
  background: var(--bg-card);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s ease;
}

.history-item:hover {
  border-color: var(--border-light);
}

.history-item.positive {
  border-left: 3px solid var(--positive-base);
}

.history-item.negative {
  border-left: 3px solid var(--negative-base);
}

.history-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.history-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.history-badge.positive {
  background: var(--positive-bg);
  color: var(--positive-text);
}

.history-badge.negative {
  background: var(--negative-bg);
  color: var(--negative-text);
}

.history-time {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.history-text {
  font-size: 0.88rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-meta {
  display: flex;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.empty-state {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 24px 0;
}

/* --------------------------------------------------------------------------
   Research Benchmarks Modal
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title-group h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

.modal-subtitle {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 16px 20px;
}

.benchmarks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.benchmarks-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-subtle);
}

.benchmarks-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.score-badge {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--positive-text);
  background: var(--positive-bg);
  padding: 2px 8px;
  border-radius: 4px;
}

.modal-footnote {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.modal-footnote code {
  font-family: var(--font-mono);
  background: var(--bg-inset);
  padding: 2px 4px;
  border-radius: 3px;
}

/* --------------------------------------------------------------------------
   Toast Notification
   -------------------------------------------------------------------------- */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  animation: toastIn 0.25s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .container {
    padding: 16px 12px 40px 12px;
  }

  .title {
    font-size: 1.5rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .predict-btn {
    width: 100%;
  }

  .button-bar {
    justify-content: stretch;
  }
}