:root {
  /* Cores que NÃO mudam com a paleta: a superfície, os sinais de acerto/erro/aviso e as medidas. */
  --surface: #ffffff;
  --green: #2fa96a;
  --green-bg: #e5f7ee;
  --amber: #d99a1f;
  --amber-bg: #fdf3de;
  --red: #d34b4b;
  --red-bg: #fbe9e9;
  --radius: 16px;
  --font: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ===== PALETAS (cor do site) =====
   O aluno escolhe no Perfil (atributo data-cor na tag <html>); sem escolha vale o azul, que também é o das telas sem login.
   Cada paleta define a cor de ação e os tons que combinam com ela (fundo, bordas, textos, sombras e o tema escuro).
   Os nomes das variáveis ficam genéricos ("purple") de propósito: o valor real muda por paleta.
   --purple (botões, links, menu ativo) passa de 4,5:1 com texto branco; --purple-2 (ponta do degradê) de 3:1. */
/* Azul (padrão) */
:root, [data-cor="azul"] {
  --purple: #1979cc;
  --purple-dark: #145fa1;
  --purple-light: #e7f3fe;
  --purple-2: #3c98e9;
  --purple-rgb: 25, 121, 204;
  --bg: #f4f8fa;
  --ink: #1c2a36;
  --ink-soft: #5e6f7d;
  --border: #e3ebf2;
  --shade-rgb: 34, 79, 119;
  --shadow: 0 14px 32px -12px rgba(34, 79, 119, 0.22);
  --shadow-lg: 0 20px 45px -14px rgba(25, 121, 204, 0.45);
  /* tema escuro desta paleta */
  --d-bg: #0f151a;
  --d-surface: #171f26;
  --d-ink: #e6eef4;
  --d-soft: #a5b3c0;
  --d-border: #2c3944;
  --d-light: #1f3447;
}
/* Roxo */
[data-cor="roxo"] {
  --purple: #6a42fa;
  --purple-dark: #4b1af9;
  --purple-light: #ece7fe;
  --purple-2: #815efd;
  --purple-rgb: 106, 66, 250;
  --bg: #f6f4fa;
  --ink: #211c36;
  --ink-soft: #6e6789;
  --border: #e6e3f2;
  --shade-rgb: 53, 34, 119;
  --shadow: 0 14px 32px -12px rgba(53, 34, 119, 0.22);
  --shadow-lg: 0 20px 45px -14px rgba(106, 66, 250, 0.45);
  /* tema escuro desta paleta */
  --d-bg: #110f1a;
  --d-surface: #1a1726;
  --d-ink: #e9e6f4;
  --d-soft: #aba5c0;
  --d-border: #312c44;
  --d-light: #271f47;
}
/* Verde */
[data-cor="verde"] {
  --purple: #0d8756;
  --purple-dark: #0b6b44;
  --purple-light: #e7fef5;
  --purple-2: #0fa96b;
  --purple-rgb: 13, 135, 86;
  --bg: #f4faf8;
  --ink: #1c362b;
  --ink-soft: #587469;
  --border: #e3f2ec;
  --shade-rgb: 34, 119, 85;
  --shadow: 0 14px 32px -12px rgba(34, 119, 85, 0.22);
  --shadow-lg: 0 20px 45px -14px rgba(13, 135, 86, 0.45);
  /* tema escuro desta paleta */
  --d-bg: #0f1a16;
  --d-surface: #172620;
  --d-ink: #e6f4ef;
  --d-soft: #a5c0b5;
  --d-border: #2c443b;
  --d-light: #1f4737;
}
/* Laranja */
[data-cor="laranja"] {
  --purple: #b1610b;
  --purple-dark: #8d4d09;
  --purple-light: #fef3e7;
  --purple-2: #e17a0c;
  --purple-rgb: 177, 97, 11;
  --bg: #faf7f4;
  --ink: #36291c;
  --ink-soft: #796a5b;
  --border: #f2ebe3;
  --shade-rgb: 119, 78, 34;
  --shadow: 0 14px 32px -12px rgba(119, 78, 34, 0.22);
  --shadow-lg: 0 20px 45px -14px rgba(177, 97, 11, 0.45);
  /* tema escuro desta paleta */
  --d-bg: #1a150f;
  --d-surface: #261f17;
  --d-ink: #f4ede6;
  --d-soft: #c0b3a5;
  --d-border: #44392c;
  --d-light: #47341f;
}
/* Rosa */
[data-cor="rosa"] {
  --purple: #df2a66;
  --purple-dark: #b41b4e;
  --purple-light: #fee7ee;
  --purple-2: #e75082;
  --purple-rgb: 223, 42, 102;
  --bg: #faf4f6;
  --ink: #361c24;
  --ink-soft: #83636d;
  --border: #f2e3e8;
  --shade-rgb: 119, 34, 62;
  --shadow: 0 14px 32px -12px rgba(119, 34, 62, 0.22);
  --shadow-lg: 0 20px 45px -14px rgba(223, 42, 102, 0.45);
  /* tema escuro desta paleta */
  --d-bg: #1a0f12;
  --d-surface: #26171c;
  --d-ink: #f4e6eb;
  --d-soft: #c0a5ae;
  --d-border: #442c34;
  --d-light: #471f2c;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.app-shell { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
}
.icon { display: block; flex-shrink: 0; }

.brand { padding: 0 6px 10px; }
.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-icon {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px -2px rgba(var(--purple-rgb), 0.55);
}
.brand-logo { font-weight: 800; font-size: 1.3rem; }
.brand-logo .accent { color: var(--purple); }
.brand-tagline { font-size: 0.68rem; letter-spacing: 0.08em; color: var(--ink-soft); font-weight: 700; text-transform: uppercase; margin-top: 4px; }

.nav-section-label { font-size: 0.68rem; letter-spacing: 0.08em; color: var(--ink-soft); font-weight: 700; text-transform: uppercase; margin: 22px 10px 8px; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-list a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  color: var(--ink-soft); font-weight: 600; font-size: 0.92rem;
}
.nav-list a:hover { background: var(--purple-light); color: var(--ink); }
.nav-list a.active { background: var(--purple); color: #fff; box-shadow: 0 6px 14px -4px rgba(var(--purple-rgb), 0.55); }
.nav-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.sidebar-promo {
  margin-top: auto;
  background: var(--purple-light);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 0.85rem;
}
.sidebar-promo-icon {
  width: 30px; height: 30px; border-radius: 9px; margin-bottom: 8px;
  background: var(--surface); color: var(--purple);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px -1px rgba(var(--shade-rgb), 0.15);
}
.sidebar-promo strong { display: block; margin-bottom: 4px; }

.sidebar-profile {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; padding: 10px 8px;
  border-top: 1px solid var(--border);
}
.avatar-chip {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--purple-light); color: var(--purple-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.9rem; flex-shrink: 0;
}
.sidebar-profile .who { flex: 1; min-width: 0; }
.sidebar-profile .name { font-size: 0.85rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-profile .level { font-size: 0.72rem; color: var(--ink-soft); }
.logout-link { color: var(--ink-soft); background: none; border: none; display: flex; align-items: center; justify-content: center; padding: 6px; border-radius: 8px; }
.logout-link:hover { background: var(--bg); color: var(--red); }

/* ===== MAIN ===== */
.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 32px; border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.breadcrumb { flex: 1; min-width: 0; font-size: 0.85rem; color: var(--ink-soft); }
.breadcrumb strong { color: var(--ink); }
.topbar-badges { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.badge { border-radius: 100px; padding: 7px 14px; font-weight: 800; font-size: 0.82rem; display: inline-flex; align-items: center; gap: 5px; }
.badge-xp { background: var(--purple-light); color: var(--purple-dark); }
.badge-level { background: var(--bg); color: var(--ink); border: 1px solid var(--border); }
.header-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--purple); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }

.hamburger-btn {
  display: none; background: none; border: none; font-size: 1.5rem;
  color: var(--ink); padding: 4px 6px; flex-shrink: 0; line-height: 1;
}
.sidebar-backdrop { display: none; }
.bottom-nav { display: none; }

.page { padding: 28px 32px 60px; max-width: 1160px; margin: 0 auto; }
.page-eyebrow { font-size: 0.72rem; letter-spacing: 0.1em; color: var(--purple); font-weight: 800; text-transform: uppercase; margin-bottom: 6px; }
.page-title { font-size: 1.7rem; font-weight: 800; margin: 0 0 6px; }
.page-subtitle { color: var(--ink-soft); margin: 0 0 24px; }

/* ===== CARDS ===== */
.card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.card img { max-width: 100%; height: auto; border-radius: 8px; display: block; }

.hero-card {
  background: linear-gradient(135deg, var(--purple), var(--purple-2) 70%);
  color: #fff; border-radius: 20px; padding: 30px; position: relative; overflow: hidden;
  margin-bottom: 24px; box-shadow: var(--shadow-lg);
}
.hero-card::before, .hero-card::after {
  content: ""; position: absolute; border-radius: 50%;
  background: rgba(255, 255, 255, 0.10); pointer-events: none;
}
.hero-card::before { width: 260px; height: 260px; right: -80px; top: -110px; }
.hero-card::after { width: 160px; height: 160px; right: 40px; bottom: -90px; background: rgba(255, 255, 255, 0.08); }
.hero-card .eyebrow { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 800; opacity: 0.85; position: relative; z-index: 1; }
.hero-card h2 { font-size: 1.5rem; margin: 10px 0 8px; font-weight: 800; max-width: 60%; position: relative; z-index: 1; }
.hero-card p { opacity: 0.92; max-width: 55%; margin: 0 0 18px; position: relative; z-index: 1; }
.hero-btn {
  display: inline-flex; align-items: center; gap: 8px; background: #fff; color: var(--purple-dark);
  font-weight: 800; padding: 11px 20px; border-radius: 100px; border: none; font-size: 0.92rem;
  position: relative; z-index: 1; box-shadow: 0 10px 22px -8px rgba(20, 10, 50, 0.35);
}
.hero-icon-badge {
  position: absolute; top: 26px; right: 28px; z-index: 1;
  width: 56px; height: 56px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.18); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.hero-icon-badge .icon { width: 26px; height: 26px; }
.hero-spark {
  position: absolute; z-index: 1; opacity: 0.85;
}

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
@media (min-width: 901px) { .stats-grid.stats-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.achv-list.achv-list-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 480px) { .achv-list.achv-list-2 { grid-template-columns: 1fr; } }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.stat-icon { color: var(--purple); }
.stat-value { font-size: 1.6rem; font-weight: 800; }
.stat-hint { font-size: 0.78rem; color: var(--ink-soft); display: flex; align-items: center; gap: 5px; }

.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.two-col > * { min-width: 0; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.section-title { font-weight: 800; font-size: 1rem; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }

.goal-bar-track { background: var(--bg); border-radius: 100px; height: 10px; overflow: hidden; margin: 10px 0; }
.goal-bar-fill { background: var(--purple); height: 100%; border-radius: 100px; }
.goal-bar-fill.empty { background: var(--border); }

.progress-list { display: flex; flex-direction: column; gap: 14px; }
.progress-row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 0.85rem; }
.progress-row-label { font-weight: 700; }
.progress-row-value { color: var(--ink-soft); font-size: 0.8rem; white-space: nowrap; }
.progress-row .goal-bar-track { margin: 6px 0 0; }
.subject-fill-matematica { background: #3866d6; }
.subject-fill-portugues { background: #d43c7c; }
.subject-fill-geografia { background: var(--green); }
.subject-fill-historia { background: var(--amber); }

.progress-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.progress-summary-item { background: var(--bg); border-radius: 12px; padding: 12px 8px; text-align: center; }
.progress-summary-value { font-weight: 800; font-size: 1.25rem; }
.progress-summary-label { font-size: 0.72rem; color: var(--ink-soft); margin-top: 2px; }
@media (max-width: 480px) {
  .progress-summary-value { font-size: 1.05rem; }
  .progress-summary-label { font-size: 0.65rem; }
}
.goal-dots { display: flex; gap: 8px; margin-top: 14px; }
.goal-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; color: var(--ink-soft); }
.goal-dot.met { background: var(--purple); color: #fff; border-color: var(--purple); }
.goal-dot.today { box-shadow: 0 0 0 2px var(--purple-light); }

.achv-list { display: flex; flex-direction: column; gap: 10px; }
.achv-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; }
.achv-item.unlocked { background: var(--green-bg); }
.achv-icon { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; background: #fff; flex-shrink: 0; }
.achv-item.unlocked .achv-icon { background: var(--green); color: #fff; }
.achv-item.locked { opacity: 0.55; }
.achv-title { font-weight: 700; font-size: 0.88rem; }
.achv-desc { font-size: 0.76rem; color: var(--ink-soft); }
.achv-check { margin-left: auto; color: var(--green); font-weight: 800; }

.reminder-box { background: var(--purple-light); border-radius: var(--radius); padding: 18px; margin-top: 20px; }
.reminder-box .label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800; color: var(--purple-dark); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.reminder-link { display: inline-flex; align-items: center; gap: 4px; color: var(--purple-dark); font-weight: 800; margin-top: 4px; }

/* ===== GRIDS OF CARDS (simulados, temas) ===== */
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 800px) { .card-grid { grid-template-columns: 1fr; } }
.item-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.item-card-top { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 12px; }
.item-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--purple-light); color: var(--purple-dark); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.item-icon-solid { background: var(--purple); color: #fff; }
.subject-icon-ciencias { background: var(--purple-light); color: var(--purple-dark); }
.subject-icon-matematica { background: #e3edff; color: #3866d6; }
.subject-icon-portugues { background: #fde3ec; color: #d43c7c; }
.subject-icon-geografia { background: var(--green-bg); color: var(--green); }
.subject-icon-historia { background: var(--amber-bg); color: var(--amber); }
.item-card h3 { margin: 0 0 4px; font-size: 1.02rem; }
.item-card .item-meta { font-size: 0.8rem; color: var(--ink-soft); }
.tag { display: inline-block; background: var(--purple-light); color: var(--purple-dark); font-size: 0.68rem; font-weight: 800; padding: 3px 9px; border-radius: 100px; letter-spacing: 0.03em; }
.item-facts { display: flex; gap: 16px; font-size: 0.82rem; color: var(--ink-soft); margin: 12px 0 16px; }
.item-facts span { display: inline-flex; align-items: center; gap: 5px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--purple); color: #fff; font-weight: 800; padding: 10px 18px; border-radius: 10px; border: none; font-size: 0.88rem; width: 100%; }
.btn:hover { background: var(--purple-dark); }
.btn-outline { background: #fff; color: var(--purple-dark); border: 1.5px solid var(--purple); }
.btn-secondary { background: var(--bg); color: var(--ink); }
.btn-sm { width: auto; padding: 8px 14px; }
/* Botão de ação no pé de um cartão: ocupa toda a largura do cartão */
.card-action { display: flex; width: 100%; margin-top: 12px; padding: 10px 14px; }

.topic-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1000px) { .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.topic-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: left; }
.topic-card .item-icon { margin-bottom: 12px; }
.topic-card .count { color: var(--ink-soft); font-size: 0.82rem; }

/* ===== VÍDEOS ===== */
.video-player-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.video-player-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-now-playing { margin-top: 12px; font-weight: 700; font-size: 0.92rem; }
.video-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-top: 20px; }
.video-card { position: relative; background: var(--surface); border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; text-align: left; cursor: pointer; }
.video-card.active { border-color: var(--purple); }
.video-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.video-card-play {
  position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,0.55); color: #fff; display: inline-flex; align-items: center; justify-content: center;
}
.video-card-title { font-size: 0.82rem; font-weight: 700; padding: 8px 10px 2px; }
.video-card-channel { font-size: 0.74rem; color: var(--ink-soft); padding: 0 10px 10px; }

/* ===== FILTER CHIPS ===== */
.filter-group { margin-bottom: 14px; }
.filter-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800; color: var(--ink-soft); margin-bottom: 8px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--surface); border: 1px solid var(--border); border-radius: 100px; padding: 7px 15px; font-size: 0.82rem; font-weight: 700; color: var(--ink); }
.chip.active { background: var(--purple); color: #fff; border-color: var(--purple); }

.form-input, .form-select {
  display: block; width: 100%; background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 10px 14px; font-size: 0.9rem; font-family: inherit; color: var(--ink);
}
.form-input:focus, .form-select:focus { outline: none; border-color: var(--purple); }
.form-select { cursor: pointer; }

/* ===== QUESTION ===== */
.support-box { background: #fdf9e9; border: 1px solid #f0e3ac; border-radius: 14px; padding: 16px 18px; margin-bottom: 18px; font-size: 0.92rem; }
.support-box .label { font-weight: 800; font-size: 0.78rem; color: #a3780f; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.qfigure img, .support-box img { max-width: 100%; border-radius: 8px; }
.question-statement { font-weight: 700; font-size: 1.02rem; margin: 18px 0; }
.options-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.option-btn {
  display: flex; align-items: flex-start; gap: 12px; text-align: left;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 12px;
  padding: 13px 16px; font-size: 0.92rem; width: 100%;
}
.option-letter { width: 26px; height: 26px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.8rem; flex-shrink: 0; }
.option-btn.correct { border-color: var(--green); background: var(--green-bg); }
.option-btn.correct .option-letter { background: var(--green); color: #fff; }
.option-btn.wrong { border-color: var(--red); background: var(--red-bg); }
.option-btn.wrong .option-letter { background: var(--red); color: #fff; }
.option-btn.selected-only { border-color: var(--purple); }
.option-btn:has(input:checked) { border-color: var(--purple); background: var(--purple-light); }
.option-btn input[type="radio"] { accent-color: var(--purple); }
.explanation-box { background: var(--purple-light); border-radius: 12px; padding: 14px 16px; font-size: 0.88rem; margin-bottom: 20px; }
.question-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.question-progress { font-size: 0.82rem; color: var(--ink-soft); font-weight: 700; }

/* ===== QUADRADINHOS DE QUESTÃO (navegação no simulado + revisão pós-simulado) ===== */
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 8px; margin-bottom: 14px; }
.review-square {
  aspect-ratio: 1; border-radius: 9px; border: 1.5px solid var(--border); background: var(--bg);
  color: var(--ink-soft); font-weight: 800; font-size: 0.82rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; text-decoration: none;
}
.review-square.answered { background: var(--purple-light); border-color: var(--purple); color: var(--purple-dark); }
.review-square.correct { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.review-square.wrong { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.review-square.active { outline: 2px solid var(--purple); outline-offset: 2px; }
.review-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 4px; }
.review-legend span { display: inline-flex; align-items: center; gap: 6px; }
.review-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; background: var(--bg); border: 1.5px solid var(--border); }
.review-dot.correct { background: var(--green-bg); border-color: var(--green); }
.review-dot.wrong { background: var(--red-bg); border-color: var(--red); }
.review-panel { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }

/* ===== FOCUS MODE (simulado em andamento) — sem sidebar, header enxuto ===== */
.app-shell-focus { background: var(--bg); }
.focus-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 16px 32px; }
.focus-header-top { display: flex; align-items: center; gap: 14px; max-width: 760px; margin: 0 auto; }
.focus-close {
  width: 34px; height: 34px; border-radius: 50%; background: var(--bg); color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.focus-close:hover { background: var(--border); color: var(--ink); }
.focus-title { flex: 1; min-width: 0; font-weight: 800; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer-badge {
  display: inline-flex; align-items: center; gap: 5px; background: var(--purple-light); color: var(--purple-dark);
  font-weight: 800; font-size: 0.8rem; padding: 6px 12px; border-radius: 100px; flex-shrink: 0;
}
.focus-page { max-width: 760px; padding: 28px 32px 60px; }
@media (max-width: 640px) {
  .focus-header { padding: 14px 16px; }
  .focus-page { padding: 20px 16px 48px; }
}

/* ===== RANKING ===== */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
@media (max-width: 800px) { .podium { grid-template-columns: 1fr; } }
.podium-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; text-align: center; }
.podium-medal { font-size: 1.6rem; margin-bottom: 8px; }
.podium-avatar { width: 54px; height: 54px; border-radius: 50%; background: var(--purple-light); color: var(--purple-dark); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.3rem; margin: 0 auto 10px; }
.podium-name { font-weight: 800; }
.podium-level { font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 6px; }
.rank-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; background: var(--surface); }
.rank-row.me { border-color: var(--purple); background: var(--purple-light); }
.rank-pos { font-weight: 800; color: var(--ink-soft); width: 24px; }
.rank-row .who { flex: 1; }
.rank-row .name { font-weight: 700; font-size: 0.92rem; }
.rank-row .meta { font-size: 0.76rem; color: var(--ink-soft); }
.you-tag { color: var(--purple); font-weight: 800; font-size: 0.75rem; margin-left: 6px; }

/* ===== ADMIN ===== */
.admin-table-wrap { overflow-x: auto; overflow-y: auto; max-height: 420px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-table th { text-align: left; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); font-weight: 800; padding: 10px 14px; border-bottom: 2px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: var(--bg); }
.admin-table .cell-name { font-weight: 700; }
.admin-table .cell-email { color: var(--ink-soft); font-size: 0.8rem; }
.admin-badge-online { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 6px; }
.hardest-q-list { max-height: 420px; overflow-y: auto; }
.hardest-q { padding: 14px 0; border-bottom: 1px solid var(--border); }
.hardest-q:last-child { border-bottom: none; }
.hardest-q-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.hardest-q-pct { font-weight: 800; color: var(--red); }
.easiest-q-pct { font-weight: 800; color: var(--green); }
.analises-heading { font-size: 1.05rem; font-weight: 800; margin: 28px 0 14px; }
.hardest-q-text { font-size: 0.88rem; color: var(--ink); }
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 100px; background: var(--red); color: #fff; font-size: 0.68rem;
  font-weight: 800; margin-left: auto;
}
.report-row { padding: 14px 0; border-bottom: 1px solid var(--border); }
.report-row:last-child { border-bottom: none; }
.report-row.resolvido { opacity: 0.6; }
.report-row-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.report-status { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 9px; border-radius: 100px; }
.report-status.aberto { background: var(--red-bg); color: var(--red); }
.report-status.resolvido { background: var(--green-bg); color: var(--green); }
.report-message { font-size: 0.88rem; color: var(--ink); white-space: pre-wrap; margin-bottom: 8px; }

/* ===== REPORTAR PROBLEMA (botão flutuante) ===== */
.bug-report-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 95;
  width: 52px; height: 52px; border-radius: 50%; border: none;
  background: var(--purple); color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px -6px rgba(var(--purple-rgb), 0.55); cursor: pointer;
}
.bug-report-fab:hover { background: var(--purple-dark); }
.bug-report-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.bug-report-modal[hidden] { display: none; }
.bug-report-modal-backdrop { position: absolute; inset: 0; background: rgba(20, 12, 45, 0.5); }
.bug-report-modal-card {
  position: relative; background: var(--surface); border-radius: var(--radius); padding: 22px;
  max-width: 420px; width: 100%; box-shadow: var(--shadow-lg);
}
.bug-report-modal-header { display: flex; align-items: center; justify-content: space-between; font-weight: 800; margin-bottom: 10px; }
.bug-report-modal-header span { display: flex; align-items: center; gap: 8px; }

/* ===== TOAST ===== */
.app-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px;
  font-size: 0.85rem; font-weight: 700; z-index: 300; opacity: 0; transition: opacity 0.25s, transform 0.25s;
  box-shadow: var(--shadow-lg); max-width: calc(100vw - 40px); text-align: center;
}
.app-toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* ===== PROGRESS ===== */
.week-chart { display: flex; align-items: flex-end; gap: 14px; height: 160px; margin: 16px 0; }
.week-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.week-bar { width: 100%; max-width: 34px; background: var(--purple-light); border-radius: 8px 8px 0 0; position: relative; }
.week-bar.has-xp { background: var(--purple); }
.week-bar-label { font-size: 0.72rem; color: var(--ink-soft); margin-top: 8px; font-weight: 700; text-transform: capitalize; }
.week-bar-value { font-size: 0.68rem; color: var(--ink-soft); margin-bottom: 4px; }

/* ===== PROFILE ===== */
.profile-header { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.profile-header > div:not(.profile-avatar) { min-width: 0; }
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--purple-light); color: var(--purple-dark); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.6rem; }
.profile-header h2 { margin: 0; font-size: 1.2rem; }
.profile-header .sub { color: var(--ink-soft); font-size: 0.85rem; }
.level-progress-label { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--ink-soft); font-weight: 700; margin-bottom: 6px; }
.account-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.account-row:last-child { border-bottom: none; }
.account-icon { color: var(--purple); width: 20px; text-align: center; }

/* ===== LOGIN ===== */
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--purple), var(--purple-2)); }
.login-card { background: #fff; border-radius: 20px; padding: 40px; max-width: 380px; width: 100%; text-align: center; box-shadow: 0 30px 60px -20px rgba(0,0,0,0.35); }
.login-card .brand-logo { font-size: 1.6rem; margin-bottom: 4px; }
.login-card p { color: var(--ink-soft); margin-bottom: 26px; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; border: 1.5px solid var(--border); border-radius: 12px; padding: 13px; font-weight: 700; font-size: 0.92rem; width: 100%; }
.google-btn:hover { background: var(--bg); }
.footer-credit { text-align: center; color: var(--ink-soft); font-size: 0.76rem; margin-top: 40px; }
.alert { background: var(--red-bg); color: var(--red); border-radius: 10px; padding: 12px 16px; font-size: 0.85rem; margin-bottom: 16px; }
.legal-disclaimer { text-align: left; color: var(--ink-soft); font-size: 0.7rem; line-height: 1.5; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); }
.legal-disclaimer a { color: var(--purple-dark); font-weight: 700; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--ink-soft); }
.ajax-loading { opacity: 0.5; pointer-events: none; transition: opacity 0.1s ease; }

/* ===== RESPONSIVO (celular/tablet) ===== */
@media (max-width: 900px) {
  .hamburger-btn { display: block; }

  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 110;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 0 0 40px rgba(20, 10, 50, 0.25);
    width: 82vw; max-width: 300px;
    /* o menu é mais alto que telas pequenas: rola por dentro (sem arrastar a página junto) */
    height: 100vh; height: 100dvh;
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-backdrop {
    display: block; position: fixed; inset: 0;
    background: rgba(20, 10, 50, 0.45); z-index: 100;
    opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
  }
  .sidebar-backdrop.open { opacity: 1; pointer-events: auto; }

  .topbar { padding: 14px 16px; flex-wrap: wrap; row-gap: 10px; }
  .topbar-badges { gap: 6px; }
  .badge { padding: 6px 10px; font-size: 0.74rem; }
  .header-avatar { width: 30px; height: 30px; font-size: 0.8rem; }

  .page { padding: 18px 16px calc(78px + env(safe-area-inset-bottom)); }
  .page-title { font-size: 1.35rem; }

  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    background: var(--surface); border-top: 1px solid var(--border);
    box-shadow: 0 -6px 20px -6px rgba(var(--shade-rgb), 0.15);
    padding: 6px 2px calc(6px + env(safe-area-inset-bottom));
  }
  .bug-report-fab { right: 14px; bottom: calc(78px + env(safe-area-inset-bottom)); width: 46px; height: 46px; }
  .bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 2px; border-radius: 10px; color: var(--ink-soft);
  }
  .bottom-nav a .icon { width: 21px; height: 21px; }
  .bottom-nav a span { font-size: 0.64rem; font-weight: 700; }
  .bottom-nav a.active { color: var(--purple); }

  .hero-card { padding: 20px; }
  .hero-card h2 { max-width: 100%; font-size: 1.2rem; }
  .hero-icon-badge { display: none; }
  .hero-card p { max-width: 100%; }

  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .profile-avatar { width: 52px; height: 52px; font-size: 1.3rem; flex-shrink: 0; }
  .profile-header h2 { font-size: 1.05rem; word-break: break-word; }
  .two-col { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .podium { grid-template-columns: 1fr; }

  .option-btn { padding: 11px 12px; font-size: 0.88rem; }

  .week-chart { gap: 6px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .topic-grid { grid-template-columns: 1fr; }
  .breadcrumb { font-size: 0.78rem; }
}

.hour-chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.hour-bar-wrap { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.hour-bar { width: 100%; border-radius: 4px 4px 0 0; background: var(--border); }
.hour-bar.has { background: var(--purple); }
.hour-label { font-size: 0.62rem; color: var(--ink-soft); height: 14px; margin-top: 4px; }

/* ===== LGPD: páginas legais, aceite e privacidade no perfil ===== */
.footer-legal { text-align: center; font-size: 0.72rem; color: var(--ink-soft); margin: 4px 0 18px; }
.footer-legal a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }
.footer-legal a:hover { color: var(--purple-dark); }

.legal-shell { min-height: 100vh; max-width: 820px; margin: 0 auto; padding: 22px 18px 48px; }
.legal-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.legal-top .brand-logo { font-size: 1.35rem; font-weight: 800; color: var(--ink); text-decoration: none; }
.legal-top .brand-logo .accent { color: var(--purple); }
.legal-back { font-size: 0.85rem; font-weight: 700; color: var(--purple-dark); text-decoration: none; }

.legal-summary { background: var(--purple-light); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 20px; font-size: 0.92rem; line-height: 1.55; }
.legal-summary .label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800; color: var(--purple-dark); margin-bottom: 4px; }

.legal-doc { font-size: 0.92rem; line-height: 1.65; }
.legal-doc section + section { margin-top: 26px; }
.legal-doc h2 { font-size: 1.02rem; font-weight: 800; margin: 0 0 8px; }
.legal-doc p { margin: 0 0 10px; }
.legal-doc ul { margin: 0 0 10px; padding-left: 20px; }
.legal-doc li { margin-bottom: 6px; }
.legal-doc a, .legal-link { color: var(--purple-dark); font-weight: 700; }
.legal-doc code { background: var(--bg); border-radius: 6px; padding: 1px 6px; font-size: 0.85em; }
.legal-table-wrap { overflow-x: auto; margin: 0 0 12px; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.legal-table th { text-align: left; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); font-weight: 800; padding: 8px 12px; border-bottom: 2px solid var(--border); }
.legal-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.legal-table tr:last-child td { border-bottom: none; }
.legal-table td:first-child { font-weight: 700; white-space: nowrap; }

.login-consent-hint { font-size: 0.72rem; color: var(--ink-soft); margin: 14px 0 0; }
.login-consent-hint a { color: var(--purple-dark); font-weight: 700; }
.notice { background: var(--green-bg); color: var(--green); border-radius: 10px; padding: 12px 16px; font-size: 0.85rem; margin-bottom: 16px; }

.consent-card { max-width: 440px; text-align: left; }
.consent-card .brand-logo { text-align: center; }
.consent-title { font-size: 1.3rem; font-weight: 800; margin: 14px 0 6px; text-align: center; }
.consent-lead { font-size: 0.88rem; color: var(--ink-soft); margin: 0 0 12px; text-align: center; }
.consent-points { list-style: none; margin: 0 0 18px; padding: 14px 16px; background: var(--bg); border-radius: 12px; font-size: 0.84rem; line-height: 1.5; }
.consent-points li + li { margin-top: 8px; }
.consent-form { display: flex; flex-direction: column; gap: 12px; }
.consent-check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.84rem; line-height: 1.45; cursor: pointer; }
.consent-check input { margin-top: 3px; width: 18px; height: 18px; flex: 0 0 18px; accent-color: var(--purple); }
.consent-check a { color: var(--purple-dark); font-weight: 700; }
.consent-decline { text-align: center; margin-top: 14px; }
.consent-decline-btn { background: none; border: none; color: var(--ink-soft); font: inherit; font-size: 0.8rem; text-decoration: underline; cursor: pointer; }

.privacy-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.delete-account-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.delete-account-form[hidden] { display: none; }
.delete-warning { margin: 0; font-size: 0.82rem; color: var(--red); }
.btn-danger { background: var(--red); color: #fff; }
.privacy-note { margin: 0 0 14px; font-size: 0.82rem; line-height: 1.55; color: var(--ink-soft); }

/* ===== Selo Platina (todas as conquistas) ===== */
.platinum-badge { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 2px 9px; border-radius: 100px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.03em; vertical-align: middle; color: #3a4660; background: linear-gradient(135deg, #f7f9fc 0%, #d5dbe8 55%, #eef1f7 100%); border: 1px solid #b4bdd0; box-shadow: 0 1px 2px rgba(60, 75, 110, 0.18); white-space: nowrap; }
.platinum-badge .icon { width: 12px; height: 12px; }
.podium-name .platinum-badge { display: flex; width: fit-content; margin: 6px auto 0; }
.achv-count { margin-left: auto; font-size: 0.8rem; font-weight: 800; color: var(--ink-soft); }

/* ===== Perfil: "Sobre você" e aviso de perfil incompleto no painel ===== */
.profile-form { display: flex; flex-direction: column; gap: 14px; }
.profile-field { display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; font-weight: 700; }
.profile-field em { font-style: normal; font-weight: 600; color: var(--ink-soft); }
.field-error { color: var(--red); font-weight: 600; font-size: 0.78rem; }

.profile-nudge { display: flex; align-items: center; gap: 14px; background: var(--purple-light); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 20px; }
.profile-nudge-icon { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; background: var(--surface); color: var(--purple-dark); display: flex; align-items: center; justify-content: center; }
.profile-nudge-text { flex: 1; font-size: 0.86rem; line-height: 1.45; }
.profile-nudge-text strong { display: block; font-size: 0.92rem; margin-bottom: 2px; }
.profile-nudge-btn { flex: 0 0 auto; white-space: nowrap; text-decoration: none; }
@media (max-width: 560px) {
  .profile-nudge { flex-wrap: wrap; }
  .profile-nudge-text { flex-basis: calc(100% - 52px); }
  .profile-nudge-btn { width: 100%; }
}
.profile-form .btn { align-self: flex-start; }

/* ===== Convite (painel) e bloqueio de usuários (admin) ===== */
.invite-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.invite-actions .btn { text-decoration: none; }
.cell-actions { white-space: nowrap; }
.inline-form { display: inline; margin-left: 8px; }
.blocked-badge { display: inline-block; background: var(--red-bg); color: var(--red); border-radius: 100px; padding: 2px 10px; font-size: 0.7rem; font-weight: 800; }
.blocked-row td { opacity: 0.6; }
.blocked-row td.cell-actions { opacity: 1; }
.cell-actions .inline-form:first-child { margin-left: 0; }

/* ===== Treino: avisos de XP e de questão já respondida ===== */
.xp-note { padding: 10px 14px; border-radius: 12px; font-size: 0.86rem; line-height: 1.45; margin: 0 0 14px; }
.xp-earned { background: var(--green-bg); color: var(--green); }
.xp-info { background: var(--purple-light); color: var(--purple-dark); }
.xp-wrong { background: var(--amber-bg); color: var(--amber); }

/* Treino: com muitas questões, a grade rola dentro do próprio bloco */
.treino-grid { max-height: 210px; overflow-y: auto; padding: 4px; margin-left: -4px; margin-right: -4px; }
.treino-grid .review-square { text-decoration: none; }

/* Celular: sem o flash azul padrão do toque; feedback suave na cor do site */
a, button, .btn, .nav-list a, .review-square { -webkit-tap-highlight-color: transparent; }
@media (hover: none) {
  .btn:hover { background: var(--purple); }
  .btn-secondary:hover { background: var(--bg); }
  .bug-report-fab:hover { background: var(--purple); }
}
.btn, .hero-btn { transition: transform .1s ease; }
.btn:active, .hero-btn:active { transform: scale(0.97); }
@media (max-width: 900px) {
  .bottom-nav a:active { background: var(--purple-light); color: var(--purple); }
}

/* Questões salvas (estrela e anotação) */
.save-top { float: right; margin: 0 0 6px 10px; }
.save-form { margin: 0; }
.save-btn { border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 100px; padding: 6px 14px; font: inherit; font-size: 0.82rem; font-weight: 800; cursor: pointer; }
.save-btn.on { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.saved-card { text-decoration: none; color: inherit; display: block; }
.saved-note { margin-top: 8px; font-size: 0.85rem; color: var(--ink-soft); background: var(--bg); border-radius: 10px; padding: 6px 10px; }
.note-area { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; background: var(--surface); color: var(--ink); resize: vertical; }

/* ===== Aparência: tema escuro e tamanho da letra (escolhidos no Perfil, guardados na conta) ===== */
html[data-theme="dark"] {
  --bg: var(--d-bg); --surface: var(--d-surface); --ink: var(--d-ink); --ink-soft: var(--d-soft); --border: var(--d-border);
  --purple-light: var(--d-light); --green-bg: #12301f; --amber-bg: #3a2d10; --red-bg: #3a1a1a;
  --shadow: 0 14px 32px -12px rgba(0, 0, 0, 0.6); --shadow-lg: 0 20px 45px -14px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}
html[data-theme="dark"] body { --purple-light: color-mix(in srgb, var(--purple) 22%, var(--surface)); }
html[data-theme="dark"] .support-box { background: #2a2614; border-color: #4d4318; }
html[data-theme="dark"] .support-box .label { color: #e6bf5a; }
html[data-theme="dark"] .btn-outline, html[data-theme="dark"] .google-btn, html[data-theme="dark"] .achv-icon { background: var(--surface); color: var(--ink); }
html[data-theme="dark"] .hero-btn { background: var(--surface); }
html[data-theme="dark"] [class*="subject-icon-"] { background: rgba(255, 255, 255, 0.09); }
html[data-theme="dark"] .save-btn.on { background: #4a3a10; border-color: #b7791f; color: #fde68a; }
html[data-theme="dark"] .heat-good { background: #14532d; color: #bbf7d0; border-color: #166534; }
html[data-theme="dark"] .heat-mid { background: #713f12; color: #fef08a; border-color: #854d0e; }
html[data-theme="dark"] .heat-bad { background: #7f1d1d; color: #fecaca; border-color: #991b1b; }
html[data-theme="dark"] .form-error { color: #fca5a5; }
html[data-theme="dark"] .app-toast { background: var(--surface); color: var(--ink); border: 1px solid var(--border); }
html[data-theme="dark"] img { filter: none; }
html[data-theme="dark"] #questao img, html[data-theme="dark"] .question-statement img, html[data-theme="dark"] .option-btn img, html[data-theme="dark"] .support-box img, html[data-theme="dark"] .review-detail img { background: #fff; border-radius: 8px; }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: var(--d-bg); --surface: var(--d-surface); --ink: var(--d-ink); --ink-soft: var(--d-soft); --border: var(--d-border);
    --purple-light: var(--d-light); --green-bg: #12301f; --amber-bg: #3a2d10; --red-bg: #3a1a1a;
    --shadow: 0 14px 32px -12px rgba(0, 0, 0, 0.6); --shadow-lg: 0 20px 45px -14px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
  html[data-theme="auto"] body { --purple-light: color-mix(in srgb, var(--purple) 22%, var(--surface)); }
  html[data-theme="auto"] .support-box { background: #2a2614; border-color: #4d4318; }
  html[data-theme="auto"] .support-box .label { color: #e6bf5a; }
  html[data-theme="auto"] .btn-outline, html[data-theme="auto"] .google-btn, html[data-theme="auto"] .achv-icon { background: var(--surface); color: var(--ink); }
  html[data-theme="auto"] .hero-btn { background: var(--surface); }
  html[data-theme="auto"] [class*="subject-icon-"] { background: rgba(255, 255, 255, 0.09); }
  html[data-theme="auto"] .save-btn.on { background: #4a3a10; border-color: #b7791f; color: #fde68a; }
  html[data-theme="auto"] .heat-good { background: #14532d; color: #bbf7d0; border-color: #166534; }
  html[data-theme="auto"] .heat-mid { background: #713f12; color: #fef08a; border-color: #854d0e; }
  html[data-theme="auto"] .heat-bad { background: #7f1d1d; color: #fecaca; border-color: #991b1b; }
  html[data-theme="auto"] .form-error { color: #fca5a5; }
  html[data-theme="auto"] .app-toast { background: var(--surface); color: var(--ink); border: 1px solid var(--border); }
  html[data-theme="auto"] img { filter: none; }
  html[data-theme="auto"] #questao img, html[data-theme="auto"] .question-statement img, html[data-theme="auto"] .option-btn img, html[data-theme="auto"] .support-box img, html[data-theme="auto"] .review-detail img { background: #fff; border-radius: 8px; }
}
html[data-font="lg"] { font-size: 112.5%; }
html[data-font="xl"] { font-size: 125%; }

/* ===== Radar de matérias, mapa de temas e listas ===== */
.radar-wrap { display: flex; justify-content: center; margin: 6px 0 2px; }
.radar { width: 100%; max-width: 420px; height: auto; overflow: visible; }
.radar-ring { fill: none; stroke: var(--border); stroke-width: 1; }
.radar-axis { stroke: var(--border); stroke-width: 1; }
.radar-shape { fill: var(--purple); fill-opacity: 0.22; stroke: var(--purple); stroke-width: 2; stroke-linejoin: round; }
.radar-dot { fill: var(--purple); }
.radar-label { font-size: 11px; font-weight: 700; fill: var(--ink); }
.radar-label.muted { fill: var(--ink-soft); font-weight: 600; }
.heat-group { margin-bottom: 14px; }
.heat-title { font-weight: 800; font-size: 0.9rem; margin-bottom: 6px; }
.heat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.heat { display: inline-block; padding: 5px 11px; border-radius: 100px; font-size: 0.78rem; font-weight: 700; text-decoration: none; border: 1px solid transparent; }
.heat-good { background: #dcfce7; color: #166534; border-color: #86efac; }
.heat-mid { background: #fef9c3; color: #854d0e; border-color: #fde047; }
.heat-bad { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.plan-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.plan-list a { font-weight: 700; }
.form-error { color: #b91c1c; font-size: 0.85rem; font-weight: 700; margin-top: 4px; }

/* ===== Formulários simples (Perfil > Aparência, plano de estudos etc.) ===== */
.radio-line { display: block; margin: 6px 0; cursor: pointer; }
.form-row { margin-bottom: 16px; }
.form-row > label { display: block; font-weight: 800; margin-bottom: 4px; }
.form-row select, .form-row input[type=date], .form-row input[type=number] { width: 100%; max-width: 360px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; background: var(--surface); color: var(--ink); }

/* Simulado sob medida */
.custom-exam-cta { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.check-chip { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.check-chip input { accent-color: var(--purple); }
.form-row > label.radio-line { font-weight: 500; }
.form-row > label.radio-line strong { font-weight: 800; }

/* O que estudar hoje */
.today-list { margin: 0; padding-left: 22px; display: grid; gap: 16px; }
.today-list li { padding-left: 4px; }
.today-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }

/* Ofensiva, escudo e calendário do mês */
.ofensiva-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ofensiva-num { font-size: 2.6rem; font-weight: 800; line-height: 1; color: #ea580c; }
.shield-box { margin-left: auto; display: flex; gap: 4px; font-size: 1.5rem; }
.shield { filter: grayscale(1); opacity: 0.3; }
.shield.on { filter: none; opacity: 1; }
.ofensiva-regras { margin-top: 10px; font-size: 0.88rem; }
.ofensiva-regras summary { cursor: pointer; font-weight: 800; color: var(--purple-dark); }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cal-nav { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-size: 1.3rem; color: var(--ink); background: var(--surface); }
.cal-nav.off { opacity: 0.3; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 5px; }
.cal-dow span { text-align: center; font-size: 0.72rem; font-weight: 800; color: var(--ink-soft); }
.cal-cell { position: relative; aspect-ratio: 1 / 1; max-height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 0.85rem; font-weight: 700; border: 1px solid var(--border); background: var(--surface); color: var(--ink); }
.cal-cell.empty { border: 0; background: transparent; }
.cal-cell.ofensiva { background: #22c55e; border-color: #16a34a; color: #fff; }
.cal-cell.estudou { background: #bbf7d0; border-color: #86efac; color: #14532d; }
.cal-cell.escudo { background: #dbeafe; border-color: #93c5fd; color: #1e3a8a; }
.cal-cell.futuro { opacity: 0.45; }
.cal-cell.today { outline: 2px solid var(--purple); outline-offset: 1px; }
.cal-cell.evento { opacity: 1; background: var(--amber-bg); border-color: var(--amber); color: var(--ink); }
.cal-cell.evento b { position: absolute; right: 3px; top: 0; font-size: 0.7rem; color: var(--amber); }
.cal-cell.prova { background: var(--purple); border-color: var(--purple-dark); color: #fff; }
.cal-cell.prova b { color: #fff; }
.cal-dot.evento { background: var(--amber-bg); border-color: var(--amber); }
.cal-agenda { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.cal-agenda-title { font-weight: 800; font-size: 0.85rem; margin-bottom: 8px; }
.cal-agenda-row { display: flex; gap: 10px; font-size: 0.82rem; padding: 4px 0; align-items: baseline; }
.cal-agenda-row.prova { font-weight: 800; }
.cal-agenda-date { flex: 0 0 54px; font-weight: 800; color: var(--purple-dark); }
html[data-theme="dark"] .cal-agenda-date { color: var(--purple-2); }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .cal-agenda-date { color: var(--purple-2); } }
.cal-cell i { position: absolute; right: 1px; bottom: -2px; font-size: 0.7rem; font-style: normal; }
.cal-dot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; border: 1px solid var(--border); vertical-align: -1px; margin-right: 4px; background: var(--surface); }
.cal-dot.ofensiva { background: #22c55e; border-color: #16a34a; }
.cal-dot.estudou { background: #bbf7d0; border-color: #86efac; }
.cal-dot.escudo { background: #dbeafe; border-color: #93c5fd; }
html[data-theme="dark"] .cal-cell.estudou { background: #14532d; border-color: #166534; color: #bbf7d0; }
html[data-theme="dark"] .cal-cell.escudo { background: #1e3a8a; border-color: #1d4ed8; color: #dbeafe; }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .cal-cell.estudou { background: #14532d; border-color: #166534; color: #bbf7d0; }
  html[data-theme="auto"] .cal-cell.escudo { background: #1e3a8a; border-color: #1d4ed8; color: #dbeafe; }
}
.mark-note { margin: 10px 0; }
.duel-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); text-decoration: none; color: inherit; }
.duel-row.winner { background: #fef9c3; border-radius: 10px; padding-left: 10px; padding-right: 10px; }
html[data-theme="dark"] .duel-row.winner { background: #4a3a10; }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .duel-row.winner { background: #4a3a10; } }

/* Escolha da cor do site (Perfil > Aparência) */
.color-choices { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; }
.color-choice { position: relative; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.85rem; font-weight: 700; }
.color-choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.color-dot { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55); }
.color-choice input:checked + .color-dot { outline: 3px solid var(--ink); outline-offset: 2px; }
.color-choice input:focus-visible + .color-dot { outline: 3px solid var(--purple); outline-offset: 2px; }
.color-name { color: var(--ink-soft); }
.color-choice input:checked ~ .color-name { color: var(--ink); }

/* Cartão Novidades (painel) */
.news-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border); }
.news-card { margin-bottom: 14px; }
.news-card .news-row { border-top: 0; padding: 0 0 4px; }
.section-title + .news-row { border-top: 0; padding-top: 4px; }
.news-icon { font-size: 1.25rem; line-height: 1.3; flex-shrink: 0; width: 28px; text-align: center; }
.news-title { font-weight: 800; font-size: 0.9rem; }
.news-text { display: block; margin-top: 2px; }
.news-date { white-space: nowrap; opacity: 0.8; }
.news-badge { display: inline-block; background: var(--purple); color: #fff; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; padding: 1px 7px; border-radius: 999px; vertical-align: 1px; margin-left: 4px; }
/* Página Novidades: cartões mais enxutos, botão fino */
.news-page { max-width: 640px; }
.news-meta { font-size: 0.72rem; font-weight: 800; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.news-meta .news-badge { margin-left: 0; }
.news-card .news-title { font-size: 1rem; }
.news-body { font-size: 0.88rem; color: var(--ink-soft); margin-top: 4px; }
.card-action-slim { margin-top: 12px; padding: 8px 14px; font-size: 0.82rem; border-radius: 10px; }
