/* =========================================================
   Aprovado Vestibular — folha de estilos
   Paleta validada para daltonismo (ver README).
   ========================================================= */

:root {
  color-scheme: light;

  /* superfícies e tinta */
  --page:            #f9f9f7;
  --surface-1:       #fcfcfb;
  --surface-2:       #f2f2ee;
  --text-primary:    #0b0b0b;
  --text-secondary:  #52514e;
  --text-muted:      #898781;
  --border:          rgba(11, 11, 11, 0.10);
  --border-strong:   rgba(11, 11, 11, 0.18);
  --grid:            #e1e0d9;
  --axis:            #c3c2b7;

  /* acento */
  --accent:          #2a78d6;
  --accent-strong:   #256abf;
  --accent-soft:     #cde2fb;
  --on-accent:       #ffffff;

  /* estado (interface) */
  --good:            #0ca30c;
  --warning:         #fab219;
  --critical:        #d03b3b;
  --good-text:       #006300;

  /* dados: acerto vs. erro — par validado para daltonismo nos dois temas
     (ΔE deutan 9,9 — verde puro contra vermelho reprova, verde-água passa) */
  --ok:              #1baf7a;
  --err:             #d03b3b;

  /* série categórica (matérias) — ordem fixa, nunca ciclada */
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #4a3aa7; --series-8: #e34948;

  /* rampa sequencial (mapa de constância) */
  --seq-0: #f2f2ee; --seq-1: #cde2fb; --seq-2: #9ec5f4; --seq-3: #5598e7; --seq-4: #2a78d6; --seq-5: #184f95;

  --shadow-sm: 0 1px 2px rgba(11,11,11,.05);
  --shadow-md: 0 4px 16px rgba(11,11,11,.07);
  --shadow-lg: 0 12px 40px rgba(11,11,11,.12);

  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px;
  --sidebar-w: 232px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page:            #0d0d0d;
    --surface-1:       #1a1a19;
    --surface-2:       #232322;
    --text-primary:    #ffffff;
    --text-secondary:  #c3c2b7;
    --text-muted:      #898781;
    --border:          rgba(255, 255, 255, 0.10);
    --border-strong:   rgba(255, 255, 255, 0.20);
    --grid:            #2c2c2a;
    --axis:            #383835;
    --accent:          #3987e5;
    --accent-strong:   #5598e7;
    --accent-soft:     #184f95;
    --good-text:       #0ca30c;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
    --seq-0: #232322; --seq-1: #104281; --seq-2: #184f95; --seq-3: #256abf; --seq-4: #3987e5; --seq-5: #86b6ef;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 4px 16px rgba(0,0,0,.45);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.6);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page:            #0d0d0d;
  --surface-1:       #1a1a19;
  --surface-2:       #232322;
  --text-primary:    #ffffff;
  --text-secondary:  #c3c2b7;
  --text-muted:      #898781;
  --border:          rgba(255, 255, 255, 0.10);
  --border-strong:   rgba(255, 255, 255, 0.20);
  --grid:            #2c2c2a;
  --axis:            #383835;
  --accent:          #3987e5;
  --accent-strong:   #5598e7;
  --accent-soft:     #184f95;
  --good-text:       #0ca30c;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  --seq-0: #232322; --seq-1: #104281; --seq-2: #184f95; --seq-3: #256abf; --seq-4: #3987e5; --seq-5: #86b6ef;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,.45);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.6);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--page);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.015em; line-height: 1.25; }
p { margin: 0; }
button { font: inherit; color: inherit; }
.muted { color: var(--text-muted); font-size: .875rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  padding: .6rem 1rem; border-radius: var(--r-sm); border: 1px solid transparent;
  font-size: .9rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .06s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: var(--surface-1); border-color: var(--border-strong); color: var(--text-primary); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--critical); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-danger-ghost { background: transparent; border-color: var(--border-strong); color: var(--critical); }
.btn-danger-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: .4rem .7rem; font-size: .82rem; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; font-size: .85rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; }

/* ---------- ícones ---------- */
/* O sprite só guarda as formas; nada nele é desenhado na página. */
.ico-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico {
  width: 1.15rem; height: 1.15rem; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.plus { font-size: 1.1em; line-height: 1; font-weight: 400; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface-1); cursor: pointer; font-size: 1rem; flex: none;
  transition: background .15s;
}
.icon-btn:hover { background: var(--surface-2); }
/* Usado pela engrenagem de Ajustes no celular: sem isto, a única aba que não
   vive na barra de baixo seria também a única sem indicação de que está aberta. */
.icon-btn.is-active {
  color: var(--on-accent); background: var(--accent); border-color: var(--accent);
}
.icon-btn.is-active:hover { background: var(--accent-strong); }

/* ---------- formulários ---------- */
.form { display: flex; flex-direction: column; gap: .9rem; }
.form-inline { flex-flow: row wrap; align-items: flex-end; gap: 1rem; }
.form-inline .field { flex: 1 1 180px; }
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field-row { display: flex; gap: .9rem; }
.field-row .field { flex: 1 1 0; }
label { font-size: .8rem; font-weight: 600; color: var(--text-secondary); }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=time], textarea, select {
  width: 100%; min-width: 0; max-width: 100%;
  padding: .62rem .75rem; font: inherit; font-size: .92rem;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface-1); color: var(--text-primary);
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.45; }
select { -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) calc(50% + 1px), calc(100% - 10px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 2rem;
}
.field-hint { font-size: .75rem; color: var(--text-muted); line-height: 1.4; margin-top: .1rem; }
/* No iOS os campos de data e hora têm uma largura mínima nativa que ignora
   o width e estoura o cartão. Tirar a aparência nativa faz o navegador
   respeitar a largura; o seletor de data continua abrindo normalmente. */
input[type=date], input[type=time] { -webkit-appearance: none; appearance: none; }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.output-box {
  display: block; padding: .62rem .75rem; font-size: .92rem; font-weight: 650;
  border: 1px dashed var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text-secondary);
}
.form-msg { font-size: .82rem; min-height: 1.1em; line-height: 1.45; color: var(--critical); }
.form-msg.ok { color: var(--good-text); }

/* ---------- login ---------- */
.auth-screen {
  min-height: 100dvh; display: grid; place-items: center; padding: 1.25rem;
  background:
    radial-gradient(900px 500px at 12% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(700px 500px at 100% 110%, color-mix(in srgb, var(--series-3) 14%, transparent), transparent 60%),
    var(--page);
}
.auth-card {
  width: min(420px, 100%); background: var(--surface-1); padding: 2rem 1.75rem;
  border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
}
.auth-brand { display: flex; align-items: center; gap: .85rem; margin-bottom: 1.5rem; }
.auth-brand h1 { font-size: 1.35rem; }
.brand-mark { font-size: 1.6rem; line-height: 1; }
.auth-switch { margin-top: 1rem; text-align: center; font-size: .85rem; color: var(--text-secondary); }
.auth-sep { display: flex; align-items: center; gap: .75rem; margin: 1.25rem 0 1rem; color: var(--text-muted); font-size: .78rem; }
.auth-sep::before, .auth-sep::after { content: ""; height: 1px; background: var(--border); flex: 1; }
.notice { padding: .75rem .85rem; border-radius: var(--r-sm); font-size: .82rem; line-height: 1.45; margin-bottom: 1.1rem; }
.notice-warn { background: color-mix(in srgb, var(--warning) 18%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent); color: var(--text-primary); }
.notice-info { background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent); color: var(--text-primary); }
.notice-ok   { background: color-mix(in srgb, var(--ok) 14%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--ok) 36%, transparent); color: var(--text-primary); }
.notice code { background: var(--surface-1); padding: .05em .35em; border-radius: 4px; font-size: .95em; }
.notice ol { margin: .5rem 0 0; padding-left: 1.2rem; }
.notice li { margin-bottom: .2rem; }

/* ---------- interruptores das notificações ---------- */
.push-time { max-width: 220px; margin-top: 1.1rem; }
.push-tz { margin-top: 1rem; font-size: .78rem; }
.app-version { text-align: center; color: var(--text-muted); font-size: .76rem; padding: .5rem 0 .25rem; }
.switch-list { display: flex; flex-direction: column; margin-top: 1rem; }
.switch {
  display: flex; align-items: flex-start; gap: .85rem;
  padding: .75rem .1rem; cursor: pointer; border-top: 1px solid var(--border);
}
.switch:first-child { border-top: 0; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-track {
  position: relative; flex: none; width: 42px; height: 24px; margin-top: 1px;
  border-radius: 999px; background: var(--border-strong); transition: background .18s;
}
.switch-track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35);
  transition: transform .18s;
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 3px; }
.switch-text strong { display: block; font-size: .9rem; font-weight: 600; }
.switch-text > span { font-size: .78rem; color: var(--text-muted); line-height: 1.4; }

/* ---------- layout do app ---------- */
.app { display: flex; min-height: 100dvh; }
.sidebar {
  width: var(--sidebar-w); flex: none; display: flex; flex-direction: column;
  padding: 1.1rem .85rem; gap: 1.25rem;
  background: var(--surface-1); border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100dvh;
}
.sidebar-brand { display: flex; align-items: center; gap: .6rem; padding: .35rem .5rem; }
.brand-name { font-weight: 700; letter-spacing: -0.02em; }
.nav { display: flex; flex-direction: column; gap: .2rem; }
.nav-item {
  display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left;
  padding: .6rem .7rem; border: 0; border-radius: var(--r-sm); background: none;
  font-size: .92rem; font-weight: 550; color: var(--text-secondary); cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text-primary); }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 650; }
:root[data-theme="dark"] .nav-item.is-active { color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nav-item.is-active { color: #fff; } }
.nav-ico { opacity: .85; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: .6rem; }
.user-chip { display: flex; align-items: center; gap: .6rem; padding: .5rem; border-radius: var(--r-sm); background: var(--surface-2); min-width: 0; }
.avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 700; font-size: .82rem; }
.user-mail { font-size: .78rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1.5rem; min-height: 60px;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.topbar-title { font-size: 1.05rem; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.countdown-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem .8rem; border-radius: 999px; font-size: .85rem; font-weight: 650;
  background: var(--accent-soft); color: var(--accent-strong);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  font-variant-numeric: tabular-nums;
}
:root[data-theme="dark"] .countdown-pill { color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .countdown-pill { color: #fff; } }
.countdown-pill.is-urgent { background: color-mix(in srgb, var(--critical) 16%, var(--surface-1)); color: var(--critical); border-color: color-mix(in srgb, var(--critical) 35%, transparent); }

.content { flex: 1; padding: 1.5rem; max-width: 1180px; width: 100%; }
.view { display: none; flex-direction: column; gap: 1.1rem; }
.view.is-active { display: flex; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.view-h { font-size: 1.3rem; }
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.detail-title { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.detail-title .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }

.bottomnav { display: none; }

/* ---------- cartões ---------- */
.card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.1rem 1.15rem; box-shadow: var(--shadow-sm);
}
.card-head { margin-bottom: .9rem; }
.card-head h3 { font-size: 1rem; }
.card-sub { font-size: .8rem; color: var(--text-muted); margin-top: .15rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.1rem; }

/* ---------- contagem regressiva ---------- */
.countdown-card {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff; border-radius: var(--r-lg); padding: 1.25rem 1.3rem; box-shadow: var(--shadow-md);
}
.cd-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.cd-label { font-size: .8rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; opacity: .9; }
.countdown-card .btn-link { color: #fff; opacity: .9; }
.cd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.cd-unit { background: rgba(255,255,255,.16); border-radius: var(--r-md); padding: .8rem .5rem; text-align: center; }
.cd-num { display: block; font-size: clamp(1.75rem, 6vw, 2.6rem); font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
.cd-unit-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; opacity: .85; margin-top: .35rem; }
.cd-date { color: rgba(255,255,255,.9) !important; margin-top: .8rem; font-size: .82rem; }
.cd-empty { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; justify-content: space-between; }
.cd-empty p { font-size: .9rem; }
.cd-empty .btn-primary { background: #fff; color: var(--accent-strong); }
.cd-empty .btn-primary:hover { background: rgba(255,255,255,.88); }

/* ---------- tiles de estatística ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.stat-tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 1rem 1.05rem; box-shadow: var(--shadow-sm); }
.stat-label { font-size: .78rem; font-weight: 600; color: var(--text-secondary); }
.stat-value { font-size: 1.85rem; font-weight: 700; letter-spacing: -0.03em; margin-top: .25rem; line-height: 1.1; }
.stat-sub { font-size: .76rem; color: var(--text-muted); margin-top: .2rem; }
.meter { height: 6px; border-radius: 999px; background: var(--seq-1); margin-top: .7rem; overflow: hidden; }
.meter-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width .4s ease; }
.meter-fill.is-done { background: var(--good); }

/* ---------- matérias ---------- */
.subjects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.subject-card {
  text-align: left; cursor: pointer; background: var(--surface-1);
  border: 1px solid var(--border); border-left: 4px solid var(--series-1);
  border-radius: var(--r-lg); padding: 1rem 1.1rem; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: .7rem; width: 100%;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.subject-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.sc-top { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.sc-name { font-size: 1rem; font-weight: 650; letter-spacing: -0.01em; }
.sc-pct { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sc-meta { font-size: .78rem; color: var(--text-muted); }
.sc-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; display: flex; }
.sc-bar span { height: 100%; display: block; }
.sc-bar .ok { background: var(--ok); }
.sc-bar .gap { width: 2px; background: var(--surface-1); flex: none; }
.sc-bar .bad { background: var(--err); }
.sc-legend { display: flex; gap: 1rem; font-size: .76rem; color: var(--text-secondary); }
.sc-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: .35em; font-style: normal; }

/* ---------- revisão espaçada ---------- */
.card-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.badge {
  flex: none; min-width: 24px; padding: .1rem .5rem; border-radius: 999px;
  background: var(--critical); color: #fff; font-size: .78rem; font-weight: 700; text-align: center;
}
.nav-badge {
  margin-left: auto; min-width: 20px; padding: 0 .4rem; border-radius: 999px;
  background: var(--critical); color: #fff; font-size: .7rem; font-weight: 700; text-align: center;
}
.review-list { display: flex; flex-direction: column; gap: .5rem; }
.review-item {
  display: flex; align-items: center; gap: .85rem; padding: .7rem .85rem;
  border-radius: var(--r-md); background: var(--surface-2);
  border-left: 3px solid var(--border-strong);
}
.review-item.is-due { border-left-color: var(--critical); }
.review-item.is-soon { border-left-color: var(--warning); }
.review-body { flex: 1; min-width: 0; }
.review-title { font-size: .9rem; font-weight: 650; display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.review-sub { font-size: .78rem; color: var(--text-muted); margin-top: .1rem; }
.review-when { font-size: .74rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px; white-space: nowrap; }
.review-when.is-due { background: color-mix(in srgb, var(--critical) 16%, var(--surface-1)); color: var(--critical); }
.review-when.is-soon { background: color-mix(in srgb, var(--warning) 26%, var(--surface-1)); color: var(--text-primary); }
.review-item .btn { flex: none; }
.lead-note {
  font-size: .87rem; line-height: 1.5; padding: .7rem .85rem; margin-bottom: .9rem;
  border-radius: var(--r-md); background: var(--surface-2); color: var(--text-secondary);
}
.lead-note strong { color: var(--text-primary); }
.lead-note:empty { display: none; }
.chart-foot { margin-top: .8rem; font-size: .76rem; line-height: 1.45; }
.chart-foot:empty { display: none; }

/* ---------- caderno de erros ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 1rem; }
.filters .field { flex: 1 1 150px; }
.stat-value-sm { font-size: 1.15rem; line-height: 1.25; }
.error-list { display: flex; flex-direction: column; gap: .7rem; }
.error-card {
  border: 1px solid var(--border); border-left: 3px solid var(--err);
  border-radius: var(--r-md); padding: .85rem .95rem; background: var(--surface-1);
  display: flex; flex-direction: column; gap: .5rem;
}
.error-card.is-resolved { border-left-color: var(--ok); opacity: .72; }
.error-top { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.error-subject { font-size: .9rem; font-weight: 650; }
.error-topic { font-size: .82rem; color: var(--text-secondary); }
.error-meta { margin-left: auto; font-size: .75rem; color: var(--text-muted); white-space: nowrap; }
.error-statement { font-size: .85rem; color: var(--text-secondary); line-height: 1.5; }
.error-lesson {
  font-size: .85rem; line-height: 1.5; padding: .55rem .7rem; border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--ok) 10%, var(--surface-2)); color: var(--text-primary);
}
.error-lesson strong { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); display: block; }
.error-tags { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.tag {
  font-size: .74rem; font-weight: 650; padding: .12rem .5rem; border-radius: 999px;
  background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border);
}
.tag-marked { color: var(--critical); }
.tag-right { color: var(--good-text); }
.error-actions { display: flex; gap: .4rem; margin-left: auto; }

/* ---------- cartão-resposta ---------- */
.runner-bar {
  position: sticky; top: 60px; z-index: 15;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .85rem 1rem; border-radius: var(--r-lg);
  background: var(--surface-1); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.runner-info { min-width: 0; flex: 1 1 160px; }
.runner-name { font-weight: 650; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runner-progress { font-size: .78rem; color: var(--text-muted); }
.runner-clock { text-align: right; flex: none; }
.runner-time { font-size: 1.6rem; font-weight: 700; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.runner-time.is-over { color: var(--critical); }
.runner-pace { font-size: .74rem; color: var(--text-muted); margin-top: .15rem; }
.runner-pace.is-late { color: var(--critical); font-weight: 650; }
.runner-actions { display: flex; gap: .5rem; flex: none; }
.runner-meter { height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.runner-meter-fill { height: 100%; background: var(--accent); transition: width .3s ease; }
.runner-foot { justify-content: center; }
.check-inline { display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem; color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
.check-inline input { width: 16px; height: 16px; accent-color: var(--accent); }

.answer-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: .45rem .9rem; }
.ans-row { display: flex; align-items: center; gap: .3rem; padding: .15rem 0; }
.ans-n {
  flex: none; width: 2ch; text-align: right; font-size: .8rem; font-weight: 650;
  color: var(--text-muted); font-variant-numeric: tabular-nums; margin-right: .2rem;
}
.ans-row.is-done .ans-n { color: var(--text-primary); }
.ans-opt {
  flex: 1; min-width: 34px; height: 34px; padding: 0; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface-1); color: var(--text-secondary);
  font-size: .85rem; font-weight: 650; transition: background .12s, color .12s, border-color .12s;
}
.ans-opt:hover { background: var(--surface-2); }
.ans-opt.is-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ans-flag {
  flex: none; width: 26px; height: 34px; padding: 0; cursor: pointer;
  border: 0; background: none; color: var(--border-strong); font-size: .95rem;
}
.ans-flag.is-on { color: var(--warning); }
.ans-row.is-flagged .ans-n { color: var(--warning); }

/* resultado da correção */
.dialog-wide { width: min(680px, calc(100vw - 2rem)); }
.result-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .7rem; }
.result-tile { background: var(--surface-2); border-radius: var(--r-md); padding: .7rem .8rem; text-align: center; }
.result-tile .rt-value { font-size: 1.5rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.result-tile .rt-label { font-size: .72rem; color: var(--text-muted); margin-top: .15rem; }
.result-tile.is-pass .rt-value { color: var(--good-text); }
.result-tile.is-fail .rt-value { color: var(--critical); }
.result-scroll { max-height: min(46vh, 380px); overflow-y: auto; margin: .2rem -.3rem; padding: 0 .3rem; }
.result-wrong { display: flex; flex-direction: column; gap: .45rem; }
.result-q {
  display: flex; align-items: center; gap: .6rem; padding: .5rem .65rem;
  border-radius: var(--r-sm); background: var(--surface-2); font-size: .84rem;
}
.result-q .rq-n { font-weight: 700; min-width: 2.5ch; font-variant-numeric: tabular-nums; }
.result-q .rq-info { flex: 1; color: var(--text-secondary); }
.result-q .btn { flex: none; }
.result-q.is-added { opacity: .55; }
.result-note { font-size: .84rem; color: var(--text-secondary); line-height: 1.5; }

.running-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0; }
.running-banner span { display: block; font-size: .82rem; color: var(--text-secondary); }

/* ---------- estados vazios ---------- */
.empty { text-align: center; padding: 2.5rem 1.25rem; background: var(--surface-1); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); }
.empty-ico { font-size: 2rem; color: var(--text-muted); margin-bottom: .5rem; }
.empty h4 { font-size: 1.05rem; margin-bottom: .3rem; }
.empty-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: 1.1rem; }

/* ---------- tabelas ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .87rem; min-width: 520px; }
.table th, .table td { padding: .65rem .7rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-size: .76rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); white-space: nowrap; }
.table td { color: var(--text-secondary); }
.table td.num { font-variant-numeric: tabular-nums; text-align: right; }
.table th.num { text-align: right; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .strong { color: var(--text-primary); font-weight: 600; }
.pill { display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: .76rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.pill.good { background: color-mix(in srgb, var(--good) 18%, var(--surface-1)); color: var(--good-text); }
.pill.warn { background: color-mix(in srgb, var(--warning) 26%, var(--surface-1)); color: var(--text-primary); }
.pill.bad  { background: color-mix(in srgb, var(--critical) 16%, var(--surface-1)); color: var(--critical); }
.row-del { background: none; border: 0; color: var(--text-muted); cursor: pointer; font-size: 1rem; padding: .1rem .35rem; border-radius: 4px; }
.row-del:hover { color: var(--critical); background: var(--surface-2); }

/* ---------- prioridades ---------- */
.insights { display: flex; flex-direction: column; gap: .6rem; }
.insight { display: flex; gap: .75rem; align-items: flex-start; padding: .7rem .8rem; border-radius: var(--r-md); background: var(--surface-2); }
.insight-ico { font-size: 1.05rem; line-height: 1.3; flex: none; }
.insight-body strong { display: block; font-size: .9rem; }
.insight-body span { font-size: .8rem; color: var(--text-secondary); }

/* ---------- gráficos ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-empty { display: grid; place-items: center; min-height: 160px; color: var(--text-muted); font-size: .85rem; text-align: center; padding: 1rem; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin-top: .8rem; font-size: .8rem; color: var(--text-secondary); }
.chart-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5; opacity: 0;
  padding: .5rem .65rem; border-radius: var(--r-sm); font-size: .78rem; line-height: 1.4;
  background: var(--surface-1); color: var(--text-primary);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-md);
  white-space: nowrap; transform: translate(-50%, -115%); transition: opacity .12s;
}
.chart-tip.is-on { opacity: 1; }
.chart-tip b { font-variant-numeric: tabular-nums; }
.chart-tip .tip-title { font-weight: 650; margin-bottom: .15rem; }
.tick { font-size: 11px; fill: var(--text-muted); font-variant-numeric: tabular-nums; }
.tick-strong { font-size: 11px; fill: var(--text-secondary); }
.donut-center-num { font-size: 34px; font-weight: 700; fill: var(--text-primary); letter-spacing: -1px; }
.donut-center-label { font-size: 11px; fill: var(--text-muted); }

/* ---------- diálogos ---------- */
.dialog {
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: 0;
  background: var(--surface-1); color: var(--text-primary);
  width: min(460px, calc(100vw - 2rem)); box-shadow: var(--shadow-lg);
}
.dialog::backdrop { background: rgba(11,11,11,.5); backdrop-filter: blur(2px); }
.dialog-form { display: flex; flex-direction: column; gap: .9rem; padding: 1.4rem; }
.dialog-form h3 { font-size: 1.1rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: .3rem; }
.swatches { display: flex; flex-wrap: wrap; gap: .5rem; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px var(--border); }
.swatch.is-sel { border-color: var(--text-primary); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 100; padding: .7rem 1.1rem; border-radius: 999px;
  background: var(--text-primary); color: var(--page);
  font-size: .85rem; font-weight: 600; box-shadow: var(--shadow-lg);
  animation: toastIn .25s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } }

/* =========================================================
   Responsivo — celular
   ========================================================= */
.only-mobile { display: none; }

@media (max-width: 860px) {
  .sidebar { display: none; }
  .only-mobile { display: inline-flex; }
  .content { padding: 1rem .9rem calc(84px + env(safe-area-inset-bottom)); }
  .topbar { padding: .6rem .9rem; }
  .topbar-title { font-size: 1rem; }
  .icon-btn { width: 34px; height: 34px; }
  .countdown-pill { padding: .35rem .65rem; font-size: .78rem; }

  .bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: color-mix(in srgb, var(--surface-1) 94%, transparent);
    backdrop-filter: blur(12px); border-top: 1px solid var(--border);
    padding: .35rem .1rem calc(.35rem + env(safe-area-inset-bottom));
  }
  .bn-item {
    display: flex; flex-direction: column; align-items: center; gap: .15rem;
    padding: .45rem .1rem; border: 0; background: none; cursor: pointer;
    font-size: .64rem; font-weight: 600; color: var(--text-muted); border-radius: var(--r-sm);
    /* Com 5 abas o rótulo mais longo ("Simulados") não cabe em telas de 320px:
       encolher a fonte mantém tudo em uma linha em vez de quebrar a grade. */
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
  }
  .bn-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .bn-item.is-active { color: var(--accent); }
  .bn-ico { width: 1.35rem; height: 1.35rem; }

  .view-head { align-items: stretch; }
  .view-head > .btn-primary, .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .cd-grid { gap: .45rem; }
  .cd-unit { padding: .65rem .25rem; }
  .stat-row { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .stat-value { font-size: 1.5rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .subjects-grid { grid-template-columns: 1fr; }
  /* Ao virar coluna, o flex-basis passa a valer como ALTURA — era isso que
     esticava e espaçava os campos. E o flex-wrap herdado de `flex-flow: row
     wrap` jogava campo para uma segunda coluna, estourando a borda do cartão.
     Aqui os dois são desfeitos. */
  .field-row, .form-inline {
    flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: .9rem;
  }
  .field-row .field, .form-inline .field { flex: 0 0 auto; width: 100%; }
  .form-inline .btn { width: 100%; }

  /* 16px é o limiar abaixo do qual o iOS dá zoom sozinho ao focar um campo.
     Subir a fonte dos controles resolve o zoom indesejado sem desativar o
     zoom por pinça, que as pessoas precisam para enxergar. */
  input[type=text], input[type=email], input[type=password],
  input[type=number], input[type=date], input[type=time],
  .output-box, select, textarea {
    font-size: 16px;
  }
  .dialog, .dialog-wide { width: calc(100vw - 1.5rem); }
  .auth-card { padding: 1.6rem 1.25rem; }

  /* O cronômetro é o que a pessoa olha de relance no meio da prova:
     fica sozinho na primeira linha, grande, com os botões embaixo. */
  .runner-bar { top: 52px; padding: .75rem .85rem; gap: .6rem; }
  .runner-info { flex: 1 1 100%; order: 1; }
  .runner-clock { order: 2; text-align: left; }
  .runner-actions { order: 3; margin-left: auto; }
  .runner-time { font-size: 1.9rem; }
  .answer-sheet { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: .35rem .7rem; }
  .ans-opt { height: 38px; }
  .ans-flag { height: 38px; }
  .review-item { flex-wrap: wrap; }
  .review-item .btn { width: 100%; }
  .filters .field { flex: 1 1 100%; }
  .error-actions { margin-left: 0; width: 100%; }
  .error-actions .btn { flex: 1; }
}

@media (max-width: 380px) {
  .stat-row { grid-template-columns: 1fr; }
  .answer-sheet { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .bottomnav, .topbar, .btn, .icon-btn { display: none !important; }
  .card, .stat-tile { break-inside: avoid; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =========================================================
   VESTIBULAR — componentes próprios deste app

   Tudo daqui para baixo é próprio do vestibular: nota estimada
   contra a nota de corte, as cinco competências da redação, a
   lista de provas com pesos por curso e os blocos de área do
   cartão-resposta.
   ========================================================= */

/* ---- cartão da nota estimada ---- */

.score-card { border-left: 3px solid var(--accent); }

.score-main {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1.6rem 2.4rem;
  margin-top: .4rem;
}
.score-big, .score-gap { min-width: 0; }
.score-value {
  margin: 0; font-size: clamp(2.4rem, 8vw, 3.4rem); font-weight: 700;
  letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums;
}
.score-value.good { color: var(--good-text); }
.score-value.warn { color: var(--text-primary); }
.score-value.bad  { color: var(--critical); }
.score-gap-value {
  margin: 0; font-size: clamp(1.4rem, 5vw, 1.9rem); font-weight: 700;
  letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums;
}
.score-gap-value.good { color: var(--good-text); }
.score-gap-value.bad  { color: var(--critical); }
.score-cap { margin: .45rem 0 0; font-size: .82rem; color: var(--text-muted); }

/* A barra da nota tem um traço na posição do corte: dá para ver de relance
   se você está do lado de cá ou do lado de lá dele. */
.meter-lg { position: relative; height: 10px; margin-top: 1.1rem; overflow: visible; }
.meter-lg .meter-fill { border-radius: 999px; }
.meter-mark {
  position: absolute; top: -4px; width: 2px; height: 18px;
  background: var(--text-primary); border-radius: 1px; transform: translateX(-1px);
}
.meter-mark::after {
  content: ""; position: absolute; left: -3px; bottom: -4px;
  border: 4px solid transparent; border-bottom-color: var(--text-primary);
}

/* ---- outras provas na contagem regressiva ---- */

.cd-others { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.cd-other {
  display: inline-flex; align-items: baseline; gap: .4rem;
  padding: .3rem .6rem; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-size: .78rem;
}
.cd-other strong { font-weight: 600; }
.cd-other span { color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* ---- filtro por área na aba Matérias ---- */

.area-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.area-tab {
  padding: .38rem .8rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-1);
  color: var(--text-secondary); font: inherit; font-size: .82rem;
}
.area-tab:hover { border-color: var(--border-strong); }
.area-tab.is-active {
  background: var(--accent); border-color: var(--accent);
  color: var(--on-accent); font-weight: 600;
}
.sc-area { color: var(--text-muted); }
.sc-area.is-warn { color: var(--critical); font-weight: 600; }

/* ---- redação: diagnóstico por competência ---- */

.comp-diag { display: flex; flex-direction: column; gap: 1rem; }
.comp-row { padding-top: .2rem; }
.comp-row-head { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.comp-badge {
  display: inline-grid; place-items: center; min-width: 2rem; padding: .12rem .4rem;
  border-radius: var(--r-sm); color: #fff; font-size: .74rem; font-weight: 700;
}
.comp-row-name { font-weight: 600; font-size: .92rem; }
.comp-row-value { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.comp-row-max { font-size: .8rem; }
.comp-bar {
  height: 8px; border-radius: 999px; background: var(--surface-2);
  margin: .45rem 0 .35rem; overflow: hidden;
}
.comp-bar span { display: block; height: 100%; border-radius: 999px; transition: width .4s ease; }
.comp-row-sub { margin: 0; font-size: .8rem; color: var(--text-muted); line-height: 1.5; }

/* ---- redação: formulário das notas ---- */

.comp-fields {
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: .9rem 1rem 1rem; margin: .2rem 0 0;
}
.comp-fields legend { padding: 0 .4rem; font-size: .82rem; font-weight: 600; color: var(--text-secondary); }
.comp-inputs { display: grid; gap: .9rem; margin-top: .6rem; }
@media (min-width: 720px) { .comp-inputs { grid-template-columns: 1fr 1fr; } }
.comp-field-head { display: flex; align-items: center; gap: .45rem; margin-bottom: .3rem; }
.comp-name { font-size: .86rem; font-weight: 600; margin: 0; }
.comp-select { width: 100%; }
.comp-total {
  display: flex; align-items: baseline; gap: .5rem; margin-top: 1rem;
  padding-top: .8rem; border-top: 1px solid var(--border);
}
.comp-total-value {
  font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.comp-total-value.good { color: var(--good-text); }
.comp-total-value.bad  { color: var(--critical); }

/* ---- redação: lista ---- */

.essay-list { display: flex; flex-direction: column; gap: .8rem; }
.essay-item {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: .9rem 1rem; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
}
.essay-body { flex: 1; min-width: 0; }
.essay-head { display: flex; gap: .8rem; align-items: center; }
.essay-score {
  display: inline-grid; place-items: center; min-width: 3.4rem; padding: .35rem .5rem;
  border-radius: var(--r-sm); font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--surface-1); border: 1px solid var(--border);
}
.essay-score.good { color: var(--good-text); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.essay-score.bad  { color: var(--critical); border-color: color-mix(in srgb, var(--err) 40%, transparent); }
.essay-title { min-width: 0; }
.essay-theme { margin: 0; font-weight: 600; font-size: .94rem; }
.essay-meta { margin: .15rem 0 0; font-size: .78rem; color: var(--text-muted); }
.essay-comps { display: flex; flex-wrap: wrap; gap: .35rem .8rem; margin-top: .6rem; }
.essay-comp {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .74rem; color: var(--text-secondary); font-variant-numeric: tabular-nums;
}
.essay-comp i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.essay-note { margin: .5rem 0 0; font-size: .82rem; color: var(--text-secondary); line-height: 1.5; }
.essay-note strong { color: var(--text-primary); }
.essay-actions { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }

/* ---- ajustes: lista de provas ---- */

.target-list { display: flex; flex-direction: column; gap: .7rem; }
.target-item {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: .85rem 1rem; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
}
.target-item.is-main { border-left-color: var(--accent); }
.target-body { flex: 1; min-width: 0; }
.target-title {
  margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  font-weight: 600; font-size: .96rem;
}
.target-sub { margin: .2rem 0 0; font-size: .82rem; color: var(--text-secondary); }
.target-actions { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }

.peso-inputs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: .7rem; margin-top: .6rem;
}
.peso-field label { display: block; font-size: .78rem; color: var(--text-secondary); margin-bottom: .25rem; }
.peso-field input { width: 100%; }

/* ---- cartão-resposta: cabeçalho de área ---- */

.ans-area {
  grid-column: 1 / -1;
  display: flex; align-items: baseline; justify-content: space-between; gap: .6rem;
  margin: 1rem 0 .3rem; padding-bottom: .35rem;
  border-bottom: 1px solid var(--border);
}
.ans-area:first-child { margin-top: 0; }
.ans-area-name { font-weight: 700; font-size: .86rem; letter-spacing: -0.01em; }
.ans-area .muted { font-size: .76rem; font-variant-numeric: tabular-nums; }

/* ---- resultado do simulado: placar por área ---- */

.result-areas { display: flex; flex-direction: column; gap: .3rem; margin: .8rem 0; }
.result-area {
  display: grid; grid-template-columns: 1fr auto auto auto; gap: .8rem;
  align-items: baseline; padding: .45rem .6rem;
  border-radius: var(--r-sm); background: var(--surface-2);
  font-size: .86rem; font-variant-numeric: tabular-nums;
}
.ra-name {
  font-weight: 600; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Em tela estreita "Ciências da Natureza" + três números não cabem numa
   linha só: o nome passa a ocupar a linha de cima e os números ficam
   embaixo, alinhados à direita. */
@media (max-width: 420px) {
  .result-area { grid-template-columns: auto auto auto; justify-content: end; }
  .ra-name { grid-column: 1 / -1; white-space: normal; }
}
.ra-pct, .ra-score { color: var(--text-secondary); }
.ra-nota { font-weight: 700; min-width: 3.2rem; text-align: right; }

.tag-ok  { color: var(--good-text); }
.tag-bad { color: var(--critical); }
