:root {
  --bg: #F4F7F5;
  --bg-alt: #FFFFFF;
  --card: #FFFFFF;
  --card-hover: #F0FAF4;
  --border: #E4E9E6;
  --text: #10241A;
  --text-dim: #64756D;
  --accent: #00A651;
  --accent-dark: #00793C;
  --accent-2: #0072CE;
  --good: #00A651;
  --bad: #E5484D;
  --warn: #F5A623;
  --radius: 18px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bg-grid: rgba(0,121,60,.05);
  --shadow-card: 0 1px 2px rgba(16,36,26,.04), 0 6px 16px -8px rgba(16,36,26,.12);
  --shadow-card-lg: 0 2px 4px rgba(16,36,26,.06), 0 14px 32px -12px rgba(16,36,26,.18);
  font-size: 16px;
}
:root[data-theme="dark"] {
  --bg: #0A130E;
  --bg-alt: #0F1B14;
  --card: #132018;
  --card-hover: #17281D;
  --border: #223529;
  --text: #EAF3EE;
  --text-dim: #8FA79A;
  --bg-grid: rgba(0,166,81,.045);
  --shadow-card: 0 1px 2px rgba(0,0,0,.25), 0 6px 16px -8px rgba(0,0,0,.4);
  --shadow-card-lg: 0 2px 4px rgba(0,0,0,.3), 0 14px 32px -12px rgba(0,0,0,.5);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; overscroll-behavior-y: none; }

/* ===== ACESSIBILIDADE: foco de teclado, toque, movimento reduzido ===== */
button, a, input, [tabindex] { touch-action: manipulation; }
:focus-visible {
  outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 4px;
}
button:active:not(:disabled) { transform: scale(.97); }
button { transition: transform .1s ease, background .15s, color .15s, border-color .15s; }
@media (hover: hover) {
  .area-row:hover, .flash-area-btn:hover, .simulado-card:hover, .historico-item:hover { border-color: var(--accent); }
  .nav-btn:hover { color: var(--accent-dark); }
  .alt-btn:not(.disabled):hover { border-color: var(--accent-2); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
body {
  background:
    linear-gradient(var(--bg-grid) 1px, transparent 1px) 0 0/100% 28px,
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px) 0 0/28px 100%,
    var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, .brand-title, .simulado-title, .result-score {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}
.icon { width: 20px; height: 20px; display: inline-block; vertical-align: middle; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 26px; height: 26px; }
.icon-xl { width: 44px; height: 44px; }

#app { max-width: 480px; margin: 0 auto; padding-bottom: calc(76px + var(--safe-bottom)); }

/* ===== TOPBAR ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; position: sticky; top: 0; z-index: 20;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.brand-badge {
  width: 52px; height: 52px; border-radius: 15px;
  color: #fff; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; animation: badgePulse 2.8s ease-in-out infinite; overflow: hidden;
}
.brand-badge .icon { width: 24px; height: 24px; }
.brand-logo-img { width: 100%; height: 100%; object-fit: contain; }
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,166,81,.4); }
  50% { box-shadow: 0 0 0 7px rgba(0,166,81,0); }
}
.brand-center { flex: 1; text-align: center; }
.brand-title {
  font-weight: 800; font-size: 20px; line-height: 1.1;
  background: linear-gradient(100deg, var(--text) 20%, var(--accent) 45%, var(--text) 70%);
  background-size: 250% auto; background-position: 0% center;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 5s ease-in-out infinite;
}
@keyframes shine {
  0% { background-position: 40% center; }
  50% { background-position: -60% center; }
  100% { background-position: 40% center; }
}
.brand-petrobras {
  color: #fff; font-weight: 800; font-size: 10.5px; letter-spacing: .12em;
  margin-top: 2px; -webkit-text-stroke: .3px var(--accent-dark);
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
:root:not([data-theme="dark"]) .brand-petrobras { color: var(--accent-dark); -webkit-text-stroke: none; text-shadow: none; }
.icon-btn {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  width: 44px; height: 44px; cursor: pointer; color: var(--text);
  display: flex; align-items: center; justify-content: center;
}

/* ===== ABAS (tab-panel) ===== */
.tab-panel { animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ===== MENU INFERIOR ===== */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  max-width: 480px; margin: 0 auto;
  background: var(--bg-alt); border-top: 1px solid var(--border);
  display: flex; padding: 8px 8px calc(8px + var(--safe-bottom));
  box-shadow: 0 -6px 20px -12px rgba(0,0,0,.15);
}
.nav-btn {
  flex: 1; background: none; border: none; display: flex; flex-direction: column;
  align-items: center; gap: 2px; padding: 6px 0; color: var(--text-dim);
  font-family: inherit; font-size: 10.5px; cursor: pointer; border-radius: 12px;
  transition: color .15s, transform .1s ease;
}
.nav-btn .icon { width: 22px; height: 22px; }
.nav-btn.active { color: var(--accent-dark); }
:root[data-theme="dark"] .nav-btn.active { color: var(--accent); }
.nav-btn.active .icon { transform: translateY(-1px); }

/* ===== HERO ===== */
.hero-card {
  position: relative; margin: 14px 16px 0; border-radius: 20px; overflow: hidden;
  aspect-ratio: 16/10; background: var(--accent-dark); box-shadow: var(--shadow-card-lg);
}
.hero-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 16px; background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(4,16,10,.92) 100%);
}
.hero-brand {
  color: rgba(255,255,255,.75); font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 10px;
}
.hero-stats {
  display: flex; align-items: center; background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.14); border-radius: 16px; padding: 12px 6px;
  backdrop-filter: blur(6px);
}
.hero-stat {
  flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center;
  cursor: default; -webkit-tap-highlight-color: transparent;
}
label.hero-stat { cursor: pointer; }
.hero-stat-num { font-family: 'Space Grotesk'; font-weight: 800; font-size: 22px; color: #fff; line-height: 1.15; }
.hero-stat-label {
  font-size: 10.5px; color: rgba(255,255,255,.8); margin-top: 2px;
  display: flex; align-items: center; gap: 3px; justify-content: center;
}
.hero-stat-label .icon-sm { width: 11px; height: 11px; opacity: .85; }
.hero-stat-divider { width: 1px; align-self: stretch; background: rgba(255,255,255,.16); margin: 2px 0; }
.countdown-input {
  position: absolute; left: 22px; bottom: 16px; opacity: 0; width: 40px; height: 40px; pointer-events: none;
}

/* ===== SAUDACAO + ANEL DE PROGRESSO (fica abaixo do hero antigo) ===== */
.greet-card {
  position: relative; margin: 14px 16px 0; padding: 20px 18px 18px; border-radius: 24px;
  background: linear-gradient(160deg, var(--accent-dark), #023d22 70%, #012814);
  box-shadow: var(--shadow-card-lg); overflow: hidden;
}
.greet-card::before {
  content: ""; position: absolute; top: -60px; right: -60px; width: 180px; height: 180px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.10), rgba(255,255,255,0) 70%);
}
.greet-top { display: flex; align-items: flex-start; justify-content: space-between; position: relative; z-index: 1; }
.greet-hello { color: #fff; font-family: 'Space Grotesk'; font-weight: 800; font-size: 21px; letter-spacing: -.01em; }
.greet-sub { color: rgba(255,255,255,.7); font-size: 12px; margin-top: 2px; font-weight: 600; }
.greet-days-pill {
  display: flex; align-items: center; gap: 5px; background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.18); border-radius: 20px; padding: 7px 12px 7px 10px;
  color: #fff; font-weight: 800; font-size: 13px; font-family: 'Space Grotesk'; cursor: pointer; flex-shrink: 0;
}
.greet-days-label { font-family: 'Inter'; font-weight: 600; font-size: 10.5px; opacity: .8; }

.ring-wrap { position: relative; width: 140px; height: 140px; margin: 14px auto 8px; z-index: 1; }
.ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(255,255,255,.14); stroke-width: 11; }
.ring-fill {
  fill: none; stroke: #fff; stroke-width: 11; stroke-linecap: round;
  stroke-dasharray: 377; stroke-dashoffset: 377; transition: stroke-dashoffset .6s ease;
}
.ring-center {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-pct { color: #fff; font-family: 'Space Grotesk'; font-weight: 800; font-size: 30px; line-height: 1; }
.ring-label { color: rgba(255,255,255,.7); font-size: 11px; font-weight: 700; margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; }

.greet-stats { display: flex; gap: 10px; position: relative; z-index: 1; }
.greet-stat {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.14); border-radius: 14px;
  padding: 9px 6px; color: rgba(255,255,255,.9); font-size: 11.5px; font-weight: 600;
}
.greet-stat b { font-family: 'Space Grotesk'; font-weight: 800; color: #fff; font-size: 13px; }
.greet-stat.streak-off { opacity: .55; }
.greet-flame { color: var(--warn); }

/* ===== SECTIONS ===== */
.section { padding: 18px 16px 0; }
.section-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.section-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.section-sub { font-size: 11.5px; color: var(--text-dim); }

/* ===== SIMULADOS ===== */
.simulados-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.simulado-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 18px 16px; border-radius: 20px; border: none; cursor: pointer; overflow: hidden;
  text-align: left; font-family: inherit; color: #fff; box-shadow: var(--shadow-card-lg);
  transition: transform .18s ease, box-shadow .18s ease;
}
@media (hover: hover) {
  .simulado-card:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(16,36,26,.1), 0 20px 36px -14px rgba(16,36,26,.32); }
}
.simulado-card::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.22), rgba(255,255,255,0) 55%);
  pointer-events: none;
}
.simulado-card .icon-lg { position: relative; z-index: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,.15)); }
.simulado-card::after {
  content: ""; position: absolute; right: -18px; bottom: -18px; width: 92px; height: 92px;
  border-radius: 50%; background: rgba(255,255,255,.12); pointer-events: none;
}
.simulado-rapido { background: linear-gradient(150deg, #1E8FFF, #0057a3 65%, #00397a); }
.simulado-oficial { background: linear-gradient(150deg, #1BC96B, var(--accent-dark) 65%, #004d26); }
.simulado-title { position: relative; z-index: 1; font-weight: 800; font-size: 15.5px; margin-top: 6px; letter-spacing: -.01em; }
.simulado-desc { position: relative; z-index: 1; font-size: 11.5px; opacity: .92; font-weight: 600; }
.simulado-arrow {
  position: relative; z-index: 1; margin-top: 10px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center;
}
.badge-novo {
  position: absolute; top: 10px; right: 10px; z-index: 1; font-size: 9px; font-weight: 800;
  background: rgba(255,255,255,.28); padding: 4px 8px; border-radius: 20px; letter-spacing: .05em;
  animation: badgePulse2 2.4s ease-in-out infinite;
}
@keyframes badgePulse2 {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.35); }
  50% { box-shadow: 0 0 0 5px rgba(255,255,255,0); }
}

/* ===== AREA LIST (estilo lista com foto) ===== */
.area-list { display: flex; flex-direction: column; gap: 10px; }
.area-row {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border: 1px solid var(--border); border-radius: 16px; padding: 8px; cursor: pointer;
  transition: background .15s, box-shadow .15s; box-shadow: var(--shadow-card);
}
.area-row:active { background: var(--card-hover); }
.area-thumb {
  width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex-shrink: 0;
  background: var(--border);
}
.area-info { flex: 1; min-width: 0; }
.area-name { font-weight: 700; font-size: 13.5px; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.area-icon-badge {
  width: 22px; height: 22px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0; position: relative; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15), 0 2px 5px -1px rgba(0,0,0,.35);
}
.area-icon-badge::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(150deg, rgba(255,255,255,.4), rgba(255,255,255,0) 60%);
}
.area-icon-badge .icon { position: relative; }
.area-icon-badge .icon { width: 12px; height: 12px; }
.area-icon-img { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.area-progress-bar { height: 5px; border-radius: 6px; background: var(--border); overflow: hidden; margin-top: 4px; }
.area-progress-fill { height: 100%; border-radius: 6px; transition: width .4s; background: var(--accent); }
.area-progress-text { font-size: 10.5px; color: var(--text-dim); margin-top: 4px; }
.area-tag {
  font-size: 9px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-dim);
}
.area-chevron { color: var(--text-dim); flex-shrink: 0; }

/* ===== REVIEW ===== */
.review-btn {
  width: 100%; background: #FDEDED; color: #C4342A;
  border: 1px solid #F6C9C7; border-radius: 16px; padding: 13px 14px;
  font-weight: 700; font-size: 13px; cursor: pointer; display: flex; align-items: center;
  gap: 8px; font-family: inherit; box-shadow: var(--shadow-card);
}
:root[data-theme="dark"] .review-btn { background: #2A1414; color: #FF8A80; border-color: #4A2323; }
.review-btn span:nth-child(2) { flex: 1; text-align: left; }

/* ===== HISTORICO ===== */
.historico-list { display: flex; flex-direction: column; gap: 8px; }
.empty-state { color: var(--text-dim); font-size: 12.5px; padding: 16px; text-align: center;
  border: 1px dashed var(--border); border-radius: var(--radius); }
.historico-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px;
  box-shadow: var(--shadow-card);
}
.historico-item .h-left { font-size: 12.5px; }
.historico-item .h-title { font-weight: 700; }
.historico-item .h-date { color: var(--text-dim); font-size: 11px; }
.historico-item .h-score { font-weight: 800; font-family: 'Space Grotesk'; font-size: 15px; }
.h-score.good { color: var(--good); } .h-score.bad { color: var(--bad); }


/* ===== SEQUENCIA — card grande na aba Progresso ===== */
.streak-card-big {
  background: linear-gradient(160deg, #FFF6E5, #FFEBCF); border: 1px solid #FCE1B0;
  border-radius: 20px; padding: 24px 16px; text-align: center; box-shadow: var(--shadow-card-lg);
}
:root[data-theme="dark"] .streak-card-big { background: linear-gradient(160deg, #2A2010, #1F1808); border-color: #4A3A18; }
.streak-big-icon { color: var(--warn); margin-bottom: 4px; }
.streak-big-num { font-family: 'Space Grotesk'; font-weight: 800; font-size: 40px; color: var(--warn); line-height: 1; }
.streak-big-label { font-size: 13px; color: var(--text-dim); margin-top: 2px; font-weight: 600; }
.streak-big-best { font-size: 11.5px; color: var(--text-dim); margin-top: 10px; }
.streak-big-best b { color: var(--text); }

/* ===== FLASHCARDS — lista de matérias na home (bloco separado) ===== */
.flash-area-list { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.flash-area-btn {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px;
  min-width: 84px; cursor: pointer; font-family: inherit; color: var(--text); box-shadow: var(--shadow-card);
}
.flash-area-btn .flash-icon-badge {
  width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  color: #fff; position: relative; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15), 0 2px 5px -1px rgba(0,0,0,.35);
}
.flash-area-btn .flash-icon-badge::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(150deg, rgba(255,255,255,.4), rgba(255,255,255,0) 60%);
}
.flash-area-btn .flash-icon-badge .icon { width: 16px; height: 16px; position: relative; }
.flash-area-btn .flash-area-nome { font-size: 11px; font-weight: 700; text-align: center; line-height: 1.25; }
.flash-icon-img { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; }

.flash-area-list-vertical {
  flex-direction: column; overflow-x: visible;
}
.flash-area-list-vertical .flash-area-btn {
  flex-direction: row; align-items: center; gap: 12px; min-width: 0; width: 100%;
  padding: 14px 16px; text-align: left;
}
.flash-area-list-vertical .flash-area-btn .flash-icon-badge { width: 36px; height: 36px; flex-shrink: 0; }
.flash-area-list-vertical .flash-area-btn .flash-icon-badge .icon { width: 18px; height: 18px; }
.flash-area-list-vertical .flash-area-btn .flash-icon-img { width: 40px; height: 40px; }
.flash-area-list-vertical .flash-area-btn .flash-area-nome { font-size: 13.5px; text-align: left; }

/* ===== GRAFICO DE DESEMPENHO POR MATERIA (aba Progresso) ===== */
.area-chart-list { display: flex; flex-direction: column; gap: 10px; }
.area-chart-row {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px;
  box-shadow: var(--shadow-card);
}
.area-chart-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.area-chart-name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 12.5px; }
.area-chart-name .icon { width: 15px; height: 15px; }
.area-chart-pct { font-family: 'Space Grotesk'; font-weight: 800; font-size: 13px; }
.area-chart-bar { height: 7px; border-radius: 6px; background: var(--border); overflow: hidden; }
.area-chart-bar-fill { height: 100%; border-radius: 6px; transition: width .5s; }

/* ===== FLASHCARD (Modo Foco) ===== */
.flashcard { perspective: 1200px; margin-top: 4px; }
.flashcard-inner {
  min-height: 220px; border-radius: 18px; border: 1px solid var(--border); background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 10px; padding: 24px; cursor: pointer; transition: background .15s; position: relative;
  box-shadow: var(--shadow-card-lg);
}
.flashcard-inner:active { background: var(--card-hover); }
.flashcard-inner.revelado { align-items: flex-start; text-align: left; background: var(--card-hover); cursor: default; }
.flashcard-hint { color: var(--text-dim); }
.flashcard-hint-text { color: var(--text-dim); font-size: 12.5px; }
.flashcard-answer-tag { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--good); }
.flashcard-answer-text { font-weight: 700; font-size: 15px; margin-top: 4px; }
.flashcard-explicacao { font-size: 13px; color: var(--text-dim); margin-top: 10px; line-height: 1.5; }

/* ===== QUIZ ===== */
.quiz-topbar {
  display: flex; align-items: center; justify-content: space-between; padding: 14px 16px;
  position: sticky; top: 0; background: var(--bg); z-index: 10; border-bottom: 1px solid var(--border);
}
.back-btn { background: var(--card); border: 1px solid var(--border); border-radius: 10px; width: 44px; height: 44px;
  color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.quiz-title { font-weight: 700; font-size: 14px; }
.quiz-timer { font-weight: 800; color: var(--warn); font-size: 13px; font-family: 'Space Grotesk'; min-width: 50px; text-align: right; }
.quiz-progressbar { height: 4px; background: var(--border); margin: 0 16px; border-radius: 4px; overflow: hidden; margin-top: 10px; }
.quiz-progressbar-fill { height: 100%; background: var(--accent); width: 0%; transition: width .3s; }
.quiz-body { padding: 20px 16px; }
.quiz-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.quiz-counter { font-size: 12px; color: var(--text-dim); }
.quiz-tag { font-size: 11px; background: var(--card); border: 1px solid var(--border); padding: 4px 10px; border-radius: 20px; display: inline-flex; align-items: center; gap: 5px; }
.quiz-question { font-size: 15.5px; line-height: 1.55; margin-bottom: 18px; white-space: pre-wrap; }

/* ===== TEXTO DE APOIO (interpretacao de texto) ===== */
.texto-apoio {
  position: relative; margin-bottom: 16px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--card-hover); overflow: hidden; box-shadow: var(--shadow-card);
}
.texto-apoio-head {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  background: none; border: none; cursor: pointer; font-family: inherit; color: var(--accent-dark);
  font-weight: 700; font-size: 12.5px; text-align: left;
}
:root[data-theme="dark"] .texto-apoio-head { color: var(--accent); }
.texto-apoio-head span { flex: 1; }
.texto-apoio-chevron { transform: rotate(90deg); transition: transform .2s; flex-shrink: 0; }
.texto-apoio.aberto .texto-apoio-chevron { transform: rotate(-90deg); }
.texto-apoio-body {
  padding: 0 14px; font-size: 13px; line-height: 1.6; color: var(--text); white-space: pre-wrap;
  max-height: 120px; overflow: hidden;
}
.texto-apoio.aberto .texto-apoio-body { max-height: none; padding-bottom: 14px; }
.texto-apoio-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 40px; pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--card-hover));
}
.texto-apoio.aberto .texto-apoio-fade { display: none; }
.quiz-alternatives { display: flex; flex-direction: column; gap: 10px; }
.alt-btn {
  display: flex; align-items: flex-start; gap: 12px; text-align: left;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 13px; cursor: pointer; font-family: inherit; color: var(--text); font-size: 13.5px;
  line-height: 1.4; min-height: 48px; box-shadow: var(--shadow-card);
}
.alt-btn.disabled { cursor: default; }
.alt-texto { flex: 1; }
.alt-letter {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--bg-alt);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11.5px;
}
.alt-marker { flex-shrink: 0; margin-top: 1px; }
.alt-btn.selected { border-color: var(--accent-2); background: rgba(0,114,206,.08); }
.alt-btn.correct { border-color: var(--good); background: rgba(0,166,81,.10); }
.alt-btn.correct .alt-letter { background: var(--good); color: #fff; }
.alt-btn.correct .alt-marker { color: var(--good); }
.alt-btn.wrong { border-color: var(--bad); background: rgba(229,72,77,.10); }
.alt-btn.wrong .alt-letter { background: var(--bad); color: #fff; }
.alt-btn.wrong .alt-marker { color: var(--bad); }
.quiz-explicacao {
  margin-top: 16px; padding: 13px; border-radius: 14px; background: var(--card-hover);
  border: 1px solid var(--border); font-size: 13px; color: var(--text-dim); line-height: 1.5;
}
.quiz-explicacao b { color: var(--accent-dark); }
.quiz-footer {
  display: flex; gap: 10px; padding: 14px 16px; position: sticky; bottom: 76px;
  background: var(--bg); border-top: 1px solid var(--border);
}
.btn-primary, .btn-secondary {
  flex: 1; padding: 14px; border-radius: 14px; font-weight: 700; font-size: 13.5px;
  cursor: pointer; font-family: inherit; border: none;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); }

/* ===== RESULT ===== */
#view-result { padding: 26px 16px; }
.result-card { text-align: center; }
.result-badge { color: var(--accent); margin-bottom: 6px; }
.result-card h1 { font-size: 19px; margin: 0 0 12px; }
.result-score { font-size: 40px; font-weight: 800; margin-bottom: 6px; }
.result-corte { font-size: 13px; color: var(--text-dim); margin-bottom: 20px; line-height: 1.5; text-align: left; background: var(--card); border: 1px solid var(--border); padding: 12px 14px; border-radius: 14px; }
.result-areas { display: flex; flex-direction: column; gap: 8px; text-align: left; margin-bottom: 22px; }
.result-area-row {
  display: flex; align-items: center; gap: 10px; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; font-size: 12px;
}
.result-area-row .bar { flex: 1; height: 6px; background: var(--border); border-radius: 6px; overflow: hidden; }
.result-area-row .bar-fill { height: 100%; border-radius: 6px; }
.result-actions { display: flex; gap: 10px; }

@media (max-width: 360px) {
  .simulados-row { gap: 8px; }
  .hero-overlay h1 { font-size: 18px; }
}

/* ===== LAYOUT DE PC (so vale em tela larga; celular fica identico) ===== */
@media (min-width: 1024px) {
  #app { max-width: 1240px; padding: 0 32px 40px 140px; }
  .topbar { padding: 18px 8px; }
  .brand-badge { width: 56px; height: 56px; }
  .brand-title { font-size: 24px; }

  /* menu inferior vira barra lateral */
  .bottom-nav {
    top: 110px; bottom: auto; right: auto; left: max(24px, calc(50% - 620px + 24px));
    width: 92px; max-width: none; margin: 0; flex-direction: column; gap: 6px;
    padding: 10px 8px; border: 1px solid var(--border); border-radius: 22px;
    box-shadow: var(--shadow-card-lg);
  }
  .nav-btn { flex: none; padding: 12px 0; font-size: 11.5px; }
  .nav-btn.active { background: var(--card); box-shadow: var(--shadow-card); }
  .nav-btn .icon { width: 24px; height: 24px; }

  /* inicio: coluna do painel a esquerda, ferramentas a direita */
  #tab-inicio:not([style*="none"]) {
    display: grid !important; grid-template-columns: 390px 1fr; grid-template-rows: auto 1fr;
    column-gap: 12px; align-items: start;
  }
  #tab-inicio > .hero-card { grid-column: 2; grid-row: 1; aspect-ratio: 21/7; }
  #tab-inicio > .greet-card { grid-column: 1; grid-row: 1; }
  #tab-inicio > .section:nth-child(3) { grid-column: 1; grid-row: 2; }
  #tab-inicio > .section:nth-child(4) { grid-column: 2; grid-row: 2; }
  .greet-card { padding: 24px 22px 22px; }
  .ring-wrap { width: 170px; height: 170px; margin: 18px auto 12px; }
  .ring-pct { font-size: 36px; }
  .section-head h2 { font-size: 20px; }
  .section-sub { font-size: 13px; }

  .area-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .area-row { padding: 8px 10px; }
  .area-thumb { width: 62px; height: 62px; }
  .area-name { font-size: 14.5px; }
  @media (hover: hover) { .area-row:hover { background: var(--card-hover); box-shadow: var(--shadow-card-lg); } }

  /* flashcards e progresso em grade */
  .flash-area-list-vertical { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .area-chart-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

  /* quiz e resultado centralizados, largura de leitura */
  #view-quiz, #view-result { max-width: 820px; margin: 0 auto; }
  .quiz-question { font-size: 17px; }
  .quiz-footer { bottom: 0; }
}

/* ===== MEU CARGO ===== */
.cargo-intro { font-size: 13px; color: var(--text-dim); margin: -2px 0 12px; line-height: 1.45; }
.cargo-lista { display: grid; gap: 8px; }
.cargo-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 13px 14px; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--text); cursor: pointer; transition: border-color .15s, background .15s, transform .1s; -webkit-tap-highlight-color: transparent; }
.cargo-item:active { transform: scale(.985); }
.cargo-item-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; color: transparent; flex: none; }
.cargo-item-check .icon { width: 13px; height: 13px; }
.cargo-item.ativo { border-color: var(--accent); background: var(--card-hover); }
.cargo-item.ativo .cargo-item-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.cargo-escolhido { background: linear-gradient(135deg, #00A651, #00793C); color: #fff; border-radius: 18px; padding: 16px; margin-bottom: 14px; animation: cargoIn .35s ease; box-shadow: 0 12px 28px -14px rgba(0,121,60,.7); }
@keyframes cargoIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.cargo-ok-top { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .92; display: flex; align-items: center; gap: 6px; }
.cargo-ok-top .icon { width: 15px; height: 15px; }
.cargo-ok-nome { font-size: 19px; font-weight: 800; margin: 4px 0 2px; line-height: 1.25; }
.cargo-ok-sub { font-size: 13px; opacity: .92; margin-bottom: 10px; }
.cargo-ok-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cargo-chip-mat { display: inline-flex; align-items: center; gap: 5px; background: rgba(255,255,255,.18); border-radius: 999px; padding: 4px 10px 4px 4px; font-size: 12px; font-weight: 700; }
.cargo-chip-mat img { width: 20px; height: 20px; border-radius: 50%; background: #fff; object-fit: cover; }
.cargo-ok-btn { width: 100%; border: 0; border-radius: 12px; padding: 12px; font: inherit; font-weight: 800; font-size: 14.5px; background: #fff; color: #00793C; cursor: pointer; }
.cargo-atalho { display: flex; align-items: center; gap: 6px; width: 100%; margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--accent); background: var(--card-hover); color: var(--accent-dark); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; text-align: left; }
.cargo-atalho .icon { width: 16px; height: 16px; flex: none; }
.cargo-atalho span { margin-left: auto; font-weight: 600; opacity: .8; }
:root[data-theme="dark"] .cargo-atalho { color: var(--accent); }
