/* =============================================================
   IKIGAI — Personality Test App
   Mobile-first phone shell, light theme, soft pastel option chips
   ============================================================= */

:root {
  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f6f7fb;
  --ink: #0e1116;
  --ink-2: #2a2f3a;
  --muted: #7a8194;
  --line: #e7eaf0;

  --dark: #1f2127;
  --dark-2: #2a2c33;

  --c-passion: #c8efd2;       /* green  */
  --c-passion-ink: #1f6b3b;
  --c-skills: #ffd8d6;        /* pink   */
  --c-skills-ink: #a14444;
  --c-mission: #c8e8e6;       /* teal   */
  --c-mission-ink: #20696a;
  --c-vocation: #f5e9b6;      /* yellow */
  --c-vocation-ink: #8a6f1a;
  --c-extra: #dccff5;         /* lilac (option E) */
  --c-extra-ink: #5a3da8;

  --accent: #6cd17e;
  --accent-2: #59b86a;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --shadow-card: 0 12px 30px rgba(20, 30, 50, 0.06),
                 0 2px 6px rgba(20, 30, 50, 0.04);
  --shadow-pop: 0 18px 40px rgba(20, 30, 50, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI",
    Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  background:
    radial-gradient(800px 600px at 20% -10%, #e8efe9 0%, transparent 60%),
    radial-gradient(700px 500px at 100% 110%, #eae6f3 0%, transparent 60%),
    var(--bg);
}

/* ---------- Phone shell ---------- */
.phone-shell {
  position: relative;
  width: 100%;
  max-width: 420px;
  /* dvh = usable viewport on mobile (toolbar-safe); a bit taller than before */
  height: min(920px, calc(100dvh - 20px));
  background: var(--surface);
  border-radius: 36px;
  overflow: hidden;
  box-shadow:
    0 30px 80px rgba(20, 30, 50, 0.18),
    0 6px 16px rgba(20, 30, 50, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: fade 0.4s ease both;
}
.screen.active { display: flex; }

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

/* =============================================================
   1. SPLASH
   ============================================================= */
.screen--splash {
  background: linear-gradient(180deg, #f4f7f4 0%, #ffffff 60%, #f1eef8 100%);
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.splash-bg {
  position: absolute; inset: 0; pointer-events: none;
}
.orb {
  position: absolute;
  width: 220px; height: 220px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  animation: float 9s ease-in-out infinite;
}
.orb-passion  { background: var(--c-passion);  top: 10%;  left: -40px; }
.orb-skills   { background: var(--c-skills);   top: 30%;  right: -60px; animation-delay: -1.5s; }
.orb-mission  { background: var(--c-mission);  bottom: 18%; left: -60px; animation-delay: -3s; }
.orb-vocation { background: var(--c-vocation); bottom: 0;   right: -40px; animation-delay: -4.5s; }

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-18px) scale(1.05); }
}

.splash-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  z-index: 2;
}
.logo-mark {
  width: 110px; height: 110px;
  background: var(--surface);
  border-radius: 28px;
  box-shadow: var(--shadow-pop);
  display: flex; align-items: center; justify-content: center;
}
.logo-circles {
  position: relative;
  width: 64px; height: 64px;
}
.lc {
  position: absolute;
  width: 36px; height: 36px;
  border-radius: 50%;
  mix-blend-mode: multiply;
  opacity: 0.85;
}
.lc-1 { background: var(--c-passion);  top: 0;     left: 14px; }
.lc-2 { background: var(--c-skills);   top: 14px;  right: 0; }
.lc-3 { background: var(--c-mission);  bottom: 0;  left: 14px; }
.lc-4 { background: var(--c-vocation); top: 14px;  left: 0; }

.splash-title {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 8px 0 0;
}
.splash-tag {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.splash-loader { margin-top: 28px; width: 160px; }
.loader-bar {
  width: 100%; height: 4px; background: #e3e7eb; border-radius: 999px; overflow: hidden;
}
.loader-bar span {
  display: block; height: 100%; width: 30%;
  background: linear-gradient(90deg, var(--accent), #4dbf64);
  border-radius: 999px;
  animation: loader 1.6s ease-in-out infinite;
}
@keyframes loader {
  0%   { transform: translateX(-100%); width: 30%; }
  50%  { transform: translateX(150%);  width: 50%; }
  100% { transform: translateX(330%);  width: 30%; }
}

/* =============================================================
   2. WELCOME
   ============================================================= */
.screen--welcome {
  background: linear-gradient(180deg, #f1f4f1 0%, #ffffff 50%);
  padding: 28px 22px 24px;
  gap: 20px;
}

.welcome-hero {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  height: 230px;
}
.hero-illustration {
  position: relative;
  width: 230px; height: 230px;
}
.circle-overlay {
  position: absolute;
  width: 130px; height: 130px;
  border-radius: 50%;
  mix-blend-mode: multiply;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.55);
}
.circle-overlay span {
  position: absolute;
  top: 14px;
}
.c-passion  { background: var(--c-passion);  top: 0;       left: 50px; }
.c-skills   { background: var(--c-skills);   top: 50px;    right: 0; }
.c-mission  { background: var(--c-mission);  bottom: 0;    left: 50px; }
.c-vocation { background: var(--c-vocation); top: 50px;    left: 0; }

.ikigai-center {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: var(--ink);
  letter-spacing: -0.01em;
}

.welcome-card {
  flex: 1;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 26px 22px 24px;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-2);
}
.welcome-title {
  margin: 8px 0 12px;
  font-size: 28px; line-height: 1.15; font-weight: 800;
  letter-spacing: -0.02em;
}
.welcome-desc {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px; line-height: 1.55;
}
.welcome-meta {
  display: flex; align-items: center;
  gap: 12px;
  padding: 14px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  margin-bottom: 22px;
}
.meta-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.meta-num { font-size: 20px; font-weight: 800; }
.meta-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.meta-divider { width: 1px; height: 28px; background: var(--line); }

.btn-primary {
  appearance: none;
  border: 0;
  background: var(--ink);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  height: 54px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center; justify-content: center; gap: 10px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s;
  box-shadow: 0 8px 20px rgba(15, 17, 22, 0.25);
}
.btn-primary:hover { transform: translateY(-1px); background: #000; }
.btn-primary:active { transform: translateY(0); }

.welcome-fineprint {
  margin: 12px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* =============================================================
   3. FORM
   ============================================================= */
.screen--form {
  background: linear-gradient(180deg, #f3f5f9 0%, #ffffff 70%);
  padding: 22px 18px 0;
  gap: 14px;
}

.form-header {
  display: flex; align-items: center; gap: 12px;
}
.icon-btn {
  width: 38px; height: 38px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(0.97); }

.progress-wrap { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.progress-track {
  height: 6px;
  background: #e3e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 5%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(.4,0,.2,1);
}
.progress-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: var(--muted); font-weight: 600;
  letter-spacing: 0.04em;
}
.progress-circle {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-2);
}

.form-body {
  flex: 1;
  display: flex; flex-direction: column;
  padding: 4px 4px 16px;
  overflow-y: auto;
}

.circle-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: var(--surface-2);
  border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  align-self: flex-start;
  border: 1px solid var(--line);
}
.circle-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(108, 209, 126, 0.18);
}
.circle-pill[data-circle="passion"]  .circle-dot { background: var(--c-passion-ink);  box-shadow: 0 0 0 3px var(--c-passion); }
.circle-pill[data-circle="skills"]   .circle-dot { background: var(--c-skills-ink);   box-shadow: 0 0 0 3px var(--c-skills); }
.circle-pill[data-circle="mission"]  .circle-dot { background: var(--c-mission-ink);  box-shadow: 0 0 0 3px var(--c-mission); }
.circle-pill[data-circle="vocation"] .circle-dot { background: var(--c-vocation-ink); box-shadow: 0 0 0 3px var(--c-vocation); }

.question-title {
  margin: 14px 0 6px;
  font-size: 22px; line-height: 1.25; font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.question-hint {
  margin: 0 0 16px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.options { display: flex; flex-direction: column; gap: 10px; }

.option {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s,
              box-shadow 0.2s;
  text-align: left;
  font-family: inherit;
  width: 100%;
  appearance: none;
}
.option:hover { background: var(--surface-2); }
.option:active { transform: scale(0.995); }

.option-letter {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
  flex: 0 0 auto;
  color: var(--ink);
}
.option[data-letter="A"] .option-letter { background: var(--c-passion);  color: var(--c-passion-ink); }
.option[data-letter="B"] .option-letter { background: var(--c-skills);   color: var(--c-skills-ink); }
.option[data-letter="C"] .option-letter { background: var(--c-mission);  color: var(--c-mission-ink); }
.option[data-letter="D"] .option-letter { background: var(--c-vocation); color: var(--c-vocation-ink); }
.option[data-letter="E"] .option-letter { background: var(--c-extra);    color: var(--c-extra-ink); }

.option-text {
  font-size: 14px; line-height: 1.4;
  color: var(--ink-2);
  font-weight: 500;
}

.option.selected {
  border-color: var(--ink);
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 17, 22, 0.08);
}
.option.selected .option-text { color: var(--ink); font-weight: 600; }

.option .check {
  margin-left: auto;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  color: transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex: 0 0 auto;
}
.option.selected .check {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.form-footer {
  background: var(--dark);
  color: #fff;
  margin: 0 -18px;
  padding: 12px 18px 22px;
  border-radius: 28px 28px 0 0;
  position: relative;
  box-shadow: 0 -10px 24px rgba(15, 17, 22, 0.15);
}
.footer-grip {
  width: 44px; height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 999px;
  margin: 0 auto 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.footer-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.85);
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 12px;
  transition: background 0.15s, color 0.15s;
}
.footer-btn--ghost:hover { background: rgba(255,255,255,0.06); color: #fff; }
.footer-btn--ghost { justify-self: start; }
.footer-btn--solid {
  justify-self: end;
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.footer-btn--solid:hover { background: rgba(255,255,255,0.18); }
.footer-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.footer-center {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 70px;
}
.footer-label {
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.selected-chips {
  display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: center;
}
.selected-chips .chip {
  width: 28px; height: 28px;
  border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px;
  background: var(--surface);
  color: var(--ink);
}
.selected-chips .chip[data-letter="A"] { background: var(--c-passion);  color: var(--c-passion-ink); }
.selected-chips .chip[data-letter="B"] { background: var(--c-skills);   color: var(--c-skills-ink); }
.selected-chips .chip[data-letter="C"] { background: var(--c-mission);  color: var(--c-mission-ink); }
.selected-chips .chip[data-letter="D"] { background: var(--c-vocation); color: var(--c-vocation-ink); }
.selected-chips .chip[data-letter="E"] { background: var(--c-extra);    color: var(--c-extra-ink); }
.chip-empty {
  font-size: 12px; color: rgba(255,255,255,0.4);
}

/* =============================================================
   4. RESULT
   ============================================================= */
.screen--result {
  background: linear-gradient(180deg, #f4f6fa 0%, #ffffff 60%);
  padding: 22px 18px 28px;
  gap: 16px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.result-header { padding: 0 0 4px; }
.progress-track.full { height: 6px; }
.progress-fill.full { width: 100%; }

.result-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: flex-start;
}
.result-meta { display: flex; flex-direction: column; }
.result-meta .eyebrow {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.result-name {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.result-blurb {
  margin: 8px 0 12px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
  max-width: 220px;
}
.result-icons { display: inline-flex; gap: 8px; }
.rico {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-2);
  border: 1px solid var(--line);
}

.result-avatar {
  width: 110px; height: 130px;
  border-radius: 22px;
  background:
    radial-gradient(120% 100% at 30% 20%, #ffe9c2 0%, #f0a8a0 40%, #6b6f8d 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.result-avatar::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 40% at 50% 30%, rgba(255,255,255,0.45) 0%, transparent 60%);
  pointer-events: none;
}
.avatar-glyph {
  font-size: 56px;
  font-weight: 800;
  color: rgba(255,255,255,0.95);
  text-shadow: 0 2px 12px rgba(0,0,0,0.25);
  z-index: 1;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.score-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 10px;
  display: flex; flex-direction: column; gap: 6px;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.score-num { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.score-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 700;
}
.score-bar {
  height: 4px; background: var(--surface-2); border-radius: 999px; overflow: hidden;
}
.score-fill {
  height: 100%; width: 0%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(.4,0,.2,1);
}
.score-card[data-circle="passion"]  .score-fill { background: var(--c-passion-ink); }
.score-card[data-circle="skills"]   .score-fill { background: var(--c-skills-ink); }
.score-card[data-circle="mission"]  .score-fill { background: var(--c-mission-ink); }
.score-card[data-circle="vocation"] .score-fill { background: var(--c-vocation-ink); }

.result-card {
  margin: 4px -18px 0;
  background: var(--dark);
  color: #fff;
  border-radius: 28px 28px 0 0;
  padding: 18px 22px 26px;
  flex: 0 0 auto;
  display: flex; flex-direction: column;
  position: relative;
  box-shadow: 0 -12px 30px rgba(15,17,22,0.18);
}
.result-card-grip {
  width: 44px; height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 999px;
  margin: 0 auto 14px;
}
.result-card-title {
  margin: 0 0 10px;
  font-size: 26px; font-weight: 800;
  letter-spacing: -0.015em;
}
.result-card-text {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255,255,255,0.82);
}
.result-card-text.small { font-size: 12.5px; color: rgba(255,255,255,0.7); }

.overlap-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 6px 0 16px;
}
.overlap-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}
.ghost-light, .solid-light {
  appearance: none;
  border: 0;
  height: 46px;
  border-radius: 14px;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.ghost-light {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
}
.ghost-light:hover { background: rgba(255,255,255,0.06); }
.solid-light {
  background: #fff;
  color: var(--ink);
}
.solid-light:hover { background: #f3f3f3; }
.solid-light:active, .ghost-light:active { transform: scale(0.98); }

/* =============================================================
   Helpers / responsive
   ============================================================= */
@media (max-width: 360px) {
  .welcome-title { font-size: 24px; }
  .question-title { font-size: 19px; }
}

/* Scrollbars (subtle) */
.form-body::-webkit-scrollbar,
.screen--result::-webkit-scrollbar { width: 0; height: 0; }

/* Result avatar color variants by archetype */
.result-avatar[data-tone="passion"]  { background: radial-gradient(120% 100% at 30% 20%, #ffeed6 0%, #c8efd2 50%, #2c7a4a 100%); }
.result-avatar[data-tone="skills"]   { background: radial-gradient(120% 100% at 30% 20%, #ffe5e2 0%, #ffd8d6 50%, #a14444 100%); }
.result-avatar[data-tone="mission"]  { background: radial-gradient(120% 100% at 30% 20%, #d8f0ee 0%, #c8e8e6 50%, #20696a 100%); }
.result-avatar[data-tone="vocation"] { background: radial-gradient(120% 100% at 30% 20%, #fff3c8 0%, #f5e9b6 50%, #8a6f1a 100%); }

/* =============================================================
   AI Analysis section — Mercury 2 via Inception
   ============================================================= */
.ai-section {
  margin: 18px 18px 0;
  border-radius: var(--radius-md);
  background: linear-gradient(
    180deg,
    rgba(108, 209, 126, 0.06) 0%,
    rgba(220, 207, 245, 0.08) 100%
  );
  border: 1px solid var(--line);
  overflow-x: hidden;
  overflow-y: visible;
  position: relative;
  /* Reserve a larger reading pane so this block doesn’t feel like a thin strip */
  min-height: clamp(260px, 52dvh, 520px);
}

.ai-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 80% 0%, rgba(108, 209, 126, 0.12), transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(220, 207, 245, 0.18), transparent 50%);
  pointer-events: none;
}

.ai-loading,
.ai-content,
.ai-error {
  position: relative;
  padding: 24px 22px;
}

.hidden {
  display: none !important;
}

/* ---- Loading state ---- */
.ai-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-height: 130px;
  justify-content: center;
}

.ai-spinner {
  display: inline-flex;
  gap: 6px;
}

.ai-spinner span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  display: inline-block;
  animation: aiBounce 1.2s ease-in-out infinite;
}

.ai-spinner span:nth-child(2) {
  animation-delay: 0.15s;
  background: var(--c-mission-ink);
}

.ai-spinner span:nth-child(3) {
  animation-delay: 0.3s;
  background: var(--c-extra-ink);
}

@keyframes aiBounce {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.ai-loading-text {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* ---- Content state ---- */
.ai-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ai-badge svg {
  color: var(--accent-2);
}

.ai-text {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-2);
  white-space: pre-wrap;
  font-weight: 500;
}

.ai-fineprint {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* ---- Error state ---- */
.ai-error {
  text-align: center;
}

.ai-error-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}

.ai-error-msg {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.ai-retry {
  font-size: 13px;
  padding: 8px 16px;
}
