:root {
  /* Mirrors Ausculte/src/theme/colors.ts */
  --bg: #f2f5f0;
  --card: #ffffff;
  --text: #1a2d09;
  --muted: #4a5745;
  --warm: #5e6b58;
  --forest: #1a2d09;
  --brand: #2c6322;
  --lime: #c2ff60;
  --coral: #ff5a50;
  --teal: #8fd8c8;
  --tint: rgba(26, 45, 9, 0.08);
  --on-dark-muted: #cfe0c6;
  --shadow: 0 10px 28px rgba(26, 36, 32, 0.08);
  --shadow-sm: 0 4px 14px rgba(26, 36, 32, 0.06);
  --radius: 22px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 5%, rgba(143, 216, 200, 0.45), transparent 45%),
    radial-gradient(circle at 95% 12%, rgba(255, 90, 80, 0.14), transparent 38%),
    radial-gradient(circle at 0% 55%, rgba(44, 99, 34, 0.08), transparent 40%),
    radial-gradient(circle at 70% 100%, rgba(194, 255, 96, 0.35), transparent 50%),
    var(--bg);
}

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

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

/* —— Top bar —— */
.topbar {
  width: min(560px, calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0 0.5rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-select {
  font: 500 0.75rem var(--font-mono);
  color: var(--muted);
  background: var(--card);
  border: 0;
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.link-btn {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand);
  padding: 0.4rem 0.2rem;
}

.link-btn:hover {
  text-decoration: underline;
}

/* —— Screen layout —— */
.app {
  width: min(560px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 3rem;
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  animation: fade-in 0.25s ease;
}

.screen.top {
  justify-content: flex-start;
}

.screen.center {
  text-align: center;
  align-items: center;
}

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

.dots {
  display: flex;
  gap: 6px;
  margin-bottom: 0.5rem;
}

.dots span {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: rgba(26, 45, 9, 0.12);
}

.dots span.on {
  background: var(--forest);
}

.eyebrow {
  font: 500 0.72rem var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

.headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 5vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.headline .green {
  color: var(--brand);
  font-style: normal;
}

.headline .coral {
  color: var(--coral);
  font-style: normal;
}

.sub {
  color: var(--warm);
  font-size: 0.98rem;
}

.hint {
  font: 500 0.72rem var(--font-mono);
  color: var(--warm);
}

.error {
  background: rgba(255, 90, 80, 0.1);
  color: #b3261e;
  border-radius: 14px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

/* —— Cards & options (no outlines) —— */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.card.dark {
  background: var(--forest);
  color: #fff;
}

.options {
  display: grid;
  gap: 0.6rem;
}

.options.grid-2 {
  grid-template-columns: 1fr 1fr;
}

.option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  background: var(--card);
  border-radius: 16px;
  padding: 0.95rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, background 0.12s ease;
}

.option:hover {
  transform: translateY(-1px);
}

.option.selected {
  background: #e6efe0;
}

.option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.option-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.option-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.check {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: rgba(26, 45, 9, 0.1);
}

.option.selected .check {
  background: var(--coral);
}

.flag {
  font-size: 1.4rem;
}

textarea,
input[type='email'],
input[type='text'] {
  width: 100%;
  font: 400 1rem var(--font-body);
  color: var(--text);
  background: var(--card);
  border: 0;
  border-radius: 16px;
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow-sm);
  outline: none;
}

textarea:focus,
input:focus {
  box-shadow: 0 0 0 2px rgba(44, 99, 34, 0.35), var(--shadow-sm);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input.code {
  font: 600 1.5rem var(--font-mono);
  letter-spacing: 0.4em;
  text-align: center;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 52px;
  border-radius: 999px;
  padding: 0.85rem 1.25rem;
  font-weight: 600;
  font-size: 1rem;
  background: var(--forest);
  color: #fff;
  transition: transform 0.12s ease, opacity 0.12s ease;
  text-decoration: none;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.4;
}

.btn.coral {
  background: var(--coral);
}

.btn.ghost {
  background: transparent;
  color: var(--brand);
  min-height: 44px;
}

.btn.light {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

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

/* —— Welcome —— */
.welcome-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: 500 0.75rem var(--font-mono);
  background: var(--card);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  box-shadow: var(--shadow-sm);
}

.pill.coral {
  background: var(--coral);
  color: #fff;
}

.bullets {
  list-style: none;
  display: grid;
  gap: 0.6rem;
}

.bullets li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.bullets li::before {
  content: '✓';
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--coral);
  margin-top: 1px;
}

/* —— Building / progress —— */
.pulse {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--lime);
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  box-shadow: 0 0 0 18px rgba(44, 99, 34, 0.12);
  animation: pulse 1.8s ease-in-out infinite;
  margin: 1rem auto 1.5rem;
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 28px rgba(44, 99, 34, 0.06);
  }
}

.steps {
  display: grid;
  gap: 0.85rem;
  text-align: left;
  width: 100%;
  max-width: 380px;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  opacity: 0.45;
  transition: opacity 0.2s;
  font-weight: 500;
}

.step.done,
.step.active {
  opacity: 1;
}

.step-mark {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(26, 45, 9, 0.1);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  flex: none;
}

.step.done .step-mark {
  background: var(--forest);
}

.step.active .step-mark {
  background: var(--tint);
  box-shadow: 0 0 0 2px var(--brand) inset;
}

/* —— Session (tutor chat) —— */
.session {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

.session-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.prompt-card {
  background: var(--forest);
  color: #fff;
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
}

.prompt-card .eyebrow {
  color: var(--lime);
}

.prompt-card p {
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 1.35;
  margin-top: 0.35rem;
}

.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.25rem 0;
}

.bubble {
  max-width: 88%;
  border-radius: 18px;
  padding: 0.75rem 0.95rem;
  font-size: 0.95rem;
  line-height: 1.45;
  box-shadow: var(--shadow-sm);
}

.bubble.tutor {
  align-self: flex-start;
  background: var(--card);
  border-bottom-left-radius: 6px;
}

.bubble.user {
  align-self: flex-end;
  background: #e1ecd9;
  border-bottom-right-radius: 6px;
}

.bubble .replay {
  display: inline-flex;
  margin-top: 0.4rem;
  font: 500 0.72rem var(--font-mono);
  color: var(--brand);
}

.bubble .fix {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(26, 45, 9, 0.15);
  font-size: 0.82rem;
  color: var(--muted);
}

.bubble .fix strong {
  color: var(--brand);
}

.typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 0.85rem 1rem;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warm);
  animation: blink 1.2s infinite;
}

.typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  50% {
    opacity: 0.25;
  }
}

.mic-bar {
  position: sticky;
  bottom: 0;
  padding: 0.75rem 0 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}

.mic {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(255, 90, 80, 0.35);
  transition: transform 0.12s ease;
}

.mic:hover:not(:disabled) {
  transform: scale(1.04);
}

.mic:disabled {
  opacity: 0.45;
}

.mic.recording {
  background: var(--forest);
  box-shadow: 0 0 0 calc(6px + var(--level, 0) * 22px) rgba(255, 90, 80, 0.25);
}

.mic svg {
  width: 30px;
  height: 30px;
}

.mic-label {
  font: 500 0.75rem var(--font-mono);
  color: var(--warm);
}

/* —— Analysis —— */
.score-card {
  background: var(--forest);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}

.score-card .eyebrow {
  color: var(--lime);
}

.score-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 0.35rem 0 0.25rem;
}

.score-big {
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 1;
  color: var(--lime);
}

.score-label {
  color: var(--on-dark-muted);
}

.score-card h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.2rem;
  line-height: 1.35;
  margin-top: 0.5rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.metric {
  background: var(--card);
  border-radius: 18px;
  padding: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.metric b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.4rem;
}

.metric span {
  font-size: 0.78rem;
  color: var(--muted);
}

.pillar-row {
  display: grid;
  grid-template-columns: 74px 1fr 36px;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.7rem;
}

.pillar-row:first-of-type {
  margin-top: 0.4rem;
}

.tag {
  font: 500 0.68rem var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 999px;
  padding: 0.25rem 0.5rem;
  text-align: center;
}

.tag.logos {
  background: var(--lime);
}

.tag.ethos {
  background: var(--teal);
}

.tag.pathos {
  background: var(--coral);
  color: #fff;
}

.bar {
  height: 8px;
  border-radius: 8px;
  background: rgba(26, 45, 9, 0.08);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: 8px;
  background: var(--forest);
}

.pillar-row b {
  font: 600 0.9rem var(--font-mono);
  text-align: right;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.card p + p {
  margin-top: 0.5rem;
}

.next-card {
  background: #e6efe0;
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}

.next-card .eyebrow {
  margin-bottom: 0.3rem;
}

.locked {
  position: relative;
  color: var(--muted);
}

.locked::after {
  content: '🔒';
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.pillar-row.dark .bar {
  background: rgba(255, 255, 255, 0.14);
}

.pillar-row.dark .bar i {
  background: var(--lime);
}

.pillar-row.dark b {
  color: #fff;
}

.section-head {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.2;
}

/* —— Plan (locked cards) —— */
.plan-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  text-align: left;
  background: var(--card);
  border-radius: 20px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease;
}

.plan-card:hover {
  transform: translateY(-1px);
}

.plan-card.next {
  box-shadow: var(--shadow);
}

.plan-card-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.plan-index {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 600 0.75rem var(--font-mono);
  background: var(--forest);
  color: var(--lime);
  flex: none;
}

.plan-card .lock {
  margin-left: auto;
  font-size: 0.85rem;
  opacity: 0.7;
}

.plan-title {
  font-weight: 600;
  font-size: 1rem;
}

.plan-body {
  font-size: 0.88rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.pill.small {
  padding: 0.2rem 0.55rem;
  font-size: 0.66rem;
  box-shadow: none;
}

.coral-text {
  color: var(--coral);
  font-weight: 600;
}

/* —— Paywall sheet —— */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(26, 45, 9, 0.35);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade-in 0.2s ease;
}

.sheet {
  position: relative;
  width: min(560px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.6rem 1.4rem 1.8rem;
  border-radius: 28px 28px 0 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(143, 216, 200, 0.45), transparent 50%),
    radial-gradient(circle at 100% 10%, rgba(255, 90, 80, 0.14), transparent 40%),
    radial-gradient(circle at 70% 100%, rgba(194, 255, 96, 0.35), transparent 55%),
    var(--bg);
}

.sheet-close {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  font-size: 1.2rem;
}

@media (min-width: 640px) {
  .modal {
    align-items: center;
  }

  .sheet {
    border-radius: 28px;
  }
}

.store-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.store-row .btn {
  font-size: 0.9rem;
}

.footer-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--warm);
  margin-top: 1rem;
}

.footer-note a {
  color: var(--warm);
}

@media (max-width: 480px) {
  .options.grid-2,
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .score-big {
    font-size: 3.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
