: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-wrap {
  position: relative;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: 500 0.75rem var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--forest);
  background: var(--card);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease;
}

.lang-toggle:hover,
.lang-toggle[aria-expanded='true'] {
  box-shadow: var(--shadow);
}

.lang-toggle .flag {
  font-size: 0.9rem;
  line-height: 1;
}

.lang-toggle .chev {
  font-size: 0.6rem;
  opacity: 0.55;
  transition: transform 0.15s ease;
}

.lang-toggle[aria-expanded='true'] .chev {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  min-width: 190px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.35rem;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow), 0 2px 6px rgba(26, 36, 32, 0.05);
  transform-origin: top right;
  animation: menu-in 0.14s ease both;
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.97);
  }
}

.lang-opt {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.62rem 0.75rem;
  border-radius: 12px;
  font-size: 0.92rem;
  text-align: left;
  color: var(--text);
}

.lang-opt .flag {
  font-size: 1.05rem;
  line-height: 1;
}

.lang-opt:hover,
.lang-opt:focus-visible {
  background: rgba(143, 216, 200, 0.24);
  outline: none;
}

.lang-opt.on {
  color: var(--forest);
  font-weight: 600;
}

.lang-opt .check {
  margin-left: auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--lime);
  color: var(--forest);
  font-size: 0.68rem;
  font-weight: 700;
}

.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;
}

.prompt-card .prompt-intro-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1.2;
  margin-top: 0.3rem;
}

.prompt-card p.prompt-intro {
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
  margin-top: 0.45rem;
}

.prompt-question {
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.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-from {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  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);
}

/* —— Accueil: resume, pack, surprise, congrats, round, themes —— */
.resume-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.2rem 0.75rem;
  width: 100%;
  text-align: left;
  background: var(--card);
  border-radius: 20px;
  padding: 0.95rem 1.1rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--coral);
}

.resume-card .eyebrow {
  grid-column: 1;
}

.resume-card .plan-title {
  grid-column: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resume-card .pill {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.plan-card.done {
  opacity: 0.72;
}

.plan-card.done .plan-index,
.plan-index.done {
  background: var(--lime);
  color: var(--forest);
}

.pill.lime {
  background: var(--lime);
  color: var(--forest);
}

.pill.done {
  background: #e1ecd9;
  color: var(--brand);
  box-shadow: none;
}

.btn.lime {
  background: var(--lime);
  color: var(--forest);
}

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

.section-head.light {
  color: #fff;
}

.on-dark {
  color: var(--on-dark-muted);
  font-size: 0.95rem;
}

.on-dark.small {
  font-size: 0.82rem;
}

.card.surprise {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(194, 255, 96, 0.22), transparent 55%),
    var(--forest);
}

.surprise-q {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.35;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 0.8rem 0.95rem;
}

.card.congrats {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background:
    radial-gradient(circle at 0% 0%, rgba(194, 255, 96, 0.45), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(143, 216, 200, 0.4), transparent 50%),
    var(--card);
}

.card.congrats .btn {
  margin-top: 0.35rem;
}

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

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

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

.round-track i,
.xp-track i {
  display: block;
  height: 100%;
  border-radius: 8px;
  background: var(--lime);
  transition: width 0.4s ease;
}

.score-card .xp-track {
  background: rgba(255, 255, 255, 0.14);
  margin: 0.6rem 0 0.4rem;
}

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

.theme-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-align: left;
  background: var(--card);
  border-radius: 20px;
  padding: 0.95rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease;
}

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

.theme-card .plan-card-top {
  min-height: 1.2rem;
}

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

.theme-card.reco {
  box-shadow: 0 0 0 2px var(--lime) inset, var(--shadow-sm);
}

.theme-card.done {
  background: #eaf3e2;
}

.theme-card .plan-body {
  -webkit-line-clamp: 2;
}

/* —— Session extras —— */
.session-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  font-size: 1.3rem;
  line-height: 1;
  flex: none;
}

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

.bubble.soft {
  background: #fff4f3;
  color: #8a2d26;
  box-shadow: 0 0 0 1px rgba(255, 90, 80, 0.25) inset;
}

/* —— Themes and drills —— */
.back-link {
  align-self: flex-start;
  font: 500 0.8rem var(--font-mono);
  color: var(--brand);
  padding: 0.25rem 0;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.drill-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  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;
}

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

.drill-card .lock {
  margin-left: auto;
  opacity: 0.7;
}

.drill-card .pill.done {
  margin-left: auto;
}

.drill-card.locked {
  opacity: 0.6;
}

.drill-card.locked::after {
  content: none;
}

.drill-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card.drill-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
}

.orb {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2rem;
  color: var(--forest);
  background: radial-gradient(circle at 30% 30%, #e8ffc2, var(--lime));
  box-shadow: 0 10px 30px rgba(194, 255, 96, 0.55);
}

.center-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.9rem;
  min-height: 38vh;
}

.count-ring {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 600 3.4rem var(--font-display);
  color: var(--forest);
  background: var(--card);
  box-shadow: 0 0 0 6px var(--lime), var(--shadow);
}

.count-ring.small {
  width: 96px;
  height: 96px;
  font-size: 2rem;
}

.count-ring.breath {
  transition: transform 1s ease;
}

.count-ring.breath.in {
  transform: scale(1.18);
  box-shadow: 0 0 0 6px var(--teal), var(--shadow);
}

.count-ring.breath.hold {
  transform: scale(1.18);
  box-shadow: 0 0 0 6px var(--lime), var(--shadow);
}

.count-ring.breath.out {
  transform: scale(0.9);
  box-shadow: 0 0 0 6px var(--coral), var(--shadow);
}

.solo-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 0 0.5rem;
}

.solo-clock {
  font: 600 1.4rem var(--font-mono);
  color: var(--forest);
}

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

.seg-row {
  display: flex;
  gap: 5px;
}

.seg-row i {
  flex: 1;
  height: 5px;
  border-radius: 5px;
  background: rgba(26, 45, 9, 0.1);
}

.seg-row i.on {
  background: var(--forest);
}

.full-line {
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.4;
  max-width: 30ch;
}

.chunk {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 7vw, 2.4rem);
  line-height: 1.25;
  color: var(--forest);
}

.flash-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 11vw, 3.6rem);
  color: var(--forest);
}

.flash-word.alt {
  color: var(--brand);
}

.row-actions {
  display: flex;
  gap: 0.5rem;
}

.row-actions .btn {
  flex: 1;
}

/* —— Progress —— */
.seg-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--tint);
  border-radius: 999px;
  padding: 4px;
}

.seg-tabs button {
  border-radius: 999px;
  padding: 0.6rem;
  font-weight: 600;
  color: var(--muted);
}

.seg-tabs button.on {
  background: var(--card);
  color: var(--forest);
  box-shadow: var(--shadow-sm);
}

.since-line {
  font: 500 0.88rem var(--font-mono);
  color: var(--muted);
  margin-top: 0.35rem;
}

.since-line.up {
  color: var(--brand);
}

.since-line.down {
  color: #b3261e;
}

.history-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0;
  border-top: 1px solid var(--tint);
}

.history-row:first-of-type {
  border-top: none;
}

.history-score {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 600 1rem var(--font-display);
  background: var(--forest);
  color: var(--lime);
}

.history-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.history-text b {
  font-weight: 600;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-text small {
  font-size: 0.78rem;
  color: var(--muted);
}

.chev {
  font-size: 1.3rem;
  color: var(--warm);
}

/* —— Settings —— */
.lang-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lang-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  background: var(--bg);
  font-weight: 500;
}

.lang-chip.on {
  background: var(--forest);
  color: #fff;
}

.lang-chip:disabled {
  opacity: 0.5;
}

.card.list {
  padding: 0.35rem 1.1rem;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0.85rem 0;
  border-top: 1px solid var(--tint);
}

.settings-row:first-child {
  border-top: none;
}

.settings-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.settings-text b {
  font-weight: 600;
}

.settings-text small {
  font-size: 0.8rem;
  color: var(--muted);
}

.settings-row.danger b {
  color: #b3261e;
}

/* —— Analysis (app: AnalysisScreen) —— */
.an-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.pillar-detail {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 0.35rem;
}

.pillar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.pillar-head b {
  font-weight: 600;
}

.pillar-head span {
  font: 600 0.82rem var(--font-mono);
  color: var(--muted);
}

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

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

.bar.pathos i {
  background: var(--coral);
}

.metric b {
  overflow-wrap: anywhere;
}

.filler-fix {
  background: #f6f8f3;
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.filler-context {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted);
}

.filler-context mark {
  background: rgba(255, 90, 80, 0.14);
  color: #b3261e;
  border-radius: 6px;
  padding: 0 0.2rem;
  font-weight: 600;
}

.filler-swap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.filler-swap s {
  color: var(--coral);
}

.filler-swap .arrow {
  color: var(--warm);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filler-chip,
.weak-chip {
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  background: #eef4ea;
  color: var(--forest);
}

.filler-chip {
  background: rgba(255, 90, 80, 0.1);
  color: #b3261e;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.weak-chip.muted {
  background: var(--tint);
  color: var(--muted);
}

.filler-rate {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

.filler-cta {
  align-self: flex-start;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.filler-coach {
  background: var(--forest);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0.25rem 0 0.5rem;
}

.filler-coach .eyebrow {
  color: #c2ff60;
}

.filler-coach h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 0;
}

.filler-coach p {
  margin: 0;
  line-height: 1.5;
}

.filler-coach .filler-chip {
  background: #ff5a50;
  color: #fff;
}

.filler-coach .filler-rate {
  color: #cfe0c6;
}

.filler-example {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filler-example s {
  color: #ff5a50;
  font-weight: 600;
}

.filler-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #cfe0c6;
}

.filler-pause {
  color: #c2ff60;
}

.filler-plan {
  color: #c2ff60;
  font-weight: 600;
}

.filler-goal {
  align-self: center;
  background: var(--forest);
  color: #c2ff60;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  margin: 0;
}

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

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

.takeaway-body {
  font-family: var(--font-display);
  font-size: 1.12rem;
  line-height: 1.4;
}

.takeaway .sub {
  color: var(--on-dark-muted);
}

.tip-row {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--tint);
  font-size: 0.92rem;
  line-height: 1.45;
}

.tip-row:first-of-type {
  border-top: none;
}

.tip-row b {
  font: 600 0.75rem var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand);
  padding-top: 0.15rem;
}

.locked-block {
  width: 100%;
  text-align: left;
}

.blurred {
  filter: blur(4px);
  user-select: none;
}

.lock-hint {
  font: 600 0.8rem var(--font-mono);
  color: var(--coral);
}

/* —— Web plans (paywall) —— */
.plan-options {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.plan-options:empty {
  display: none;
}

.plan-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  background: var(--card);
  border-radius: 18px;
  padding: 0.95rem 1.1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease;
}

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

.plan-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.plan-option.selected {
  background: var(--forest);
  color: #fff;
  box-shadow: 0 0 0 2px var(--lime) inset, var(--shadow);
}

.plan-radio {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.22) inset;
}

.plan-option.selected .plan-radio {
  background: var(--lime);
  box-shadow: 0 0 0 5px var(--forest) inset, 0 0 0 2px var(--lime);
}

.plan-cta {
  width: 100%;
  margin-top: 0.35rem;
  font-size: 1.05rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.plan-option-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.plan-option-text b {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.plan-option-text small {
  font-size: 0.85rem;
  color: var(--muted);
}

.plan-option.selected .plan-option-text small {
  color: var(--on-dark-muted);
}

/* —— Répertoire —— */
.rep-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 116px;
  text-align: left;
  background: #f7f9f5;
  border-radius: 18px;
  padding: 0.9rem 1rem;
  box-shadow: 0 0 0 1px var(--tint) inset;
}

.rep-card.on {
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.rep-card:disabled {
  cursor: default;
}

.rep-card b {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}

.rep-card small {
  font-size: 0.78rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rep-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rep-tag {
  font: 500 0.72rem var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rep-logos {
  color: var(--brand);
}

.rep-ethos {
  color: #2f8f7c;
}

.rep-pathos {
  color: var(--coral);
}

.rep-orb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.66rem;
  background: var(--tint);
}

.rep-card.on .rep-orb {
  background: var(--lime);
  color: var(--forest);
  font-weight: 700;
}

.rep-evidence {
  background: #eef4ea;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}

/* —— Bottom tab bar —— */
body.with-tabs .app {
  padding-bottom: 6.5rem;
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: min(420px, calc(100% - 2rem));
  padding: 6px;
  border-radius: 999px;
  background: var(--forest);
  box-shadow: 0 14px 34px rgba(26, 45, 9, 0.28);
}

.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.65rem 0.5rem;
  color: var(--on-dark-muted);
  font-weight: 600;
  font-size: 0.88rem;
}

.tab.on {
  background: var(--lime);
  color: var(--forest);
}

.tab-icon {
  font-size: 1rem;
  line-height: 1;
}

@media (max-width: 480px) {
  .theme-grid {
    grid-template-columns: 1fr;
  }

  .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;
  }
}
