:root {
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.6);
  --border: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --brand: #2f5fd8;
  --brand-hover: #2449ad;
  --danger: #f87171;
  --success: #34d399;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

.hidden { display: none !important; }

h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 28px 0 12px; }
.subtitle { color: var(--muted); font-size: 14px; margin: 0 0 32px; }

.card {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 10px;
  padding: 20px;
}

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: #cbd5e1; margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 10px 12px;
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}
.field input:focus { outline: none; border-color: var(--brand); }

button {
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  width: 100%;
  padding: 12px 20px;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  padding: 8px 16px;
  background: transparent;
  color: #cbd5e1;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}
.btn-secondary:hover { background: #1e293b; }

.progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.progress-track {
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--brand);
  transition: width 0.2s;
}

.question-card { margin-bottom: 20px; }
.question-prompt { font-size: 14px; margin-bottom: 14px; color: #e2e8f0; }
.scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}
.scale-row { display: flex; justify-content: space-between; gap: 8px; }
.scale-btn {
  flex: 1;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: #cbd5e1;
  font-size: 14px;
  transition: all 0.15s;
}
.scale-btn:hover { border-color: var(--brand); }
.scale-btn.selected { border-color: var(--brand); background: var(--brand); color: white; }

.save-status { font-size: 12px; color: var(--muted); text-align: right; margin-top: 8px; }

.error-text { color: var(--danger); font-size: 13px; margin-top: 8px; }

.score-hero { text-align: center; padding: 24px; }
.score-hero .value { font-size: 48px; font-weight: 700; }
.score-hero .band { color: var(--muted); font-size: 14px; text-transform: capitalize; }

.factor-bar-row { margin-bottom: 14px; }
.factor-bar-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.factor-bar-track { height: 8px; background: #1e293b; border-radius: 999px; overflow: hidden; }
.factor-bar-fill { height: 100%; background: var(--brand); border-radius: 999px; }

.narrative-box {
  white-space: pre-line;
  font-size: 13px;
  line-height: 1.7;
  color: #cbd5e1;
}

.footer-note {
  margin-top: 32px;
  font-size: 11px;
  color: #64748b;
  text-align: center;
  line-height: 1.6;
}

a { color: var(--brand); }

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.history-item:first-child { border-top: none; }
