/*
 * Nia design system - mobile-first (docs/prototypes/
 * mobile-first-demo.html). Small, hand-written CSS - no framework, no
 * preprocessor, no build step. Every color/spacing/radius value here comes
 * from app/web/static/tokens.css; nothing below hardcodes a "magic" value
 * that duplicates a token.
 *
 * Layout model: a single phone-width column (--app-width) centered on any
 * screen. There is no separate desktop layout.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* The native `hidden` attribute must always win over a class that sets its
   own `display` (e.g. `.banner`, `.button`) - otherwise an element authors
   intended to be hidden (banners, recovery buttons) renders visible. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  background: var(--color-page-bg);
  color: var(--color-text);
}

img {
  max-width: 100%;
}

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

input[type="radio"],
input[type="checkbox"] {
  accent-color: var(--color-primary);
}

/* Focus is always visible - never outline: none without a replacement. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

h1,
h2,
h3 {
  line-height: var(--leading-tight);
  font-weight: var(--weight-bold);
}

h1 {
  font-size: var(--text-2xl);
  margin: 0 0 var(--space-2);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-xl);
  margin: var(--space-6) 0 var(--space-3);
}

h3 {
  font-size: var(--text-lg);
  margin: var(--space-4) 0 var(--space-2);
}

p {
  margin: 0 0 var(--space-3);
}

textarea {
  font: inherit;
  resize: vertical;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  color: var(--color-text);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
}

.skip-link:focus {
  left: var(--space-2);
  top: var(--space-2);
}

/* ---------- App shell (phone-width column) ---------- */

.app-shell {
  width: min(100%, var(--app-width));
  min-height: 100vh;
  min-height: 100dvh;
  margin-inline: auto;
  background: var(--color-bg);
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
}

/* Room for the fixed bottom navigation. */
.app-shell--with-nav {
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
}

.page {
  padding: calc(env(safe-area-inset-top) + var(--space-4)) var(--space-4) var(--space-6);
}

.page--auth {
  padding-top: var(--space-7);
}

.page__back {
  display: inline-block;
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
}

/* ---------- Top bar (home) ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--touch-target);
  margin-bottom: var(--space-1);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-inline-end: auto;
  min-width: 0;
  color: var(--color-text);
  text-decoration: none;
}

.brand__mark {
  color: var(--color-brand);
}

.brand-copy {
  display: grid;
  line-height: 1.2;
  min-width: 0;
}

.brand-copy strong {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  letter-spacing: -0.015em;
}

.brand-copy span {
  margin-top: 1px;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.icon-link {
  display: grid;
  place-items: center;
  width: var(--touch-target);
  height: var(--touch-target);
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--text-lg);
  border: 0;
  cursor: pointer;
}

/* Bolha redonda do avatar/perfil no cabeçalho da Home - distinta de
   .icon-link (usado para setas de voltar e o menu "..." em outras telas)
   porque o protótipo pede uma forma diferente ali. */
.icon-btn {
  display: grid;
  place-items: center;
  width: var(--touch-target);
  height: var(--touch-target);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text-muted);
  text-decoration: none;
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

/* ---------- Idioma e sequência (home) ---------- */

.status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
  margin-bottom: var(--space-1);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch-target);
  padding-inline: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  font-size: var(--text-sm);
}

/* Idioma da prática (tasks/036-multilingual-foundation.md): o chip é agora
   um <form>/<select> real, mas com uma única opção enquanto só o inglês
   estiver disponível - visualmente idêntico ao chip de exibição anterior. */
.chip--lang {
  font-weight: var(--weight-medium);
}

.chip--lang .flag {
  width: 22px;
  height: 15px;
  flex: 0 0 auto;
  border: 1px solid var(--color-border);
  border-radius: 3px;
}

/* Reseta a aparência nativa do <select> para que ele leia como o texto do
   chip que substituiu, não como um campo de formulário. */
.chip-lang-select {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: inherit;
  color: inherit;
  cursor: pointer;
}

.chip-lang-select:focus-visible {
  outline: 2px solid var(--color-border-strong);
  outline-offset: 2px;
}

/* A chama é recompensa pequena: o laranja fica no ícone, o texto segue na
   cor normal - nada de pílula colorida disputando com o CTA principal. */
.chip--streak {
  color: var(--color-text-muted);
}

.chip--streak strong {
  color: var(--color-text);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
}

.flame {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.flame-outer {
  fill: var(--color-streak);
}

.flame-core {
  fill: var(--color-streak-core);
}

/* ---------- A prática de hoje - o herói da tela ---------- */

.today {
  margin-top: var(--space-5);
}

.greeting {
  color: var(--color-text-muted);
  font-size: var(--text-md);
  margin-bottom: 0;
}

.today .eyebrow {
  margin-top: var(--space-5);
  color: var(--color-brand);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.today h1 {
  margin-top: var(--space-2);
  font-size: clamp(1.75rem, 7.5vw, 2.125rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.today-meta {
  margin-top: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* A razão da escolha (D-079): só existe quando é lastreada em dado real -
   por isso texto corrido, e não um rótulo de diagnóstico. */
.reason {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-brand-soft);
  color: var(--color-brand);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.actions {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.section-title {
  font-size: var(--text-lg);
  margin: var(--space-6) 0 var(--space-3);
}

/* ---------- Bottom navigation ---------- */

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, var(--app-width));
  height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  padding: var(--space-2) var(--space-3) calc(var(--space-2) + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  z-index: 50;
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  min-width: 70px;
  min-height: var(--touch-target);
  justify-content: center;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-xs);
  border-radius: var(--radius-md);
}

.bottom-nav__icon {
  font-size: var(--text-xl);
  line-height: 1;
}

/* Current page: never conveyed by color alone - weight and a filled
   background change together with the color. */
.bottom-nav__item[aria-current="page"] {
  color: var(--color-text);
  font-weight: var(--weight-bold);
  background: var(--color-primary-soft);
}

.bottom-nav__item[aria-current="page"] .bottom-nav__icon {
  color: var(--color-link);
}

/* Eyebrow/meta de destaque reaproveitados fora da Home (ex. "Revisão
   rápida" no topo de Revisar) - preservados por style.css mesmo sem
   ".hero-card" em volta, porque o valor está no par rótulo+meta, não no
   cartão que os envolvia. */
.hero-card__eyebrow {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-brand);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-2);
}

.hero-card__meta {
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

/* ---------- Régua ---------- */

/* No lugar de mais uma borda de card: a Home é separada por espaço e
   linha, não por caixas empilhadas (menos cards, mais hierarquia). */
.rule {
  height: 1px;
  margin: var(--space-6) 0;
  border: 0;
  background: var(--color-border);
  padding: 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.section-head h2 {
  margin: 0;
}

.section-head span {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ---------- Ritmo da semana (home) ---------- */

.week-count {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  line-height: var(--leading-tight);
  font-variant-numeric: tabular-nums;
}

.week-count small {
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  color: var(--color-text-muted);
}

.week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-4);
  list-style: none;
  padding: 0;
}

.week li {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  padding-block: var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

/* Forma + cor, nunca só cor: praticado = check preenchido, pendente = anel
   vazio (acessibilidade - significado não depende só da cor). */
.week .mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  font-size: var(--text-xs);
  line-height: 1;
}

.week .is-done {
  background: var(--color-done-bg);
  color: var(--color-done-text);
}

.week .is-done .mark {
  border-color: var(--color-done);
  background: var(--color-done);
  color: var(--color-on-done);
}

.week .is-today {
  border-color: var(--color-border-strong);
}

/* ---------- Revisões (home) - ação pequena, sem sensação de dívida ---------- */

.review-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.review-row > div {
  flex: 1 1 11rem;
}

.review-row p {
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  margin: 0;
}

.review-row .meta {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-1);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.home-note {
  margin-top: var(--space-5);
  font-size: var(--text-sm);
}

/* ---------- Cards ---------- */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.card + .card,
.stack > .card + .card {
  margin-top: var(--space-4);
}

.card--primary-action {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--touch-target);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-family: inherit;
  font-weight: var(--weight-medium);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface-alt);
  color: var(--color-text);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}

.button:hover {
  background: var(--color-border);
}

.button--primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: var(--color-primary-contrast);
  border-color: transparent;
}

.button--primary:hover {
  background: var(--color-primary-hover);
}

.button--danger {
  background: transparent;
  color: var(--color-danger-text);
  border-color: var(--color-danger-border);
}

.button--danger:hover {
  background: var(--color-danger-bg);
}

/* Ação pequena e discreta (ex. "Revisar" na Home): tom de marca, sem a
   força visual de .button--primary - a prática recomendada continua sendo
   o único CTA principal da tela. */
.button--tonal {
  background: var(--color-brand-soft);
  color: var(--color-brand);
  border-color: transparent;
}

.button--tonal:hover {
  background: var(--color-surface-alt);
}

.button--small {
  min-height: 2rem;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

.button--block {
  width: 100%;
}

.button--hero {
  min-height: 52px;
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  border-radius: var(--radius-lg);
}

.button:disabled,
.button[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
}

.button[aria-busy="true"] {
  cursor: progress;
}

.button__spinner {
  width: 0.9em;
  height: 0.9em;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Forms ---------- */

form.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.field > label {
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
}

.field input,
.field select,
.field textarea {
  font: inherit;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text);
  min-height: var(--touch-target);
}

.field textarea {
  min-height: calc(var(--touch-target) * 2);
}

.field__help {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.field--error input,
.field--error select,
.field--error textarea {
  border-color: var(--color-danger);
}

.field__error {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-danger-text);
}

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  background: var(--color-surface-alt);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  white-space: nowrap;
}

.badge--success {
  background: var(--color-success-bg);
  color: var(--color-success-text);
  border-color: var(--color-success-border);
}

.badge--warning {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  border-color: var(--color-warning-border);
}

.badge--danger {
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
  border-color: var(--color-danger-border);
}

.badge--info {
  background: var(--color-info-bg);
  color: var(--color-info-text);
  border-color: var(--color-info-border);
}

/* ---------- Banners ---------- */

.banner {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  font-size: var(--text-sm);
}

.banner__icon {
  flex-shrink: 0;
  font-weight: var(--weight-bold);
}

.banner--info {
  background: var(--color-info-bg);
  border-color: var(--color-info-border);
  color: var(--color-info-text);
}

.banner--success {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
  color: var(--color-success-text);
}

.banner--warning {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
  color: var(--color-warning-text);
}

.banner--error {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-border);
  color: var(--color-danger-text);
}

.banner__actions {
  margin-top: var(--space-2);
}

/* Legacy aliases kept so any inline message still gets readable color even
   before every template is touched by a future change. */
.error {
  color: var(--color-danger-text);
}

.success {
  color: var(--color-success-text);
}

/* ---------- Empty states ---------- */

.empty-state {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  color: var(--color-text-muted);
}

.empty-state__icon {
  font-size: var(--text-2xl);
  display: block;
  margin-bottom: var(--space-2);
}

.empty-state__action {
  margin-top: var(--space-3);
}

/* ---------- Lists as responsive card groups (never a wide table) ---------- */

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.item-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}

.item-card__title {
  font-weight: var(--weight-medium);
  text-decoration: none;
  color: var(--color-text);
  display: block;
}

.item-card__title:hover {
  color: var(--color-link);
}

.item-card__meta {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

/* ---------- Definition-style summary lists ---------- */

.summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.summary-list.card {
  padding: var(--space-4);
}

.summary-list > li {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  flex-direction: column;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-2);
}

.summary-list > li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.summary-list__label {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ---------- Conversation as chat ---------- */

.transcript {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.transcript__item {
  max-width: 85%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
}

.transcript__item--assistant {
  align-self: flex-start;
  border-bottom-left-radius: var(--radius-sm);
}

.transcript__item--learner {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  border-color: transparent;
  color: var(--color-primary-contrast);
  border-bottom-right-radius: var(--radius-sm);
}

.transcript__who {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  opacity: 0.7;
  margin-bottom: var(--space-1);
}

.utterance-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.review-origin__quote {
  font-style: italic;
}

/* ---------- Conversation room ---------- */

.page--chat {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: var(--space-4);
}

.chat-header {
  display: grid;
  grid-template-columns: var(--touch-target) 1fr var(--touch-target);
  align-items: center;
  gap: var(--space-2);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-3);
}

.chat-header__title {
  text-align: center;
  min-width: 0;
}

.chat-header__title h1 {
  font-size: var(--text-base);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header__subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.chat-menu {
  position: relative;
}

.chat-menu > summary {
  list-style: none;
}

.chat-menu > summary::-webkit-details-marker {
  display: none;
}

.chat-menu__panel {
  position: absolute;
  right: 0;
  top: calc(var(--touch-target) + var(--space-2));
  z-index: 60;
  width: min(280px, calc(100vw - 2 * var(--space-4)));
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-md);
}

.chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  /* Keep the last messages clear of the fixed composer. */
  padding-bottom: 150px;
}

.chat-body .transcript {
  flex: 1;
}

.empty-state--chat {
  border: 0;
  margin-top: var(--space-6);
}

.assist-chip {
  align-self: flex-end;
  margin-top: var(--space-3);
  border: 1px solid var(--color-info-border);
  background: var(--color-primary-soft);
  color: var(--color-link);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  font-family: inherit;
  min-height: var(--touch-target);
  cursor: pointer;
}

/* ---------- Voice composer ---------- */

.composer {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, var(--app-width));
  padding: var(--space-2) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--color-bg) 75%, transparent);
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.composer__status {
  margin: 0;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Call/turn errors live inside the fixed composer (tasks/020) so a failure
   mid-conversation is visible without scrolling the chat back to the top. */
.composer__alert {
  margin: 0;
  font-size: var(--text-sm);
}

.composer__hint {
  margin: 0;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text);
}

.composer__card {
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  box-shadow: var(--shadow-md);
}

/* While requesting the microphone / stopping, every primary button may be
   hidden - don't render an empty pill. */
.composer__card:not(:has(button:not([hidden]))) {
  display: none;
}

.mic-button {
  flex: 1;
  border: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: var(--color-primary-contrast);
  padding: var(--space-4);
  font-family: inherit;
  font-weight: var(--weight-bold);
  font-size: var(--text-base);
  min-height: 52px;
  cursor: pointer;
}

.mic-button--stop {
  background: linear-gradient(135deg, var(--color-danger), var(--color-danger-hover));
}

/* "✓ Terminei": the mic is live, so the dominant button turns recording-red
   (same visual language as the prototype's recording state). */
.mic-button--finish {
  background: linear-gradient(135deg, var(--color-danger), var(--color-danger-hover));
}

.mic-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.composer__secondary {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.composer__secondary:empty {
  display: none;
}

/* Secondary composer controls, up to three peers sharing the row below the
   dominant voice CTA - [ Repetir ] [ Escrever resposta ] [ Encerrar
   prática ] (tasks/019 designed this for two; tasks/024 added "Repetir"
   without revisiting the row, and tasks/027's production validation found
   the third button overflowing/overlapping its neighbours at real
   smartphone widths: `white-space: nowrap` with `min-width: 0` lets a flex
   item shrink its box below its own text's width instead of the row
   wrapping to a second line - the text spills out rather than the layout
   adapting). Letting the label wrap inside its own button (min-height as a
   floor, not a cap) fixes it at any width from ~360 to 480px and for two
   or three buttons alike, without a breakpoint or a smaller font. */
.composer__action {
  flex: 1 1 0;
  min-height: 48px;
  min-width: 0;
  padding: var(--space-2) var(--space-2);
  font-size: var(--text-sm);
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}

/* ---------- Text composer (typed turn) ---------- */

.composer__text {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.composer__text input {
  flex: 1;
  min-width: 0;
  min-height: var(--touch-target);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-full);
  background: var(--color-surface-alt);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-base);
}

.composer__text input::placeholder {
  color: var(--color-text-muted);
}

.composer__send {
  flex: 0 0 auto;
  width: var(--touch-target);
  height: var(--touch-target);
  border: 0;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: var(--color-primary-contrast);
  font-size: var(--text-base);
  cursor: pointer;
}

/* ---------- Conversation mode selector (chat menu) ---------- */

.chat-menu__modes {
  border: 0;
  margin: 0 0 var(--space-2);
  padding: 0 0 var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

.chat-menu__modes legend {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 0 var(--space-2);
}

.mode-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  cursor: pointer;
}

.mode-option input {
  margin-top: 3px;
}

.mode-option__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mode-option__title {
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
}

.mode-option__desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.mode-option__hint {
  margin: var(--space-1) 0 0;
  font-size: var(--text-xs);
}

/* ---------- Pre-call setup: pace + modality (tasks/028) ------------------
   Ritmo (tasks/024) moved out of the "⋯" menu here, so it is reachable
   without opening anything; the modality choice sits right below it and is
   the very first action in a fresh room - answered before any
   getUserMedia call. Both live in the fixed composer and disappear once a
   call is connecting/active (there is nothing to change mid-call, D-070). */

.pre-call-setup {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.modality-picker {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.modality-picker__prompt {
  margin: 0;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.modality-picker__options {
  display: flex;
  gap: var(--space-2);
}

.modality-picker__options .mic-button,
.modality-picker__options .button {
  flex: 1;
}

/* ---------- Microphone recovery (tasks/028) -------------------------------
   getUserMedia failing is never a dead end: a short, non-technical
   explanation plus both exits (retry, or continue by text) in the same
   place. */

.mic-recovery {
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  box-shadow: var(--shadow-md);
}

.mic-recovery__message {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text);
}

.mic-recovery__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* ---------- Bottom sheet ---------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: var(--color-scrim);
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet {
  width: min(100%, var(--app-width));
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-3) var(--space-4) calc(var(--space-5) + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-md);
}

.sheet h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
}

.sheet__grabber {
  width: 44px;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--color-border-strong);
  margin: 0 auto var(--space-4);
}

.sheet__goal {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  font-size: var(--text-sm);
}

.sheet__topics {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.sheet__topics li {
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
}

/* ---------- Realtime call panel (legacy session detail) ---------- */

.call-panel__status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
}

.call-panel__timer {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

.call-panel__controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* ---------- Consent ---------- */

.consent-box {
  border: 1px solid var(--color-info-border);
  background: var(--color-info-bg);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

/* ---------- Onboarding steps ---------- */

.onboarding-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.onboarding-steps > li {
  display: flex;
  gap: var(--space-3);
  align-items: baseline;
}

.onboarding-steps__index {
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  min-width: 1.5rem;
}

.onboarding-steps > li[data-done="true"] .onboarding-steps__index::after {
  content: " ✓";
}

/* ---------- Utilities ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-muted {
  color: var(--color-text-muted);
}

.text-lg {
  font-size: var(--text-lg);
}

.section {
  margin-top: var(--space-6);
}

/* ---------- Smart chat scroll (tasks/018) ---------- */

/* Floats just above the fixed composer; shown only when the learner
   scrolled up and a new message arrived. */
.jump-to-latest {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(160px + env(safe-area-inset-bottom));
  z-index: 46;
  min-height: var(--touch-target);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

/* ---------- Post-practice result (tasks/018) ---------- */

.result-header {
  text-align: center;
  margin-bottom: var(--space-4);
}

.result-header h1 {
  margin-bottom: var(--space-1);
}

.result-header p {
  margin: 0;
}

.result-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.result-list__mark {
  font-weight: var(--weight-bold);
  margin-right: var(--space-1);
}

.result-list__mark--good {
  color: var(--color-success-text);
}

.result-progress {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-3);
  font-weight: var(--weight-bold);
}

.result-progress__spinner {
  flex-shrink: 0;
  width: 1.1em;
  height: 1.1em;
  border: 2px solid var(--color-border-strong);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: result-spinner-rotate 0.9s linear infinite;
}

@keyframes result-spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

.result-actions {
  margin-top: var(--space-7, var(--space-6));
}

.result-details-link {
  text-align: center;
  margin: var(--space-2) 0 0;
}

/* ---------- Collapsible detail sections (tasks/018) ---------- */

.detail-fold {
  margin-top: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.detail-fold > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch-target);
  padding: var(--space-3) var(--space-4);
  font-weight: var(--weight-bold);
  cursor: pointer;
  border-radius: var(--radius-lg);
}

.detail-fold > summary::-webkit-details-marker {
  display: none;
}

.detail-fold > summary::before {
  content: "▸";
  color: var(--color-text-muted);
  transition: transform 0.15s ease;
}

.detail-fold[open] > summary::before {
  transform: rotate(90deg);
}

.detail-fold__body {
  padding: 0 var(--space-4) var(--space-4);
}

/* Nested category groups inside "Habilidades" (tasks/019): lighter frame
   than the top-level fold so the hierarchy reads at a glance. */
.detail-fold--nested {
  border-color: var(--color-border);
  background: var(--color-surface-alt);
}

.detail-fold--nested > summary {
  font-size: var(--text-sm);
}

/* ---------- Guias Essenciais (tasks/025) ---------- */

.guide-list {
  list-style: none;
  margin: 0 0 var(--space-6);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.guide-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--touch-target);
  padding: var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
}

.guide-card:hover,
.guide-card:focus-visible {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

.guide-card__icon {
  font-size: var(--text-lg);
}

.guide-card__text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.guide-card__title {
  font-weight: var(--weight-bold);
}

.guide-card__subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.guide-card__time {
  font-size: var(--text-xs);
  white-space: nowrap;
}

.guide-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.guide-header__eyebrow {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.guide-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-2);
}

.guide-purpose {
  margin: 0 0 var(--space-4);
  color: var(--color-text-muted);
}

.guide-key {
  color: var(--color-link);
  font-weight: var(--weight-bold);
}

.guide-patterns {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.guide-patterns__label {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.guide-patterns__form {
  display: block;
  font-size: var(--text-base);
}

.guide-mistakes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.guide-mistakes__wrong,
.guide-mistakes__right {
  margin: 0;
  display: flex;
  gap: var(--space-2);
}

.guide-mistakes__wrong {
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.guide-mistakes__mark {
  font-weight: var(--weight-bold);
}

.guide-mistakes__right .guide-mistakes__mark {
  color: var(--color-success-text);
}

/* ---------- Frases do "O que dizer?" (tasks/024) ---------- */

.sheet__label {
  margin: var(--space-4) 0 var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.phrase-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.phrase {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.phrase__en {
  display: block;
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
}

.phrase__pt {
  display: block;
  font-size: var(--text-sm);
}

/* ---------- Feedback v3 (tasks/023) ---------- */

.result-opening {
  margin: 0 0 var(--space-4);
  font-size: var(--text-lg);
  line-height: 1.5;
}

.model-sentence__text {
  margin: 0 0 var(--space-2);
  padding: var(--space-3);
  border-left: 3px solid var(--color-primary);
  background: var(--color-primary-soft);
  border-radius: var(--radius-sm);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
}

/* ---------- Free conversation (tasks/022) ---------- */

/* Deliberately a link, not a second hero button: the recommended practice
   stays the single primary action of the home. */
.hero-card__secondary {
  display: block;
  width: 100%;
  margin-top: var(--space-3);
  padding: var(--space-2);
  border: 0;
  background: none;
  color: var(--color-link);
  font-family: inherit;
  font-size: var(--text-sm);
  text-align: center;
  text-decoration: underline;
  cursor: pointer;
  min-height: var(--touch-target);
}

.free-topics {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.free-topic {
  min-height: var(--touch-target);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-base);
  cursor: pointer;
}

.free-topic:hover,
.free-topic:focus-visible {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

/* ---------- Review activity (tasks/021) ---------- */

.review-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.review-header__counter {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: var(--weight-bold);
}

.review-instruction {
  margin: 0 0 var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.review-options {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Chips read as inline choices for a gap; the recognition list stays a
   stack of full-width options. */
.review-options--chips {
  flex-direction: row;
  flex-wrap: wrap;
}

.review-option {
  width: 100%;
  min-height: var(--touch-target);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-base);
  text-align: left;
  cursor: pointer;
}

.review-options--chips .review-option {
  width: auto;
  border-radius: var(--radius-full);
  text-align: center;
}

.review-option:hover,
.review-option:focus-visible {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

.review-reveal {
  margin-top: var(--space-4);
}

.review-reveal__body {
  margin-top: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.review-diff__label {
  margin: var(--space-3) 0 var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.review-diff__line {
  margin: 0;
  font-size: var(--text-lg);
}

.review-diff__changed {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-1);
  font-weight: var(--weight-bold);
}

.review-done {
  margin: 0;
  text-align: center;
  font-size: var(--text-lg);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .button__spinner {
    animation: none;
    border-style: dashed;
  }
}

/* =====================================================================
   tasks/032a - marca Nia, landing, autenticação, conta e Progresso.
   Só tokens semânticos: nenhuma cor literal daqui para baixo.
   ===================================================================== */

/* ---------- Assinatura da marca ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.brand__mark {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
}

/* ---------- Telas de autenticação (login, recuperação) ---------- */

.auth-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-4) var(--space-4);
  box-shadow: var(--shadow-md);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  min-height: var(--touch-target);
  text-decoration: none;
  color: var(--color-text);
}

.auth-brand__mark {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
}

.auth-brand__name {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
}

.auth-card h1 {
  margin-bottom: var(--space-2);
}

.auth-card__aside {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
}

/* ---------- Landing (visitante deslogado em /) ---------- */

.page--landing {
  padding-bottom: var(--space-8);
}

.landing__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-7);
}

.landing__hero {
  margin-bottom: var(--space-7);
}

.landing__title {
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}

.landing__lead {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}

/* Sem caixa: a hierarquia da landing é feita de espaço, tipografia e um
   divisor - não de mais um card dentro de outro card. */
.landing__section {
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
  margin-bottom: var(--space-5);
}

.landing__section p {
  color: var(--color-text-muted);
}

.landing__section .section-title {
  margin-top: 0;
}

.landing__loop {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: loop;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.landing__loop > li {
  counter-increment: loop;
  position: relative;
  padding-left: var(--space-6);
  color: var(--color-text-muted);
}

.landing__loop > li::before {
  content: counter(loop);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--radius-full);
  background: var(--color-primary-soft);
  color: var(--color-brand);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
}

.landing__loop strong {
  display: block;
  color: var(--color-text);
}

.landing__footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-sm);
}

/* ---------- Páginas legais ---------- */

.legal h2 {
  font-size: var(--text-lg);
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}

.legal p,
.legal li {
  color: var(--color-text-muted);
}

.legal ul {
  margin: 0 0 var(--space-3) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.legal strong {
  color: var(--color-text);
}

/* ---------- Lista de ações (área Conta) ---------- */

.link-list {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.link-list__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-height: var(--touch-target);
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
  color: var(--color-text);
}

.link-list__item + .link-list__item {
  border-top: 1px solid var(--color-border);
}

a.link-list__item:hover {
  background: var(--color-surface-alt);
}

.link-list__label {
  font-weight: var(--weight-medium);
}

.link-list__hint {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.profile__danger {
  margin-top: var(--space-6);
  font-size: var(--text-sm);
}

.profile__danger a {
  color: var(--color-danger-text);
}

/* ---------- Aparência (perfil) ---------- */

.appearance-control {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin: 0;
  min-width: 0;
  border: 1px solid var(--color-border);
}

.appearance-control legend {
  width: 100%;
  margin-bottom: var(--space-2);
  padding: 0;
}

.appearance-control label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch-target);
  font-size: var(--text-sm);
}

.page-lead {
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}

/* ---------- Progresso: "Isto melhorou" (Antes → Agora) ---------- */

.wins {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.win {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

/* Both links in the card are real touch targets: the visual weight stays
   small, the tappable area is not (>=44px, bloco transversal). */
.win__skill {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  text-decoration: none;
  margin-bottom: var(--space-1);
}

.win__skill:hover {
  color: var(--color-link);
}

.win__step {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: 0;
}

.win__when {
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.win__quote {
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

/* A frase de agora é a prova - é ela que precisa ser lida primeiro dentro
   do card, e a única coisa que a distingue não é cor sozinha (é peso). */
.win__step--after .win__quote {
  color: var(--color-text);
  font-weight: var(--weight-medium);
}

.win__arrow {
  margin: var(--space-1) 0;
  color: var(--color-brand);
  line-height: 1;
}

/* Selos e contagem: presentes, alcançáveis, e deliberadamente discretos -
   não podem competir com a comparação (tasks/032a, bloco 5.7). */
.win__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.win__details {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target);
  font-size: var(--text-xs);
  white-space: nowrap;
}

/* Aceite dos documentos como ato afirmativo próprio, ao lado do botão que
   consente com o processamento por IA (tasks/032a, auditoria pré-commit). */

.consent-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-height: var(--touch-target);
  padding: var(--space-2) 0 var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text);
  cursor: pointer;
}

.consent-check input[type="checkbox"] {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.1rem;
}
