/* PAU Interactiva */
:root {
  --fons: #f6f7fb; --paper: #fff; --tinta: #1c2333; --silenciat: #5b6480;
  --primari: #4338ca; --primari-clar: #eef2ff; --vora: #e3e6f0;
  --be: #16a34a; --mig: #d97706; --mal: #dc2626;
  --ombra: 0 1px 3px rgba(28,35,51,.08), 0 4px 16px rgba(28,35,51,.06);
  --radi: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--fons); color: var(--tinta);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
h1, h2, h3 { line-height: 1.25; }
a { color: var(--primari); }

header {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .9rem 1.2rem; background: var(--paper); border-bottom: 1px solid var(--vora);
}
.marca { display: flex; gap: .7rem; align-items: center; }
.logo { font-size: 2rem; }
header h1 { margin: 0; font-size: 1.25rem; }
.sub { margin: 0; color: var(--silenciat); font-size: .8rem; }
.perfil-caixa { display: flex; gap: .4rem; align-items: center; flex-shrink: 0; }
.perfil-caixa select, .perfil-caixa button {
  padding: .45rem .6rem; border: 1px solid var(--vora); border-radius: 8px;
  background: var(--paper); font-size: .9rem; cursor: pointer;
}
#perfil-grup { display: flex; gap: .3rem; align-items: center; }
#perfil-grup.ocult { display: none !important; }
.perfil-icona { font-size: 1.05rem; }
#perfil-sel { max-width: 9rem; text-overflow: ellipsis; }
#compte-btn.compte { background: var(--primari-clar); color: var(--primari); font-weight: 600; border-color: transparent; }
#compte-btn.connectat { background: var(--be-clar, var(--primari-clar)); }

nav#pestanyes {
  display: flex; gap: .3rem; padding: .5rem 1rem; background: var(--paper);
  border-bottom: 1px solid var(--vora); overflow-x: auto; position: sticky; top: 0; z-index: 20;
}
/* sub-pestanyes del grup actiu (només si en té més d'una) */
#subpestanyes {
  padding: .55rem 1rem; background: var(--fons); border-bottom: 1px solid var(--vora);
  position: sticky; top: 3rem; z-index: 19; margin: 0; overflow-x: auto; white-space: nowrap;
}
#subpestanyes .chip { font-size: .88rem; }
nav#pestanyes button {
  border: 0; background: none; padding: .55rem .9rem; border-radius: 999px;
  font-size: .95rem; cursor: pointer; white-space: nowrap; color: var(--silenciat);
}
nav#pestanyes button.actiu { background: var(--primari-clar); color: var(--primari); font-weight: 600; }

main { max-width: 1000px; margin: 0 auto; padding: 1.2rem 1rem 4rem; }
.sec { display: none; }
.sec.activa { display: block; }
.ocult { display: none !important; }
.silenciat { color: var(--silenciat); font-size: .88rem; }

.camp { margin: .9rem 0; }
.camp > label { display: block; font-weight: 600; margin-bottom: .35rem; }
input, select {
  font: inherit; padding: .5rem .7rem; border: 1px solid var(--vora);
  border-radius: 8px; background: var(--paper); color: var(--tinta);
}
button { font: inherit; cursor: pointer; }
button.primari {
  background: var(--primari); color: #fff; border: 0; border-radius: 10px;
  padding: .6rem 1.1rem; font-weight: 600;
}
button.primari:hover { filter: brightness(1.1); }
button.gran { font-size: 1.05rem; padding: .8rem 1.4rem; }
button.lleuger, a.lleuger {
  background: var(--paper); border: 1px solid var(--vora); border-radius: 10px;
  padding: .55rem .9rem; color: var(--tinta); text-decoration: none; display: inline-block;
}

.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  border: 1.5px solid var(--vora); background: var(--paper); border-radius: 999px;
  padding: .35rem .85rem; font-size: .9rem; cursor: pointer; user-select: none;
}
.chip.actiu { background: var(--primari); border-color: var(--primari); color: #fff; }

/* pregunta */
.pregunta-cap { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .7rem; }
.etiquetes { display: flex; gap: .35rem; flex-wrap: wrap; }
.etiqueta {
  background: var(--primari-clar); color: var(--primari); border-radius: 6px;
  font-size: .78rem; padding: .15rem .5rem; font-weight: 600;
}
.etiqueta.gris { background: #eef0f6; color: var(--silenciat); }
.etiqueta.groc { background: #fef3c7; color: #92400e; }
.etiqueta.verd { background: #dcfce7; color: #166534; }
.etiqueta.roig { background: #fee2e2; color: #991b1b; }
.imatges { display: flex; flex-direction: column; gap: .4rem; }
.imatges img {
  width: 100%; height: auto; background: #fff; border: 1px solid var(--vora);
  border-radius: var(--radi); box-shadow: var(--ombra); display: block;
}
.imatges.solucio img { border-left: 5px solid var(--be); }
.accions-pregunta { display: flex; gap: .6rem; margin: .9rem 0; flex-wrap: wrap; align-items: center; }
.valora {
  background: var(--paper); border: 1px solid var(--vora); border-radius: var(--radi);
  padding: .9rem 1.1rem; display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  box-shadow: var(--ombra); margin-top: 1rem;
}
.valora p { margin: 0; font-weight: 600; }
.valora button { border: 2px solid transparent; border-radius: 10px; padding: .55rem 1rem; font-weight: 600; background: #f2f4f9; }
.valora .v-be:hover { border-color: var(--be); } .valora .v-mig:hover { border-color: var(--mig); } .valora .v-mal:hover { border-color: var(--mal); }
/* per què surt aquesta pregunta i d'on ve */
.perque {
  font-size: .88rem; color: var(--silenciat); background: var(--primari-clar);
  border-radius: 8px; padding: .45rem .75rem; margin-bottom: .6rem;
}
.origen { margin-top: 1rem; font-size: .85rem; color: var(--silenciat); }
.origen b { color: var(--tinta); }
.origen a { text-decoration: none; }
.tecles { margin-top: .8rem; font-size: .78rem; }
kbd {
  background: var(--paper); border: 1px solid var(--vora); border-bottom-width: 2px;
  border-radius: 5px; padding: .05rem .35rem; font-family: inherit; font-size: .9em; margin: 0 .1rem;
}
/* transicions suaus entre preguntes */
#practica-pregunta { animation: entra .28s cubic-bezier(.2,.7,.3,1); }
@keyframes entra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.imatges img { min-height: 60px; }

/* pràctica de recuperació */
.intent {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radi);
  padding: .8rem 1rem; margin-top: .8rem;
}
.intent p { margin: .3rem 0; font-size: .94rem; }
.cronometre { font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 700; color: var(--mig); margin: .4rem 0; }
.pregunta-confianca { margin-top: .7rem !important; }
.confianca .chip { font-size: .88rem; }
.avis {
  background: var(--paper); border-left: 5px solid var(--mig); border-radius: 10px;
  padding: .7rem .9rem; margin-top: .8rem; font-size: .93rem; box-shadow: var(--ombra);
}
.recursos-mini { margin-top: 1rem; font-size: .92rem; }
.recursos-mini a { margin-right: .8rem; }

/* explorar */
.filtres { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.filtres input[type=search] { flex: 1; min-width: 220px; }
.opcio-filtre { display: flex; align-items: center; gap: .35rem; font-size: .88rem; color: var(--silenciat); cursor: pointer; }
.opcio-filtre input { width: auto; }
.targetes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .8rem; }
.targeta {
  background: var(--paper); border: 1px solid var(--vora); border-radius: var(--radi);
  padding: .85rem .95rem; box-shadow: var(--ombra); cursor: pointer; transition: transform .08s;
}
.targeta:hover { transform: translateY(-2px); }
.targeta .text { font-size: .88rem; color: var(--tinta); margin: .5rem 0 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.targeta.feta { outline: 2px solid var(--be); }

/* temes */
.tema-bloc {
  background: var(--paper); border: 1px solid var(--vora); border-radius: var(--radi);
  margin: .7rem 0; box-shadow: var(--ombra); overflow: hidden;
}
.tema-cap { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; cursor: pointer; }
.tema-cap h3 { margin: 0; font-size: 1.02rem; flex: 1; }
.barra-fons { background: #edeff5; border-radius: 99px; height: 10px; width: 160px; overflow: hidden; }
.barra { height: 100%; background: var(--primari); border-radius: 99px; }
.tema-pct { font-weight: 700; color: var(--primari); min-width: 3.2rem; text-align: right; }
.tema-cos { padding: 0 1rem 1rem; border-top: 1px dashed var(--vora); display: none; }
.tema-bloc.obert .tema-cos { display: block; }
.tema-cos h4 { margin: .9rem 0 .3rem; font-size: .9rem; color: var(--silenciat); text-transform: uppercase; letter-spacing: .03em; }
.recursos .targeta { cursor: default; }
.recursos .targeta a { font-weight: 600; }

/* pla */
#pla-resultat { margin-top: 1.4rem; }
.setmana { margin: 1rem 0; }
.setmana h4 { margin: .3rem 0 .5rem; }
.sessions { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .6rem; }
.sessio {
  background: var(--paper); border: 1px solid var(--vora); border-left: 5px solid var(--primari);
  border-radius: 10px; padding: .6rem .8rem; font-size: .92rem; box-shadow: var(--ombra);
}
.sessio.feta { opacity: .55; border-left-color: var(--be); }
.sessio .dia { font-weight: 700; font-size: .8rem; color: var(--silenciat); }
.sessio label { display: flex; gap: .4rem; align-items: baseline; cursor: pointer; margin-top: .3rem; }
.sessio .accions { margin-top: .35rem; }
.sessio .accions a { font-size: .82rem; margin-right: .6rem; }

/* progrés */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .7rem; margin-bottom: 1.2rem; }
.kpi { background: var(--paper); border: 1px solid var(--vora); border-radius: var(--radi); padding: .8rem; text-align: center; box-shadow: var(--ombra); }
.kpi b { display: block; font-size: 1.6rem; color: var(--primari); }
.prog-tema { display: flex; align-items: center; gap: .7rem; margin: .45rem 0; }
.prog-tema span.nom { flex: 1; font-size: .93rem; }
.prog-barra { flex: 2; background: #edeff5; height: 14px; border-radius: 99px; overflow: hidden; display: flex; }
.prog-barra i { height: 100%; display: block; }
.prog-barra .pb { background: var(--be); } .prog-barra .pm { background: var(--mig); } .prog-barra .px { background: var(--mal); }

/* modal */
#modal { position: fixed; inset: 0; background: rgba(20,24,38,.55); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 2rem 1rem; overflow-y: auto; }
#modal-cos { background: var(--fons); border-radius: 14px; max-width: 900px; width: 100%; padding: 1.2rem; position: relative; }
#modal-tanca { position: absolute; top: .6rem; right: .7rem; border: 0; background: var(--paper); border-radius: 99px; width: 2rem; height: 2rem; font-size: 1rem; box-shadow: var(--ombra); }

footer { max-width: 1000px; margin: 0 auto; padding: 1rem; color: var(--silenciat); font-size: .8rem; border-top: 1px solid var(--vora); }

/* notes PAU */
.taula-embolcall { overflow-x: auto; }
.taula-notes { border-collapse: collapse; width: 100%; background: var(--paper); border-radius: var(--radi); box-shadow: var(--ombra); font-size: .93rem; }
.taula-notes th, .taula-notes td { padding: .5rem .8rem; border-bottom: 1px solid var(--vora); text-align: left; }
.taula-notes th { background: var(--primari-clar); color: var(--primari); }
.taula-notes td.alt { color: var(--be); font-weight: 700; }
.taula-notes td.baix { color: var(--mal); font-weight: 700; }
.analisi { background: var(--paper); border: 1px solid var(--vora); border-radius: var(--radi); padding: .9rem 1.1rem; box-shadow: var(--ombra); }

/* pantalla d'inici */
.avui-graella { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; margin: 1rem 0; }
.avui-anell-caixa { flex: 0 0 132px; }
.anell { width: 132px; height: 132px; transform: rotate(-90deg); }
.anell-fons { fill: none; stroke: #e6e9f2; stroke-width: 11; }
.anell-progres {
  fill: none; stroke: var(--primari); stroke-width: 11; stroke-linecap: round;
  transition: stroke-dashoffset .7s cubic-bezier(.2,.7,.3,1);
}
.anell-text, .anell-sub { transform: rotate(90deg); transform-origin: 60px 60px; text-anchor: middle; }
.anell-text { font-size: 25px; font-weight: 800; fill: var(--tinta); }
.anell-sub { font-size: 13px; fill: var(--silenciat); }
.avui-xifres { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.xifra { display: flex; flex-direction: column; }
.xifra b { font-size: 1.9rem; color: var(--primari); line-height: 1.1; }
.xifra span { font-size: .82rem; color: var(--silenciat); }
button.ample { width: 100%; max-width: 420px; }
.objectiu-ctrl { margin: .2rem 0 1rem; }
.objectiu-ctrl select { padding: .2rem .4rem; font-size: .9rem; }
.motiu { margin: .5rem 0 1rem; max-width: 560px; }
.avui-secundaris { display: flex; gap: .5rem; flex-wrap: wrap; }
.avui-sessio {
  background: var(--paper); border: 1px solid var(--vora); border-left: 5px solid var(--primari);
  border-radius: var(--radi); padding: .7rem .9rem; margin: 1.2rem 0; box-shadow: var(--ombra);
  display: flex; gap: .6rem; align-items: center; flex-wrap: wrap;
}
#avui-explicacio { margin-top: 1.6rem; }
#avui-explicacio summary { cursor: pointer; font-weight: 600; color: var(--primari); }

/* simulacre */
.sim-barra {
  position: sticky; top: 3.2rem; z-index: 15; background: var(--paper);
  border: 1px solid var(--vora); border-radius: var(--radi); box-shadow: var(--ombra);
  padding: .6rem .9rem; display: flex; align-items: center; gap: .8rem;
  justify-content: space-between; flex-wrap: wrap; margin-bottom: .8rem;
}
.sim-crono { font-variant-numeric: tabular-nums; font-size: 1.6rem; font-weight: 800; color: var(--primari); }
.sim-crono.alerta { color: var(--mal); animation: bat 1s infinite; }
@keyframes bat { 50% { opacity: .45; } }
.sim-nav { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: .9rem 0 2rem; }
input[type=range] { width: 100%; max-width: 320px; vertical-align: middle; }
output { font-weight: 700; color: var(--primari); margin-left: .5rem; }

/* ESO */
.eso-bloc { margin-top: 1.2rem; }
#eso-pestanyes { margin: 1.2rem 0 .4rem; }
#eso-comp, #eso-curs { margin-right: .5rem; }
.grafic-embolcall { overflow-x: auto; background: var(--paper); border: 1px solid var(--vora); border-radius: var(--radi); padding: .6rem; box-shadow: var(--ombra); }
.grafic { width: 100%; min-width: 480px; height: auto; }
.llegenda { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .6rem; font-size: .85rem; }
.lleg { display: flex; align-items: center; gap: .35rem; }
.lleg i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
#sec-eso details summary { cursor: pointer; font-weight: 600; color: var(--primari); }

/* simulador de places */
#places-suggeriments { margin-top: .4rem; display: flex; flex-direction: column; gap: .25rem; max-height: 340px; overflow-y: auto; }
.suggeriment {
  display: flex; justify-content: space-between; gap: .8rem; text-align: left; width: 100%;
  background: var(--paper); border: 1px solid var(--vora); border-radius: 9px;
  padding: .55rem .8rem; font-size: .9rem; align-items: center;
}
.suggeriment:hover { background: var(--primari-clar); border-color: var(--primari); }
.sug-dreta { white-space: nowrap; color: var(--silenciat); font-size: .85rem; }
.preferencia {
  display: flex; align-items: center; gap: .7rem; background: var(--paper);
  border: 1px solid var(--vora); border-radius: 10px; padding: .55rem .8rem; margin: .4rem 0;
}
.pref-num { background: var(--primari); color: #fff; border-radius: 50%; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; font-weight: 700; font-size: .82rem; flex: 0 0 auto; }
.pref-nom { flex: 1; display: flex; flex-direction: column; font-size: .92rem; }
.pref-nom span { font-size: .8rem; }
.materies-opt { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .5rem; margin: .6rem 0; }
.mat-opt { background: var(--paper); border: 1px solid var(--vora); border-radius: 10px; padding: .6rem .8rem; font-size: .9rem; }
.mat-opt.top { border-left: 4px solid var(--be); }
.mat-cap { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.mat-opt span.silenciat { font-size: .8rem; display: block; margin-top: .25rem; }
.places-accions { margin: 1.2rem 0; }
#sec-places h4 { margin: 1.4rem 0 .5rem; }

/* compartir */
#modal-compartir { position: fixed; inset: 0; background: rgba(20,24,38,.55); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 1rem; }
#modal-compartir-cos { background: var(--paper); border-radius: 14px; max-width: 420px; width: 100%; padding: 1.4rem; position: relative; box-shadow: var(--ombra); text-align: center; }
#compartir-tanca { position: absolute; top: .6rem; right: .7rem; border: 0; background: var(--fons); border-radius: 99px; width: 2rem; height: 2rem; }
#compartir-qr img { background: #fff; padding: .6rem; border-radius: 12px; border: 1px solid var(--vora); image-rendering: pixelated; }
.enllac-copia code { background: var(--fons); padding: .35rem .6rem; border-radius: 6px; font-size: .85rem; word-break: break-all; }
.enllac-copia code.ressalta { background: #fef3c7; }
.compartir-botons { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; margin: .9rem 0; }

/* els dos anys */
.calc { background: var(--paper); border: 1px solid var(--vora); border-radius: var(--radi); padding: 1rem 1.1rem; box-shadow: var(--ombra); }
.calc .camp { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: .5rem 0; flex-wrap: wrap; }
.calc .camp label { margin: 0; font-weight: 500; font-size: .93rem; }
.calc input { width: 100px; }
.calc-caixa { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1rem 0 .5rem; }
.calc-xifra { background: var(--fons); border-radius: 10px; padding: .7rem 1.1rem; flex: 1; min-width: 150px; }
.calc-xifra span { display: block; font-size: .82rem; color: var(--silenciat); }
.calc-xifra b { font-size: 2rem; color: var(--tinta); }
.calc-xifra.destaca { background: var(--primari-clar); }
.calc-xifra.destaca b { color: var(--primari); }
.fase .tema-cap { gap: .7rem; }
.fase-num {
  background: var(--primari); color: #fff; border-radius: 50%; width: 1.7rem; height: 1.7rem;
  display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: 0 0 auto;
}
.fase .tema-cos ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.fase .tema-cos li { margin: .3rem 0; font-size: .93rem; }

/* respostes model */
.dues-respostes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: .8rem; margin: .8rem 0; }
.resposta { background: var(--fons); border-radius: 10px; padding: .8rem 1rem; border-top: 4px solid var(--primari); }
.resposta:nth-child(2) { border-top-color: var(--mig); }
.resposta h4 { margin: 0 0 .5rem; font-size: .98rem; text-transform: none; letter-spacing: 0; color: var(--tinta); }
.resposta p { font-size: .92rem; margin: .4rem 0; }
.resposta .autors { color: var(--primari); font-weight: 600; font-size: .86rem; }

/* com estudiar */
.metode-graella { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: .8rem; margin: 1rem 0 1.6rem; }
.metode { background: var(--paper); border: 1px solid var(--vora); border-left: 5px solid var(--primari); border-radius: var(--radi); padding: .8rem 1rem; box-shadow: var(--ombra); }
.metode h3 { margin: 0 0 .4rem; font-size: 1rem; }
.metode p { margin: .4rem 0; font-size: .92rem; }

/* zona personal */
button.compte { background: var(--primari-clar); color: var(--primari); border: 0; font-weight: 600; }
button.compte.connectat { background: #e7f7ec; color: var(--be); }
#modal-compte { position: fixed; inset: 0; background: rgba(20,24,38,.55); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 1rem; }
#modal-compte-cos { background: var(--paper); border-radius: 14px; max-width: 420px; width: 100%; padding: 1.4rem; position: relative; box-shadow: var(--ombra); }
#compte-tanca { position: absolute; top: .6rem; right: .7rem; border: 0; background: var(--fons); border-radius: 99px; width: 2rem; height: 2rem; }
#modal-compte input { width: 100%; margin: .6rem 0; font-size: 1.05rem; }
.codi-gran { letter-spacing: .18em; text-align: center; font-size: 1.35rem; font-weight: 700;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; background: var(--fons);
  border-radius: 10px; padding: .8rem .4rem; margin: .8rem 0; word-break: break-all; }
.error { color: var(--mal); font-size: .88rem; min-height: 1.2em; }
.opcio-check { display: flex; gap: .5rem; align-items: center; font-size: .95rem; margin: .8rem 0; cursor: pointer; }
.opcio-check input { width: auto !important; margin: 0 !important; }

/* pista de recuperació */
.pista-linia { margin: .5rem 0 0; }
.pista {
  background: #fff8e1; border: 1px solid #f0dfa8; border-radius: 10px;
  padding: .6rem .8rem; margin: .5rem 0 0; font-size: .95rem; line-height: 1.5;
}
.pista-recursos { display: inline-block; margin-top: .4rem; font-size: .9rem; }

/* onboarding */
#modal-onboarding { position: fixed; inset: 0; background: rgba(20,24,38,.6); z-index: 70; display: flex; align-items: center; justify-content: center; padding: 1rem; }
#onb-cos {
  background: var(--paper); border-radius: 16px; max-width: 480px; width: 100%;
  padding: 1.6rem 1.4rem 1.2rem; position: relative; box-shadow: var(--ombra);
  max-height: 90vh; overflow-y: auto;
}
#onb-cos h2 { margin: .2rem 0 .6rem; font-size: 1.35rem; }
#onb-salta { position: absolute; top: .6rem; right: .7rem; border: 0; background: var(--fons); border-radius: 99px; width: 2rem; height: 2rem; }
.onb-punts { display: flex; gap: .4rem; justify-content: center; margin-bottom: 1rem; }
.onb-punts i { width: 7px; height: 7px; border-radius: 99px; background: var(--vora); display: block; }
.onb-punts i.actiu { background: var(--primari); width: 22px; }
.onb-punts-clau { margin: 1rem 0; }
.onb-punts-clau p { margin: .55rem 0; font-size: .95rem; line-height: 1.45; }
.onb-opcions { display: flex; flex-direction: column; gap: .55rem; margin: 1rem 0 .4rem; }
.onb-opcions button {
  text-align: left; border: 1px solid var(--vora); background: var(--paper);
  border-radius: 12px; padding: .75rem .9rem; cursor: pointer; font: inherit;
}
.onb-opcions button:hover { border-color: var(--primari); background: var(--primari-clar); }
.onb-opcions button b { display: block; font-size: 1rem; }
.onb-opcions button span { display: block; font-size: .85rem; color: var(--silenciat); margin-top: .15rem; }
#onb-materies { margin: .8rem 0 1rem; }
#onb-cos .hero-xifres { margin: .8rem 0; }

/* guió de classe */
.classe-barra { display: flex; gap: .8rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1rem; }
.classe-exercici { border: 1px solid var(--vora); border-radius: 12px; padding: .9rem; margin: .9rem 0; background: var(--paper); }
.classe-exercici details summary { cursor: pointer; font-weight: 600; margin: .5rem 0; }
@media print {
  header, nav#pestanyes, footer, .no-imprimir, .classe-barra { display: none !important; }
  .sec { display: none !important; }
  .sec.activa { display: block !important; }
  body { background: #fff; }
  .classe-exercici { break-inside: avoid; }
}

/* gestió de perfils dins la zona personal */
#compte-perfils { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--vora); }
#compte-perfils h4 { margin: 0 0 .2rem; }
.perfil-fila {
  display: flex; justify-content: space-between; align-items: center; gap: .6rem;
  flex-wrap: wrap; padding: .5rem .6rem; border-radius: 8px; font-size: .92rem;
}
.perfil-fila.actiu { background: var(--primari-clar); }
.perfil-accions { display: flex; gap: .35rem; align-items: center; }
.perfil-accions button { padding: .25rem .55rem; font-size: .82rem; }

/* primer ús: proposta de valor en comptes de gamificació buida */
.hero { text-align: center; padding: 1.4rem 0 .4rem; }
.hero h2 { margin: 0 0 .5rem; font-size: 1.55rem; line-height: 1.25; }
.hero > p { max-width: 34rem; margin: 0 auto .9rem; }
.hero .primari { max-width: 22rem; margin: .4rem auto; }
.hero-xifres { display: flex; justify-content: center; gap: 1.6rem; flex-wrap: wrap; margin: .4rem 0 1.2rem; }
.hero-xifres .xifra { text-align: center; }
.hero-xifres .xifra b { display: block; font-size: 1.5rem; color: var(--primari); }
.hero-xifres .xifra span { font-size: .84rem; color: var(--silenciat); }
#avui-comparteix { margin-top: 1.6rem; }

@media (max-width: 640px) {
  /* Sis grups no caben en una fila de 375 px (en calen 755): al mòbil es
     reparteixen en una graella de 3×2, així no cal fer scroll ni queda res amagat. */
  nav#pestanyes {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem;
    padding: .5rem .6rem; overflow-x: visible;
  }
  nav#pestanyes button {
    padding: .5rem .2rem; font-size: .82rem; line-height: 1.2;
    white-space: normal; text-align: center; border-radius: 12px;
  }
  #subpestanyes { top: 0; }
  header { flex-direction: column; align-items: stretch; gap: .6rem; padding: .8rem 1rem; }
  .perfil-caixa { justify-content: flex-end; }
  #compte-btn.compte { flex: 1; }
  .hero h2 { font-size: 1.3rem; }
  .hero-xifres { gap: 1.1rem; }
  .barra-fons { width: 90px; }
}

/* ---------- MIR: preguntes de tria múltiple ---------- */
:root { --primari: #0d7a6f; --primari-clar: #e2f4f1; }
.enunciat { font-size: 1.05rem; line-height: 1.55; margin: .8rem 0 1rem; }
.opcions { display: flex; flex-direction: column; gap: .5rem; margin: 1rem 0; }
.opcio {
  text-align: left; border: 1px solid var(--vora); background: var(--paper);
  border-radius: 12px; padding: .75rem .9rem; font: inherit; cursor: pointer;
  display: flex; gap: .7rem; align-items: flex-start; line-height: 1.45;
}
.opcio b {
  flex: 0 0 1.6rem; height: 1.6rem; border-radius: 99px; background: var(--fons);
  display: grid; place-items: center; font-size: .85rem; color: var(--silenciat);
}
.opcio:hover { border-color: var(--primari); background: var(--primari-clar); }
.bloquejat .opcio { cursor: default; }
.bloquejat .opcio:hover { border-color: var(--vora); background: var(--paper); }
.opcio.triada { border-color: var(--primari); background: var(--primari-clar); }
.opcio.correcta { border-color: #1a9c5b; background: #e8f7ee; }
.opcio.correcta b { background: #1a9c5b; color: #fff; }
.opcio.incorrecta { border-color: #d64545; background: #fdecec; }
.opcio.incorrecta b { background: #d64545; color: #fff; }
.avis.be { background: #e8f7ee; border-color: #b6e3c8; }
.avis.mal { background: #fdecec; border-color: #f3c4c4; }
.opcions-llista { margin: .8rem 0; padding-left: 1.2rem; line-height: 1.5; }
.opcions-llista li.correcta { font-weight: 600; color: #14804a; }
.targeta.fallada { border-left: 3px solid #d64545; }
.pregunta-cap { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-bottom: .6rem; }

/* selector d'idioma */
.idioma { display: inline-flex; border: 1px solid var(--vora); border-radius: 99px; overflow: hidden; background: var(--paper); }
.idioma button { border: 0; background: transparent; font: inherit; font-size: .78rem; font-weight: 600;
  color: var(--silenciat); padding: .35rem .6rem; cursor: pointer; }
.idioma button.actiu { background: var(--primari); color: #fff; }

/* explicació de la resposta */
.explicacio { margin-top: .8rem; background: var(--paper); border: 1px solid var(--vora);
  border-radius: 12px; padding: .7rem .9rem; }
.explicacio summary { cursor: pointer; font-size: .95rem; }
.explicacio p { margin: .6rem 0 0; font-size: .95rem; line-height: 1.55; }
.explicacio a { color: var(--primari); }

/* cerca clínica */
#cerca-q { width: 100%; font-size: 1.05rem; }
.cerca-res h4 { margin: .3rem 0 .4rem; font-size: 1.02rem; }
.cerca-res .text { font-size: .93rem; line-height: 1.5; color: var(--silenciat); }
.cerca-res mark { background: #fff2b8; color: inherit; padding: 0 .1em; border-radius: 3px; }
.cerca-res a { color: var(--primari); font-size: .9rem; font-weight: 600; text-decoration: none; }
.cerca-res { cursor: default; }
.cerca-res:hover { border-color: var(--vora); }
