/* Estuda Fácil — v2 (tema claro) */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/nunito-latin.woff2") format("woff2");
}
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --line: #e3e6ef;
  --text: #1c2233;
  --muted: #535c70;
  --brand: #4338ca;
  --brand-soft: #eef0ff;
  --brand-2: #6366f1;
  --ok: #15803d;  --ok-soft: #e7f8ec;  --ok-line: #86d69f;
  --bad: #b91c1c; --bad-soft: #fdecec; --bad-line: #f3a3a3;
  --warn: #92400e; --warn-soft: #fff4dc; --warn-line: #f5c86a;
  --cn: #166534;  --cn-soft: #e5f6ea;
  --hist: #c2410c; --hist-soft: #fff0e5;
  --subj: var(--brand); --subj-soft: var(--brand-soft);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(28,34,51,.06), 0 4px 14px rgba(28,34,51,.06);
  --shadow-lg: 0 2px 4px rgba(28,34,51,.06), 0 10px 28px rgba(28,34,51,.10);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.subj-ciencias-naturais { --subj: var(--cn); --subj-soft: var(--cn-soft); }
.subj-historia { --subj: var(--hist); --subj-soft: var(--hist-soft); }
.subj-portugues { --subj: #1d4ed8; --subj-soft: #e8efff; }
.subj-ingles { --subj: #be123c; --subj-soft: #ffe9ee; }
.subj-frances { --subj: #a21caf; --subj-soft: #fbe9fd; }
.subj-espanhol { --subj: #a16207; --subj-soft: #fdf4d8; }
.subj-geografia { --subj: #0f766e; --subj-soft: #e2f6f3; }
.subj-matematica { --subj: #6d28d9; --subj-soft: #f1eaff; }
.subj-fisico-quimica { --subj: #0369a1; --subj-soft: #e3f3fc; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  min-height: 100vh; line-height: 1.55; font-size: 17px;
}
a { color: var(--brand); text-decoration: none; font-weight: 700; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(1.55rem, 6vw, 2.2rem); font-weight: 900; margin: .25rem 0 .75rem; }
h2 { font-size: 1.3rem; font-weight: 850; margin: 1.5rem 0 .75rem; }
h3 { font-size: 1.1rem; font-weight: 800; }
.container { width: min(920px, 100% - 2rem); margin: 0 auto; padding: 1rem 0 3rem; }

/* Cabeçalho */
#header { position: sticky; top: 0; z-index: 20; }
.site-header { background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .inner { width: min(920px, 100% - 2rem); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 0; height: 56px; }
.logo { font-weight: 900; font-size: 1.15rem; color: var(--text); display: flex; align-items: center; gap: .45rem; }
.logo:hover { text-decoration: none; }
.logo .logo-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--brand); color: #fff; font-size: 1.1rem; }
.logo span.badge { font-size: .62rem; font-weight: 800; color: var(--warn); background: var(--warn-soft); padding: .12rem .45rem; border-radius: 999px; }
.nav { display: flex; gap: .35rem; }
.nav a { color: var(--muted); font-weight: 800; font-size: .92rem; padding: .45rem .7rem; border-radius: 999px; }
.nav a:hover { text-decoration: none; background: var(--surface-2); }
.nav a.active { color: var(--brand); background: var(--brand-soft); }

/* Início */
.hero { background: linear-gradient(135deg, #3730a3 0%, #4338ca 55%, #4f46e5 100%); color: #fff; border-radius: 24px; padding: 1.5rem 1.25rem 1.4rem; margin: .25rem 0 1.25rem; position: relative; overflow: hidden; box-shadow: var(--shadow-lg); }
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.12); }
.hero h1 { color: #fff; margin: 0 0 .4rem; }
.hero p { margin: 0; color: #eef0ff; font-size: 1.02rem; max-width: 36rem; position: relative; z-index: 1; }
.step-label { display: flex; align-items: center; gap: .6rem; font-size: 1.15rem; font-weight: 900; margin: 1.6rem 0 .8rem; color: var(--text); scroll-margin-top: 4.5rem; }
.step-label .num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .95rem; flex: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.grid.anos { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow); cursor: pointer; transition: transform .12s, border-color .12s, box-shadow .12s;
  text-align: left; color: inherit; font: inherit; width: 100%; display: block; min-height: 64px;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; }
.card:active { transform: scale(.98); }
.card .title { font-weight: 850; font-size: 1.05rem; display: block; }
.card .sub { color: var(--muted); font-size: .88rem; margin-top: .2rem; display: block; font-weight: 600; }
.ano-card { text-align: center; padding: 1.1rem .5rem; }
.ano-card .big { display: block; font-size: 2.4rem; font-weight: 900; line-height: 1; color: var(--brand); }
.ano-card .big sup { font-size: .45em; vertical-align: super; }
.ano-card.selected { background: var(--brand); border-color: var(--brand); color: #fff; }
.ano-card.selected .big, .ano-card.selected .sub { color: #fff; }
.grid.disc { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.disc-card { border-color: transparent; background: var(--subj-soft); display: flex; flex-direction: row; align-items: center; gap: .85rem; grid-column: 1 / -1; min-height: 88px; padding: .9rem 1rem; }
.disc-card .icon { flex: none; display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: #fff; font-size: 1.8rem; box-shadow: var(--shadow); }
.disc-card .disc-txt { flex: 1; min-width: 0; }
.disc-card .title { font-size: 1.15rem; }
.disc-card .go { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #fff; color: var(--subj); font-weight: 900; font-size: 1.3rem; }
.disc-card.disabled { grid-column: auto; min-height: 60px; padding: .55rem .65rem; gap: .5rem; border-radius: 14px; }
.disc-card.disabled .icon { width: 36px; height: 36px; font-size: 1.15rem; border-radius: 10px; }
.disc-card.disabled .title { font-size: .9rem; line-height: 1.2; }
.disc-card.disabled .sub { margin-top: .1rem; font-size: .72rem; }
.soon-label { grid-column: 1 / -1; font-size: .85rem; font-weight: 800; color: var(--muted); margin: .4rem 0 -.1rem; }
.disc-card .title { color: var(--text); }
.disc-card.selected { border-color: var(--subj); box-shadow: 0 0 0 3px color-mix(in srgb, var(--subj) 25%, transparent), var(--shadow-lg); }
.card.disabled { background: var(--surface-2); cursor: not-allowed; box-shadow: none; }
.card.disabled .icon { filter: grayscale(1); opacity: .6; box-shadow: none; }
.card.disabled .title { color: var(--muted); }
.card.disabled:hover { transform: none; box-shadow: none; }
.tema-card { display: flex; align-items: center; gap: .85rem; margin-bottom: .7rem; border-left: 6px solid var(--subj); color: var(--text); }
.tema-card .tema-txt { flex: 1; min-width: 0; }
.tema-card .go { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--subj-soft); color: var(--subj); font-weight: 900; font-size: 1.2rem; }
.tema-card .state { margin-top: .35rem; }

.pill { display: inline-block; font-size: .74rem; font-weight: 800; padding: .18rem .6rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.pill.soon { background: #fff; color: var(--muted); border: 1px solid var(--line); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.subj { background: var(--subj-soft); color: var(--subj); }
.pill.cn { background: var(--cn-soft); color: var(--cn); }
.pill.hist { background: var(--hist-soft); color: var(--hist); }
.pill.state-started { background: var(--warn-soft); color: var(--warn); }
.pill.state-mastered { background: var(--ok-soft); color: var(--ok); }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  border: 2px solid transparent; border-radius: 14px; padding: .85rem 1.3rem; font-weight: 850;
  font-size: 1.02rem; cursor: pointer; text-decoration: none; color: #fff; background: var(--brand);
  box-shadow: 0 3px 0 #312e81; font-family: inherit; min-height: 50px; transition: transform .08s, box-shadow .08s;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #312e81; }
.btn:disabled { background: #e3e6ef; box-shadow: none; color: #535c70; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--brand); border-color: var(--line); box-shadow: 0 2px 0 var(--line); }
.btn.ok { background: var(--ok); box-shadow: 0 3px 0 #0f5a2b; }
.btn.big { width: 100%; padding: 1rem 1.3rem; font-size: 1.12rem; margin: 1rem 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.15rem; margin: 1rem 0; box-shadow: var(--shadow); }
.panel h2, .panel h3 { margin-top: 0; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.breadcrumbs { color: var(--muted); font-size: .9rem; margin: .25rem 0 .6rem; font-weight: 600; }
.breadcrumbs a { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }

/* Tema: cabeçalho + separadores */
.theme-head { background: var(--subj-soft); border-radius: 22px; padding: 1.1rem 1.1rem 1.2rem; margin-bottom: .9rem; }
.theme-head h1 { margin: .5rem 0 .2rem; font-size: clamp(1.45rem, 6vw, 2rem); }
.theme-head .dom { color: var(--muted); font-size: .92rem; font-weight: 700; }
.theme-head .head-row { display: flex; align-items: center; gap: .5rem; }
.theme-head.compact { padding: .7rem .9rem .8rem; margin-bottom: .7rem; }
.theme-head.compact h1 { font-size: 1.15rem; margin: .35rem 0 0; }
.theme-head.compact .icon { width: 32px; height: 32px; font-size: 1.05rem; border-radius: 10px; }
.theme-head .icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #fff; font-size: 1.35rem; box-shadow: var(--shadow); }
.tabs { position: sticky; top: 64px; z-index: 15; display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem; background: var(--surface-2); border: 1px solid var(--line); padding: .3rem; border-radius: 16px; margin: 0 0 1rem; }
.tab { text-align: center; padding: .65rem .3rem; border-radius: 12px; font-weight: 850; color: var(--muted); font-size: .98rem; border: 0; background: transparent; font-family: inherit; cursor: pointer; }
.tab:hover { text-decoration: none; color: var(--text); }
.tab.active { background: #fff; color: var(--subj); box-shadow: var(--shadow); }
.tab .ti { margin-right: .25rem; }

/* Resumo em blocos etiquetados */
.section-block { scroll-margin-top: 8.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.05rem 1.05rem; margin: 0 0 .9rem; box-shadow: var(--shadow); }
.section-block:target { box-shadow: 0 0 0 3px color-mix(in srgb, var(--subj) 35%, transparent), var(--shadow); }
.section-block h3 { margin: 0 0 .7rem; display: flex; gap: .55rem; align-items: flex-start; }
.section-block h3 .n { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--subj); color: #fff; font-size: .9rem; margin-top: -.05rem; }
.section-block ul { padding-left: 1.15rem; margin: .3rem 0; }
.section-block li { margin: .3rem 0; }
.section-block p, .section-block .txt { margin: .55rem 0; }
.blk { border-radius: var(--radius-sm); padding: .65rem .8rem .7rem; margin: .6rem 0; border-left: 5px solid; }
.blk > .lbl { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; padding: .1rem .5rem; border-radius: 999px; margin-bottom: .3rem; }
.blk.key { background: var(--brand-soft); border-color: var(--brand); }
.blk.key > .lbl { background: var(--brand); color: #fff; }
.blk.def { background: #eaf4ff; border-color: #1d4ed8; }
.blk.def > .lbl { background: #1d4ed8; color: #fff; }
.blk.ex { background: #f3f4f7; border-color: #6b7280; }
.blk.ex > .lbl { background: #4b5563; color: #fff; }
.blk.warn { background: var(--warn-soft); border-color: #d97706; }
.blk.warn > .lbl { background: #92400e; color: #fff; }
.blk.list { background: var(--subj-soft); border-color: var(--subj); }
.blk.list > .lbl { background: var(--subj); color: #fff; }
.blk.curio { background: #fdf2ff; border-color: #a21caf; }
.blk.curio > .lbl { background: #86198f; color: #fff; }
.blk.goal { background: var(--surface); border-color: var(--subj); }
.blk.goal > .lbl { background: var(--subj); color: #fff; }
.learn-list { list-style: none; padding: 0; margin: .3rem 0 0; }
.learn-list li { margin: .4rem 0; padding-left: 1.7rem; position: relative; }
.learn-list li::before { content: "✓"; position: absolute; left: 0; top: .05rem; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--subj); color: #fff; font-size: .75rem; font-weight: 900; display: grid; place-items: center; }
.glossary { display: grid; gap: .55rem; margin: 0; }
.glossary .g-item { background: #eaf4ff; border-left: 5px solid #1d4ed8; border-radius: var(--radius-sm); padding: .55rem .8rem; }
.glossary dt { font-weight: 900; color: #1e3a8a; }
.glossary dd { margin: .1rem 0 0; color: var(--text); }
.block-title { display: flex; align-items: center; gap: .5rem; }

/* Esquema */
.esquema { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .3rem 0 .3rem; }
.esquema-node { background: var(--subj-soft); border: 2px solid color-mix(in srgb, var(--subj) 40%, transparent); color: var(--text); border-radius: 14px; padding: .6rem .9rem; text-align: center; font-weight: 800; min-width: min(260px, 90%); white-space: pre-line; font-size: .95rem; }
.esquema-row { display: flex; gap: .5rem; justify-content: center; width: min(560px, 100%); }
.esquema-row .esquema-node { min-width: 0; flex: 1 1 0; }
/* Ecrãs estreitos: 3 nós lado a lado não cabiam a 360 px (palavras longas como «(indeterminado)»). Auditoria mat-8, 8/10/2026.
   A letra mais pequena só nas linhas com 3 nós (as de 1 ou 2 nós mantêm .95rem; verificação do revisor);
   nessas linhas o expoente sobe de .72em para .8em, para ficar com ≈ 10,9 px como antes (volumes: r^{3}). */
@media (max-width: 420px) { .esquema-row { gap: .35rem; } .esquema-row .esquema-node { padding: .5rem .35rem; overflow-wrap: anywhere; hyphens: auto; -webkit-hyphens: auto; } .esquema-row:has(> .esquema-node:nth-child(3)) .esquema-node { font-size: .85rem; } .esquema-row:has(> .esquema-node:nth-child(3)) .m-sup { font-size: .8em; } }
.esquema-arrow { color: var(--subj); font-size: 1.3rem; line-height: 1; font-weight: 900; }
.esquema-arrow-cols { display: flex; gap: .5rem; width: min(560px, 100%); }
.esquema-arrow-cols span { flex: 1 1 0; text-align: center; }

/* Teste */
.test-intro { text-align: center; }
.test-intro .big-emoji { font-size: 3rem; line-height: 1; }
.q-top { display: flex; justify-content: space-between; align-items: center; font-weight: 800; color: var(--muted); font-size: .95rem; }
.progress-bar { height: 12px; background: var(--line); border-radius: 999px; overflow: hidden; margin: .5rem 0 1rem; }
.progress-bar > span { display: block; height: 100%; background: var(--subj); border-radius: 999px; width: 0; transition: width .25s; }
.q-card .enunciado { font-size: 1.2rem; font-weight: 850; margin-bottom: 1rem; }
.options { display: grid; gap: .6rem; }
.option {
  display: flex; align-items: center; gap: .7rem; text-align: left; padding: .8rem .9rem; border-radius: 14px;
  border: 2px solid var(--line); background: #fff; color: var(--text); font: inherit; font-weight: 700; cursor: pointer;
  box-shadow: 0 2px 0 var(--line); min-height: 56px; width: 100%;
}
.option .letter { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); color: var(--muted); font-weight: 900; font-size: .9rem; }
.option .otext { flex: 1; }
.option .mark { flex: none; font-weight: 900; font-size: 1.1rem; }
.option:hover:not(:disabled) { border-color: var(--brand-2); }
.option:disabled { cursor: default; }
.option.selected { border-color: var(--brand); background: var(--brand-soft); }
.option.correct { border-color: var(--ok); background: var(--ok-soft); box-shadow: 0 2px 0 var(--ok-line); color: #0f3d20; }
.option.correct .letter { background: var(--ok); color: #fff; }
.option.correct .mark { color: var(--ok); }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); box-shadow: 0 2px 0 var(--bad-line); color: #5c1010; }
.option.wrong .letter { background: var(--bad); color: #fff; }
.option.wrong .mark { color: var(--bad); }
.option.dim { opacity: .6; }
#fb { scroll-margin-bottom: 110px; scroll-margin-top: 220px; }
.feedback { border-radius: 16px; padding: .85rem 1rem; margin-top: 1rem; border: 2px solid; }
.feedback .fb-title { font-weight: 900; font-size: 1.1rem; display: flex; align-items: center; gap: .45rem; }
.feedback p { margin: .35rem 0 0; }
.feedback.ok { background: var(--ok-soft); border-color: var(--ok-line); }
.feedback.ok .fb-title { color: var(--ok); }
.feedback.bad { background: var(--bad-soft); border-color: var(--bad-line); }
.feedback.bad .fb-title { color: var(--bad); }
.feedback a { display: inline-block; margin-top: .4rem; }
.sticky-next { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 1rem 0 .75rem; margin-top: .5rem; }
.sticky-next .btn { width: 100%; }
/* Antes de responder, a barra não fica fixa: não pode tapar (nem bloquear o toque em) opções no fundo do ecrã. */
.sticky-next.waiting { position: static; }
.sticky-next { pointer-events: none; }
.sticky-next .btn { pointer-events: auto; }

.score-card { text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 1.2rem 1rem; box-shadow: var(--shadow); }
.score-ring { --p: 0; --c: var(--ok); width: 150px; height: 150px; border-radius: 50%; margin: .25rem auto .5rem; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0); }
.score-ring > div { width: 118px; height: 118px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 2.2rem; font-weight: 900; }
.score-card.good .score-ring { --c: var(--ok); } .score-card.good .score-ring > div { color: var(--ok); }
.score-card.mid .score-ring { --c: #d97706; } .score-card.mid .score-ring > div { color: var(--warn); }
.score-card.low .score-ring { --c: var(--bad); } .score-card.low .score-ring > div { color: var(--bad); }
.score-card .score-txt { font-size: 1.15rem; font-weight: 850; margin: 0; }
.result-item { border-radius: 16px; padding: .9rem 1rem; margin: .7rem 0; border: 2px solid var(--line); background: #fff; }
.result-item.wrong { border-color: var(--bad-line); }
.result-item .tag { display: inline-block; font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; color: #fff; background: var(--bad); padding: .1rem .5rem; border-radius: 999px; }
.result-item .q { font-weight: 850; margin: .45rem 0; }
.result-item .ans { border-radius: 10px; padding: .45rem .65rem; margin: .35rem 0; font-weight: 700; }
.result-item .ans.yours { background: var(--bad-soft); color: #7f1d1d; }
.result-item .ans.right { background: var(--ok-soft); color: #14532d; }
.result-item .expl { color: var(--text); margin: .5rem 0; }
.result-item .expl::before { content: "💡 "; }

/* Evolução */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: .8rem .4rem; text-align: center; box-shadow: var(--shadow); }
.stat .n { font-size: 1.7rem; font-weight: 900; color: var(--brand); line-height: 1.1; }
.stat .l { color: var(--muted); font-size: .82rem; font-weight: 700; }
.achievements { display: flex; flex-wrap: wrap; gap: .45rem; }
.ach { padding: .4rem .7rem; border-radius: 999px; background: var(--warn-soft); border: 1px solid var(--warn-line); font-size: .86rem; font-weight: 800; color: #5b2a06; }
.ach.off { background: var(--surface-2); border-color: var(--line); color: var(--muted); filter: grayscale(1); }
.legend { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .86rem; font-weight: 700; color: var(--muted); margin: .25rem 0 .75rem; }
.legend .sw { display: inline-block; width: 16px; height: 16px; border-radius: 5px; vertical-align: -3px; margin-right: .3rem; border: 2px solid var(--line); }
.sw.none, .tile.none { background: #fff; border-color: #cfd4e2; }
.sw.started, .tile.started { background: #fde7b0; border-color: #e3a63a; }
.sw.mastered, .tile.mastered { background: #15803d; border-color: #166534; }
.mastery-group { margin: .9rem 0 1.1rem; }
.mastery-group h3 { font-size: 1rem; margin: 0 0 .5rem; display: flex; align-items: center; gap: .4rem; }
.mastery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .55rem; }
.tile { display: flex; flex-direction: column; justify-content: space-between; gap: .35rem; min-height: 96px; border: 2px solid; border-radius: 14px; padding: .6rem .7rem; color: var(--text); font-weight: 800; font-size: .9rem; line-height: 1.25; }
.tile:hover { text-decoration: none; transform: translateY(-1px); }
.tile .tile-state { font-size: .75rem; font-weight: 900; }
.tile.none .tile-state { color: var(--muted); }
.tile.started .tile-state { color: #7a3a04; }
.tile.mastered { color: #fff; }
.tile.mastered .tile-state { color: #fff; }
.theme-progress { margin: .7rem 0; padding: .85rem .9rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--subj); }
.chart-wrap { width: 100%; overflow-x: auto; }

.footer { text-align: center; color: var(--muted); font-size: .82rem; padding: 1.5rem 1rem 2rem; border-top: 1px solid var(--line); margin-top: 1.5rem; font-weight: 600; }

@media (max-width: 480px) {
  .btn-row { flex-direction: column; }
  .btn-row .btn { width: 100%; }
  .logo span.badge { display: none; }
}
@media (min-width: 720px) {
  .mastery-grid { grid-template-columns: repeat(4, 1fr); }
  .grid.disc { grid-template-columns: repeat(4, 1fr); }
  .disc-card:not(.disabled) { grid-column: span 2; }
  .hero { padding: 2.2rem 2rem; }
}
/* ---------- v3: gamificação leve ---------- */
.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; }
.small { font-size: .85rem; }
.small-btn { min-height: 44px; padding: .5rem .9rem; font-size: .95rem; }
.link-btn { background: none; border: 0; padding: .6rem .4rem; min-height: 44px; font: inherit; font-weight: 800; color: var(--brand); cursor: pointer; text-decoration: underline; }

/* Teste: pontos + trilho com boneco */
.test-bar { position: sticky; top: var(--test-bar-top, 122px); z-index: 12; background: var(--bg); margin: -.4rem -.25rem 0; padding: .4rem .25rem 0; }
.q-count strong { color: var(--text); }
.pts-pill { display: inline-flex; align-items: center; gap: .2rem; background: #fff4dc; color: #7a3a04; border: 2px solid #f5c86a; border-radius: 999px; padding: .2rem .7rem; font-weight: 900; font-size: .95rem; }
.pts-pill.bump { animation: bump .45s ease; }
@keyframes bump { 40% { transform: scale(1.18); } }
.trail { position: relative; height: 44px; margin: .35rem 0 .9rem; }
.trail-track { position: absolute; left: 0; right: 34px; top: 50%; transform: translateY(-50%); height: 12px; background: var(--line); border-radius: 999px; overflow: hidden; }
.trail-fill { display: block; height: 100%; background: var(--subj); border-radius: 999px; transition: width .45s ease; }
.walker { position: absolute; top: 50%; left: calc(14px + (100% - 62px) * var(--p, 0)); font-size: 1.6rem; line-height: 1; transform: translate(-50%, -58%); transition: left .45s ease; filter: drop-shadow(0 2px 2px rgba(0,0,0,.15)); }
.trail-goal { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #fff4dc; border: 2px solid #f5c86a; font-size: 1.05rem; }
.option { position: relative; }
.float-pts { position: absolute; right: 2.4rem; top: 50%; font-weight: 900; font-size: 1.25rem; color: #fff; background: #b45309; padding: .1rem .55rem; border-radius: 999px; pointer-events: none; animation: floatUp 1.3s ease-out forwards; box-shadow: 0 3px 10px rgba(180,83,9,.35); }
@keyframes floatUp { 0% { opacity: 0; transform: translateY(-30%) scale(.8); } 15% { opacity: 1; transform: translateY(-60%) scale(1.05); } 100% { opacity: 0; transform: translateY(-260%) scale(1); } }

/* Mascote */
.mascot-says { display: flex; align-items: flex-end; gap: .6rem; margin-top: 1rem; animation: slideIn .35s ease-out; }
.mascot-avatar { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; background: var(--brand-soft); border: 2px solid #c7cbff; }
.mascot-says .bubble { position: relative; background: #fff; border: 2px solid var(--line); border-radius: 18px 18px 18px 4px; padding: .55rem .8rem; font-weight: 800; box-shadow: var(--shadow); }
.mascot-says .bubble .who { display: block; font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }
.mascot-says.bad .bubble { border-color: #c7cbff; }
.mascot-says.ok .bubble { border-color: var(--ok-line); }
@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Semana com chama */
.week { text-align: center; }
.week-head { display: flex; align-items: center; justify-content: center; gap: .4rem; font-size: 1.15rem; }
.week-head .flame { font-size: 1.5rem; }
.week-strip { list-style: none; display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; padding: 0; margin: .7rem auto .5rem; max-width: 360px; }
.week-strip .day { display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.week-strip .dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 2px solid var(--line); font-size: 1.2rem; }
.week-strip .day.on .dot { background: #fff1e0; border-color: #f59e0b; }
.week-strip .day.today .dot { box-shadow: 0 0 0 3px var(--brand-2); }
.week-strip .day.future .dot { opacity: .55; border-style: dashed; }
.week-strip .dl { font-weight: 900; font-size: .85rem; color: var(--muted); }
.week-strip .day.today .dl { color: var(--brand); }
.week-goal { display: inline-block; margin: .3rem 0 0; background: #fff4dc; color: #5b2a06; border-radius: 999px; padding: .4rem .9rem; font-weight: 800; font-size: .95rem; }
.week.dark .week-head { color: #fff; }
.week.dark .dot { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.35); }
.week.dark .day.on .dot { background: rgba(245,158,11,.25); border-color: #fbbf24; }
.week.dark .day.today .dot { box-shadow: 0 0 0 3px #a5b4fc; }
.week.dark .dl { color: #c7d2fe; }
.week.dark .day.today .dl { color: #fff; }

/* Níveis */
.level-box { background: var(--surface-2); border-radius: 16px; padding: .8rem .9rem; text-align: left; }
.level-row { display: flex; align-items: center; gap: .7rem; margin-bottom: .55rem; line-height: 1.3; }
.level-badge { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.6rem; background: #fff; box-shadow: var(--shadow); }
.level-bar { height: 14px; background: #dfe3ee; border-radius: 999px; overflow: hidden; margin-bottom: .35rem; }
.level-bar > span { display: block; height: 100%; background: linear-gradient(90deg, #f59e0b, #d97706); border-radius: 999px; transition: width 1s ease; }

/* Celebração */
body.no-scroll { overflow: hidden; }
.celebration { position: fixed; inset: 0; z-index: 100; background: radial-gradient(circle at 50% 30%, #312e81 0%, #1e1b4b 60%, #14132b 100%); color: #fff; display: flex; overflow-y: auto; animation: fadeIn .25s ease; }
.celeb-inner { width: min(520px, 100%); margin: 0 auto; padding: 1rem 1.2rem 1.5rem; display: flex; flex-direction: column; min-height: 100%; }
.celeb-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.celeb-dots { display: flex; gap: .35rem; }
.celeb-dots span { width: 26px; height: 6px; border-radius: 999px; background: rgba(255,255,255,.25); }
.celeb-dots span.on { background: #fbbf24; }
.celeb-skip { background: transparent; border: 2px solid rgba(255,255,255,.4); color: #fff; font: inherit; font-weight: 800; border-radius: 999px; padding: .45rem 1rem; min-height: 44px; cursor: pointer; }
.celeb-skip:hover { background: rgba(255,255,255,.1); }
.celeb-step { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1.5rem 0; animation: stepIn .4s ease-out; }
.celeb-big { font-size: 5rem; line-height: 1; margin-bottom: .5rem; }
.celeb-big.pop { animation: pop .6s cubic-bezier(.2,1.6,.4,1); }
.celeb-title { color: #fff; font-size: clamp(1.7rem, 7vw, 2.3rem); margin: .3rem 0 .4rem; outline: none; }
.celeb-score { font-size: 1.25rem; font-weight: 900; margin: 0 0 .5rem; color: #fde68a; }
.celeb-sub { color: #e0e7ff; font-size: 1.05rem; max-width: 26rem; margin: .3rem 0 .8rem; }
.celeb-total { background: rgba(255,255,255,.12); border-radius: 999px; padding: .5rem 1.1rem; font-size: 1.1rem; }
.celeb-total strong { color: #fde68a; }
.record-badge { background: #fbbf24; color: #3b1d02; font-weight: 900; border-radius: 999px; padding: .45rem 1rem; margin: .3rem 0 .4rem; animation: pop .6s .2s cubic-bezier(.2,1.6,.4,1) both; }
.celeb-level { width: 100%; max-width: 380px; }
.celeb-level .level-box { color: var(--text); }
.celeb-next { background: #fff; color: #312e81; box-shadow: 0 3px 0 #a5b4fc; margin: 0; }
.celeb-next:active { box-shadow: 0 1px 0 #a5b4fc; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes stepIn { from { opacity: 0; transform: translateY(14px); } }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* Resumo: alternar Ver tudo / Modo cartões */
.view-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: .3rem; margin-bottom: .9rem; scroll-margin-top: 8.5rem; }
.vt { min-height: 46px; border: 0; border-radius: 11px; background: transparent; font: inherit; font-weight: 850; color: var(--muted); cursor: pointer; }
.vt[aria-pressed="true"] { background: #fff; color: var(--subj); box-shadow: var(--shadow); }
.cards-hint { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; background: var(--brand-soft); border: 1px solid #c7cbff; border-radius: 16px; padding: .7rem .9rem; font-weight: 700; }
.cards-hint > span:first-child { font-size: 1.8rem; }
.cards-hint > span:nth-child(2) { flex: 1; min-width: 12rem; }
.card-progress { display: flex; align-items: center; gap: .7rem; margin-bottom: .6rem; }
.cp-txt { flex: none; font-weight: 850; color: var(--muted); font-size: .92rem; }
.cp-bar { flex: 1; height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.cp-bar > span { display: block; height: 100%; background: var(--subj); border-radius: 999px; transition: width .25s; }
.study-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 1.2rem 1.15rem; box-shadow: var(--shadow-lg); min-height: 340px; font-size: 1.08rem; animation: stepIn .3s ease-out; touch-action: pan-y; }
.study-card .card-sec { display: flex; gap: .55rem; align-items: center; font-weight: 900; font-size: 1.05rem; margin-bottom: .7rem; }
.study-card .card-sec .n { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--subj); color: #fff; font-size: .9rem; }
.study-card .blk { margin: .4rem 0; }
.study-card ul { padding-left: 1.15rem; }
.study-card > .lbl, .quiz-card > .lbl { display: inline-flex; font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; padding: .1rem .5rem; border-radius: 999px; margin-bottom: .6rem; color: #fff; }
.goal-lbl { background: var(--subj); }
.kw-lbl { background: #1d4ed8; }
.quiz-lbl { background: #b45309; }
.study-card.quiz { border: 2px solid #f5c86a; background: #fffdf7; }
.quiz-card .enunciado { font-size: 1.15rem; font-weight: 850; margin-bottom: .9rem; }
.card-esquema .block-title { margin-top: 0; }
.end-card { text-align: center; }
.end-card .big-emoji { font-size: 3.5rem; }
.end-card .btn.secondary { width: 100%; }
.card-nav { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .9rem; }
.card-nav .btn { width: 100%; }
.swipe-hint { text-align: center; font-size: .85rem; margin: .6rem 0 0; }

/* Evolução: alcunha e ranking pessoal */
.prog-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .8rem; }
.prog-head h1 { margin-bottom: .2rem; }
.nick-line { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem .4rem; }
.nick-pill { background: var(--brand-soft); color: var(--text); border-radius: 999px; padding: .4rem .9rem; font-weight: 700; }
.nick-pill strong { color: var(--brand); }
.nick-label { font-weight: 850; display: block; margin-bottom: .3rem; }
.nick-row { display: flex; gap: .5rem; }
.nick-row input { flex: 1; min-width: 0; min-height: 50px; font: inherit; font-weight: 700; padding: .6rem .8rem; border: 2px solid #9aa2b8; border-radius: 12px; color: var(--text); background: #fff; }
.nick-row input:focus { border-color: var(--brand); outline: 3px solid var(--brand-2); outline-offset: 1px; }
.nick-tip { background: var(--warn-soft); color: #5b2a06; border-radius: 12px; padding: .5rem .75rem; font-weight: 700; font-size: .92rem; margin: .7rem 0 0; }
.panel .sub-h { font-size: 1.02rem; margin: 1.3rem 0 .55rem; }
.rank-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.rank-item { display: flex; align-items: center; gap: .6rem; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--subj); border-radius: 12px; padding: .55rem .75rem; min-height: 52px; }
.rank-pos { flex: none; width: 2rem; text-align: center; font-weight: 900; font-size: 1.2rem; color: var(--muted); }
.rank-name { flex: 1; min-width: 0; color: var(--text); font-weight: 800; line-height: 1.3; }
.rank-score { flex: none; font-weight: 900; color: var(--subj); font-size: 1.1rem; }
.rec-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.rec-list li { display: flex; gap: .5rem; align-items: flex-start; background: #fff9eb; border-radius: 12px; padding: .5rem .7rem; line-height: 1.35; }

@media (min-width: 720px) {
  .celeb-inner { padding-top: 2rem; }
}
@media (min-width: 720px) and (min-height: 700px) {
  .celeb-inner { min-height: 0; height: min(100%, 640px); margin: auto; }
  .study-card { padding: 1.6rem 1.8rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .celebration, .celeb-step, .celeb-big.pop, .record-badge, .mascot-says, .study-card, .pts-pill.bump { animation: none !important; }
  .float-pts { animation: fadeOnly 1.3s ease-out forwards !important; }
  @keyframes fadeOnly { 0%, 60% { opacity: 1; transform: translateY(-60%); } 100% { opacity: 0; transform: translateY(-60%); } }
}

/* ---------- Matemática: frações, potências e raízes (js/app.js → mathMarkup) ---------- */
.m-frac { display: inline-flex; flex-direction: column; align-items: stretch; vertical-align: middle; text-align: center; font-size: .9em; line-height: 1.12; margin: .1em .12em; }
.m-num { padding: 0 .18em .06em; border-bottom: max(1.5px, .08em) solid currentColor; }
.m-den { padding: .06em .18em 0; }
.m-sup { font-size: .72em; line-height: 0; vertical-align: .55em; white-space: nowrap; }
.m-nw { white-space: nowrap; }
.m-rt { white-space: nowrap; display: inline-block; }
.m-rs { font-family: "DejaVu Sans", "Noto Sans Math", "Segoe UI Symbol", system-ui, sans-serif; font-weight: 400; }
.m-rad { border-top: max(1.5px, .08em) solid currentColor; padding: .05em .12em 0; margin-left: -.02em; }
.m-ri { font-size: .6em; vertical-align: .95em; margin-right: -.45em; font-weight: 800; }
.enunciado .m-frac, .otext .m-frac { font-size: .95em; }
.erro-freq { color: var(--warn); }
.feedback p, .result-item .expl { overflow-wrap: anywhere; }
.unit-label { margin: 1.1rem 0 .45rem; font-weight: 900; font-size: 1rem; color: var(--text); display: flex; align-items: center; gap: .5rem; }
.unit-label .unit-n { background: var(--subj-soft, #f1eaff); color: var(--subj, #6d28d9); border-radius: 999px; padding: .15rem .6rem; font-size: .85rem; }
#temas .unit-label:first-child { margin-top: .2rem; }
.tema-card .sub.fichas { font-weight: 800; }

/* Matemática: vetores e figuras de geometria (SVG gerado pelo gerador) */
.m-vec { display: inline-block; white-space: nowrap; }
.m-vec > span { display: inline-block; position: relative; padding-top: .38em; line-height: 1; font-style: italic; }
.m-vec > span::before { content: ""; position: absolute; left: .04em; right: .16em; top: .17em; border-top: .085em solid currentColor; }
.m-vec > span::after { content: ""; position: absolute; right: 0; top: .04em; border-left: .32em solid currentColor; border-top: .17em solid transparent; border-bottom: .17em solid transparent; }
figure.fig, figure.q-fig { margin: .6rem auto; text-align: center; }
figure.fig svg, figure.q-fig svg { width: 100%; height: auto; max-width: 420px; display: block; margin: 0 auto; background: #fff; border-radius: 10px; }
figure.q-fig svg { max-width: 360px; }
figure.fig figcaption { font-size: .85rem; color: var(--muted, #555); margin-top: .25rem; }


/* Teste: botão «Mostrar texto» (secção do resumo) */
.study-text { margin: 0 0 1rem; }
.study-text-btn { width: 100%; font-size: .98rem; min-height: 46px; }
.study-text-panel {
  margin-top: .7rem; padding: .85rem 1rem; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  max-height: min(50vh, 420px); overflow: auto; -webkit-overflow-scrolling: touch;
}
.study-text-title { font-weight: 900; font-size: 1.02rem; margin: 0 0 .55rem; color: var(--subj, var(--brand)); }
.study-text-panel .txt { margin: 0 0 .7rem; font-weight: 600; line-height: 1.45; }
.study-text-panel .txt:last-child { margin-bottom: 0; }

/* ---------- Leitura no telemóvel (8.º ano, out. 2026) ---------- */
/* alvos de toque ≥ 44 px: menu do topo e «Rever no resumo» */
.nav a { display: inline-flex; align-items: center; min-height: 44px; }
.result-item a[href*="tema.html"] { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .35rem; margin-left: -.35rem; font-weight: 800; }
/* texto dos esquemas um pouco maior */
.esquema-node { font-size: 1.02rem; }
/* ronda 2 (m6): nós de 2 por linha voltam aos 15,2 px, que cabiam; a regra dos 3 nós vem a seguir e prevalece */
@media (max-width: 420px) { .esquema-row:has(> .esquema-node:nth-child(2)) .esquema-node { font-size: .95rem; } }
/* com 15,2 px, «proporcionalidade» (130,9 px) ainda não cabia nos 126,8 px da caixa a 360 px (já partia no publicado): menos margem lateral só nas linhas de 2 nós */
@media (max-width: 420px) { .esquema-row:has(> .esquema-node:nth-child(2)):not(:has(> .esquema-node:nth-child(3))) .esquema-node { padding-left: .15rem; padding-right: .15rem; } }
@media (max-width: 420px) { .esquema-row:has(> .esquema-node:nth-child(3)) .esquema-node { font-size: .9rem; } }
/* índices de raiz e expoentes nunca abaixo de 12 px */
.m-sup { font-size: max(12px, .72em); }
.m-ri { font-size: max(12px, .6em); margin-right: -.3em; }
@media (max-width: 420px) { .esquema-row:has(> .esquema-node:nth-child(3)) .m-sup { font-size: max(12px, .8em); } }
/* cartões divididos: a continuação de um bloco não repete a etiqueta */
.study-card .blk.cont { padding-top: .6rem; }
/* etiqueta «matéria importante e difícil» */
.badge-dificil { display: inline-block; font-size: .8rem; font-weight: 900; line-height: 1.35; color: #7c2d12; background: #ffedd5; border: 1.5px solid #f97316; border-radius: 999px; padding: .12rem .6rem; margin: 0 .25rem .3rem 0; white-space: nowrap; vertical-align: .08em; letter-spacing: .01em; }
.q-badge { margin: 0 0 .35rem; }
.blk .badge-dificil, .txt .badge-dificil { margin-right: .35rem; }
/* etiquetas pequenas (blocos, cartões, «Lia») nunca abaixo de 12 px */
.blk > .lbl, .study-card > .lbl, .quiz-card > .lbl, .mascot-says .bubble .who { font-size: max(12px, .72rem); }
.pill { font-size: max(12px, .74rem); }
.card-esquema.cont { padding-top: .2rem; }
/* ronda 2: contraste da etiqueta de Espanhol (6,45:1) e «✗ INCORRETA» dos resultados ≥ 12 px */
.subj-espanhol .pill.subj {color:#92400e}
.result-item .tag {font-size:max(12px,.72rem)}
/* ronda 2: «pergunta rápida» com figura (simetrias e frisos, 1072 px) cabe num ecrã de 360 px; o texto não muda
   (opções a 16 px, menos margens; só os desenhos sem letras — os motivos dos frisos — ficam com 100 px de altura) */
@media (max-width: 420px) {
  .study-card.quiz:has(.q-fig) { padding: 1rem .8rem; }
  .quiz-card:has(.q-fig) .enunciado { margin-bottom: .4rem; font-size: 1rem; }
  .quiz-card:has(.q-fig) .q-fig { margin: .3rem auto; }
  .quiz-card .q-fig svg:not(:has(text)) { max-height: 100px; width: auto; height: auto; }
  .quiz-card:has(.q-fig) .options { gap: .45rem; }
  .quiz-card:has(.q-fig) .option { padding: .5rem .55rem; gap: .5rem; min-height: 48px; font-size: 1rem; }
  .quiz-card:has(.q-fig) .option .letter { width: 26px; height: 26px; }
}

/* ---------- App (nov. 2026): progresso guardado + estudar sem internet ---------- */
.nav-ico { margin-right: .3rem; }
@media (max-width: 400px) {
  .site-header .inner { width: calc(100% - 1.2rem); gap: .4rem; }
  .logo { font-size: 1.02rem; gap: .35rem; }
  .logo .logo-mark { width: 30px; height: 30px; font-size: .95rem; }
  .nav { gap: .15rem; }
  .nav a { padding: .4rem .5rem; font-size: .86rem; }
  .nav-ico { display: none; }
}
/* aviso «Sem internet» (só aparece quando não há ligação) */
.net-banner { display: none; height: 28px; background: #1c2233; color: #fff; font-size: .78rem; font-weight: 800; text-align: center; padding: 0 .6rem; line-height: 28px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.is-offline .net-banner { display: block; }
/* com o aviso, o cabeçalho fica 28 px mais alto: descer o que está «colado» por baixo dele */
html.is-offline .tabs { top: 92px; }
html.is-offline .test-bar { top: calc(var(--test-bar-top, 122px) + 28px); }
html.is-offline .step-label { scroll-margin-top: calc(4.5rem + 28px); }
html.is-offline .section-block, html.is-offline .view-toggle { scroll-margin-top: calc(8.5rem + 28px); }
@media (max-width: 370px) { .net-banner { font-size: .72rem; } }

/* barras de progresso */
.gbar { display: grid; gap: .25rem; width: 100%; }
.gbar-label { font-weight: 850; font-size: .95rem; color: var(--text); }
.gbar-track { display: block; height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.gbar-fill { display: block; height: 100%; min-width: 0; border-radius: 999px; background: var(--subj, var(--brand)); transition: width .4s ease; }
.gbar-txt { font-size: .82rem; font-weight: 750; color: var(--muted); }
.gbar.compact .gbar-track { height: 7px; background: rgba(28,34,51,.12); }
.gbar.compact .gbar-txt { font-size: .78rem; }
@media (prefers-reduced-motion: reduce) { .gbar-fill { transition: none; } }

.my-progress-card { display: grid; gap: .45rem; color: var(--text); margin-top: 0; }
.my-progress-card:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
.my-progress-card .mp-title { font-weight: 900; font-size: 1.05rem; }
.my-progress-card .mp-go { font-size: .88rem; color: var(--brand); font-weight: 850; }

.ano-prog { display: flex; align-items: center; gap: .35rem; margin-top: .45rem; padding: 0 .3rem; }
.ano-prog .gbar-track { flex: 1; height: 6px; }
.ano-prog .gbar-fill { background: var(--brand); }
.ano-prog-txt { font-size: .74rem; font-weight: 850; color: var(--muted); }
.ano-card.selected .ano-prog .gbar-track { background: rgba(255,255,255,.35); }
.ano-card.selected .ano-prog .gbar-fill { background: #fff; }
.ano-card.selected .ano-prog-txt { color: #fff; }

.disc-card .gbar { margin-top: .3rem; max-width: 22rem; }

/* selos nos temas */
.tema-flags { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: .35rem; }
.tema-flags:empty { display: none; }
.tema-card .tema-flags .state { margin-top: 0; }
.seal-done { display: inline-block; font-size: .78rem; font-weight: 900; color: var(--ok); background: #fff; border: 1.5px solid var(--ok-line); padding: .08rem .5rem; border-radius: 999px; white-space: nowrap; }
.flag-lido, .flag-offline { font-size: .74rem; font-weight: 800; color: var(--muted); white-space: nowrap; }
.tema-card.needs-net { opacity: .55; }
.tema-card.needs-net .tema-flags::after { content: "Precisa de internet"; font-size: .74rem; font-weight: 800; color: var(--muted); }

.disc-summary { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--subj); border-radius: var(--radius); padding: .9rem 1rem; margin: 0 0 .9rem; box-shadow: var(--shadow); display: grid; gap: .7rem; }

/* controlo «Guardar offline» */
.offline-ctl { display: grid; gap: .3rem; }
.offline-ctl .oc-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; }
.offline-ctl .oc-txt { margin: 0; font-size: .84rem; color: var(--muted); font-weight: 650; }
.offline-ctl .oc-txt:empty { display: none; }
.offline-ctl .oc-msg { margin: 0; font-size: .84rem; font-weight: 800; color: var(--ok); }
.offline-ctl .oc-state.ok { font-weight: 900; color: var(--ok); font-size: .92rem; }
.offline-ctl .btn[disabled] { opacity: .55; cursor: not-allowed; }
.oc-progress { display: grid; gap: .35rem; }
.oc-ptxt { display: flex; justify-content: space-between; font-weight: 800; font-size: .9rem; }
.oc-bar { width: 100%; height: 12px; accent-color: var(--ok); }
.link-btn { min-height: 44px; }

/* painel O meu progresso */
.ov-year { border-top: 1px solid var(--line); padding: .55rem 0; }
.ov-year > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .6rem; min-height: 44px; }
.ov-year > summary::-webkit-details-marker { display: none; }
.ov-year > summary::after { content: "›"; font-weight: 900; color: var(--muted); font-size: 1.2rem; transition: transform .2s; flex: none; }
.ov-year[open] > summary::after { transform: rotate(90deg); }
.ov-discs { display: grid; gap: .55rem; padding: .4rem 0 .3rem .2rem; }
@media (min-width: 640px) { .ov-discs { grid-template-columns: 1fr 1fr; gap: .6rem 1.2rem; } }
.ov-disc .gbar-label { font-size: .88rem; }
.recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.recent-list li { display: grid; grid-template-columns: 1fr auto; gap: 0 .6rem; align-items: center; padding: .55rem .7rem; border-radius: 12px; background: var(--subj-soft); border-left: 4px solid var(--subj); }
.recent-list li a { color: var(--text); font-weight: 850; line-height: 1.25; }
.recent-list li .muted { grid-column: 1; }
.recent-list li .seal-done { grid-column: 2; grid-row: 1 / span 2; }

.off-year { border-top: 1px solid var(--line); padding: .3rem 0; }
.off-year > summary { cursor: pointer; font-weight: 850; min-height: 44px; display: flex; align-items: center; gap: .4rem; }
.off-disc { display: grid; gap: .3rem; padding: .55rem 0 .55rem .7rem; border-left: 4px solid var(--subj); margin: .35rem 0; }
.off-name { font-weight: 800; }
.offline-total { margin: 0 0 .4rem; font-weight: 700; }

.btn.danger { background: var(--bad); box-shadow: 0 3px 0 #7f1414; }
.danger-zone { border-color: var(--bad-line); }
.confirm-dialog { border: 0; border-radius: var(--radius); padding: 1.2rem; width: min(26rem, calc(100% - 2rem)); box-shadow: var(--shadow-lg); color: var(--text); }
.confirm-dialog::backdrop { background: rgba(28,34,51,.45); }
.friendly-error .btn-row { justify-content: center; }

/* ---------- Rodapé com ligações + páginas legais (nov. 2026) ---------- */
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 .5rem; align-items: center; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .3rem; font-weight: 800; }
.footer-note { margin: .2rem 0 0; }
.legal { max-width: 46rem; }
.legal .updated { font-size: .88rem; font-weight: 700; color: var(--muted); margin: 0 0 1rem; }
.legal .panel h2 { font-size: 1.12rem; margin: 0 0 .5rem; }
.legal .panel p, .legal .panel li { line-height: 1.6; }
.legal .panel p:last-child, .legal .panel ul:last-child { margin-bottom: 0; }
.legal ul { padding-left: 1.2rem; margin: .4rem 0 .8rem; }
.legal li { margin: .25rem 0; }
.legal .summary-box { background: var(--ok-soft); border-color: var(--ok-line); }
.legal .summary-box ul { list-style: none; padding: 0; }
.legal .summary-box li { padding-left: 1.6rem; position: relative; }
.legal .summary-box li::before { content: "✓"; position: absolute; left: .2rem; color: var(--ok); font-weight: 900; }
.legal a { overflow-wrap: anywhere; }
.contact-card { text-align: center; }
.contact-card .btn { margin: .6rem 0 .3rem; }
.faq details { border-top: 1px solid var(--line); padding: .2rem 0; }
.faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 850; min-height: 44px; display: flex; align-items: center; gap: .5rem; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "›"; margin-left: auto; font-weight: 900; color: var(--muted); font-size: 1.2rem; transition: transform .2s; flex: none; }
.faq details[open] summary::after { transform: rotate(90deg); }
.faq details > div { padding: 0 0 .6rem; }
.faq details > div p { margin: .3rem 0 .5rem; }
.contact-card .big-emoji { font-size: 2.6rem; line-height: 1; }
