:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --positive: #3fb950;
  --negative: #f85149;
  --neutral: #d29922;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 1.5rem;
}

nav a:hover {
  color: var(--accent);
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.hero {
  margin-bottom: 3rem;
}

.hero h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.hero p {
  color: var(--text-muted);
  margin: 0;
}

.demo-section h3,
.info-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.demo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#input-text {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  resize: vertical;
}

#input-text:focus {
  outline: none;
  border-color: var(--accent);
}

#analyze-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  align-self: flex-start;
}

#analyze-btn:hover {
  opacity: 0.9;
}

#analyze-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

.result-area {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.result-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.prediction-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

.prediction-badge.positive {
  background: rgba(63, 185, 80, 0.2);
  color: var(--positive);
}

.prediction-badge.negative {
  background: rgba(248, 81, 73, 0.2);
  color: var(--negative);
}

.prediction-badge.neutral {
  background: rgba(210, 153, 34, 0.2);
  color: var(--neutral);
}

.confidence {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.probabilities {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.prob-bar {
  display: grid;
  grid-template-columns: 100px 1fr 40px;
  align-items: center;
  gap: 1rem;
}

.prob-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.prob-label i {
  margin-right: 0.35rem;
}

.prob-track {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.prob-fill {
  height: 100%;
  min-width: 0;
  border-radius: 4px;
  transition: width 0.3s ease;
}

#prob-neg { background: #f85149; }
#prob-neu { background: #d29922; }
#prob-pos { background: #3fb950; }

.prob-value {
  font-size: 0.85rem;
  text-align: right;
}

.meta {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.cache-hit {
  color: var(--positive);
}

.demo-notice {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.2);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--accent);
}

.demo-notice i {
  margin-right: 0.5rem;
}

.history-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.history-section h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.history-section h4 i {
  margin-right: 0.5rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-item {
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border-radius: 4px;
  border: 1px solid var(--border);
}

.hist-pred {
  font-weight: 600;
  margin-right: 0.5rem;
}

.hist-pred.positive { color: var(--positive); }
.hist-pred.negative { color: var(--negative); }
.hist-pred.neutral { color: var(--neutral); }

.hist-text {
  color: var(--text-muted);
}

.batch-section {
  margin: 3rem 0;
}

.batch-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

#batch-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  resize: vertical;
  margin-bottom: 1rem;
}

#batch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 1rem;
}

#batch-btn:hover { opacity: 0.9; }

.batch-results {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.batch-loading {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.batch-item {
  font-size: 0.9rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.batch-item:last-child { border-bottom: none; }

.batch-item .pred {
  font-weight: 600;
  margin-right: 0.75rem;
  display: inline-block;
  min-width: 70px;
}

.batch-item .pred.positive { color: var(--positive); }
.batch-item .pred.negative { color: var(--negative); }
.batch-item .pred.neutral { color: var(--neutral); }

.samples-section {
  margin: 3rem 0;
}

.samples-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.sample-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.sample-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
}

.sample-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sample-btn i {
  font-size: 0.9rem;
}

.error-area {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.2);
  border-radius: 6px;
  color: var(--negative);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.flow-diagram {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.flow-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.flow-item i {
  font-size: 1.5rem;
  color: var(--accent);
}

.flow-arrow {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li {
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.feature-list i {
  color: var(--accent);
  width: 1.25rem;
}

footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
}

footer a:hover {
  color: var(--accent);
}
