:root {
  --bg: #0f172a;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --primary: #6366f1;
  --positive: #10b981;
  --neutral: #f59e0b;
  --negative: #ef4444;
  --border: #1f2937;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: radial-gradient(1000px 600px at 10% 10%, #1f2937, transparent),
              radial-gradient(1000px 600px at 90% 20%, #0b1021, transparent),
              var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji";
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

.app-header h1 { margin: 0 0 8px; }
.disclaimer { color: var(--muted); margin: 0 0 24px; }

.card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.card h2 { margin-top: 0; }

.help ul { margin: 8px 0 0 20px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.field { display: grid; gap: 8px; }
.label { color: var(--muted); font-size: 14px; }

input[type="date"],
input[type="number"],
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: #0b1021;
  color: var(--text);
  border-radius: 8px;
}

input[type="range"] {
  width: 100%;
}

.scale {
  display: flex; justify-content: space-between; color: var(--muted); font-size: 12px;
}

.actions { display: flex; gap: 8px; margin-top: 12px; }
.btn {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0b1021;
  color: var(--text);
  cursor: pointer;
}
.btn.primary { background: var(--primary); border-color: #4f46e5; }
.btn:active { transform: translateY(1px); }

.hidden { display: none; }

.result-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.state-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px; font-weight: 600; font-size: 14px;
  border: 1px solid var(--border);
}
.state-positive { background: rgba(16,185,129,0.15); color: #c7f9e5; border-color: rgba(16,185,129,0.35); }
.state-neutral  { background: rgba(245,158,11,0.15); color: #fde7c7; border-color: rgba(245,158,11,0.35); }
.state-negative { background: rgba(239,68,68,0.15);  color: #ffdede; border-color: rgba(239,68,68,0.35); }

.score { color: var(--muted); font-size: 14px; }

.history { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.history-item { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: start; }
.history-item .meta { color: var(--muted); font-size: 13px; }
.history-item .text { color: #e8eaf0; }

.footer { color: var(--muted); text-align: center; font-size: 14px; margin-top: 8px; }

@media (max-width: 560px) {
  .history-item { grid-template-columns: 1fr; }
}

/* Chat assistant */
.chat-messages {
  display: grid; gap: 8px; max-height: 280px; overflow: auto;
  padding: 8px; background: transparent; border: none; border-radius: 8px; margin-bottom: 10px;
}
.bubble { max-width: 75%; padding: 10px 12px; border-radius: 12px; line-height: 1.4; }
.from-user { justify-self: end; background: #1f2937; border: 1px solid var(--border); }
.from-bot { justify-self: start; background: #0e162f; border: 1px solid var(--border); }
.chat-input-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.chat-note { color: var(--muted); font-size: 12px; margin-top: 8px; }

/* Chat input theming */
.chat-input-row input[type="text"] {
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: #0b1021;
  color: var(--text);
  border-radius: 8px;
  outline: none;
}
.chat-input-row input[type="text"]::placeholder { color: var(--muted); }
.chat-input-row input[type="text"]:focus {
  border-color: #374151;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

/* Floating chat widget */
.chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: min(360px, calc(100vw - 32px));
  z-index: 999;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
.chat-widget h2 { margin-top: 0; margin-bottom: 8px; font-size: 18px; }

@media (max-width: 560px) {
  .chat-widget { right: 12px; bottom: 12px; }
}


