/* Layout: a printed report card. Single column (max 1180px): intro → "Boletim" sheet (fields | result)
   → chance distribution bar → tools → results table → method. Hairline rules, one accent: blue pen ink.
   Dark-first: dark tokens on :root, light tokens under [data-theme="light"] / prefers-color-scheme: light. */
:root {
  --paper: #0e1014;        /* page */
  --sheet: #15181e;        /* surfaces */
  --sheet-2: #1b1f27;      /* hover / inset */
  --ink: #e8eaee;          /* text */
  --ink-2: #a9afba;        /* secondary text */
  --ink-3: #868d99;        /* captions */
  --rule: #262a33;
  --rule-strong: #3a404c;
  --pen: #7d95ff;          /* accent: caneta azul */
  --pen-ink: #0e1014;      /* text on pen fill */
  --pen-soft: #1c2448;
  --hatch: rgba(125, 149, 255, 0.22);

  --c-boa: #4cc27a;
  --c-possivel: #e0b23e;
  --c-dificil: #f08a4b;
  --c-muito: #f2675a;
  --c-fora: #8f96a3;

  --usp: #f2c230;
  --unesp: #27b062;
  --unicamp: #e0443e;
  --fatec: #3d7ae0;
  --univesp: #9064e0;

  --f-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --f-body: "IBM Plex Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 8px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --paper: #f3f4f6; --sheet: #ffffff; --sheet-2: #f6f7f9; --ink: #14171c; --ink-2: #4a515c; --ink-3: #646b77;
    --rule: #dfe2e7; --rule-strong: #c3c8d0; --pen: #1d3fd1; --pen-ink: #ffffff; --pen-soft: #e8ecfc; --hatch: rgba(29, 63, 209, 0.14);
    --c-boa: #137a3a; --c-possivel: #8a6100; --c-dificil: #b4470a; --c-muito: #b42318; --c-fora: #5b6170;
    --usp: #e0ac00; --unesp: #1e9e53; --unicamp: #c62828; --fatec: #1f5fbf; --univesp: #6d3fc0;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --paper: #f3f4f6; --sheet: #ffffff; --sheet-2: #f6f7f9; --ink: #14171c; --ink-2: #4a515c; --ink-3: #646b77;
  --rule: #dfe2e7; --rule-strong: #c3c8d0; --pen: #1d3fd1; --pen-ink: #ffffff; --pen-soft: #e8ecfc; --hatch: rgba(29, 63, 209, 0.14);
  --c-boa: #137a3a; --c-possivel: #8a6100; --c-dificil: #b4470a; --c-muito: #b42318; --c-fora: #5b6170;
  --usp: #e0ac00; --unesp: #1e9e53; --unicamp: #c62828; --fatec: #1f5fbf; --univesp: #6d3fc0;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.55 var(--f-body); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; }
b { font-weight: 600; }
a { color: var(--pen); }
.mono { font-family: var(--f-mono); }
.num { font-family: var(--f-display); font-variant-numeric: tabular-nums; font-stretch: 75%; font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--sheet); color: var(--ink); padding: 8px 14px; border: 1px solid var(--rule-strong); border-radius: var(--r); }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--pen); outline-offset: 2px; border-radius: 4px; }
.ico { width: 16px; height: 16px; display: inline-block; vertical-align: -3px; flex: none; }
.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 720px) { .wrap { padding-inline: 32px; } }
main { padding-bottom: 56px; }
.tab-panel { display: flex; flex-direction: column; gap: 32px; padding-top: 28px; }
@media (max-width: 759px) { main { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); } }
h1, h2, h3 { font-family: var(--f-display); font-stretch: 100%; text-wrap: balance; margin: 0; }
h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }

/* Buttons */
.btn { font: 500 14px/1 var(--f-body); display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--rule-strong); background: var(--sheet); color: var(--ink); cursor: pointer; text-decoration: none; transition: background-color .15s, border-color .15s; }
.btn:hover { background: var(--sheet-2); border-color: var(--ink-3); }
.btn-primary { background: var(--pen); border-color: var(--pen); color: var(--pen-ink); }
.btn-primary:hover { background: var(--pen); filter: brightness(1.08); border-color: var(--pen); }
.btn-ghost { background: transparent; }
.btn-icon { width: 38px; padding: 0; justify-content: center; }
.link-btn { background: none; border: 0; padding: 4px; color: var(--pen); cursor: pointer; font: 500 14px var(--f-body); }

/* Top bar */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: var(--paper); border-bottom: 1px solid var(--rule); }
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand-mark { width: 30px; height: 30px; border-radius: 50%; background: url("icons/logo.svg") center / contain no-repeat; flex: none; }
.brand-name { font: 800 17px/1 var(--f-display); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-year { font-size: 12px; color: var(--ink-2); border: 1px solid var(--rule-strong); border-radius: 4px; padding: 2px 6px; }
.topbar-score { color: inherit; text-decoration: none; border-radius: 6px; margin-left: auto; display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.tb-label { font-size: 12px; color: var(--ink-2); }
.tb-value { font-size: 26px; line-height: 1; color: var(--ink); }
.tb-max { font-size: 12px; color: var(--ink-3); }
.topbar-actions { display: flex; gap: 8px; }
@media (max-width: 760px) { .brand-year { display: none; } .btn-text { display: none; } #btnShare { width: 38px; padding: 0; justify-content: center; } }
@media (max-width: 480px) { .tb-label { display: none; } .topbar-inner { gap: 10px; } }

/* Intro */
.intro { padding-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.kicker { margin: 0; font-size: 12px; color: var(--ink-2); letter-spacing: .04em; text-transform: uppercase; }
.intro h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.05; font-weight: 800; font-stretch: 88%; letter-spacing: -0.02em; }
.lede { margin: 0; max-width: 64ch; color: var(--ink-2); font-size: 16px; }
.lede b { color: var(--ink); }

/* Sheets */
.sheet { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--rule); }
.sheet-head h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; }
.sheet-tag { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.count { font-size: 13px; color: var(--ink-2); }

/* Boletim */
.boletim-grid { display: grid; grid-template-columns: 1fr; }
@media (min-width: 960px) { .boletim-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.fields { display: flex; flex-direction: column; }
.field { padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--rule); }
.field:last-child { border-bottom: 0; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field-label { font: 700 17px/1.2 var(--f-display); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.field-label small { font: 400 13px var(--f-body); color: var(--ink-2); }
.field-no { font-size: 12px; color: var(--pen); font-weight: 600; }
.field-weight { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.field-main { display: flex; align-items: center; gap: 16px; }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--rule-strong); border-radius: var(--r); background: var(--paper); overflow: hidden; flex: none; transition: border-color .15s, box-shadow .15s; }
.stepper:focus-within { border-color: var(--pen); box-shadow: 0 0 0 3px var(--pen-soft); }
.step { width: 40px; border: 0; background: transparent; color: var(--ink-2); font: 500 22px/1 var(--f-body); cursor: pointer; transition: background-color .12s, color .12s; }
.step:hover { background: var(--sheet-2); color: var(--ink); }
.step:active { background: var(--pen-soft); color: var(--pen); }
.num-input { width: 2.4ch; height: 54px; font-size: 38px; line-height: 1; border: 0; border-inline: 1px solid var(--rule); padding: 0 8px; box-sizing: content-box; background: transparent; color: var(--ink); text-align: center; -moz-appearance: textfield; appearance: textfield; }
.field[data-key="n3"] .num-input { width: 3.2ch; }
.num-input:focus { outline: none; }
.num-input::-webkit-outer-spin-button, .num-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field-unit { margin: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--ink-2); min-width: 0; }
.field-unit .mono { font-size: 12px; color: var(--ink-3); }
.field-unit b { color: var(--ink); font-weight: 600; }
.field-contrib { margin: 0 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.field-contrib span { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.field-contrib b { font-size: 28px; line-height: 1; color: var(--pen); }
@media (max-width: 420px) { .field-main { flex-wrap: wrap; } .field-contrib { margin-left: 0; flex-direction: row; align-items: baseline; gap: 8px; width: 100%; } }

.range { --p: 50%; -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; margin: 0; }
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--pen) var(--p), var(--rule-strong) var(--p)); }
.range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--rule-strong); }
.range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--pen); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: var(--sheet); border: 2px solid var(--pen); transition: transform .12s var(--ease); }
.range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--sheet); border: 2px solid var(--pen); }
.range:active::-webkit-slider-thumb { transform: scale(1.12); }
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--pen-soft); }
.range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--pen-soft); }
.ruler { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); margin-top: -8px; padding-inline: 4px; }

/* 3ª série: modo único x por área */
.mode-switch { display: flex; border: 1px solid var(--rule-strong); border-radius: var(--r); overflow: hidden; align-self: flex-start; }
.mode-switch button { font: 500 13px var(--f-body); color: var(--ink-2); background: transparent; border: 0; padding: 8px 14px; cursor: pointer; }
.mode-switch button + button { border-left: 1px solid var(--rule); }
.mode-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.modo-simples { display: flex; flex-direction: column; gap: 12px; }
.modo-area { display: flex; flex-direction: column; gap: 12px; }
.det-intro { margin: 0; font-size: 13px; color: var(--ink-2); }
.det-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.det-item { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.det-item label { font-size: 13px; font-weight: 500; color: var(--ink); }
.det-item label small { color: var(--ink-3); font-weight: 400; }
.stepper.sm .step { width: 34px; font-size: 18px; }
.stepper.sm .num-input { height: 42px; font-size: 26px; width: 3ch; }
.det-total { margin: 0; font-size: 12px; color: var(--ink-2); }
.det-alert { margin: 0; font-size: 13px; color: var(--c-muito); border: 1px solid var(--c-muito); border-radius: var(--r); padding: 10px 12px; background: color-mix(in srgb, var(--c-muito) 8%, transparent); }
.area-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--rule-strong); border-radius: var(--r); overflow: hidden; }
.area-pick button { font: 500 12px var(--f-body); color: var(--ink-2); background: var(--sheet); border: 0; padding: 8px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.area-pick button + button { border-left: 1px solid var(--rule); }
.area-pick button b { font-size: 20px; color: var(--ink); }
.area-pick button[aria-pressed="true"] { background: var(--pen-soft); color: var(--pen); box-shadow: inset 0 -3px 0 var(--pen); }
.pesos-wrap { overflow-x: auto; }
.pesos { border-collapse: collapse; font-size: 13px; width: 100%; }
.pesos th, .pesos td { padding: 6px 8px; border-bottom: 1px solid var(--rule); text-align: center; }
.pesos th[scope="row"], .pesos thead th:first-child { text-align: left; font-weight: 500; color: var(--ink-2); }
.pesos td { font-family: var(--f-mono); }

/* Result */
.result { padding: 22px 20px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--rule); background: var(--sheet-2); border-radius: 0 0 var(--r) var(--r); }
@media (min-width: 960px) { .result { border-top: 0; border-left: 1px solid var(--rule); border-radius: 0 0 var(--r) 0; padding: 24px 28px; } }
.result-label { font: 600 13px var(--f-body); color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; }
.result-big { margin: 0; display: flex; align-items: baseline; gap: 6px; }
.result-big .num { font-size: clamp(76px, 15vw, 128px); line-height: .9; font-weight: 800; font-stretch: 70%; color: var(--ink); letter-spacing: -0.01em; }
.result-big small { font-size: 16px; color: var(--ink-3); }
.result-formula { margin: 0; font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.scale { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; }
.scale-track { position: relative; height: 12px; background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 2px; }
.scale-max { position: absolute; inset: 0 auto 0 0; width: 0; background: repeating-linear-gradient(-45deg, var(--hatch) 0 4px, transparent 4px 8px); transition: width .5s var(--ease); }
.scale-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--pen); transition: width .5s var(--ease); }
.scale-mark { position: absolute; top: -6px; bottom: -6px; width: 2px; left: 0; background: var(--ink); transition: left .5s var(--ease); }
.scale-mark span { position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.scale-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); }
.result-facts { margin: 8px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border-top: 1px solid var(--rule); padding-top: 14px; }
.result-facts div { display: flex; flex-direction: column; gap: 2px; }
.result-facts dt { font-size: 12px; color: var(--ink-2); }
.result-facts dd { margin: 0; font-size: 30px; line-height: 1; }
.result-note { margin: 0; font-size: 12px; color: var(--ink-3); }

/* Distribution */
.dist { display: flex; flex-direction: column; gap: 14px; }
.dist-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; }
.dist-hint { margin: 0; font-size: 13px; color: var(--ink-3); }
.veredito { margin: 0; font: 600 clamp(18px, 3vw, 22px)/1.3 var(--f-body); color: var(--ink-2); }
.veredito:has(b) { color: var(--ink); }
.veredito b { font-family: var(--f-display); font-weight: 800; font-size: 1.25em; margin-right: 4px; color: var(--c-boa); }
.veredito[data-tom="possivel"] b { color: var(--c-possivel); }
.veredito[data-tom="dificil"] b { color: var(--c-dificil); }
.veredito[data-tom="muito"] b { color: var(--c-muito); }
.dist-bar { display: flex; height: 14px; border-radius: 3px; overflow: hidden; background: var(--rule); gap: 2px; }
.dist-seg { height: 100%; min-width: 0; transition: flex-grow .5s var(--ease), opacity .2s; }
.dist-seg[data-c="boa"] { background: var(--c-boa); }
.dist-seg[data-c="possivel"] { background: var(--c-possivel); }
.dist-seg[data-c="dificil"] { background: var(--c-dificil); }
.dist-seg[data-c="muito"] { background: var(--c-muito); }
.dist-seg[data-c="fora"] { background: var(--c-fora); }
.dist-bar.filtered .dist-seg:not(.sel) { opacity: .25; }
.dist-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--rule); border-radius: var(--r); background: var(--sheet); }
.leg { font: inherit; color: inherit; text-align: left; background: transparent; border: 0; border-right: 1px solid var(--rule); padding: 12px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: background-color .15s; }
.leg:last-child { border-right: 0; }
.leg:hover { background: var(--sheet-2); }
.leg[aria-pressed="true"] { background: var(--sheet-2); box-shadow: inset 0 -3px 0 var(--cc); }
.leg-top { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.leg-top i { width: 10px; height: 10px; border-radius: 50%; background: var(--cc); flex: none; }
.leg-num { font-size: 30px; line-height: 1; }
.leg-pct { font-size: 12px; color: var(--ink-3); }
.leg-pct.note { font-family: var(--f-body); line-height: 1.35; color: var(--ink-2); }
@media (max-width: 640px) {
  .dist-legend { grid-template-columns: 1fr 1fr; }
  .leg { border-bottom: 1px solid var(--rule); }
  .leg:nth-child(2n) { border-right: 0; }
  .leg:last-child { grid-column: 1 / -1; border-bottom: 0; }
}

/* WhatsApp */
.btn-whats { background: #1f7a4d; border-color: #1f7a4d; color: #ffffff; }
.btn-whats:hover { background: #1a6a43; border-color: #1a6a43; }
.rank-body > .btn-whats { align-self: flex-start; }

/* Ranking */
.rank-school { text-transform: none; letter-spacing: 0; font: 500 13px var(--f-body); color: var(--ink-2); text-align: right; overflow-wrap: anywhere; }
.rank-body { padding: 8px 20px 18px; display: flex; flex-direction: column; gap: 14px; }
.rank-list { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.rank-list li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: baseline; gap: 12px; padding: 10px; border-bottom: 1px solid var(--rule); }
.rank-list li:last-child { border-bottom: 0; }
.rank-list li.me { background: var(--pen-soft); border-radius: 6px; }
.rank-pos { font-size: 20px; color: var(--ink-2); }
.rank-list li:nth-child(-n+3) .rank-pos { color: var(--pen); }
.rank-name { font-weight: 500; overflow-wrap: anywhere; }
.rank-name small { color: var(--pen); font-weight: 600; }
.rank-nota { font-size: 22px; }
.rank-msg, .rank-note, .rank-me { margin: 0; color: var(--ink-2); font-size: 14px; }
.rank-note { font-size: 12px; color: var(--ink-3); }
.rank-me b { color: var(--ink); }
.rank-action { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; border-top: 1px solid var(--rule); padding-top: 14px; }
.rank-action p { margin: 0; color: var(--ink-2); font-size: 14px; max-width: 62ch; }
.rank-action b { color: var(--ink); }
.rank-action.join { border: 1px solid var(--pen); background: var(--pen-soft); border-radius: var(--r); padding: 14px; }
.rank-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding-top: 8px; }
.rank-empty p { margin: 0; color: var(--ink-2); max-width: 60ch; }
button:disabled { opacity: .6; cursor: progress; }

/* Compare */
.compare-scroll { overflow-x: auto; }
.compare-table { width: 100%; border-collapse: collapse; min-width: 520px; font-size: 14px; }
.compare-table th, .compare-table td { padding: 10px 14px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.compare-table tr:last-child th, .compare-table tr:last-child td { border-bottom: 0; }
.compare-table th[scope="row"] { font-weight: 500; color: var(--ink-2); white-space: nowrap; width: 1%; }
.compare-table thead th { font: 700 15px/1.3 var(--f-display); }
.compare-table td.n { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.cmp-h { display: flex; flex-direction: column; gap: 6px; min-width: 140px; }
.cmp-h .x { align-self: flex-start; }

/* Reverse */
.reverse { padding: 22px 20px; display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .reverse { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); padding: 26px 28px; gap: 32px; } }
.reverse-text p { margin: 8px 0 0; color: var(--ink-2); max-width: 52ch; }
.reverse-box { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.combo, .search { position: relative; display: flex; align-items: center; gap: 10px; padding: 0 12px; height: 44px; border-radius: var(--r); background: var(--paper); border: 1px solid var(--rule-strong); color: var(--ink-3); transition: border-color .15s; }
.combo:focus-within, .search:focus-within { border-color: var(--pen); box-shadow: 0 0 0 3px var(--pen-soft); }
.combo input, .search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--ink); font: 400 16px var(--f-body); outline: none; }
.combo-list { position: absolute; z-index: 20; left: -1px; right: -1px; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--r); box-shadow: 0 12px 32px -12px rgba(0,0,0,.35); max-height: 320px; overflow-y: auto; }
.combo-list li { padding: 8px 10px; border-radius: 6px; cursor: pointer; display: flex; gap: 10px; align-items: center; color: var(--ink); font-size: 14px; }
.combo-list li small { color: var(--ink-3); margin-left: auto; white-space: nowrap; }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: var(--sheet-2); }
.combo-list li .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reverse-out:empty { display: none; }
.rev { border-top: 1px solid var(--rule); padding-top: 14px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 18px; align-items: center; }
.rev-big { grid-row: span 2; font-size: 64px; line-height: .9; color: var(--cc); }
.rev p { margin: 0; color: var(--ink-2); font-size: 14px; }
.rev p b { color: var(--ink); }
.rev .full { grid-column: 1 / -1; }

/* Filters */
.results { display: flex; flex-direction: column; gap: 14px; }
.filters { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 960px) { .filters { grid-template-columns: minmax(0, 1fr) auto; } .selects { grid-column: 1 / -1; } }
.seg { display: flex; flex-wrap: wrap; border: 1px solid var(--rule-strong); border-radius: var(--r); overflow: hidden; background: var(--sheet); align-self: start; }
.seg button { font: 500 13px var(--f-body); color: var(--ink-2); background: transparent; border: 0; border-right: 1px solid var(--rule); height: 42px; padding: 0 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; flex: 1 0 auto; transition: background-color .15s, color .15s; }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--sheet-2); color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg .sq { width: 9px; height: 9px; border-radius: 2px; background: var(--sq); }
.selects { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.sel { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); }
.sel select { font: 400 15px var(--f-body); color: var(--ink); background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--r); height: 42px; padding: 0 10px; cursor: pointer; }

/* Lista de cursos (linhas compactas que expandem) */
.table { overflow: hidden; }
.thead, .row-main { display: grid; grid-template-columns: minmax(0, 1fr) 220px 20px; gap: 16px; align-items: center; padding: 0 18px; }
.thead { height: 40px; border-bottom: 1px solid var(--rule-strong); font-size: 12px; color: var(--ink-2); font-weight: 500; background: var(--sheet-2); }
.tbody { display: flex; flex-direction: column; }
.row { --cc: var(--c-fora); border-bottom: 1px solid var(--rule); position: relative; content-visibility: auto; contain-intrinsic-size: auto 72px; }
.row:last-child { border-bottom: 0; }
.row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--cc); transition: background-color .4s var(--ease); }
.row-main { padding-block: 12px; cursor: pointer; transition: background-color .15s; }
.row-main:hover { background: var(--sheet-2); }
.row-main:focus-visible { outline-offset: -2px; }
.row.enter { animation: fadeIn .35s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; } }
.row[data-chance="boa"], .rev[data-chance="boa"] { --cc: var(--c-boa); }
.row[data-chance="possivel"], .rev[data-chance="possivel"] { --cc: var(--c-possivel); }
.row[data-chance="dificil"], .rev[data-chance="dificil"] { --cc: var(--c-dificil); }
.row[data-chance="muito"], .rev[data-chance="muito"] { --cc: var(--c-muito); }
.row[data-chance="fora"], .rev[data-chance="fora"] { --cc: var(--c-fora); }
.c-course { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.c-tags { display: flex; align-items: center; gap: 10px; min-width: 0; }
.meta-city { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inst { display: inline-flex; align-items: center; gap: 6px; font: 600 11px var(--f-mono); letter-spacing: .06em; color: var(--ink); flex: none; }
.inst i { width: 9px; height: 9px; border-radius: 2px; background: var(--sq); flex: none; }
.inst[data-inst="USP"] { --sq: var(--usp); }
.inst[data-inst="UNESP"] { --sq: var(--unesp); }
.inst[data-inst="UNICAMP"] { --sq: var(--unicamp); }
.inst[data-inst="FATEC"] { --sq: var(--fatec); }
.inst[data-inst="UNIVESP"] { --sq: var(--univesp); }
.c-course h3 { font: 600 15.5px/1.3 var(--f-body); overflow-wrap: anywhere; }
.meta { margin: 0; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.c-chance { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.chance { font: 600 13px var(--f-body); color: var(--cc); display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; transition: color .4s var(--ease); }
.chance i { width: 8px; height: 8px; border-radius: 50%; background: var(--cc); transition: background-color .4s var(--ease); }
.chance.pop { animation: pop .4s var(--ease); }
@keyframes pop { 40% { transform: translateX(3px); } }
.gap { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-3); }
.gap-bar { flex: 1; height: 4px; background: var(--rule); border-radius: 2px; overflow: hidden; min-width: 40px; }
.gap-bar i { display: block; height: 100%; width: 0; background: var(--cc); transition: width .5s var(--ease), background-color .4s var(--ease); }
.gap-text { white-space: nowrap; }
.chev { width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); justify-self: center; transition: transform .2s var(--ease); margin-top: -4px; }
.row.open .chev { transform: rotate(-135deg); margin-top: 4px; }
.row.open .row-main { background: var(--sheet-2); }
.row-details { padding: 4px 18px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--sheet-2); }
.row-nums { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.row-nums div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.row-nums dt { font-size: 11px; color: var(--ink-3); }
.row-nums dd { margin: 0; font: 600 16px var(--f-mono); font-variant-numeric: tabular-nums; }
.row-nums .need { color: var(--cc); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; align-self: flex-start; }
.pin[aria-pressed="true"] { background: var(--pen); border-color: var(--pen); color: var(--pen-ink); }
.loading, .empty { color: var(--ink-2); padding: 28px 18px; margin: 0; }
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.empty p { margin: 0; }
.active-filters { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--pen); border-radius: var(--r); background: var(--pen-soft); font-size: 14px; color: var(--ink-2); }
.active-filters b { color: var(--ink); font-weight: 600; }
.sentinel { height: 1px; }
@media (max-width: 759px) {
  .thead { display: none; }
  .row-main { grid-template-columns: minmax(0, 1fr) 16px; gap: 8px 10px; padding: 12px 14px 12px 16px; }
  .row-main .c-chance { grid-column: 1; grid-row: 2; flex-direction: row; align-items: center; gap: 12px; }
  .row-main .c-chance .gap { flex: 1; }
  .row-main .chev { grid-column: 2; grid-row: 1 / span 2; }
  .row-details { padding: 4px 16px 14px; }
  .row-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Abas */
.tabs { position: sticky; top: calc(60px + env(safe-area-inset-top, 0px)); z-index: 45; background: var(--paper); border-bottom: 1px solid var(--rule); }
.tabs-inner { display: flex; gap: 4px; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; color: var(--ink-2); text-decoration: none; font: 500 14px var(--f-body); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--pen); }
.tab .ico { width: 17px; height: 17px; }
@media (max-width: 759px) {
  .tabs { position: fixed; top: auto; bottom: 0; left: 0; right: 0; border-bottom: 0; border-top: 1px solid var(--rule-strong); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .tabs-inner { padding-inline: 4px; gap: 0; }
  .tab { flex: 1; flex-direction: column; justify-content: center; gap: 3px; height: 60px; padding: 0 4px; font-size: 11px; border-bottom: 0; border-top: 2px solid transparent; margin: -1px 0 0; text-align: center; }
  .tab[aria-selected="true"] { border-top-color: var(--pen); color: var(--pen); }
  .tab .ico { width: 20px; height: 20px; }
}

/* Menu ⋯ */
.topbar-actions { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 230px; padding: 6px; background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--r); box-shadow: 0 16px 40px -16px rgba(0,0,0,.45); display: flex; flex-direction: column; }
.menu-item { font: 500 14px var(--f-body); color: var(--ink); text-decoration: none; background: transparent; border: 0; border-radius: 6px; padding: 10px 10px; display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--sheet-2); outline: none; }
.menu-item .ico { color: var(--ink-2); }
.menu-item .avatar { width: 24px; height: 24px; line-height: 24px; font-size: 11px; }

/* Blocos recolhíveis */
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.calc > summary { font-size: 12px; color: var(--pen); display: inline-flex; align-items: center; gap: 6px; }
.calc > summary::after, .more-filters > summary::after, .reverse-d > summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin-top: -3px; transition: transform .2s; }
.calc[open] > summary::after, .more-filters[open] > summary::after, .reverse-d[open] > summary::after { transform: rotate(-135deg); margin-top: 3px; }
.calc .result-formula { margin-top: 8px; }
.more-filters > summary { font: 500 14px var(--f-body); color: var(--ink); display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--rule-strong); border-radius: var(--r); background: var(--sheet); }
.more-filters[open] > summary { margin-bottom: 10px; }
@media (min-width: 760px) { .more-filters > summary { display: none; } }
.reverse-d > summary { padding: 18px 20px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.reverse-d > summary span { font: 700 18px var(--f-display); color: var(--ink); }
.reverse-d > summary small { font-size: 13px; color: var(--ink-2); flex: 1; }
.reverse-d > summary::after { align-self: center; color: var(--ink-3); }
.reverse-d .reverse { border-top: 1px solid var(--rule); padding-top: 18px; }
.reverse-help { margin: 0; color: var(--ink-2); font-size: 14px; max-width: 52ch; }

/* Cartão de privacidade */
.priv-card { padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; }
.priv-card h2 { font-size: 18px; }
.priv-card p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; max-width: 60ch; }

/* Method */
.how { display: flex; flex-direction: column; gap: 18px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; grid-template-columns: 1fr; counter-reset: step; border-top: 1px solid var(--rule); }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.steps > li { counter-increment: step; padding: 18px 0; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
@media (min-width: 900px) { .steps { column-gap: 32px; } }
.steps > li::before { content: counter(step, decimal-leading-zero); font: 600 12px var(--f-mono); color: var(--pen); }
.steps h3 { font-size: 17px; }
.steps p { margin: 0; color: var(--ink-2); font-size: 14px; }
.steps code { font-size: 12.5px; color: var(--ink); background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; padding: 8px 10px; overflow-x: auto; white-space: nowrap; }
.how-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; font-size: 14px; color: var(--ink-2); }
.how-list b { color: var(--ink); font-weight: 600; }
.c-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.c-dot[data-c="boa"] { background: var(--c-boa); }
.c-dot[data-c="possivel"] { background: var(--c-possivel); }
.c-dot[data-c="dificil"] { background: var(--c-dificil); }
.c-dot[data-c="muito"] { background: var(--c-muito); }
.c-dot[data-c="fora"] { background: var(--c-fora); }
.how-note { margin: 0; font-size: 13px; color: var(--ink-3); max-width: 92ch; }

.footer { border-top: 1px solid var(--rule); padding-block: 24px 36px; color: var(--ink-3); font-size: 13px; }
.footer p { margin: 0; }
@media (max-width: 759px) { main { padding-bottom: 24px; } .footer { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); } }
.insta-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--ink-2); text-decoration: none; }
.insta-link:hover b { text-decoration: underline; }
.insta-link .ico { width: 16px; height: 16px; }

/* Personalização */
.profile-btn { padding-left: 6px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--pen-soft); color: var(--pen); font: 700 12px/26px var(--f-display); text-align: center; flex: none; letter-spacing: .02em; }
@media (max-width: 760px) { .profile-btn { width: 38px; padding: 0; justify-content: center; } }
.hello { margin: 0; font-size: 16px; color: var(--ink-2); }
.hello b { color: var(--ink); font-weight: 600; }
.hello-sep { color: var(--ink-3); margin-inline: 4px; }
.sheet-id { margin: 0 0 0 auto; display: flex; flex-wrap: wrap; gap: 4px 28px; min-width: 0; }
.sheet-id div { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.sheet-id dt { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.sheet-id dd { margin: 0; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.sheet-head { flex-wrap: wrap; }
@media (max-width: 640px) { .sheet-id { margin-left: 0; order: 3; width: 100%; flex-direction: column; } }
.welcome { gap: 16px; padding: 24px; width: min(100%, 460px); }
.welcome h2 { font-size: 26px; font-stretch: 90%; }
.welcome .kicker { margin: 0; }
.welcome-sub { margin: -6px 0 0; color: var(--ink-2); }
.input-row { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.input-row small { color: var(--ink-3); font-weight: 400; }
.input-row input { height: 46px; border-radius: var(--r); border: 1px solid var(--rule-strong); background: var(--paper); color: var(--ink); font: 400 16px var(--f-body); padding: 0 12px; }
.input-row input:focus { outline: none; border-color: var(--pen); box-shadow: 0 0 0 3px var(--pen-soft); }
.input-row > label { color: var(--ink-2); }
.school-field { display: flex; flex-direction: column; }
.school-field input { width: 100%; }
.school-field input[aria-expanded="true"] { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.school-list { margin: 0; padding: 4px; list-style: none; border: 1px solid var(--pen); border-top: 0; border-radius: 0 0 var(--r) var(--r); background: var(--paper); max-height: 236px; overflow-y: auto; }
.school-list li { padding: 8px 10px; border-radius: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.school-list li b { font-weight: 500; color: var(--ink); font-size: 14px; }
.school-list li span { font-size: 12px; color: var(--ink-3); }
.school-list li[aria-selected="true"], .school-list li:hover { background: var(--sheet-2); }
.school-list li mark { background: none; color: var(--pen); font-weight: 600; }
.school-list .none { cursor: default; color: var(--ink-3); font-size: 13px; }
.school-hint { margin: 0; font-size: 12px; color: var(--ink-3); font-weight: 400; }
.input-row input[aria-invalid="true"] { border-color: var(--c-muito); }
.form-error { margin: -6px 0 0; color: var(--c-muito); font-size: 13px; }
.pf-clear { margin-left: auto; color: var(--ink-2); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--pen); }

/* Modal / toast */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 9, 12, .6); }
.modal-card { position: relative; width: min(100%, 440px); max-height: calc(100vh - 32px); overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: 10px; }
.modal-card h2 { font-size: 18px; }
.modal-card img { border-radius: 6px; border: 1px solid var(--rule); width: 100%; aspect-ratio: 4 / 5; background: var(--paper); }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.modal-hint { margin: 0; font-size: 12px; color: var(--ink-3); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 90; padding: 10px 16px; border-radius: var(--r); background: var(--ink); color: var(--paper); font-size: 14px; max-width: calc(100% - 32px); box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
.reverse-d .reverse { grid-template-columns: 1fr; padding: 18px 20px 22px; gap: 14px; }
@media (min-width: 900px) { .reverse-d .reverse { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); } }
/* Itens do menu não herdam as regras antigas dos botões do topo */
.menu .menu-item, .menu #btnShare, .menu .profile-btn { width: auto; height: auto; padding: 10px; justify-content: flex-start; white-space: nowrap; }

/* Aviso da fonte das notas (lista de cursos e páginas de curso) */
.fonte { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); padding: 10px 14px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--sheet); }
.fonte b { color: var(--ink); }
.fonte-curta { padding: 0 2px; border: 0; background: none; font-size: 12px; color: var(--ink-3); align-items: center; }
.fonte-curta .fonte-dot { margin-top: 0; width: 6px; height: 6px; }
.fonte-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-possivel); margin-top: 6px; flex: none; }

/* Páginas de curso, universidade e índice (geradas por scripts/build_paginas.py) */
.pg { display: flex; flex-direction: column; gap: 24px; padding-top: 24px; padding-bottom: 56px; }
.pg-top-cta { margin-left: auto; align-self: center; }
.pg-crumb { font-size: 13px; color: var(--ink-3); }
.pg-crumb a { color: var(--ink-2); text-decoration: none; }
.pg-crumb a:hover { color: var(--pen); }
.pg-head h1 { font-size: clamp(28px, 5vw, 40px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.pg-lede { color: var(--ink-2); max-width: 64ch; margin: 10px 0 0; }
.pg-kpis { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid var(--rule); }
.pg-kpis div { padding: 14px 0; min-width: 0; }
.pg-kpis div + div { border-left: 1px solid var(--rule); padding-left: 16px; }
.pg-kpis dt { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.pg-kpis dd { margin: 0; font-size: clamp(24px, 4vw, 30px); line-height: 1.15; }
.pg-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 18px 20px; border: 1px solid var(--pen); border-radius: var(--r); background: var(--pen-soft); }
.pg-cta p { margin: 0; max-width: 56ch; }
.pg-table { overflow-x: auto; }
.pg-table table { width: 100%; border-collapse: collapse; }
.pg-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); text-align: left; font-weight: 500; padding: 10px 16px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.pg-table td { padding: 12px 16px; border-bottom: 1px solid var(--rule); vertical-align: top; overflow-wrap: anywhere; }
.pg-table tr:last-child td { border-bottom: 0; }
.pg-table td a { color: var(--ink); text-decoration: none; font-weight: 500; }
.pg-table td a:hover { color: var(--pen); text-decoration: underline; }
.pg-table .r { text-align: right; white-space: nowrap; }
.pg-nota { font-size: 20px; }
.pg-sub { display: block; font-size: 13px; color: var(--ink-3); font-weight: 400; }
h2 .pg-sub, li .pg-sub { display: inline; margin-left: 4px; font-family: var(--f-mono); font-size: 12px; }
.pg-inst { font: 600 12px var(--f-mono); border-left: 3px solid var(--ic); padding-left: 8px; white-space: nowrap; }
.pg-rel h2, .pg-area h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.pg-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pg-links a { padding: 6px 12px; border: 1px solid var(--rule-strong); border-radius: 999px; font-size: 13px; color: var(--ink-2); text-decoration: none; }
.pg-links a:hover { border-color: var(--pen); color: var(--pen); }
.pg-uni { margin: 12px 0 0; font-size: 13px; color: var(--ink-3); }
.pg-lista { margin: 0; padding: 0; list-style: none; columns: 3 220px; column-gap: 24px; }
.pg-lista li { break-inside: avoid; padding: 5px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.pg-lista a { color: var(--ink); text-decoration: none; }
.pg-lista a:hover { color: var(--pen); }
@media (max-width: 600px) {
  .pg-table th, .pg-table td { padding-inline: 12px; }
  .pg-table th:nth-child(3), .pg-table td:nth-child(3) { display: none; }
  .pg-kpis div + div { padding-left: 12px; }
}

/* Comparador: barra fixa (aba Cursos) que abre o comparador por cima da tela */
.cmp-bar { position: fixed; z-index: 70; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 48px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--pen); color: var(--pen-ink); font: 600 15px var(--f-body); cursor: pointer; box-shadow: 0 12px 30px -10px rgba(0,0,0,.55); }
.cmp-bar:hover { filter: brightness(1.08); }
.cmp-bar .num { font-size: 18px; }
.cmp-bar-sub { font-weight: 500; }
body:not([data-aba-atual="cursos"]) .cmp-bar { display: none; }
.cmp-card { width: min(100%, 880px); }
.cmp-head-actions { display: flex; align-items: center; gap: 8px; }
.cmp-card .compare-scroll { border: 1px solid var(--rule); border-radius: var(--r); }
@media (max-width: 759px) {
  .cmp-bar { left: 16px; right: 16px; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  body.has-pins[data-aba-atual="cursos"] main { padding-bottom: calc(160px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  body.has-pins[data-aba-atual="cursos"] .toast { bottom: calc(132px + env(safe-area-inset-bottom, 0px)); }
  .cmp-card { max-height: calc(100vh - 32px); }
}
@media (min-width: 760px) {
  body.has-pins[data-aba-atual="cursos"] .toast { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
}
.cmp-cards { display: none; }
@media (max-width: 600px) {
  .cmp-card .compare-scroll { display: none; }
  .cmp-cards { display: flex; flex-direction: column; gap: 10px; }
  .cmp-c { position: relative; padding: 12px 14px 12px 16px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--sheet-2); overflow: hidden; }
  .cmp-c::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--cc); }
  .cmp-c-head { display: flex; align-items: center; justify-content: space-between; }
  .cmp-c h3 { font-size: 16px; margin: 2px 0 2px; }
  .cmp-c-local { margin: 0; font-size: 13px; color: var(--ink-3); }
  .cmp-c-chance { margin: 8px 0 0; font-size: 14px; color: var(--cc); }
  .cmp-c-chance .mono { font-size: 12px; color: var(--ink-3); margin-left: 6px; }
  .cmp-c dl { margin: 10px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .cmp-c dt { font-size: 11px; color: var(--ink-3); }
  .cmp-c dd { margin: 0; font: 600 15px var(--f-mono); }
  .cmp-c .need { color: var(--cc); }
}
