:root {
  --bg: #f4f7f6;
  --card: #ffffff;
  --ink: #14211f;
  --muted: #5f6f6b;
  --line: #dce5e1;
  --brand: #0f766e;
  --brand-strong: #0b5f59;
  --brand-soft: #e6f4f1;
  --danger: #b42318;
  --warn: #b54708;
  --ok: #067647;
  --info: #175cd3;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 33, 31, 0.06), 0 8px 24px rgba(20, 33, 31, 0.05);

  /* c1.2 — menu e fases (decoração vs. texto AA) */
  --fv-sidebar: #02291e;
  --fv-sidebar-ink: #f4f7f6;
  --fv-sidebar-active: #125b2e;
  --fv-coin: #b54708;
  --fv-progress: #125b2e;
  --fv-gap: 16px;
  --fv-radius-card: 16px;

  --fv-phase-0: #4a3ab7;
  --fv-phase-1: #11ad50;
  --fv-phase-2: #0292e5;
  --fv-phase-3: #f78a12;
  --fv-phase-4: #03ada5;
  --fv-phase-5: #931a75;
  --fv-phase-6: #133571;

  /* Texto branco pequeno: só tokens AA */
  --fv-phase-0-text: #4a3ab7;
  --fv-phase-1-text: #0d883f;
  --fv-phase-2-text: #027bc2;
  --fv-phase-3-text: #b46106;
  --fv-phase-4-text: #02857f;
  --fv-phase-5-text: #931a75;
  --fv-phase-6-text: #133571;

  /* Gráficos da carteira: cores próprias (não mudam de matiz com o tema, para as classes nunca se confundirem). */
  --graf-0: #0b5f59;
  --graf-1: #175cd3;
  --graf-2: #b54708;
  --graf-3: #931a75;
  --graf-4: #4a3ab7;
  --graf-5: #5f6f6b;
}

* {
  box-sizing: border-box;
}

html.aguardando-tema body {
  opacity: 0;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 8px 12px;
  z-index: 100;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 1.6rem;
  line-height: 1.2;
}

h2 {
  font-size: 1.15rem;
  line-height: 1.3;
}

h3 {
  font-size: 1rem;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  overflow-x: clip;
}

.sidebar {
  grid-row: 1 / span 2;
  background: var(--fv-sidebar);
  color: var(--fv-sidebar-ink);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  max-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  min-width: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fv-sidebar-ink);
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
}

.sidebar-brand:hover {
  text-decoration: none;
  opacity: 0.95;
}

.sidebar-logo {
  display: block;
  width: 40px;
  height: 40px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar .nav-link,
.bottom-nav .nav-link {
  color: var(--fv-sidebar-ink);
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  opacity: 0.9;
}

.sidebar .nav-link:hover,
.bottom-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
  opacity: 1;
}

.sidebar .nav-link-active,
.bottom-nav .nav-link-active {
  background: var(--fv-sidebar-active);
  color: #fff;
  opacity: 1;
  text-decoration: none;
}

.sidebar-modules:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: auto;
}

.app-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.topbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px 20px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  min-width: 0;
}

.topbar-title {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
}

.apoio-topo-caixa {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.apoio-topo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.apoio-topo:hover,
.apoio-topo:focus-visible {
  border-color: var(--brand);
  color: var(--brand);
}

.apoio-topo:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.apoio-topo-painel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: 250px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(16, 38, 29, 0.16);
}

.apoio-topo-painel[hidden] {
  display: none;
}

.apoio-pix {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.82rem;
}

.apoio-pix-titulo {
  margin: 0;
  font-weight: 700;
}

.apoio-pix-qr {
  align-self: center;
  line-height: 0;
}

.apoio-pix-aviso,
.apoio-pix-detalhe,
.apoio-pix-ciencia {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.apoio-pix-copiar {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.apoio-pix-status {
  margin: 0;
  min-height: 1em;
}

.apoio-pix-codigo {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--bg);
}
.apoio-pix-mais {
  margin: 0.25rem 0;
}
.apoio-pix-mais-titulo {
  cursor: pointer;
  font-size: 0.8rem;
  opacity: 0.85;
}

.apoio-pix-outras {
  text-decoration: underline;
}

.account-link {
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Sair fica discreto no topo; a ação principal continua em "Minha conta". */
.account-sair {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}

.account-sair:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.account-sair:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.page {
  width: min(1100px, 100%);
  max-width: 100%;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 40px) 48px;
  flex: 1;
  min-width: 0;
}

.home {
  min-width: 0;
  overflow-wrap: anywhere;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 24px 16px 32px;
}

.bottom-nav {
  display: none;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(16px, 3vw, 24px);
  box-shadow: var(--shadow);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  background: var(--brand);
  color: #fff;
}

.button:hover {
  background: var(--brand-strong);
  text-decoration: none;
}

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

.button-secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.button-secondary:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
  background: #fff;
}

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--line);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.badge-locked,
.badge-indisponivel {
  background: #f2f4f3;
  color: var(--muted);
}

.badge-completed {
  background: #e8f8ef;
  color: var(--ok);
}

.badge-coming {
  background: #fff7e8;
  color: var(--warn);
}

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

.mission-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mission-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.mission-item a {
  font-weight: 700;
}

/* Home */
.home-hero {
  position: relative;
  border-radius: var(--fv-radius-card);
  overflow: hidden;
  background: var(--fv-sidebar);
  min-height: 200px;
  min-width: 0;
}

.home-hero-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1600 / 600;
  object-fit: cover;
}

.home-hero-overlay {
  position: absolute;
  inset: 0;
  padding: clamp(16px, 4vw, 36px);
  justify-content: flex-end;
  align-items: flex-start;
  max-width: min(50%, 28rem);
  box-sizing: border-box;
  background: linear-gradient(
    90deg,
    rgba(2, 41, 30, 0.92) 0%,
    rgba(2, 41, 30, 0.72) 70%,
    rgba(2, 41, 30, 0.15) 100%
  );
  color: #fff;
}

.home-hero-overlay h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  overflow-wrap: anywhere;
}

.home-hero-cta {
  width: auto;
  max-width: min(22rem, 100%);
  align-self: flex-start;
  white-space: normal;
  text-align: center;
}

.home-selo-fase {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--fv-sidebar-active);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  width: fit-content;
}

.home-progress {
  width: min(320px, 100%);
  height: 10px;
  border: none;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.25);
}

.home-progress::-webkit-progress-bar {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
}

.home-progress::-webkit-progress-value {
  background: #fff;
  border-radius: 999px;
}

.home-progress::-moz-progress-bar {
  background: #fff;
  border-radius: 999px;
}

.home-progress-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.92);
}

.home-coins-value {
  font-size: 1.25rem;
  color: var(--fv-coin);
}

.home-badge-pending {
  margin: 0;
  width: fit-content;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.home-phases {
  display: flex;
  flex-direction: column;
  gap: var(--fv-gap);
}

.home-phases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: var(--fv-gap);
  align-items: stretch;
  min-width: 0;
}

.phase-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--fv-radius-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  box-shadow: var(--shadow);
}

.phase-card-img {
  display: block;
  width: 100%;
  height: auto;
  flex: 0 0 auto;
  aspect-ratio: 480 / 270;
  object-fit: cover;
  background: var(--brand-soft);
}

.phase-card-body {
  padding: 14px 16px 18px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.phase-card-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.phase-card-num {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  width: fit-content;
}

.phase-card-body h3 {
  line-height: 1.3;
  min-height: calc(1.3em * 2);
}

/* Linhas opcionais com altura reservada → títulos/selos/progresso alinhados. */
.phase-card-subtitle {
  min-height: calc(1.5em * 2);
  margin: 0;
}

.phase-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 1.6em;
}

.phase-card-progress {
  min-height: calc(1.5em * 2);
  margin: 0;
}

.phase-card-footer {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  /* Reserva a altura do botão mesmo quando bloqueada/em breve (item 8). */
  min-height: calc(2.75rem + 12px);
}

.phase-card-footer .button {
  width: 100%;
  max-width: 100%;
  white-space: normal;
}

/* Numerais: tokens AA (≥ 3:1 sobre fundo do cartão). Faixa continua decorativa. */
.phase-card-0 .phase-card-num {
  color: var(--fv-phase-0-text);
}
.phase-card-1 .phase-card-num {
  color: var(--fv-phase-1-text);
}
.phase-card-2 .phase-card-num {
  color: var(--fv-phase-2-text);
}
.phase-card-3 .phase-card-num {
  color: var(--fv-phase-3-text);
}
.phase-card-4 .phase-card-num {
  color: var(--fv-phase-4-text);
}
.phase-card-5 .phase-card-num {
  color: var(--fv-phase-5-text);
}
.phase-card-6 .phase-card-num {
  color: var(--fv-phase-6-text);
}

.phase-card-0 {
  border-top: 4px solid var(--fv-phase-0);
}
.phase-card-1 {
  border-top: 4px solid var(--fv-phase-1);
}
.phase-card-2 {
  border-top: 4px solid var(--fv-phase-2);
}
.phase-card-3 {
  border-top: 4px solid var(--fv-phase-3);
}
.phase-card-4 {
  border-top: 4px solid var(--fv-phase-4);
}
.phase-card-5 {
  border-top: 4px solid var(--fv-phase-5);
}
.phase-card-6 {
  border-top: 4px solid var(--fv-phase-6);
}

/* Selos com texto branco pequeno: só fundo AA */
.phase-chip-aa-0 {
  background: var(--fv-phase-0-text);
  color: #fff;
}
.phase-chip-aa-1 {
  background: var(--fv-phase-1-text);
  color: #fff;
}
.phase-chip-aa-2 {
  background: var(--fv-phase-2-text);
  color: #fff;
}
.phase-chip-aa-3 {
  background: var(--fv-phase-3-text);
  color: #fff;
}
.phase-chip-aa-4 {
  background: var(--fv-phase-4-text);
  color: #fff;
}
.phase-chip-aa-5 {
  background: var(--fv-phase-5-text);
  color: #fff;
}
.phase-chip-aa-6 {
  background: var(--fv-phase-6-text);
  color: #fff;
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.activity-item {
  display: grid;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.activity-item:last-child {
  border-bottom: none;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  margin: 0 0 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.option-mark {
  flex: 0 0 1.1em;
  width: 1.1em;
  text-align: center;
  line-height: 1.4;
  color: var(--brand-strong);
  font-weight: 800;
}

.option:hover {
  border-color: #9ec5c0;
  background: #f7fbfa;
}

.option:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.option[aria-pressed="true"] {
  border-color: var(--brand-strong);
  border-width: 2px;
  padding: 11px 13px;
  background: var(--brand-soft);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--brand-strong);
}

.option.correct {
  border-color: var(--ok);
  background: #e8f8ef;
}

.option.wrong {
  border-color: var(--danger);
  background: #fef3f2;
}

.pergunta-erro {
  border: 2px solid var(--danger);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fef3f2;
}

.pergunta-erro-texto {
  margin: 0;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 600;
}

.pergunta-erro-texto[hidden] {
  display: none;
}

.missao-feedback:empty,
.missao-acoes:empty {
  display: none;
}

.message {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.message-erro {
  border-color: #fecdca;
  background: #fef3f2;
  color: var(--danger);
}

.message-ok {
  border-color: #abefc6;
  background: #e8f8ef;
  color: var(--ok);
}

.message-info {
  border-color: #b2ddff;
  background: #eff8ff;
  color: var(--info);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table th,
.table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}

.table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
}

.richtext b {
  font-weight: 700;
}

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

/* Escola (aluno) — c2.2 */
.input {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-color: var(--brand);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.check-row input[type="checkbox"] {
  margin-top: 4px;
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  accent-color: var(--brand);
}

.check-row label {
  font-size: 0.95rem;
  line-height: 1.4;
}

.aviso-privacidade {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--brand-soft);
}

.badge-provisorio {
  background: #fff7e8;
  color: var(--warn);
  border-color: #f7d9a8;
  font-weight: 600;
}

.turma-lista,
.acesso-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.turma-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.turma-item-info {
  gap: 4px;
  min-width: 0;
  flex: 1 1 12rem;
}

.acesso-item {
  gap: 4px;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(20, 33, 31, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.dialog {
  width: min(24rem, 100%);
  max-height: min(90vh, 32rem);
  overflow: auto;
  box-shadow: var(--shadow);
}

.dialog-acoes {
  justify-content: flex-end;
}

/* Escola (professor) — c2.3 */
.convite-codigo {
  gap: 8px;
  min-width: min(100%, 16rem);
  margin-top: 0;
}

.convite-codigo-rotulo {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0;
}

.convite-codigo-campo {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--ink);
}

.convite-codigo-campo:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.convite-copia-feedback {
  min-height: 1.25em;
  margin: 0;
}

.convite-slot {
  margin: 0;
  padding: 0;
}

.turma-detalhe-convite {
  gap: 8px;
}

.turmas-item-prof {
  flex-direction: column;
  align-items: stretch;
  /* space-between do .turma-item abriria vão entre validade e código */
  justify-content: flex-start;
  gap: 8px;
}

.turmas-item-nome {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}

.turmas-item-nome:hover {
  color: var(--brand);
}

.nome-turma-contador {
  margin: 0;
  font-size: 0.875rem;
}

.aviso-lista-alunos {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #f7d9a8;
  background: #fff7e8;
  color: var(--warn);
  font-size: 0.95rem;
}

.lista-alunos-confirmacao {
  margin: 0;
  font-size: 0.875rem;
}

.turma-contagem-visual {
  min-height: 1.25em;
  margin: 0;
}

/* Desafios e aviso vigente (c3.2 aluno) */
.aviso-notice-pendente {
  border-color: #f7d9a8;
  background: #fff7e8;
}

.aviso-notice-titulo {
  font-size: 1.05rem;
  margin: 0;
}

.badge-desafio-pendente {
  background: #eef2f1;
  color: var(--ink);
  border-color: var(--line);
  font-weight: 700;
}

.turma-desafios-grupo-titulo {
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
}

.turma-desafios-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.turma-desafio-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.turma-desafio-info {
  gap: 6px;
  min-width: 0;
  flex: 1 1 12rem;
}

.turma-desafio-prazo {
  font-size: 0.9rem;
}

.dialog-aviso {
  width: min(28rem, 100%);
  max-height: min(90vh, 40rem);
}

.turmas-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
  align-items: center;
}

@media (max-width: 800px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    padding-bottom: 64px;
  }

  .sidebar {
    display: none;
  }

  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    background: var(--fv-sidebar);
    gap: 2px;
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    /* Até 13 itens: rolam de lado com o rótulo inteiro, em vez de partir as palavras. */
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .bottom-nav::-webkit-scrollbar {
    display: none;
  }

  .bottom-nav .nav-link {
    flex: 1 0 auto;
    text-align: center;
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 10px 12px;
  }

  .home-hero-overlay {
    max-width: min(72%, 22rem);
    background: linear-gradient(
      180deg,
      rgba(2, 41, 30, 0.35) 0%,
      rgba(2, 41, 30, 0.9) 100%
    );
  }
}

/* Desafios na tela do professor (c3.3) */
.turma-desafio-acoes {
  flex-wrap: wrap;
  gap: 8px;
}

.turma-desafio-form {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.turma-progresso-item {
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

/* Abas da turma, lista numerada de desafios, editor e correções (c4) */
.abas-lista {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.aba {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.aba:hover {
  background: var(--brand-soft);
}

.aba:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.aba-ativa,
.aba-ativa:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #fff;
}

.turma-desafios select,
.turma-desafios input[type="date"],
.turma-correcoes input[type="text"],
.turma-correcoes textarea,
.atividade-editor input[type="text"],
.atividade-editor textarea,
.dialog input[type="date"],
#resposta-aberta {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.turma-desafios select:focus-visible,
.turma-desafios input[type="date"]:focus-visible,
.turma-correcoes input[type="text"]:focus-visible,
.turma-correcoes textarea:focus-visible,
.atividade-editor input[type="text"]:focus-visible,
.atividade-editor textarea:focus-visible,
.dialog input[type="date"]:focus-visible,
#resposta-aberta:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-color: var(--brand);
}

.turma-desafio-num {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 700;
}

.turma-desafio-mais {
  flex: 1 1 100%;
}

.turma-desafio-mais summary {
  cursor: pointer;
  color: var(--brand-strong);
  font-weight: 600;
  min-height: 32px;
}

.turma-desafio-mais summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.turma-desafio-origem {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.turma-desafio-origem legend {
  font-weight: 600;
  padding: 0 6px;
}

.check-row input[type="radio"] {
  margin-top: 4px;
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  accent-color: var(--brand);
}

.turma-correcao-item {
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.turma-correcao-texto,
.atividade-intro p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.atividade-pergunta {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

.atividade-pergunta legend {
  font-weight: 700;
  padding: 0 6px;
}

.atividade-opcao {
  align-items: center;
  flex-wrap: nowrap;
}

.atividade-opcao input[type="radio"] {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--brand);
}

/* O atributo hidden vale mesmo em elementos com display próprio (.stack, .row, .card): abas e blocos ocultos. */
[hidden] {
  display: none !important;
}

/* XP, nível, conquistas e dica do dia (b3) */
.nivel-nome {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--brand-strong);
}

.nivel-barra {
  width: 100%;
  height: 14px;
  accent-color: var(--brand);
}

.cartao-dica {
  border-color: #f7d9a8;
  background: #fffaf0;
}

.conquistas-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.conquista-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.conquista-fechada {
  opacity: 0.85;
}

.conquista-nova {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #b7e0c4;
  background: #ecf8f0;
  color: var(--ok);
  font-weight: 700;
}

/* Cidade EcoRenda (e1) */
.cidade-atividades { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.cidade-atividade-linha { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; }
.cidade-atividade-nome { font-weight: 600; flex: 1 1 12rem; }
.cidade-estrelas { color: #b46106; letter-spacing: 0.1em; font-size: 1.1rem; }
.cidade-cartao { min-height: 6rem; }
.cidade-item { padding: 0.5rem 0; border-bottom: 1px solid rgba(0, 0, 0, 0.1); }

/* Cidade EcoRenda: mapa isométrico (e-vis1). Cores das faces vêm do atributo fill (cor do lugar). */
.cidade-mapa-janela {
  overflow-x: auto;
  border-radius: var(--fv-radius-card);
  box-shadow: var(--shadow);
  background: #bfe0c8;
}
.cidade-mapa-svg { display: block; width: 100%; min-width: 640px; height: auto; }
.cidade-mapa-svg .grama { fill: #cfe9d6; }
.cidade-mapa-svg .grade { stroke: #b7dcc2; stroke-width: 1; }
.cidade-mapa-svg .rua { fill: none; stroke: #ece6d6; stroke-width: 22; stroke-linecap: round; stroke-linejoin: round; }
.cidade-mapa-svg .rua-faixa { fill: none; stroke: #ffffff; stroke-width: 2; stroke-dasharray: 10 12; }
.cidade-mapa-svg .nuvem { fill: #ffffff; opacity: 0.75; animation: cidade-nuvem 38s linear infinite alternate; }
.cidade-mapa-svg .nuvem-2 { animation-duration: 52s; }
.cidade-mapa-svg .sombra { fill: rgba(2, 41, 30, 0.16); }
.cidade-mapa-svg .face { stroke: rgba(2, 41, 30, 0.35); stroke-width: 1; stroke-linejoin: round; }
.cidade-mapa-svg .janela { fill: #fdf3c4; stroke: rgba(2, 41, 30, 0.25); stroke-width: 0.5; }
.cidade-mapa-svg .toldo { fill: #c0392b; stroke: #ffffff; stroke-width: 2; stroke-dasharray: 6 6; }
.cidade-mapa-svg .agua { fill: #7cc4e8; stroke: #ffffff; stroke-width: 2; }
.cidade-mapa-svg .jato { stroke: #7cc4e8; stroke-width: 3; stroke-linecap: round; }
.cidade-mapa-svg .mastro { stroke: #3d4a47; stroke-width: 3; stroke-linecap: round; }
.cidade-mapa-svg .luz { fill: #f4a6a0; }
.cidade-mapa-svg .tronco { stroke: #7a5230; stroke-width: 4; stroke-linecap: round; }
.cidade-mapa-svg .copa { fill: #3fa35b; }
.cidade-mapa-svg .copa-sombra { fill: #2e7d45; }
.cidade-mapa-svg .bandeira { fill: #0d883f; }
.cidade-mapa-svg .grua line { stroke: #b46106; stroke-width: 3; stroke-linecap: round; }
.cidade-mapa-svg .andaime { fill: none; stroke: #8a5a00; stroke-width: 2; stroke-dasharray: 5 4; }
.cidade-mapa-svg .cadeado { font-size: 22px; }
.cidade-mapa-svg .balao { animation: cidade-balao 2.6s ease-in-out infinite alternate; transform-box: fill-box; }
.cidade-mapa-svg .balao-corpo { fill: #ffffff; stroke: #02291e; stroke-width: 2.5; }
.cidade-mapa-svg .balao-ponta { fill: #ffffff; stroke: #02291e; stroke-width: 2.5; stroke-linejoin: round; }
.cidade-mapa-svg .balao-simbolo { font-size: 22px; font-weight: 900; }
.cidade-mapa-svg .balao-pendente .balao-simbolo { fill: #b5482a; }
.cidade-mapa-svg .balao-completo .balao-simbolo { fill: #b46106; }
.cidade-mapa-svg .balao-fechado .balao-corpo,
.cidade-mapa-svg .balao-fechado .balao-ponta { fill: #e3e8e6; }
.cidade-mapa-svg .balao-fechado .balao-simbolo { font-size: 16px; }
.cidade-mapa-svg .placa rect { fill: #02291e; }
.cidade-mapa-svg .placa text,
.cidade-mapa-svg .neblina text { fill: #f4f7f6; font-size: 14px; font-weight: 700; }
.cidade-mapa-svg .predio { cursor: pointer; transition: transform 0.15s ease; }
.cidade-mapa-svg .predio:hover .predio-corpo { transform: translateY(-3px); }
.cidade-mapa-svg .predio-corpo { transition: transform 0.15s ease; }
.cidade-mapa-svg .predio-base { fill: transparent; stroke: transparent; stroke-width: 3; }
.cidade-mapa-svg .predio:focus { outline: none; }
.cidade-mapa-svg .predio:focus-visible .predio-base,
.cidade-mapa-svg .predio-escolhido .predio-base { fill: rgba(255, 255, 255, 0.55); stroke: #02291e; }
.cidade-mapa-svg .predio-fechado .predio-corpo { filter: grayscale(1); opacity: 0.55; }
.cidade-mapa-svg .predio-completo .bandeira { animation: cidade-bandeira 2.4s ease-in-out infinite alternate; transform-origin: left center; transform-box: fill-box; }
.cidade-mapa-svg .neblina > rect:first-child { fill: rgba(244, 247, 246, 0.55); }
.cidade-mapa-svg .neblina .placa-neblina { fill: #02291e; }

@keyframes cidade-balao { from { transform: translateY(0); } to { transform: translateY(-6px); } }
@keyframes cidade-nuvem { from { transform: translateX(-30px); } to { transform: translateX(60px); } }
@keyframes cidade-bandeira { from { transform: scaleX(1); } to { transform: scaleX(0.75); } }

@media (prefers-reduced-motion: reduce) {
  .cidade-mapa-svg .nuvem,
  .cidade-mapa-svg .balao,
  .cidade-mapa-svg .predio-completo .bandeira { animation: none; }
  .cidade-mapa-svg .predio,
  .cidade-mapa-svg .predio-corpo { transition: none; }
  .cidade-mapa-svg .predio:hover .predio-corpo { transform: none; }
}

/* Cidade: simulador (e2). As cores das partes da barra são as do legado. */
.cidade-objetivo { font-weight: 600; }
.cidade-controle-rotulo { justify-content: space-between; font-weight: 600; }
.cidade-controle-valor { font-variant-numeric: tabular-nums; color: var(--brand-strong); }
.cidade-controle { width: 100%; accent-color: var(--brand); min-height: 44px; }
.cidade-barra { display: block; width: 100%; height: 14px; border-radius: 7px; background: var(--line); }
.cidade-barra-preciso { fill: #f2b632; }
.cidade-barra-quero { fill: #d8694c; }
.cidade-barra-futuro { fill: #6fae55; }
.cidade-objetivo-ok { color: var(--ok); font-weight: 700; }

/* Cidade: cena do lugar (e-vis2b). As cores das faces vêm do atributo fill. */
.cidade-cena-janela {
  overflow-x: auto;
  border-radius: var(--fv-radius-card);
  box-shadow: var(--shadow);
  background: #eaf1ee;
}
.cidade-cena-svg { display: block; width: 100%; min-width: 520px; height: auto; }
.cidade-fala { border-left: 6px solid var(--brand); }
.cidade-cena-svg .piso { stroke: rgba(2, 41, 30, 0.12); stroke-width: 1; }
.cidade-cena-svg .parede { stroke: rgba(2, 41, 30, 0.2); stroke-width: 1; }
.cidade-cena-svg .janela-parede { fill: #bfe3f4; stroke: #7a5230; stroke-width: 4; }
.cidade-cena-svg .toldo-parede { fill: #c0392b; stroke: #ffffff; stroke-width: 2; stroke-dasharray: 10 8; }
.cidade-cena-svg .prateleira-parede { fill: #a9703f; }
.cidade-cena-svg .guiche { fill: #9ec9e2; stroke: #3d4a47; stroke-width: 3; }
.cidade-cena-svg .placa-banco { fill: #02291e; }
.cidade-cena-svg .face { stroke: rgba(2, 41, 30, 0.35); stroke-width: 1; stroke-linejoin: round; }
.cidade-cena-svg .sombra { fill: rgba(2, 41, 30, 0.18); }
.cidade-cena-svg .prato { fill: #ffffff; stroke: rgba(2, 41, 30, 0.3); }
.cidade-cena-svg .puxador,
.cidade-cena-svg .divisoria { stroke: #7b8a90; stroke-width: 3; stroke-linecap: round; }
.cidade-cena-svg .tabua { fill: #7a5230; }
.cidade-cena-svg .produto { stroke: rgba(2, 41, 30, 0.3); stroke-width: 0.5; }
.cidade-cena-svg .pe { stroke: #7a5230; stroke-width: 4; stroke-linecap: round; }
.cidade-cena-svg .quadro { fill: #2f6b4f; stroke: #7a5230; stroke-width: 3; }
.cidade-cena-svg .cartaz-placa { fill: #f6efd8; }
.cidade-cena-svg .barra { stroke: rgba(2, 41, 30, 0.25); stroke-width: 0.5; }
.cidade-cena-svg .mostrador { fill: #f2b632; stroke: #3d4a47; stroke-width: 2; }
.cidade-cena-svg .caixa-registradora { fill: #3d4a47; }
.cidade-cena-svg .visor { fill: #bfe3f4; }
.cidade-cena-svg .alca { fill: none; stroke: #8a5a00; stroke-width: 4; stroke-linecap: round; }
.cidade-cena-svg .fruta { stroke: rgba(2, 41, 30, 0.3); stroke-width: 1; }
.cidade-cena-svg .pele { fill: #e8b88f; stroke: rgba(2, 41, 30, 0.3); }
.cidade-cena-svg .olho { fill: #14211f; }
.cidade-cena-svg .cabelo { stroke: rgba(2, 41, 30, 0.25); }
.cidade-cena-svg .objeto { cursor: pointer; }
.cidade-cena-svg .objeto-desenho { transition: transform 0.15s ease; }
.cidade-cena-svg .objeto:hover .objeto-desenho { transform: translateY(-3px); }
.cidade-cena-svg .objeto-base { fill: transparent; stroke: transparent; stroke-width: 3; }
.cidade-cena-svg .objeto:focus { outline: none; }
.cidade-cena-svg .objeto:focus-visible .objeto-base,
.cidade-cena-svg .objeto-escolhido .objeto-base { fill: rgba(255, 255, 255, 0.5); stroke: #02291e; }
.cidade-cena-svg .objeto-indisponivel .objeto-desenho { filter: grayscale(1); opacity: 0.55; }
.cidade-cena-svg .objeto-estrelas { fill: #b46106; font-size: 18px; letter-spacing: 2px; stroke: #ffffff; stroke-width: 3px; paint-order: stroke; }
.cidade-cena-svg .objeto-cadeado { font-size: 20px; }
.cidade-objeto-detalhe h2 { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .cidade-cena-svg .objeto-desenho { transition: none; }
  .cidade-cena-svg .objeto:hover .objeto-desenho { transform: none; }
}

/* Cidade: jogos dentro da cena (e-vis2c). O "palco" mostra o morador falando e o jogo embaixo. */
.cidade-palco { border-left: 6px solid var(--brand); }
.cidade-palco-cabeca { align-items: center; flex-wrap: wrap; gap: 0.5rem 1rem; }
.cidade-palco-cabeca h2 { flex: 1 1 10rem; margin: 0; }
.cidade-avatar { width: 56px; height: 62px; flex: none; background: var(--brand-soft); border-radius: 50%; }
.cidade-avatar .sombra { display: none; }
.cidade-avatar .pele { fill: #e8b88f; stroke: rgba(2, 41, 30, 0.3); }
.cidade-avatar .olho { fill: #14211f; }
.cidade-avatar .face { stroke: rgba(2, 41, 30, 0.35); stroke-width: 1; }
.cidade-palco-fala {
  position: relative;
  margin: 0;
  padding: 0.75rem 1rem;
  background: var(--brand-soft);
  border-radius: var(--radius);
}
.cidade-palco-cards .cidade-cartao {
  background: #ffffff;
  border: 2px solid var(--brand);
  border-radius: var(--radius);
  font-size: 1.1rem;
}

/* Cidade: decisões (e3a) */
.cidade-saldo { font-weight: 700; font-size: 1.15rem; color: var(--brand-strong); margin: 0; }
.cidade-decide-cena { font-weight: 600; margin: 0; }
.cidade-saldo-passo { font-variant-numeric: tabular-nums; font-weight: 600; margin: 0; }

/* Cidade: fluxo da renda (e4a) */
.cidade-fluxo { background: #fffdf6; border-radius: var(--fv-radius-card); box-shadow: var(--shadow); padding: 0.5rem; }
.cidade-fluxo-svg { display: block; width: 100%; max-height: 260px; }
.cidade-fluxo-svg .fluxo-no circle { fill: #fffdf6; stroke: #16302a; stroke-width: 3; }
.cidade-fluxo-svg .fluxo-icone { font-size: 24px; }
.cidade-fluxo-svg .fluxo-nome { font-size: 12px; font-weight: 800; fill: #16302a; }
.cidade-fluxo-svg .fluxo-rotulo { font-size: 12px; font-weight: 800; fill: #16302a; stroke: #fffdf6; stroke-width: 4px; paint-order: stroke; }

/* Cidade: interior mais rico (e-vis4b). Cores nas formas vêm de atributos; aqui, o resto. */
.cidade-cena-svg .sala,
.cidade-cena-svg .luz,
.cidade-cena-svg .vinheta { pointer-events: none; }
.cidade-cena-svg .parede-sombra,
.cidade-cena-svg .vinheta,
.cidade-cena-svg .luz { stroke: none; }
.cidade-cena-svg .rodape { fill: rgba(2, 20, 15, 0.28); }
.cidade-cena-svg .piso-fresta { stroke: rgba(122, 82, 48, 0.28); stroke-width: 1; }
.cidade-cena-svg .piso-brilho { fill: rgba(255, 255, 255, 0.28); }
.cidade-cena-svg .piso-veio { stroke: rgba(255, 255, 255, 0.55); stroke-width: 1.2; }
.cidade-cena-svg .parapeito,
.cidade-cena-svg .caixilho,
.cidade-cena-svg .moldura { fill: #7a5230; }
.cidade-cena-svg .cortina { fill: #c0584a; stroke: rgba(2, 41, 30, 0.25); stroke-width: 0.5; }
.cidade-cena-svg .tabua { fill: #7a5230; }
.cidade-cena-svg .livro { stroke: rgba(2, 41, 30, 0.35); stroke-width: 0.5; }
.cidade-cena-svg .tela { stroke: rgba(2, 41, 30, 0.25); stroke-width: 0.5; }
.cidade-cena-svg .relogio { fill: #fffdf6; stroke: #7a5230; stroke-width: 3; }
.cidade-cena-svg .ponteiro { stroke: #14211f; stroke-width: 1.6; stroke-linecap: round; }
.cidade-cena-svg .tapete { fill: #a8432f; stroke: #e6c46a; stroke-width: 2; }
.cidade-cena-svg .tapete-miolo { fill: #c25a43; }
.cidade-cena-svg .tapete-detalhe { fill: none; stroke: #e6c46a; stroke-width: 1.5; stroke-dasharray: 5 4; }
.cidade-cena-svg .folha { fill: #3fa35b; stroke: rgba(2, 41, 30, 0.3); stroke-width: 0.6; }
.cidade-cena-svg .folha-escura { fill: #2e7d45; }
.cidade-cena-svg .vaso { fill: #b9824f; stroke: rgba(2, 41, 30, 0.35); stroke-width: 0.6; }
.cidade-cena-svg .lousa { fill: #2f6b4f; stroke: #7a5230; stroke-width: 4; }
.cidade-cena-svg .giz { fill: rgba(255, 255, 255, 0.85); }
.cidade-cena-svg .etiqueta { fill: #ffffff; stroke: rgba(2, 41, 30, 0.3); stroke-width: 0.4; }
.cidade-cena-svg .capacho { fill: #6b7a74; stroke: rgba(2, 41, 30, 0.35); stroke-width: 1; }
.cidade-cena-svg .balcao-parede { fill: #8a5a2f; stroke: rgba(2, 41, 30, 0.3); stroke-width: 0.6; }
.cidade-cena-svg .barra-cotacao { stroke: rgba(255, 255, 255, 0.25); stroke-width: 0.4; }
.cidade-cena-svg .passadeira { fill: #7a2e2e; }
.cidade-cena-svg .passadeira-borda { fill: none; stroke: #e6c46a; stroke-width: 2; }
.cidade-cena-svg .toalha { fill: #f6efd8; stroke: #d8694c; stroke-width: 1.5; stroke-dasharray: 4 3; }
.cidade-cena-svg .ima { stroke: rgba(2, 41, 30, 0.3); stroke-width: 0.5; }
.cidade-cena-svg .vidro { fill: rgba(190, 228, 244, 0.55); stroke: rgba(255, 255, 255, 0.7); stroke-width: 1; }
.cidade-cena-svg .papel { fill: #ffffff; stroke: rgba(2, 41, 30, 0.35); stroke-width: 0.6; }
.cidade-cena-svg .sino { fill: #f2b632; stroke: #8a5a00; stroke-width: 1; }
.cidade-cena-svg .parafuso { fill: #c9d3d6; }
.cidade-cena-svg .puxador-cofre { fill: #c9d3d6; stroke: #3d4a47; stroke-width: 0.8; }
.cidade-cena-svg .braco { stroke: #e8b88f; stroke-width: 5; stroke-linecap: round; }
.cidade-cena-svg .sapato { fill: #3d2a1c; }

/* Cidade: o jogo numa janela por cima da cena (e-vis4c), com a cara do objeto. Só CSS. */
.cidade-janela-fundo {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(2, 20, 15, 0.62);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.cidade-janela-fundo > .cidade-palco {
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  margin: auto;
}
.cidade-janela-fundo .cidade-palco-fala { font-size: 1rem; }
.cidade-palco { position: relative; }

/* Livro (cartões): capa marrom na lombada, páginas empilhadas e letra com serifa. */
.cidade-palco-cards,
.moldura-livro {
  background: #fbf3dc;
  color: #2a1d12;
  border: 0;
  border-left: 16px solid #7a3b2a;
  border-radius: 6px 16px 16px 6px;
  font-family: Georgia, "Times New Roman", serif;
  box-shadow: inset 10px 0 14px -10px rgba(0, 0, 0, 0.4), 4px 4px 0 #efe2bd, 8px 8px 0 #e3d3a6, 0 14px 30px rgba(0, 0, 0, 0.45);
}
.cidade-palco-cards .cidade-cartao { background: transparent; border: 0; box-shadow: none; font-size: 1.2rem; line-height: 1.6; min-height: 8rem; }
.cidade-palco-cards .cidade-palco-fala { background: rgba(122, 59, 42, 0.1); }

/* Pergaminho (quiz): papel envelhecido com dois rolos de madeira. */
.cidade-palco-quiz,
.moldura-pergaminho {
  background: linear-gradient(#f3e2b3, #ebd49b 60%, #e6cb8c);
  color: #2a1d12;
  border: 0;
  border-radius: 4px;
  padding-top: 34px;
  padding-bottom: 34px;
  box-shadow: inset 0 0 44px rgba(122, 82, 48, 0.3), 0 14px 30px rgba(0, 0, 0, 0.45);
}
.cidade-palco-quiz::before,
.cidade-palco-quiz::after,
.moldura-pergaminho::before,
.moldura-pergaminho::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 16px;
  background: linear-gradient(#d9b57a, #8a5a2f 70%, #6a431f);
  border-radius: 8px;
}
.cidade-palco-quiz::before,
.moldura-pergaminho::before { top: 0; }
.cidade-palco-quiz::after,
.moldura-pergaminho::after { bottom: 0; }
.cidade-palco-quiz .cidade-palco-fala { background: rgba(122, 82, 48, 0.12); }

/* Quadro de giz (ordenar): lousa verde com moldura de madeira e traço de giz. */
.cidade-palco-sort {
  background: #2b5a47;
  color: #f5f7f2;
  border: 12px solid #8a5a2f;
  border-radius: 6px;
  box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.4), 0 14px 30px rgba(0, 0, 0, 0.45);
}
.cidade-palco-sort .muted,
.cidade-palco-sort .cidade-objetivo { color: rgba(245, 247, 242, 0.85); }
.cidade-palco-sort .cidade-palco-fala { background: rgba(255, 255, 255, 0.12); color: #f5f7f2; }
.cidade-palco-sort .cidade-item { border-bottom-color: rgba(255, 255, 255, 0.25); }
.cidade-palco-sort .cidade-estrelas { color: #ffd36b; }
.cidade-palco-sort .option { background: transparent; color: #f5f7f2; border: 2px dashed rgba(245, 247, 242, 0.8); }
.cidade-palco-sort .option[aria-pressed="true"] { background: rgba(255, 255, 255, 0.2); border-style: solid; }
.cidade-palco-sort .option.correct { background: #1d6b3a; border-style: solid; }
.cidade-palco-sort .option.wrong { background: #8a2f22; border-style: solid; }

/* Painel de madeira (simulador): moldura grossa de madeira em volta do painel de controle. */
.cidade-palco-slider {
  background: #fbf3dc;
  border: 14px solid #7a5230;
  border-radius: 10px;
  box-shadow: inset 0 0 0 3px #a9703f, inset 0 0 24px rgba(0, 0, 0, 0.2), 0 14px 30px rgba(0, 0, 0, 0.45);
}

/* Balão de fala (decisões): o morador fala num balão com a ponta virada para ele. */
.cidade-palco-decide {
  background: #fffdf6;
  border: 3px solid #14211f;
  border-radius: 24px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}
.cidade-palco-decide .cidade-palco-fala {
  position: relative;
  margin-top: 12px;
  background: #ffffff;
  border: 3px solid #14211f;
  border-radius: 20px;
}
.cidade-palco-decide .cidade-palco-fala::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 26px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-top: 3px solid #14211f;
  border-left: 3px solid #14211f;
  transform: rotate(45deg);
}

/* Mapa de papel (fluxo): papel quadriculado com borda tracejada. */
.cidade-palco-flow {
  background-color: #f1e6c8;
  background-image: linear-gradient(rgba(138, 90, 47, 0.14) 1px, transparent 1px), linear-gradient(90deg, rgba(138, 90, 47, 0.14) 1px, transparent 1px);
  background-size: 24px 24px;
  border: 3px dashed #8a5a2f;
  border-radius: 10px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}
.cidade-palco-flow .cidade-palco-fala { background: rgba(255, 253, 246, 0.85); }

@media (max-width: 600px) {
  .cidade-janela-fundo { padding: 0; align-items: stretch; }
  .cidade-janela-fundo > .cidade-palco { max-width: none; max-height: none; border-radius: 0; margin: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .cidade-janela-fundo > .cidade-palco { animation: cidade-janela-entra 0.18s ease-out; }
}
@keyframes cidade-janela-entra { from { transform: translateY(14px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }

/* Cidade: ambientes e objetos novos das cenas dos outros lugares (e-vis3). */
.cidade-cena-svg .jato { stroke: #7cc4e8; stroke-width: 3; stroke-linecap: round; }
.cidade-cena-svg .porta { fill: #7a5230; stroke: rgba(2, 41, 30, 0.35); stroke-width: 1; }
.cidade-cena-svg .canteiro { fill: #7a5230; }
.cidade-cena-svg .flor { stroke: rgba(2, 41, 30, 0.3); stroke-width: 0.6; }
.cidade-cena-svg .calcada { fill: rgba(122, 82, 48, 0.16); }
.cidade-cena-svg .fonte-borda { fill: #cfd8d6; stroke: #6b7a74; stroke-width: 2.5; }
.cidade-cena-svg .fonte-agua { fill: #7cc4e8; stroke: #ffffff; stroke-width: 1.5; }
.cidade-cena-svg .coluna { fill: #f7f2e6; stroke: rgba(2, 41, 30, 0.25); stroke-width: 0.8; }
.cidade-cena-svg .bandeira-asta { fill: #7a5230; }
.cidade-cena-svg .bandeira-verde { fill: #2f8f4e; }
.cidade-cena-svg .bandeira-amarela { fill: #f2c230; }
.cidade-cena-svg .bandeira-azul { fill: #2b5fa3; }
.cidade-cena-svg .ceu { fill: #9fd0ea; }
.cidade-cena-svg .mar { fill: #3d8fb8; }
.cidade-cena-svg .onda { fill: rgba(255, 255, 255, 0.6); }
.cidade-cena-svg .janela-moldura { fill: none; stroke: #7a5230; stroke-width: 6; stroke-linejoin: round; }
.cidade-cena-svg .sol { fill: #ffe27a; }
.cidade-cena-svg .ripa { fill: rgba(122, 82, 48, 0.35); }
.cidade-cena-svg .vigia { fill: #b9824f; stroke: #7a5230; stroke-width: 2; }
.cidade-cena-svg .vigia-vidro { fill: #9fd0ea; stroke: rgba(2, 41, 30, 0.35); stroke-width: 1; }
.cidade-cena-svg .boia { fill: #e0533b; stroke: #ffffff; stroke-width: 3; }
.cidade-cena-svg .boia-miolo { fill: #e3ebe9; }
.cidade-cena-svg .barril { fill: #a9703f; stroke: rgba(2, 41, 30, 0.4); stroke-width: 1; }
.cidade-cena-svg .barril-tampa { fill: #c9a063; stroke: rgba(2, 41, 30, 0.4); stroke-width: 1; }
.cidade-cena-svg .barril-aro { stroke: #3d4a47; stroke-width: 2; }
.cidade-cena-svg .tela-grande { fill: #14211f; stroke: #5b6770; stroke-width: 3; }
.cidade-cena-svg .faixa-cotacao { fill: #2b5fa3; }
.cidade-cena-svg .tapete-azul { fill: #2b4a7a; }
.cidade-cena-svg .tapete-azul-miolo { fill: #3b629c; }
.cidade-cena-svg .tapete-cinza { fill: rgba(95, 111, 107, 0.18); stroke: none; }
.cidade-cena-svg .brasao { fill: #e6c46a; stroke: #8a5a00; stroke-width: 2; }
.cidade-cena-svg .brasao-miolo { fill: #2b4a7a; }
.cidade-cena-svg .brasao-ponto { fill: #e6c46a; }
.cidade-cena-svg .cortica { fill: #c9a063; stroke: #7a5230; stroke-width: 4; }
.cidade-cena-svg .nota { stroke: rgba(2, 41, 30, 0.3); stroke-width: 0.6; }
.cidade-cena-svg .mapa-papel { fill: #f1e6c8; stroke: rgba(2, 41, 30, 0.35); stroke-width: 1; }
.cidade-cena-svg .mapa-seta { stroke: #3d4a47; stroke-width: 1.6; stroke-dasharray: 3 2; stroke-linecap: round; }
.cidade-cena-svg .mapa-no { stroke: #ffffff; stroke-width: 1.2; }
.cidade-cena-svg .ripa-caixote { stroke: rgba(2, 41, 30, 0.35); stroke-width: 1.5; }
.cidade-cena-svg .telao-tela { fill: #14211f; stroke: #5b6770; stroke-width: 3; }
.cidade-cena-svg .poste { stroke: #3d4a47; stroke-width: 3.5; stroke-linecap: round; }
.cidade-cena-svg .corrente { stroke: #7b8a90; stroke-width: 1.4; }
.cidade-cena-svg .prato-balanca { fill: #e6c46a; stroke: #8a5a00; stroke-width: 1.5; }
.cidade-cena-svg .peso { fill: #5b6770; stroke: rgba(2, 41, 30, 0.4); stroke-width: 1; }
.cidade-cena-svg .peso-leve { fill: #9aa7a2; }
.cidade-cena-svg .manchete { fill: #14211f; }
.cidade-cena-svg .texto-jornal { fill: #7b8a90; }
.cidade-cena-svg .foto-jornal { fill: #9aa7a2; }
.cidade-cena-svg .ranhura { fill: #14211f; }
.cidade-cena-svg .haste { stroke: #3d4a47; stroke-width: 4; stroke-linecap: round; }
.cidade-cena-svg .manopla { fill: #d8412f; stroke: #7a1f14; stroke-width: 1.2; }

/* Cidade: marcos de exploração dos simuladores com estado (e4b) */
.cidade-marcos { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.cidade-marco { color: var(--muted); }
.cidade-marco-feito { color: var(--ok); font-weight: 700; }

/* Jornada: trilha por fase (v1) */
.trilha-svg { display: block; width: 100%; height: auto; }
.trilha-painel { padding: 12px; }
.trilha-detalhe { min-height: 1.5em; margin: 0; }
.trilha-svg .parada { cursor: pointer; }
.trilha-svg .parada:focus { outline: none; }
.trilha-svg .parada:focus-visible .parada-disco { stroke: #02291e; stroke-width: 7; }
.trilha-svg .parada-sombra { fill: rgba(2, 41, 30, 0.18); }
.trilha-svg .parada-titulo { fill: #02291e; font-size: 17px; font-weight: 700; paint-order: stroke; stroke: #ffffff; stroke-width: 4px; stroke-linejoin: round; }
.trilha-svg .parada-selo circle { fill: #125b2e; stroke: #fff; stroke-width: 2.5; }
.trilha-svg .parada-selo-atencao circle { fill: #b5482a; }
.trilha-svg .parada-selo-fechado circle { fill: #5b6663; }
.trilha-svg .parada-selo text { fill: #fff; font-size: 18px; font-weight: 900; }
.trilha-svg .parada-fechado .parada-icone,
.trilha-svg .parada-breve .parada-icone { opacity: 0.8; }
.trilha-svg .parada-breve { opacity: 0.6; }
.trilha-svg .parada-pulso { animation: trilha-pulso 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.trilha-svg .trilha-neblina { fill: rgba(244, 247, 246, 0.5); pointer-events: none; }
@keyframes trilha-pulso { from { transform: scale(0.95); opacity: 1; } to { transform: scale(1.12); opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .trilha-svg .parada-pulso { animation: none; } }

/* Missões das fases: mentor e moldura por tipo (v2). A moldura reaproveita livro e pergaminho da Cidade. */
.missao-cabeca { align-items: center; gap: 0.75rem 1rem; border-left: 6px solid var(--brand); padding-left: 0.75rem; flex-wrap: nowrap; }
.missao-cabeca .missao-fala { flex: 1 1 auto; min-width: 0; gap: 0.25rem; }
.missao-cabeca .missao-tipo { width: 52px; height: 52px; flex: none; }
.missao-fase-0 { border-left-color: var(--fv-phase-0); }
.missao-fase-1 { border-left-color: var(--fv-phase-1); }
.missao-fase-2 { border-left-color: var(--fv-phase-2); }
.missao-fase-3 { border-left-color: var(--fv-phase-3); }
.missao-fase-4 { border-left-color: var(--fv-phase-4); }
.missao-fase-5 { border-left-color: var(--fv-phase-5); }
.missao-fase-6 { border-left-color: var(--fv-phase-6); }
.moldura { position: relative; padding: 1rem; margin-top: 0.5rem; }
.moldura-livro { padding-left: 1.25rem; }
.moldura-pergaminho { padding-top: 34px; padding-bottom: 34px; color: #2a1d12; border: 0; border-radius: 4px; }
.moldura > .card { background: transparent; border: 0; box-shadow: none; }
.moldura .muted { color: #5a4630; }
.moldura-arena {
  background: #1b1530;
  color: #f4f0ff;
  border: 6px solid #d9a406;
  border-radius: 10px;
  box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.45), 0 10px 24px rgba(0, 0, 0, 0.3);
}
.moldura-arena .muted { color: rgba(244, 240, 255, 0.85); }
.moldura-arena .option { background: transparent; color: #f4f0ff; border: 2px solid rgba(244, 240, 255, 0.7); }
.moldura-arena .option[aria-pressed="true"] { background: rgba(217, 164, 6, 0.28); border-color: #d9a406; }
.moldura-arena .option.correct { background: #1d6b3a; }
.moldura-arena .option.wrong { background: #8a2f22; }
.moldura-caderno {
  background: repeating-linear-gradient(#fffef8, #fffef8 31px, #cfe3f3 32px);
  color: #14211f;
  border: 0;
  border-left: 14px double #b5482a;
  border-radius: 4px 10px 10px 4px;
  box-shadow: 3px 4px 0 #e9e4d2, 0 10px 24px rgba(0, 0, 0, 0.25);
}
@media (max-width: 600px) {
  .missao-cabeca { gap: 0.5rem; padding-left: 0.5rem; }
  .missao-cabeca .missao-tipo { display: none; }
  .missao-cabeca .cidade-avatar { width: 44px; height: 50px; }
}

/* Missão: uma pergunta por vez, estrelas no resultado e leitura em páginas (v3) */
.passo-topo { gap: 0.4rem; }
.passo-rotulo { margin: 0; font-weight: 700; }
.passos { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.passo { width: 14px; height: 14px; border-radius: 50%; background: #d6dcda; border: 2px solid #8a9490; }
.passo-respondida { background: #125b2e; border-color: #125b2e; }
.passo-atual { outline: 3px solid #d9a406; outline-offset: 1px; }
.passo-nav, .leitura-nav { justify-content: space-between; align-items: center; }
.leitura-rotulo { margin: 0; }
.resultado-estrelas { margin: 0; font-size: 2.2rem; line-height: 1; letter-spacing: 0.15em; color: #b46106; }
.resultado-estrelas-0 { color: #8a9490; }
.moldura-arena .resultado-estrelas { color: #ffd36b; }
.moldura-arena .passo { background: transparent; border-color: rgba(244, 240, 255, 0.7); }
.moldura-arena .passo-respondida { background: #d9a406; border-color: #d9a406; }
@media (prefers-reduced-motion: no-preference) {
  .resultado-estrelas { animation: estrelas-entram 0.4s ease-out; }
}
@keyframes estrelas-entram { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* Ajustes visuais reunidos (v4): mentor na trilha e na tela inicial, quiz como conversa e ordenar como prateleira */
.trilha-mentor { align-items: center; gap: 0.75rem 1rem; flex-wrap: nowrap; }
.trilha-mentor .cidade-palco-fala { flex: 1 1 auto; min-width: 0; gap: 0.25rem; }
.phase-card-pontos { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 6px 0 0; padding: 0; }
.phase-card-ponto { width: 10px; height: 10px; border-radius: 50%; background: #d6dcda; border: 1.5px solid #8a9490; box-sizing: border-box; }
.phase-card-ponto-cheio { background: #125b2e; border-color: #125b2e; }
.phase-card-mentor { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; font-size: 0.9rem; }
.phase-card-mentor .cidade-avatar { width: 32px; height: 36px; }

/* Quiz no balcão: a pergunta é a fala do morador e as alternativas são as respostas do aluno. */
.cidade-palco-quiz fieldset.pergunta { border: 0; padding: 0; margin: 0 0 1.25rem; min-width: 0; }
.cidade-palco-quiz fieldset.pergunta legend {
  float: left;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
  background: #fffdf6;
  border: 2px solid #7a5230;
  border-radius: 4px 18px 18px 18px;
  font-weight: 700;
}
.cidade-palco-quiz fieldset.pergunta .option {
  clear: both;
  width: 88%;
  margin: 0 0 0.5rem 12%;
  border-radius: 18px 18px 4px 18px;
  background: #e6f4f1;
  border: 2px solid #0f766e;
}
.cidade-palco-quiz fieldset.pergunta .option[aria-pressed="true"] { background: #0f766e; color: #fff; }
.cidade-palco-quiz fieldset.pergunta .option.correct { background: #d4f0dc; border-color: #125b2e; }
.cidade-palco-quiz fieldset.pergunta .option.wrong { background: #f7d9d2; border-color: #b5482a; }

/* Ordenar na prateleira: cada item é uma caixa de madeira e os grupos são as tábuas onde ela vai. */
.cidade-palco-sort .cidade-item > p:first-child {
  display: inline-block;
  margin: 0 0 0.5rem;
  padding: 0.5rem 0.9rem;
  color: #2a1d12;
  background: linear-gradient(#e2bd82, #c8a063);
  border: 2px solid #8a5a2f;
  border-radius: 6px;
  box-shadow: 0 3px 0 #6a431f;
  font-weight: 700;
}
.cidade-palco-sort .cidade-item .row {
  padding-bottom: 0.6rem;
  border-bottom: 10px solid #8a5a2f;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}
.trilha-rolagem { overflow-x: auto; border-radius: 18px; }
@media (max-width: 600px) {
  .trilha-svg { min-width: 720px; }
  .trilha-mentor .cidade-avatar { width: 44px; height: 50px; }
  .cidade-palco-quiz fieldset.pergunta .option { width: 94%; margin-left: 6%; }
}

/* Casos ramificados, Álbum de Ideias e confiança dos moradores (e5) */
.cidade-palco-case {
  background: #f6f1e3;
  color: #1c1a14;
  border: 3px double #14211f;
  border-radius: 6px;
  font-family: Georgia, "Times New Roman", serif;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}
.cidade-palco-case .cidade-palco-fala { background: rgba(20, 33, 31, 0.08); }
.cidade-palco-case .muted { color: #4a4636; }
.cidade-caso-cena { margin: 0; padding: 0.75rem 1rem; background: #fffdf6; border: 2px solid #14211f; border-radius: 4px 18px 18px 18px; font-weight: 700; }
.cidade-caso-credito { margin: 0; font-size: 0.85rem; font-style: italic; }
.referencia-livro { margin: 0.75rem 0 0; padding: 0.6rem 0.9rem; font-size: 0.88rem; border-left: 3px solid var(--line); }
.referencia-livro p { margin: 0.2rem 0; }
.referencia-nota { font-size: 0.8rem; font-style: italic; }
.fundamento .fundamento-obras { margin: 0; padding-left: 1.2rem; font-size: 0.9rem; }
.cidade-caso-rastro { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.4rem; }
.cidade-caso-rastro li::marker { color: #b5482a; font-weight: 700; }
.cidade-caso-final { border-left: 8px solid #8a9490; }
.cidade-caso-final-bom { border-left-color: #125b2e; }
.cidade-caso-final-medio { border-left-color: #b46106; }
.cidade-caso-final-fraco { border-left-color: #b5482a; }
.cidade-caso-ideia { padding: 0.6rem 0.8rem; background: rgba(217, 164, 6, 0.18); border-radius: 8px; }
.cidade-confianca { color: #b5482a; letter-spacing: 0.12em; font-weight: 700; }
.cidade-album-total { margin: 0; font-weight: 700; }
.cidade-album-confianca { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.cidade-album-confianca li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; }
.cidade-album-ideias { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.cidade-album-ideia { display: grid; gap: 0.2rem; padding: 0.75rem 1rem; border-radius: 10px; border: 2px solid var(--line); background: #fff; }
.cidade-album-ideia-bom { border-color: #125b2e; background: #eaf6ee; }
.cidade-album-ideia-medio { border-color: #b46106; background: #fbf1e0; }
.cidade-album-ideia-fraco { border-color: #b5482a; background: #fbeae5; }
.cidade-album-ideia-trancada { border-style: dashed; background: #f1f4f3; color: #4a5552; }
@media (min-width: 700px) {
  .cidade-album-ideias { grid-template-columns: repeat(3, 1fr); }
}

/* Vida Real (f2): 12 meses jogados no servidor */
.vida { gap: 1rem; }
.vida-cabeca { align-items: center; gap: 0.75rem 1rem; }
.vida-cabeca .cidade-avatar { width: 56px; height: 62px; }
.vida-painel { gap: 0.6rem; }
.vida-dinheiro { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.5rem 1rem; margin: 0; }
.vida-dinheiro div { display: grid; gap: 0.1rem; }
.vida-dinheiro dt { font-size: 0.85rem; color: var(--muted); }
.vida-dinheiro dd { margin: 0; font-weight: 700; font-size: 1.15rem; }
.vida-parcelas { margin: 0; padding-left: 1.2rem; }
.vida-barra { display: grid; gap: 0.2rem; }
.vida-barra meter, .vida-pilares meter { width: 100%; height: 14px; }
.vida-lugares { gap: 0.5rem; }
.vida-lugar { min-width: 8.5rem; }
.vida-aviso { margin: 0; min-height: 1.5em; font-weight: 600; }
.vida-diario { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.25rem; color: var(--muted); }
.vida-dica { margin: 0; padding: 0.6rem 0.8rem; background: rgba(217, 164, 6, 0.18); border-radius: 8px; }
.vida-acoes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.vida-acao { display: grid; gap: 0.2rem; width: 100%; text-align: left; height: auto; padding: 0.7rem 0.9rem; }
.vida-acao span { font-weight: 400; }
.vida-custo { font-weight: 700 !important; color: var(--brand-strong); }
.vida-banco-ops { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.5rem; }
.vida-pilares-lista { margin: 0; padding-left: 1.2rem; }
.vida-pilares { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.vida-pilares li { display: grid; gap: 0.15rem; }
.vida-nota { font-size: 1.25rem; font-weight: 700; margin: 0; }
.vida-janela label { font-weight: 700; }
.vida-janela input[type="number"] { max-width: 12rem; }
@media (max-width: 600px) {
  .vida-lugar { min-width: calc(50% - 0.25rem); }
}


/* Bolsa da Cidade (h1b) */
.bolsa-pregao { display: grid; gap: 0.25rem; border-left: 6px solid var(--muted); }
.bolsa-pregao-aberto { border-left-color: var(--ok); }
.bolsa-pregao-pre_abertura, .bolsa-pregao-call_fechamento { border-left-color: var(--warn); }
.bolsa-pregao-estado { margin: 0; font-weight: 800; font-size: 1.1rem; }
.bolsa-pregao p { margin: 0; }
.bolsa-resumo { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.bolsa-resumo .card { display: grid; gap: 0.5rem; align-content: start; }
.bolsa-resumo h2, .bolsa-resumo p { margin: 0; }
.bolsa-indice-valor { font-size: 1.4rem; }
.bolsa-cenario-nome { font-weight: 800; font-size: 1.2rem; }
.bolsa-variacao { font-weight: 700; white-space: nowrap; }
.bolsa-alta { color: var(--ok); }
.bolsa-baixa { color: var(--danger); }
.bolsa-estavel { color: var(--muted); }
.bolsa-tabela-rolagem { overflow-x: auto; }
.bolsa-tabela { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 10px; }
.bolsa-tabela th, .bolsa-tabela td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid var(--line); }
.bolsa-tabela thead th { font-size: 0.85rem; color: var(--muted); }
.bolsa-tabela .bolsa-num { text-align: right; font-variant-numeric: tabular-nums; }
.bolsa-grafico { width: 100%; height: auto; max-height: 16rem; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.bolsa-grade { stroke: var(--line); stroke-width: 1; }
.bolsa-linha { stroke: var(--brand-strong); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.bolsa-ponto { fill: var(--brand-strong); }
.bolsa-cotacao { font-size: 1.4rem; margin: 0; }
.bolsa-fundamentos { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.25rem; margin: 0; }
.bolsa-fundamentos dt { color: var(--muted); }
.bolsa-fundamentos dd { margin: 0; font-weight: 700; }

/* Corretora da Bolsa da Cidade (h2b) */
.corretora .campo { display: grid; gap: 0.25rem; font-weight: 600; }
.corretora .campo[hidden] { display: none; }
.corretora select, .corretora input[type="number"] { width: 100%; max-width: 24rem; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; color: var(--ink); background: #fff; }
.corretora select:focus-visible, .corretora input[type="number"]:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-color: var(--brand); }
.corretora-corpo { display: grid; gap: 1rem; }
.corretora-aviso:empty { display: none; }
.bolsa-estreias { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.bolsa-estreias .card { display: grid; gap: 0.35rem; align-content: start; }
.bolsa-estreias .card p { margin: 0; }
.bolsa-resultados { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.bolsa-resultados li { padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.bolsa-extrato { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.bolsa-extrato li { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; align-items: baseline; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }

/* ---------------------------------------------------------------------------------------------
   Home broker (corretora): terminal escuro com ticket de ordem, lista de ordens e posições.
   Cores AA: branco sobre azul e sobre os status; texto escuro sobre o laranja de VENDER.
   --------------------------------------------------------------------------------------------- */
.corretora {
  --hb-fundo: #16181c;
  --hb-painel: #22252a;
  --hb-barra: #2c3036;
  --hb-borda: #3a3f47;
  --hb-texto: #e8eaed;
  --hb-mudo: #a9b1ba;
  --hb-campo: #111316;
  background: var(--hb-fundo);
  color: var(--hb-texto);
  padding: 1rem;
  border-radius: 16px;
}
.corretora h1 { color: #fff; margin: 0; }
.corretora .muted { color: var(--hb-mudo); }
.corretora a:not(.button) { color: #8ec5ff; }
.corretora .button-secondary { background: #2f343b; color: var(--hb-texto); border-color: #454b54; }
.corretora .button-secondary:hover { background: #3a4048; }
.corretora .bolsa-alta { color: #5fe3a1; }
.corretora .bolsa-baixa { color: #ff8a9a; }
.corretora .bolsa-estavel { color: var(--hb-mudo); }

.hb-grade { display: grid; grid-template-columns: minmax(19rem, 26rem) minmax(0, 1fr); gap: 1rem; align-items: start; }
.hb-coluna { gap: 1rem; min-width: 0; }

.corretora .hb-painel {
  background: var(--hb-painel);
  color: var(--hb-texto);
  border: 1px solid var(--hb-borda);
  border-radius: 10px;
  padding: 0 0 1rem;
  gap: 0.75rem;
  box-shadow: none;
  overflow: hidden;
}
.corretora .hb-painel > :not(h2):not(.hb-barra) { margin-left: 1rem; margin-right: 1rem; }
.hb-titulo {
  margin: 0;
  padding: 0.6rem 1rem;
  background: var(--hb-barra);
  border-bottom: 1px solid var(--hb-borda);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
}
.hb-barra { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; background: var(--hb-barra); border-bottom: 1px solid var(--hb-borda); padding-right: 1rem; }
.hb-barra .hb-titulo { border: 0; }
.hb-etiqueta { font-size: 0.75rem; color: var(--hb-mudo); font-style: italic; }
.hb-aba-ordem { align-self: flex-start; padding: 0.3rem 0.8rem; background: #3a3f47; border-radius: 4px; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; color: #fff; }

.corretora .hb-painel .campo { grid-template-columns: 7rem minmax(0, 1fr); align-items: center; gap: 0.5rem; font-size: 0.9rem; font-weight: 600; color: #c9d0d8; }
.corretora .hb-painel .campo[hidden] { display: none; }
.corretora .hb-painel select,
.corretora .hb-painel input[type="number"] {
  width: 100%;
  max-width: none;
  padding: 8px 10px;
  border: 1px solid #454b54;
  border-radius: 4px;
  background: var(--hb-campo);
  color: #fff;
  font: inherit;
  font-variant-numeric: tabular-nums;
}
.corretora .hb-painel select:focus-visible,
.corretora .hb-painel input[type="number"]:focus-visible { outline: 2px solid #8ec5ff; outline-offset: 1px; border-color: #8ec5ff; }
.hb-valor-linha { display: flex; justify-content: space-between; align-items: baseline; margin-top: 0; padding: 0.5rem 0; border-top: 1px solid var(--hb-borda); border-bottom: 1px solid var(--hb-borda); font-weight: 600; color: #c9d0d8; }
.hb-valor { font-size: 1.35rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.hb-info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin-top: 0; margin-bottom: 0; font-size: 0.8rem; }
.hb-info dt { color: var(--hb-mudo); }
.hb-info dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.hb-botoes { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hb-botao { min-height: 44px; padding: 0 1.25rem; border: 0; border-radius: 4px; font: inherit; font-weight: 800; letter-spacing: 0.05em; cursor: pointer; }
.hb-botao-compra { flex: 1 1 7rem; background: #0b4f8a; color: #fff; }
.hb-botao-compra:hover:not(:disabled) { background: #0d62ad; }
.hb-botao-venda { flex: 1 1 7rem; background: #f0903a; color: #14110a; }
.hb-botao-venda:hover:not(:disabled) { background: #f5a45d; }
.hb-botao-limpar { background: #4a4f57; color: #fff; }
.hb-botao-limpar:hover { background: #5a606a; }
.hb-botao:focus-visible { outline: 2px solid #8ec5ff; outline-offset: 2px; }
.hb-botao:disabled { opacity: 0.55; cursor: not-allowed; }
.hb-nota { font-size: 0.78rem; margin-top: 0; margin-bottom: 0; }

.hb-saldo { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin-bottom: 0; }
.hb-saldo > div { padding: 0.6rem 0.75rem; background: var(--hb-campo); border: 1px solid var(--hb-borda); border-radius: 8px; }
.hb-saldo dt { font-size: 0.75rem; color: var(--hb-mudo); }
.hb-saldo dd { margin: 0.15rem 0 0; font-size: 1.1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.hb-saldo-livre { color: #5fe3a1; }

.corretora .bolsa-tabela { background: transparent; color: var(--hb-texto); border-radius: 0; }
.corretora .bolsa-tabela th,
.corretora .bolsa-tabela td { border-bottom: 1px solid #343941; padding: 0.5rem 0.6rem; }
.corretora .bolsa-tabela thead th { color: var(--hb-mudo); font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; }
.corretora .bolsa-tabela tbody tr:hover { background: rgba(255, 255, 255, 0.04); }
.hb-lado { display: inline-flex; align-items: center; justify-content: center; width: 1.3rem; height: 1.3rem; border-radius: 3px; font-size: 0.75rem; font-weight: 800; }
.hb-lado-compra { background: #0b4f8a; color: #fff; }
.hb-lado-venda { background: #f0903a; color: #14110a; }
.hb-status { display: inline-block; min-width: 5.5rem; padding: 0.2rem 0.6rem; border-radius: 4px; text-align: center; font-size: 0.8rem; font-weight: 700; color: #fff; background: #5b6068; }
.hb-status-executed { background: #1f5fa3; }
.hb-status-open { background: #1f7a4d; }
.hb-status-canceled { background: #a8264c; }
.hb-rodape { margin-top: 0; margin-bottom: 0; font-size: 0.8rem; color: var(--hb-mudo); text-align: right; }
.corretora .bolsa-extrato li { border-bottom-color: #343941; }

@media (max-width: 900px) {
  .hb-grade { grid-template-columns: minmax(0, 1fr); }
  .hb-saldo { grid-template-columns: minmax(0, 1fr); }
  .corretora { padding: 0.75rem; border-radius: 12px; }
}

/* ---------------------------------------------------------------------------------------------
   Turma (professor): cabeçalho, abas, desafios, alunos
   --------------------------------------------------------------------------------------------- */
.turma-detalhe-page { gap: 1.25rem; }
.turma-cabeca {
  gap: 0.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--fv-radius-card, 16px);
  background: linear-gradient(135deg, #02291e 0%, #125b2e 100%);
  color: #fff;
}
.turma-cabeca h1 { margin: 0; color: #fff; font-size: 1.75rem; }
.turma-cabeca a { color: #d7f3e3; }
.turma-cabeca p { margin: 0; }
.turma-cabeca .muted { color: #d7f3e3; }
.turma-cabeca .turma-resumo { align-self: flex-start; padding: 0.3rem 0.8rem; border-radius: 999px; background: rgba(255, 255, 255, 0.16); font-weight: 600; font-size: 0.9rem; color: #fff; }

.turma-detalhe-page .abas-lista { flex-wrap: nowrap; overflow-x: auto; gap: 0.25rem; padding-bottom: 0; border-bottom: 2px solid var(--line); scrollbar-width: thin; }
.turma-detalhe-page .aba { flex: 0 0 auto; border: 0; border-bottom: 3px solid transparent; border-radius: 8px 8px 0 0; background: transparent; margin-bottom: -2px; color: var(--muted); }
.turma-detalhe-page .aba:hover { background: var(--brand-soft); color: var(--brand-strong); }
.turma-detalhe-page .aba-ativa,
.turma-detalhe-page .aba-ativa:hover { background: transparent; color: var(--brand-strong); border-bottom-color: var(--brand-strong); }

.turma-detalhe-page .card { box-shadow: none; }
.turma-desafios > h2,
.turma-progresso > h2 { margin: 0; }
.turma-desafios-lista { gap: 0.75rem; }
.turma-desafio-item { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr) auto; align-items: center; gap: 0.5rem 0.9rem; }
.turma-desafio-item > .turma-desafio-acoes { flex-wrap: nowrap; justify-content: flex-end; gap: 6px; }
.turma-desafio-item .turma-desafio-acoes .button { min-height: 36px; padding: 4px 12px; font-size: 0.85rem; }
.turma-desafio-item > .turma-desafio-mais { grid-column: 2 / -1; flex: none; }
.turma-desafio-item .turma-desafio-prazo { align-self: flex-start; padding: 0.1rem 0.6rem; border-radius: 999px; background: #eef2f1; color: var(--ink); font-size: 0.8rem; font-weight: 600; }
.turma-desafio-mais summary { font-size: 0.9rem; }
.turma-desafio-mais .turma-desafio-acoes { margin-top: 0.5rem; }

.turma-detalhe-page .turma-item { gap: 0.75rem; }
.turma-avatar { flex: 0 0 auto; width: 2.25rem; height: 2.25rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); font-weight: 800; }
.turma-detalhe-page .turma-item-info { flex-direction: column; }
.turma-progresso-item { gap: 0.4rem; }

@media (max-width: 600px) {
  .turma-cabeca { padding: 1rem; }
  .turma-cabeca h1 { font-size: 1.4rem; }
  .turma-desafio-item { grid-template-columns: 2rem minmax(0, 1fr); }
  .turma-desafio-item > .turma-desafio-acoes { grid-column: 2; justify-content: flex-start; }
}
.corretora .bolsa-tabela th[scope="row"],
.corretora .bolsa-tabela td { white-space: nowrap; }
.corretora .bolsa-tabela .button { min-height: 30px; padding: 2px 10px; font-size: 0.8rem; }
.corretora .hb-painel .bolsa-tabela { font-size: 0.85rem; }
.corretora .hb-painel .bolsa-tabela th,
.corretora .hb-painel .bolsa-tabela td { padding: 0.45rem 0.3rem; }
.corretora .hb-painel .hb-status { min-width: 4.6rem; padding: 0.15rem 0.4rem; font-size: 0.75rem; }
.corretora .hb-painel .bolsa-tabela .button { padding: 2px 8px; }

/* ---------------------------------------------------------------------------------------------
   Telas "Turmas" (professor) e "Turma" (aluno): cabeçalho com ícone, cartões com ícone,
   código de convite em painel e status em pílula. Tudo por CSS e SVG por código.
   --------------------------------------------------------------------------------------------- */
.icone { flex: 0 0 auto; vertical-align: middle; }

.turma-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 1.75rem;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(120deg, #e3f5ee 0%, #f3fbf8 55%, #d6f0e6 100%);
}
.turma-hero::before,
.turma-hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.turma-hero::before { width: 16rem; height: 16rem; right: -4rem; top: -7rem; background: rgba(15, 138, 106, 0.12); }
.turma-hero::after { width: 9rem; height: 9rem; right: 8rem; bottom: -5rem; background: rgba(15, 138, 106, 0.1); }
.turma-hero-icone {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 4.5rem;
  height: 4.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: linear-gradient(145deg, #0f8a6a, #0a6650);
  color: #fff;
  box-shadow: 0 8px 18px rgba(10, 102, 80, 0.28);
}
.turma-hero-texto { position: relative; z-index: 1; min-width: 0; }
.turma-hero-texto h1 { margin: 0; font-size: 2.1rem; line-height: 1.1; color: var(--ink); }
.turma-hero-texto p { margin: 0.35rem 0 0; max-width: 34rem; }

.turma-h2 { display: flex; align-items: center; gap: 0.6rem; margin: 0; font-size: 1.25rem; }
.turma-h2-icone {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #d6f0e6;
  color: #0a6650;
}
.turma-h2-linha { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.turma-chip { padding: 0.3rem 0.8rem; border-radius: 999px; background: #e3f5ee; color: #0a6650; font-weight: 700; font-size: 0.9rem; }

/* cartão de turma (professor e aluno) */
.turmas-item-prof,
.turma-item-aluno {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) auto;
  grid-template-areas: "tile info status" "tile codigo codigo";
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  background: linear-gradient(120deg, #fbfefd, #f1faf7);
}
.turma-item-aluno { grid-template-areas: "tile info acao"; }
.turma-tile {
  grid-area: tile;
  width: 4.5rem;
  height: 4.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #d6efe6);
  color: #0a6650;
}
.turma-tile-pequeno { width: 3rem; height: 3rem; }
.turmas-item-prof > .turma-item-info,
.turma-item-aluno > .turma-item-info { grid-area: info; flex: none; }
.turmas-item-prof > .turma-status { grid-area: status; }
.turmas-item-prof > .convite-codigo { grid-area: codigo; }
.turma-item-aluno > .button { grid-area: acao; }
.turma-item-nome { font-size: 1.15rem; }
.turmas-item-nome { font-size: 1.35rem; }
.turma-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.turma-meta-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.turma-meta-item .icone { color: #0a6650; }

.turma-status { align-self: start; padding: 0.35rem 0.9rem; border-radius: 999px; font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
.turma-status-ativa { background: #e4efff; color: #175cd3; }
.turma-status-breve { background: #fff1e0; color: #b54708; }
.turma-status-expirado { background: #fde8e6; color: #b42318; }

/* código de convite: painel verde-claro com o código e o botão lado a lado */
.convite-codigo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "rotulo rotulo" "campo botao" "feedback feedback";
  gap: 0.5rem 0.75rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: #e9f7f1;
}
.convite-codigo .convite-codigo-rotulo { grid-area: rotulo; }
.convite-codigo .convite-codigo-campo { grid-area: campo; font-size: 1.5rem; padding: 10px 12px; border-color: #bfe4d6; background: #d9f1e7; }
.convite-codigo > .button { grid-area: botao; min-height: 48px; padding: 0 1.5rem; background: #0a6650; border-color: #0a6650; color: #fff; }
.convite-codigo > .button:hover { background: #084f3e; }
.convite-codigo .convite-copia-feedback { grid-area: feedback; min-height: 0; }
.convite-codigo .convite-copia-feedback:empty { display: none; }

.turma-page .turma-item,
.turmas-page .turma-item { border-color: #d6e9e2; }
.turma-page .card,
.turmas-page .card { border-radius: 18px; }

@media (max-width: 700px) {
  .turma-hero { padding: 1.1rem; gap: 0.9rem; }
  .turma-hero-icone { width: 3.5rem; height: 3.5rem; border-radius: 16px; }
  .turma-hero-icone .icone { width: 30px; height: 30px; }
  .turma-hero-texto h1 { font-size: 1.6rem; }
  .turmas-item-prof { grid-template-columns: 3.25rem minmax(0, 1fr); grid-template-areas: "tile info" "status status" "codigo codigo"; }
  .turma-item-aluno { grid-template-columns: 3.25rem minmax(0, 1fr); grid-template-areas: "tile info" "acao acao"; }
  .turma-tile { width: 3.25rem; height: 3.25rem; }
  .turma-tile .icone { width: 26px; height: 26px; }
  .turma-status { justify-self: start; }
  .convite-codigo { grid-template-columns: minmax(0, 1fr); grid-template-areas: "rotulo" "campo" "botao" "feedback"; }
}
.turma-page .aviso-privacidade { font-size: 0.9rem; }
.turma-item-aluno > .turma-tile,
.turmas-item-prof > .turma-tile { align-self: center; }
.turma-page .turma-desafio-item { border-radius: 16px; background: linear-gradient(120deg, #fbfefd, #f1faf7); border-color: #d6e9e2; }
.turma-desafio-item > .turma-tile { grid-area: auto; width: 3rem; height: 3rem; }
.turma-desafio-item > .turma-tile .icone { width: 24px; height: 24px; }
.turma-page .turma-desafio-item { grid-template-columns: 3rem minmax(0, 1fr) auto; }
.turma-page .turma-desafio-item > .button { justify-self: end; white-space: nowrap; }
.turma-page .turma-desafio-info { flex: none; }
@media (max-width: 600px) {
  .turma-page .turma-desafio-item { grid-template-columns: 3rem minmax(0, 1fr); }
  .turma-page .turma-desafio-item > .button { grid-column: 1 / -1; justify-self: stretch; text-align: center; }
}
.turma-desafio-info > .badge { align-self: flex-start; }
.phase-card-barra { width: 100%; height: 8px; margin: 8px 0 2px; border-radius: 999px; background: #dfe5e3; overflow: hidden; }
.phase-card-barra-cheia { display: block; height: 100%; border-radius: 999px; background: #125b2e; }
.phase-card-barra-p0 .phase-card-barra-cheia { width: 0%; }
.phase-card-barra-p1 .phase-card-barra-cheia { width: 5%; }
.phase-card-barra-p2 .phase-card-barra-cheia { width: 10%; }
.phase-card-barra-p3 .phase-card-barra-cheia { width: 15%; }
.phase-card-barra-p4 .phase-card-barra-cheia { width: 20%; }
.phase-card-barra-p5 .phase-card-barra-cheia { width: 25%; }
.phase-card-barra-p6 .phase-card-barra-cheia { width: 30%; }
.phase-card-barra-p7 .phase-card-barra-cheia { width: 35%; }
.phase-card-barra-p8 .phase-card-barra-cheia { width: 40%; }
.phase-card-barra-p9 .phase-card-barra-cheia { width: 45%; }
.phase-card-barra-p10 .phase-card-barra-cheia { width: 50%; }
.phase-card-barra-p11 .phase-card-barra-cheia { width: 55%; }
.phase-card-barra-p12 .phase-card-barra-cheia { width: 60%; }
.phase-card-barra-p13 .phase-card-barra-cheia { width: 65%; }
.phase-card-barra-p14 .phase-card-barra-cheia { width: 70%; }
.phase-card-barra-p15 .phase-card-barra-cheia { width: 75%; }
.phase-card-barra-p16 .phase-card-barra-cheia { width: 80%; }
.phase-card-barra-p17 .phase-card-barra-cheia { width: 85%; }
.phase-card-barra-p18 .phase-card-barra-cheia { width: 90%; }
.phase-card-barra-p19 .phase-card-barra-cheia { width: 95%; }
.phase-card-barra-p20 .phase-card-barra-cheia { width: 100%; }

/* Renda fixa: catálogo em cartões (cores só por classes, sem estilo inline) */
.rf-catalogo { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.rf-cartao { border-left: 4px solid var(--info); align-content: start; }
.rf-cartao-isento { border-left-color: var(--ok); }
.rf-emissor { font-size: 0.75rem; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); }
.rf-nome { margin: 0; font-size: 1.05rem; }
.rf-taxa { margin: 0; font-size: 1.25rem; font-weight: 800; color: var(--ok); }
.rf-selos { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.rf-dados { display: grid; grid-template-columns: 1fr 1fr; gap: 0.15rem 1rem; margin: 0; }
.rf-dados dt { font-size: 0.8rem; color: var(--muted); }
.rf-dados dd { margin: 0 0 0.4rem; font-weight: 700; }
.rf-cartao-acoes { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.rf-cartao-acoes .button { flex: 1 1 auto; }

/* Carteira: aba Investimentos */
.carteira-total { font-size: 1.6rem; }
.carteira-classe, .carteira-aplicacao { gap: 0.25rem; }
.carteira-titulo { display: grid; gap: 0.25rem; }

/* Investir: renda fixa e renda variável lado a lado no computador, uma embaixo da outra no celular. */
.investir-grade { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.investir-lista { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.35rem; }
.investir-detalhe { overflow-wrap: anywhere; }

/* Carteira: rosca, barras de segmento e evolução. Cores só por classe (a CSP não aceita style inline). */
.rosca-c0 { --rosca-cor: var(--graf-0); }
.rosca-c1 { --rosca-cor: var(--graf-1); }
.rosca-c2 { --rosca-cor: var(--graf-2); }
.rosca-c3 { --rosca-cor: var(--graf-3); }
.rosca-c4 { --rosca-cor: var(--graf-4); }
.rosca-c5 { --rosca-cor: var(--graf-5); }
.rosca { width: 11rem; max-width: 100%; height: auto; flex: none; }
.rosca-trilho { stroke: var(--line); }
.rosca-fatia { stroke: var(--rosca-cor); }
.carteira-rosca { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; }
.carteira-rosca .bolsa-tabela-rolagem { flex: 1 1 16rem; }
.carteira-cor { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 3px; background: var(--rosca-cor); vertical-align: middle; }
.carteira-segmentos { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.carteira-segmento { display: grid; gap: 0.25rem; }
.carteira-segmento-texto { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; }
.barra { width: 100%; height: 0.6rem; display: block; }
.barra-trilho { fill: var(--line); }
.barra-valor { fill: var(--rosca-cor); }
.evolucao-capital { stroke: var(--muted); stroke-width: 2; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.evolucao-ice { stroke: var(--graf-3); stroke-width: 2; stroke-dasharray: 2 4; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.evolucao-legenda { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.evolucao-chave { display: inline-block; width: 1.6rem; height: 0; border-top: 3px solid var(--brand-strong); vertical-align: middle; }
.evolucao-chave-capital { border-top: 3px dashed var(--muted); }
.evolucao-chave-ice { border-top: 3px dotted var(--graf-3); }
.carteira-evolucao-aviso:empty { display: none; }

/* Chefe da F5: teste de estresse */
.estresse-nota { margin: 0; font-weight: 800; font-size: 1.1rem; }
.estresse-criterios { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.estresse-ok strong { color: var(--ok); }
.estresse-falta strong { color: var(--warn); }
.estresse-cenarios { width: 100%; }
.estresse-pior { background: var(--brand-soft); }

/* Tema Azul institucional. O :root acima continua sendo o padrão. */
.seletor-tema-campo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.seletor-tema-rotulo {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Discreto de propósito: sem fundo e sem borda até o foco, para não roubar espaço do menu. */
.seletor-tema {
  width: auto;
  max-width: 7.5rem;
  min-height: 32px;
  padding: 2px 6px;
  font-size: 0.8rem;
  line-height: 1.2;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}

.seletor-tema:hover,
.seletor-tema:focus-visible {
  color: var(--ink);
  background: var(--card);
  border-color: var(--line);
}

@media (max-width: 560px) {
  .seletor-tema-rotulo {
    display: none;
  }

  .seletor-tema {
    max-width: 7.5rem;
    min-height: 40px;
  }

  .account-sair {
    min-height: 40px;
  }
}

html[data-theme="azul"] {
  --bg: #e7f0fe;
  --card: #ffffff;
  --ink: #142d60;
  --muted: #52678f;
  --line: #dfe9f7;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-soft: #dbeafe;
  --danger: #b91c1c;
  --warn: #b45309;
  --ok: #147a34;
  --info: #1d4ed8;
  --shadow: 0 4px 14px rgba(16, 79, 151, 0.1);
  --fv-sidebar: #0a4086;
  --fv-sidebar-ink: #ffffff;
  --fv-sidebar-active: #1665d8;
  --fv-progress: #2563eb;
  --radius: 12px;
  --fv-radius-card: 14px;
}

html[data-theme="azul"] .sidebar,
html[data-theme="azul"] .bottom-nav {
  background:
    radial-gradient(ellipse 120% 38% at 0% 100%, rgba(96, 165, 250, 0.55), transparent 64%),
    linear-gradient(180deg, #0b4c9c 0%, #093f85 55%, #072f66 100%);
}

html[data-theme="azul"] .button,
html[data-theme="azul"] .input,
html[data-theme="azul"] .seletor-tema {
  border-radius: 8px;
}

html[data-theme="azul"] .card,
html[data-theme="azul"] .turmas-page .card {
  border-radius: 14px;
}

html[data-theme="azul"] .button-secondary {
  background: #ffffff;
  color: #104f97;
  border-color: #cbd5e1;
}

html[data-theme="azul"] .sidebar .nav-link:hover,
html[data-theme="azul"] .bottom-nav .nav-link:hover {
  background: #155cac;
}

html[data-theme="azul"] .home-hero-overlay {
  background: linear-gradient(
    110deg,
    rgba(10, 70, 142, 0.95) 0%,
    rgba(21, 92, 172, 0.82) 48%,
    rgba(89, 148, 224, 0.12) 100%
  );
}

html[data-theme="azul"] .turma-cabeca {
  background: linear-gradient(110deg, #0b4c9c 0%, #093f85 48%, #4f8cd8 100%);
}

html[data-theme="azul"] .turma-cabeca a,
html[data-theme="azul"] .turma-cabeca .muted {
  color: #dbeafe;
}

html[data-theme="azul"] .convite-codigo > .button {
  background: #2563eb;
  border-color: #2563eb;
}

html[data-theme="azul"] .table th {
  background: #dbeafe;
  color: #104f97;
}

html[data-theme="azul"] .table tbody tr:hover {
  background: #f1f5fc;
}

html[data-theme="azul"] .input:focus-visible {
  border-color: #2563b8;
  outline: 3px solid #dbeafe;
}

html[data-theme="azul"] .message-ok {
  background: #dcfce7;
  border-color: #147a34;
}

html[data-theme="azul"] .message-erro {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #b91c1c;
}

html[data-theme="azul"] .message-info {
  background: #dbeafe;
  border-color: #2563b8;
}

/* Verde institucional: paleta própria, distinta do Original (--brand #0f766e / --bg do :root). */
html[data-theme="verde"] {
  --bg: #e8eef2;
  --card: #ffffff;
  --ink: #0f2a26;
  --muted: #5a6b72;
  --line: #d5dee6;
  --brand: #12805c;
  --brand-strong: #0b5a40;
  --brand-soft: #d8f3e7;
  --danger: #b42318;
  --warn: #b54708;
  --ok: #067647;
  --info: #12805c;
  --shadow: 0 4px 14px rgba(5, 61, 52, 0.1);
  --fv-sidebar: #053d34;
  --fv-sidebar-ink: #ffffff;
  --fv-sidebar-active: #1fa971;
  --fv-progress: #12805c;
  --radius: 12px;
  --fv-radius-card: 14px;
}

html[data-theme="verde"] .sidebar,
html[data-theme="verde"] .bottom-nav {
  background:
    radial-gradient(ellipse 120% 38% at 0% 100%, rgba(31, 169, 113, 0.45), transparent 64%),
    linear-gradient(180deg, #0a4f43 0%, #053d34 55%, #032820 100%);
}

html[data-theme="verde"] .button,
html[data-theme="verde"] .input,
html[data-theme="verde"] .seletor-tema {
  border-radius: 8px;
}

html[data-theme="verde"] .card,
html[data-theme="verde"] .turmas-page .card {
  border-radius: 14px;
  border-color: #d5dee6;
  box-shadow: 0 2px 10px rgba(5, 61, 52, 0.06);
}

html[data-theme="verde"] .button-secondary {
  background: #ffffff;
  color: #0b5a40;
  border-color: #c5d5ce;
}

html[data-theme="verde"] .sidebar .nav-link:hover,
html[data-theme="verde"] .bottom-nav .nav-link:hover {
  background: #0f6b4f;
}

html[data-theme="verde"] .home-hero-overlay {
  background: linear-gradient(
    110deg,
    rgba(5, 61, 52, 0.95) 0%,
    rgba(11, 90, 64, 0.82) 48%,
    rgba(31, 169, 113, 0.12) 100%
  );
}

html[data-theme="verde"] .turma-cabeca {
  background: linear-gradient(110deg, #0a4f43 0%, #053d34 48%, #1fa971 100%);
}

html[data-theme="verde"] .turma-cabeca a,
html[data-theme="verde"] .turma-cabeca .muted {
  color: #d8f3e7;
}

html[data-theme="verde"] .convite-codigo > .button {
  background: #12805c;
  border-color: #12805c;
}

html[data-theme="verde"] .table th {
  background: #d8f3e7;
  color: #0b5a40;
}

html[data-theme="verde"] .table tbody tr:hover {
  background: #eef6f3;
}

html[data-theme="verde"] .input:focus-visible {
  border-color: #12805c;
  outline: 3px solid #d8f3e7;
}

html[data-theme="verde"] .message-ok {
  background: #e3f7ec;
  border-color: #067647;
}

html[data-theme="verde"] .message-erro {
  background: #fee2e2;
  color: #b42318;
  border-color: #b42318;
}

html[data-theme="verde"] .message-info {
  background: #d8f3e7;
  border-color: #12805c;
}

/* ---------------------------------------------------------------------------------------------
   Escuro: só o administrador escolhe (tema padrão do Finvesthy ou geral). Mesma paleta do Painel
   do Investidor escuro: fundo #0a1b33, cartão #12294d, botão azul cheio #4c8dff com texto escuro.
   As ilustrações da Cidade e as molduras de papel (livro, pergaminho, caderno, arena) têm cor
   própria e não mudam. Contraste AA conferido em tests/contraste.test.mjs.
   --------------------------------------------------------------------------------------------- */
html[data-theme="escuro"] {
  --graf-0: #5fd3c5;
  --graf-1: #7fc0ff;
  --graf-2: #ffc94f;
  --graf-3: #ff9bd6;
  --graf-4: #b8aeff;
  --graf-5: #9ab0d6;
  color-scheme: dark;
  --bg: #0a1b33;
  --card: #12294d;
  --campo: #0e2444;
  --ink: #e8eefa;
  --muted: #9ab0d6;
  --line: #1e3a63;
  --brand: #7fc0ff;
  --brand-strong: #a9d4ff;
  --brand-soft: #153355;
  --botao: #4c8dff;
  --botao-hover: #6ea4ff;
  --on-brand: #08172e;
  --danger: #ff8a78;
  --warn: #ffc94f;
  --ok: #3deba8;
  --info: #7fc0ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 28px rgba(0, 0, 0, 0.35);
  --fv-sidebar: #071426;
  --fv-sidebar-ink: #e8eefa;
  --fv-sidebar-active: #1d4ed8;
  --fv-coin: #ffc94f;
  --fv-progress: #4c8dff;
}

html[data-theme="escuro"] .button,
html[data-theme="escuro"] .aba-ativa,
html[data-theme="escuro"] .aba-ativa:hover {
  background: var(--botao);
  border-color: var(--botao);
  color: var(--on-brand);
}

html[data-theme="escuro"] .button:hover {
  background: var(--botao-hover);
}

html[data-theme="escuro"] .button-secondary,
html[data-theme="escuro"] .button-secondary:hover,
html[data-theme="escuro"] .input,
html[data-theme="escuro"] .mission-item,
html[data-theme="escuro"] .option,
html[data-theme="escuro"] .turma-item,
html[data-theme="escuro"] .turma-desafio-item,
html[data-theme="escuro"] .turma-desafio-form,
html[data-theme="escuro"] .turma-progresso-item,
html[data-theme="escuro"] .aba,
html[data-theme="escuro"] #resposta-aberta,
html[data-theme="escuro"] .turma-correcao-item,
html[data-theme="escuro"] .conquista-item,
html[data-theme="escuro"] .cidade-palco-cards .cidade-cartao,
html[data-theme="escuro"] .cidade-album-ideia {
  background: var(--campo);
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="escuro"] .button-secondary:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

html[data-theme="escuro"] .option:hover {
  background: #173a61;
  border-color: #2a4d7a;
}

html[data-theme="escuro"] .option.correct,
html[data-theme="escuro"] .message-ok,
html[data-theme="escuro"] .badge-completed,
html[data-theme="escuro"] .conquista-nova,
html[data-theme="escuro"] .cidade-album-ideia-bom {
  background: #0f3a31;
  border-color: #1d6b57;
  color: var(--ink);
}

html[data-theme="escuro"] .option.wrong,
html[data-theme="escuro"] .pergunta-erro,
html[data-theme="escuro"] .message-erro,
html[data-theme="escuro"] .cidade-album-ideia-fraco {
  background: #432420;
  border-color: #7a3a30;
  color: var(--ink);
}

html[data-theme="escuro"] .message-info {
  background: #153355;
  border-color: #2a4d7a;
  color: var(--ink);
}

html[data-theme="escuro"] .badge-coming,
html[data-theme="escuro"] .badge-provisorio,
html[data-theme="escuro"] .aviso-lista-alunos,
html[data-theme="escuro"] .aviso-notice-pendente,
html[data-theme="escuro"] .cartao-dica,
html[data-theme="escuro"] .cidade-album-ideia-medio {
  background: #453314;
  border-color: #6b5222;
  color: var(--ink);
}

html[data-theme="escuro"] .badge-indisponivel,
html[data-theme="escuro"] .badge-desafio-pendente,
html[data-theme="escuro"] .turma-desafio-item .turma-desafio-prazo,
html[data-theme="escuro"] .cidade-album-ideia-trancada {
  background: #1c3b64;
  color: var(--ink);
}

html[data-theme="escuro"] .cidade-album-ideia-trancada {
  color: var(--muted);
}

html[data-theme="escuro"] .dialog-backdrop {
  background: rgba(3, 12, 28, 0.7);
}

html[data-theme="escuro"] .turma-hero {
  background: linear-gradient(120deg, #12294d 0%, #0e2444 55%, #153355 100%);
}

html[data-theme="escuro"] .turma-h2-icone,
html[data-theme="escuro"] .turma-chip,
html[data-theme="escuro"] .convite-codigo {
  background: #0f3a31;
  color: var(--ok);
}

html[data-theme="escuro"] .convite-codigo .convite-codigo-campo {
  background: var(--campo);
  border-color: #1d6b57;
}

html[data-theme="escuro"] .turma-item-aluno,
html[data-theme="escuro"] .turma-page .turma-desafio-item {
  background: linear-gradient(120deg, #12294d, #0e2444);
  border-color: var(--line);
}

html[data-theme="escuro"] .turmas-page .turma-item {
  border-color: var(--line);
}

html[data-theme="escuro"] .turma-tile {
  background: radial-gradient(circle at 35% 30%, #1c3b64, #0e2444);
  color: var(--ok);
}

html[data-theme="escuro"] .turma-meta-item .icone {
  color: var(--ok);
}

html[data-theme="escuro"] .turma-status-ativa {
  background: #153355;
  color: var(--info);
}

html[data-theme="escuro"] .turma-status-breve {
  background: #453314;
  color: var(--warn);
}

html[data-theme="escuro"] .turma-status-expirado {
  background: #432420;
  color: var(--danger);
}

html[data-theme="escuro"] .phase-card-barra,
html[data-theme="escuro"] .passo,
html[data-theme="escuro"] .phase-card-ponto {
  background: #1e3a63;
  border-color: #5f7ca8;
}

html[data-theme="escuro"] .phase-card-barra-cheia,
html[data-theme="escuro"] .passo-respondida,
html[data-theme="escuro"] .phase-card-ponto-cheio {
  background: var(--botao);
  border-color: var(--botao);
}

/* Numerais das fases: versões claras, legíveis sobre o cartão escuro (texto grande, ≥ 3:1). */
html[data-theme="escuro"] .phase-card-0 .phase-card-num { color: #a99cff; }
html[data-theme="escuro"] .phase-card-1 .phase-card-num { color: #3deba8; }
html[data-theme="escuro"] .phase-card-2 .phase-card-num { color: #7fc0ff; }
html[data-theme="escuro"] .phase-card-3 .phase-card-num { color: #ffb35c; }
html[data-theme="escuro"] .phase-card-4 .phase-card-num { color: #4fe0d6; }
html[data-theme="escuro"] .phase-card-5 .phase-card-num { color: #f08ad6; }
html[data-theme="escuro"] .phase-card-6 .phase-card-num { color: #9fb8ff; }

/* ---------- Histórias em papiro (só telas de história; paleta em tokens --pap-*) ---------- */
:root {
  --pap-marinho: #123b78;
  --pap-azul: #1763d5;
  --pap-azul-destaque: #2878e8;
  --pap-bege: #f4dead;
  --pap-creme: #fff4dc;
  --pap-dourado: #c99a50;
  --pap-borda: #a96e32;
  --pap-tinta: #172d52;
  --pap-acerto: #14532d;
  --pap-erro: #8f1d1d;
}
.historia-painel,
.aprendizado-painel {
  color: var(--pap-tinta);
  background:
    radial-gradient(circle at 12% 18%, rgba(169, 110, 50, 0.1), transparent 40%),
    radial-gradient(circle at 88% 82%, rgba(169, 110, 50, 0.12), transparent 45%),
    linear-gradient(var(--pap-creme), var(--pap-bege));
  border: 3px solid var(--pap-dourado);
  border-radius: 18px 12px 20px 10px / 10px 20px 12px 18px;
  box-shadow: inset 0 0 38px rgba(169, 110, 50, 0.28), 0 6px 16px rgba(23, 45, 82, 0.18);
  padding: 1.1rem 1.25rem;
}
.historia-painel {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1.1rem;
  align-items: start;
}
.historia-retrato { margin: 0; text-align: center; }
.historia-retrato .retrato-svg,
.historia-retrato .retrato-caixa,
.historia-retrato .retrato-img { width: 140px; height: 140px; display: block; margin: 0 auto; }
.historia-retrato figcaption { font-weight: 700; color: var(--pap-marinho); margin-top: 0.25rem; }
.historia-painel h2 { color: var(--pap-marinho); margin: 0; }
.historia-painel p { margin: 0; line-height: 1.5; }
.historia-painel .muted { color: #3d4f73; }
.historia-dilema { font-weight: 600; border-left: 4px solid var(--pap-azul); padding-left: 0.7rem; }
.pense-nisso {
  background: var(--pap-creme);
  border: 2px dashed var(--pap-dourado);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
}
.pense-nisso strong { color: var(--pap-marinho); }
.aprendizado-painel h3 { color: var(--pap-marinho); margin: 0 0 0.4rem; }
.aprendizado-lista { margin: 0; padding-left: 1.2rem; line-height: 1.5; }
.missao-conteudo.com-historia .pergunta legend {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: var(--pap-marinho);
  color: #fff;
  border-radius: 10px;
  padding: 0.7rem 0.9rem 0.7rem 2.6rem;
  position: relative;
  font-weight: 600;
}
.missao-conteudo.com-historia .pergunta legend::before {
  content: "?";
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--pap-azul);
  color: #fff;
  text-align: center;
  line-height: 1.5rem;
  font-weight: 700;
}
.missao-conteudo.com-historia .option { min-height: 44px; background: var(--pap-creme); color: var(--pap-tinta); border-color: var(--pap-dourado); }
.missao-conteudo.com-historia .option.correct { background: #dcf3e2; color: var(--pap-acerto); border-color: var(--pap-acerto); }
.missao-conteudo.com-historia .option.wrong { background: #fbe1e1; color: var(--pap-erro); border-color: var(--pap-erro); }
html[data-theme="escuro"] .missao-conteudo.com-historia .option { background: var(--pap-creme); color: var(--pap-tinta); }
html[data-theme="escuro"] .missao-conteudo.com-historia .option.correct { background: #dcf3e2; color: var(--pap-acerto); }
html[data-theme="escuro"] .missao-conteudo.com-historia .option.wrong { background: #fbe1e1; color: var(--pap-erro); }
@media (max-width: 720px) {
  .historia-painel { grid-template-columns: 1fr; }
  .historia-retrato .retrato-svg,
  .historia-retrato .retrato-img { width: 110px; height: 110px; }
}
.cidade-palco .historia-painel { grid-template-columns: 100px 1fr; padding: 0.8rem 1rem; }
.cidade-palco .historia-retrato .retrato-svg,
.cidade-palco .historia-retrato .retrato-caixa,
.cidade-palco .historia-retrato .retrato-img { width: 90px; height: 90px; }
.cidade-caso-aprendemos { margin: 0.4rem 0 0; color: var(--pap-marinho); }
@media (max-width: 720px) {
  .cidade-palco .historia-painel { grid-template-columns: 1fr; }
}
.vida-janela {
  color: var(--pap-tinta);
  background: radial-gradient(circle at 15% 15%, rgba(169, 110, 50, 0.1), transparent 40%), linear-gradient(var(--pap-creme), var(--pap-bege));
  border: 3px solid var(--pap-dourado);
  box-shadow: inset 0 0 38px rgba(169, 110, 50, 0.25), 0 8px 22px rgba(23, 45, 82, 0.25);
}
.vida-janela h2 { color: var(--pap-marinho); }
.vida-janela .muted { color: #3d4f73; }

/* Loja: avatar do aluno e lista de peças */
.avatar-aluno { width: 96px; height: 106px; }
.home-avatar { align-items: center; gap: var(--space-3, 12px); }
.home-avatar .avatar-aluno { width: 72px; height: 80px; }
.avatar-aluno .braco { stroke: #e8b88f; stroke-width: 3; stroke-linecap: round; }
.avatar-aluno .sapato { fill: #3d2a1c; }
.acessorio-oculos circle { fill: none; stroke: #14211f; stroke-width: 1.2; }
.acessorio-oculos line { stroke: #14211f; stroke-width: 1.2; }
.acessorio-bone path, .acessorio-bone rect { fill: #c0392b; }
.acessorio-chapeu rect { fill: #3d2a1c; }
.acessorio-cachecol rect { fill: #b46106; }
.acessorio-fone path { stroke: #14211f; stroke-width: 2; }
.acessorio-fone rect { fill: #14211f; }
.acessorio-colar .fio { stroke: #d4a017; stroke-width: 1.1; }
.acessorio-colar .pingente { fill: #c0392b; stroke: #d4a017; stroke-width: 0.6; }
.acessorio-pulseira .aro { fill: none; stroke: #d4a017; stroke-width: 1.2; }
.acessorio-brincos .joia { fill: #d4a017; }
.acessorio-laco polygon, .acessorio-laco circle { fill: #d45a9a; }
.acessorio-tiara .arco { stroke: #d4a017; stroke-width: 1.6; }
.acessorio-tiara .joia { fill: #d4a017; }

/* Peças do boneco (Loja e moradores da Cidade): pernas, mangas, calça, short e itens na mão. */
.morador .braco { stroke: #e8b88f; stroke-linecap: round; }
.cidade-avatar .braco { stroke-width: 3; }
.cidade-avatar .sapato { fill: #3d2a1c; }
.morador .perna { stroke: #e8b88f; stroke-width: 3; stroke-linecap: round; }
.morador .manga { stroke-width: 3.6; stroke-linecap: round; }
.cidade-cena-svg .morador .perna,
.cidade-cena-svg .morador .manga { stroke-width: 5; }
.morador .peca-calca { fill: #34425e; }
.morador .peca-short { fill: #4a6286; }
.morador .ziper { stroke: rgba(20, 33, 31, 0.55); stroke-width: 1; }
.morador .gola { fill: #f4f1ea; }
.mao-espada .lamina { fill: #d9dee3; stroke: #6b7280; stroke-width: 0.6; }
.mao-espada .guarda { fill: #b46106; }
.mao-espada .cabo { fill: #3d2a1c; }
.mao-escudo .escudo { fill: #133571; stroke: #b46106; stroke-width: 1.2; }
.mao-escudo .escudo-faixa { stroke: #e0a526; stroke-width: 1.6; }
.mao-livro .capa { fill: #931a75; }
.mao-livro .paginas { stroke: #f4f1ea; stroke-width: 1.4; }
.mao-guarda-chuva .haste,
.mao-guarda-chuva .cabo-curvo { stroke: #3d2a1c; stroke-width: 1.4; stroke-linecap: round; }
.mao-guarda-chuva .pano { fill: #027bc2; }
.mao-cofrinho .porco { fill: #e79ab8; stroke: #b0577c; stroke-width: 0.6; }
.mao-cofrinho .fenda { fill: #6b3a4f; }
.mao-cofrinho .olho { fill: #14211f; }
.loja-itens { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.loja-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.loja-item-nome { font-weight: 600; }

/* Ranking da semana */
.ranking-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ranking-linha { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 8px; }
.ranking-eu { background: var(--brand-soft); }
.ranking-posicao { min-width: 2.5rem; font-weight: 800; }
.ranking-nome { flex: 1; font-weight: 600; overflow-wrap: anywhere; }
.ranking-xp { font-weight: 700; white-space: nowrap; }
.ranking-linha .cidade-avatar { width: 36px; height: 40px; }
.ranking-apelido input { max-width: 20rem; }

/* Notificações */
.notif-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.notif-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.notif-nova { border-color: var(--brand-strong); }
.notif-item a { font-weight: 600; flex: 1; }
.notif-quando { font-size: 0.85rem; }
.nav-contador { margin-left: 6px; }

/* Domínio por competência (Perfil) */
.dominio-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.dominio-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.dominio-nome { font-weight: 600; }
.dominio-faixa { font-weight: 700; text-align: right; }
.dominio-barra { grid-column: 1 / -1; width: 100%; height: 10px; accent-color: var(--fv-progress); }
.dominio-missoes { grid-column: 1 / -1; font-size: 0.85rem; }

/* Manual (/app/manual): atalhos, índice por grupo (fixo ao lado no computador, recolhível no
   celular) e seções com passos numerados e destaques. Só cores do tema. */
.manual-page [hidden] { display: none !important; }
.manual-busca input { width: 100%; }
.manual-atalhos h2 { font-size: 1rem; margin: 0 0 8px; }
.manual-atalhos ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.manual-atalho { display: flex; align-items: center; min-height: 56px; height: 100%; box-sizing: border-box; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); background: var(--card); color: var(--ink); font-weight: 600; text-decoration: none; box-shadow: var(--shadow); }
.manual-atalho:hover, .manual-atalho:focus-visible { background: var(--brand-soft); }
.manual-layout { display: grid; gap: 18px; }
.manual-indice-nav ul { list-style: none; margin: 0 0 10px; padding: 0; }
.manual-indice-nav li a { display: block; padding: 4px 8px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.manual-indice-nav li a:hover, .manual-indice-nav li a:focus-visible { background: var(--brand-soft); }
.manual-indice-movel summary { cursor: pointer; font-weight: 600; }
.manual-indice-movel[open] summary { margin-bottom: 10px; }
.manual-indice-fixo { display: none; }
.manual-grupo-titulo { margin: 0 0 4px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.manual-corpo { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.manual-grupo { display: flex; flex-direction: column; gap: 12px; }
.manual-secao { scroll-margin-top: 16px; }
.manual-secao-cab { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; }
.manual-secao-cab h2 { margin: 0; }
.manual-secao-cab h2:focus { outline: none; }
.manual-secao-cab p { margin: 4px 0 0; }
.manual-sub { font-size: 1rem; margin: 8px 0 0; }
.manual-passos, .manual-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.manual-passos li { display: flex; gap: 10px; align-items: flex-start; }
.manual-num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-strong); color: #ffffff; font-size: 0.8rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.manual-lista li { position: relative; padding-left: 16px; }
.manual-lista li::before { content: ""; position: absolute; left: 2px; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.manual-destaque { margin: 0; padding: 10px 14px; border-radius: 10px; border-left: 4px solid; }
.manual-atencao { background: color-mix(in srgb, var(--warn) 10%, var(--card)); border-left-color: var(--warn); }
.manual-dica { background: var(--brand-soft); border-left-color: var(--brand); }
.manual-voltar { margin: 0; font-size: 0.85rem; }
@media (min-width: 1000px) {
  .manual-layout { grid-template-columns: 240px minmax(0, 1fr); align-items: start; }
  .manual-indice-nav { position: sticky; top: 12px; }
  .manual-indice-movel { display: none; }
  .manual-indice-fixo { display: block; max-height: calc(100vh - 24px); overflow-y: auto; }
}
