/* My Speaker Profile — design tokens, ported exactly from the approved Stage 1b Artifact
   (claude.ai/artifact/2Dx55HDiFC2fn9raawqDi3, Main.dc.html token sheet). Light mode only
   in v1 (Blueprint 13, delegated decision) — dark mode is a deferred v2 item
   (Changelog 2026-10-27), alongside Gikuyu's own custom icon set replacing this
   placeholder line-icon system. */

:root {
  --sprout-purple: #603075;
  --sprout-purple-dark: #3B1F49;
  --sprout-lime: #70BF44;
  --sprout-lime-deep: #4F9A2C;
  --sprout-mustard: #FEC124;
  --sprout-error: #C8475A;

  --ink-900: #1E1A20;
  --ink-700: #4A454E;
  --ink-500: #786F7B;

  --surface-0: linear-gradient(180deg, #FFFFFF, #FBF8FD 100%);
  --surface-50: #FBF9FC;
  --surface-100: #F1EDF3;
  --border: #E4DEE9;

  --shadow-sm: 0 1px 2px rgba(30, 26, 32, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  --shadow-md: 0 10px 28px rgba(30, 26, 32, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.7);

  --font-title: 'Roboto Slab', Georgia, serif;
  --font-body: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html, body, #sprout-app { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--surface-50);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
}

.sp-screen {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 40px;
}
/* On a tall desktop viewport a single short card sitting under the top padding reads as
   stranded, not centered — vertically center the card instead. Phones keep the top-aligned,
   naturally-scrolling layout, since their viewport height is usually close to the content's
   own height anyway. */
@media (min-width: 760px) {
  .sp-screen { justify-content: center; }
}

.sp-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface-0);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sp-title {
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--ink-900);
  margin: 0;
}

.sp-body-text { font-size: 15px; color: var(--ink-900); line-height: 1.6; margin: 0; }
.sp-muted { font-size: 13px; color: var(--ink-500); margin: 0; }

.sp-btn {
  width: 100%;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--sprout-purple), var(--sprout-purple-dark));
  border: none;
  border-radius: 14px;
  padding: 15px;
  cursor: pointer;
}
.sp-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.sp-btn.sp-btn-secondary {
  background: none;
  color: var(--sprout-purple);
  border: 1px solid var(--border);
}

.sp-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink-900);
}
.sp-input:focus { outline: 2px solid var(--sprout-purple); outline-offset: 1px; }
.sp-input.sp-input-error { border-color: var(--sprout-error); }

.sp-error-text { font-size: 13px; color: var(--sprout-error); margin: 0; }

/* Momentum strip: four fixed checkpoints at quarters of the bar, never tied to a
   per-tool question count (Blueprint 4.8 / Main.dc.html rationale). */
.sp-momentum { display: flex; align-items: center; gap: 6px; }
.sp-momentum .dot { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-100); }
.sp-momentum .dot.filled { background: var(--sprout-lime); }

/* Question screen: radiogroup, not <fieldset>/<legend> (the overlap-bug fix, Changelog 2026-10-27). */
.sp-radiogroup { display: flex; flex-direction: column; gap: 12px; }
.sp-question-text {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 19px;
  color: var(--ink-900);
  line-height: 1.4;
  margin: 0 0 4px;
}
.sp-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  color: var(--ink-900);
  transition: border-color 0.12s ease, background-color 0.12s ease, transform 0.08s ease;
}
.sp-option:hover {
  border-color: color-mix(in srgb, var(--sprout-purple) 45%, var(--border));
  background: color-mix(in srgb, var(--sprout-purple) 3%, white);
}
.sp-option:active { transform: scale(0.99); }
.sp-option.selected {
  border-color: var(--sprout-purple);
  background: color-mix(in srgb, var(--sprout-purple) 6%, white);
}
/* Briefly shown while the chosen option's highlight is visible and the next question is
   about to load (Question.jsx's SELECTION_PAUSE_MS) — the other options dim and stop
   reacting to hover so the one just picked stays the clear focus. */
.sp-option-locked:not(.selected) { opacity: 0.55; cursor: default; }
.sp-option-locked:not(.selected):hover { border-color: var(--border); background: #fff; }
.sp-option input { accent-color: var(--sprout-purple); width: 18px; height: 18px; }

.sp-icon-circle {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.sp-icon-circle svg { width: 55%; height: 55%; }

/* Result range bar: horizontal range + dark-purple marker, never a ring or gauge
   (Blueprint 4.8, closed design-likes decision, Changelog 2026-10-27). */
.sp-range { display: flex; flex-direction: column; gap: 10px; }
.sp-range-track {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--surface-100), color-mix(in srgb, var(--sprout-purple) 38%, var(--surface-100)));
}
.sp-range-marker {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--sprout-purple-dark);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(59, 31, 73, 0.3);
  transform: translate(-50%, -50%);
}
.sp-range-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--ink-500); font-weight: 600; }

.sp-chip-lime { background: var(--sprout-lime); color: var(--ink-900); font-weight: 700; padding: 3px 10px; border-radius: 999px; font-size: 12px; }

.sp-skel {
  border-radius: 12px;
  background: linear-gradient(90deg, var(--surface-100) 25%, #fff 37%, var(--surface-100) 63%);
  background-size: 400px 100%;
  animation: sp-shimmer 1.6s linear infinite;
}
@keyframes sp-shimmer { 0% { background-position: -200px 0; } 100% { background-position: 200px 0; } }

.sp-center-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 40px 20px; }

/* --- My Speaker Profile dashboard (Blueprint 4.4): bottom tab bar on phones, side rail
   on larger screens via the @media rule below. --- */
.sp-dash { min-height: 100vh; width: 100%; display: flex; flex-direction: column; background: var(--surface-50); }
.sp-dash-body { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 20px 20px 96px; display: flex; flex-direction: column; gap: 16px; }
.sp-tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--surface-0);
  border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(30,26,32,0.06); z-index: 10;
}
.sp-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 12px;
  background: none; border: none; font-family: var(--font-body); font-size: 11px; font-weight: 600;
  color: var(--ink-500); cursor: pointer;
}
.sp-tab.active { color: var(--sprout-purple); }
.sp-tab .dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.sp-tab.active .dot { background: var(--sprout-lime); }
@media (min-width: 760px) {
  .sp-dash { flex-direction: row; }
  .sp-tabbar { position: static; flex-direction: column; width: 220px; border-top: none; border-right: 1px solid var(--border); box-shadow: none; padding: 24px 0; height: 100vh; }
  .sp-tab { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 12px 24px; font-size: 14px; }
  .sp-dash-body { padding: 32px 32px 40px; max-width: 760px; }
}

.sp-greeting { font-family: var(--font-title); font-weight: 700; font-size: 24px; color: var(--ink-900); margin: 0; }
.sp-section-label { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-500); font-weight: 700; margin: 0; }
.sp-tile {
  background: var(--surface-0); border-radius: 18px; padding: 18px 20px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; border: none; cursor: pointer; font-family: var(--font-body);
}
.sp-tile:disabled { cursor: default; opacity: 0.65; }
.sp-tile-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sp-word-counter { font-size: 11px; color: var(--ink-500); text-align: right; }
.sp-word-counter.over { color: var(--sprout-error); }
.sp-textarea {
  width: 100%; min-height: 64px; border-radius: 12px; border: 1px solid var(--border); padding: 12px 14px;
  font-family: var(--font-body); font-size: 14px; color: var(--ink-900); background: var(--surface-0); resize: vertical;
}
.sp-textarea:focus { outline: 2px solid var(--sprout-purple); outline-offset: 1px; }
.sp-scale { display: flex; gap: 8px; justify-content: space-between; }
.sp-scale button {
  flex: 1; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-0);
  font-family: var(--font-body); font-size: 12px; color: var(--ink-700); cursor: pointer;
}
.sp-scale button.selected { background: var(--sprout-purple); border-color: var(--sprout-purple); color: #fff; }
.sp-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-chip {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-0);
  font-size: 13px; color: var(--ink-700); cursor: pointer; font-family: var(--font-body);
}
.sp-chip.selected { background: var(--sprout-purple); border-color: var(--sprout-purple); color: #fff; }
