
/* /selectivitat: the approved «Mapa» structure in the «Quadern» look (Marc, 05-11-2026): subject → topic → every exercise of
   the topic → one exercise filling the page. Dotted paper, ink, one highlighter. Generated once from the prototype; edit here. */
:root {
  --paper: #F5F0E6; --paper-2: #ECE5D6; --card: #FFFDF8; --ink: #15140F; --ink-2: #48443B; --muted: #7B7568;
  --line: rgb(21 20 15 / 0.11); --line-2: rgb(21 20 15 / 0.2);
  --blue: #008FB5; --blue-ink: #006F8D; --blue-soft: rgb(0 143 181 / 0.10);
  --sun: #F2D22E; --sun-soft: rgb(242 210 46 / 0.32);
  --orange: #D9480F; --orange-soft: rgb(217 72 15 / 0.10);
  --ok: #1D8048; --ok-soft: rgb(29 128 72 / 0.12);
  --sheet: #FFFFFF; --shadow: 0 1px 2px rgb(21 20 15 / 0.05), 0 6px 20px rgb(21 20 15 / 0.06);
  --f-display: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  --f-body: 'Inter', 'Segoe UI', system-ui, sans-serif, 'Cambria Math', 'Noto Sans Math';
  --r: 14px; --top: 0px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12110E; --paper-2: #1B1A16; --card: #1E1D19; --ink: #F1ECE1; --ink-2: #CFC8B9; --muted: #9A9384;
    --line: rgb(241 236 225 / 0.11); --line-2: rgb(241 236 225 / 0.22); --blue: #3FC0E3; --blue-ink: #6FD3EE;
    --blue-soft: rgb(63 192 227 / 0.13); --sun: #E9C71C; --sun-soft: rgb(233 199 28 / 0.2); --orange: #FF7A4D;
    --orange-soft: rgb(255 122 77 / 0.13); --ok: #4CC27E; --ok-soft: rgb(76 194 126 / 0.14); --sheet: #F7F5F0;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 30px rgb(0 0 0 / 0.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #12110E; --paper-2: #1B1A16; --card: #1E1D19; --ink: #F1ECE1; --ink-2: #CFC8B9; --muted: #9A9384;
  --line: rgb(241 236 225 / 0.11); --line-2: rgb(241 236 225 / 0.22); --blue: #3FC0E3; --blue-ink: #6FD3EE;
  --blue-soft: rgb(63 192 227 / 0.13); --sun: #E9C71C; --sun-soft: rgb(233 199 28 / 0.2); --orange: #FF7A4D;
  --orange-soft: rgb(255 122 77 / 0.13); --ok: #4CC27E; --ok-soft: rgb(76 194 126 / 0.14); --sheet: #F7F5F0;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 30px rgb(0 0 0 / 0.3); color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.55rem, 5.6vw, 2.3rem); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.1rem, 4vw, 1.35rem); font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--blue-ink); }
sub, sup { font-size: 0.72em; line-height: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
a.tile, a.tt, a.rrow, a.trow, a.xrow { text-decoration: none; }
.wrap { max-width: 880px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wide { max-width: 1180px; }
.eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 999px; border: 0; font-weight: 700; text-decoration: none; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-line { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-2); color: var(--ink); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-rev { background: var(--orange-soft); color: var(--orange); box-shadow: inset 0 0 0 1.5px var(--orange); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 0.9rem; }

/* ---------- shell ---------- */
.brandbar { background: var(--card); border-bottom: 1px solid var(--line); }
.brandrow { display: flex; align-items: center; gap: 12px; min-height: 56px; }
.logo { font-family: var(--f-display); font-weight: 800; font-size: 1.12rem; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.logo span { color: var(--blue); }
.logo small { font-family: var(--f-body); font-weight: 600; font-size: 0.78rem; color: var(--muted); margin-left: 6px; }
.switch { display: flex; gap: 6px; padding: 0 0 12px; overflow-x: auto; scrollbar-width: none; }
.switch::-webkit-scrollbar { display: none; }
.switch button { flex: 0 0 auto; border: 0; border-radius: 999px; min-height: 40px; padding: 0 14px; background: var(--paper-2); color: var(--ink-2); font-weight: 600; font-size: 0.9rem; }
.switch button[aria-current="true"] { background: var(--ink); color: var(--paper); }
.switch button b { font-weight: 800; margin-right: 4px; }
.why { background: var(--sun-soft); border-bottom: 1px solid var(--line); font-size: 0.9rem; color: var(--ink-2); }
.why .wrap { padding-top: 10px; padding-bottom: 10px; }
.why b { color: var(--ink); }
main { padding-bottom: 120px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 0.88rem; color: var(--muted); padding: 16px 0 6px; }
.crumbs a { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }

/* ---------- shared bits ---------- */
.mono { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; font-size: 1rem; background: var(--blue-soft); color: var(--blue-ink); }
.yrs { display: inline-flex; gap: 2px; vertical-align: middle; }
.yrs i { width: 7px; height: 12px; border-radius: 2px; background: var(--line-2); }
.yrs i.on { background: var(--blue); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 0.74rem; font-weight: 700; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.tag-every { background: var(--sun-soft); color: var(--ink); }
.tag-full { background: var(--ok-soft); color: var(--ok); }
.tag-new { background: var(--blue-soft); color: var(--blue-ink); }
.count { font-variant-numeric: tabular-nums; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; box-shadow: inset 0 0 0 2px var(--line-2); }
.dot.ok { background: var(--ok); box-shadow: none; }
.dot.rev { background: var(--orange); box-shadow: none; }
.bar { height: 8px; border-radius: 99px; background: var(--paper-2); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; background: var(--ok); }
.bar i.rev { background: var(--orange); }

/* the exercise (shared by the three options) */
.sheet { background: var(--sheet); border-radius: 10px; padding: 10px; box-shadow: inset 0 0 0 1px rgb(21 20 15 / 0.08); }
.sheet img { display: block; width: 100%; height: auto; border-radius: 4px; }
:root[data-theme="dark"] .sheet img { filter: none; }
.txtv { margin-top: 10px; }
.txtv summary, .sol summary { cursor: pointer; list-style: none; }
.txtv summary::-webkit-details-marker, .sol summary::-webkit-details-marker { display: none; }
.txtv summary { font-size: 0.86rem; font-weight: 600; color: var(--blue-ink); padding: 6px 0; }
.txtv summary::before { content: "▸ "; }
.txtv[open] summary::before { content: "▾ "; }
.txtbody { font-size: 0.95rem; color: var(--ink-2); display: grid; gap: 8px; padding: 6px 0 4px; }
.txtbody .data { background: var(--blue-soft); border-radius: 10px; padding: 10px 12px; }
.parts { display: grid; gap: 10px; margin-top: 14px; }
.part { border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.parthead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px 0; }
.parthead b { font-family: var(--f-display); font-size: 0.95rem; }
.parthead .oftopic { margin-right: auto; font-size: 0.74rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--acc) 22%, transparent); color: var(--ink); }
.pts { display: inline-flex; align-items: center; font-weight: 800; font-size: 0.8rem; background: var(--sun); color: #15140F; border-radius: 999px; padding: 2px 9px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.partq { padding: 6px 14px 0; font-size: 0.92rem; color: var(--ink-2); }
.sol { padding: 4px 14px 12px; }
.sol summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; margin-top: 8px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 700; font-size: 0.92rem; }
.sol[open] summary { background: var(--paper-2); color: var(--ink); }
.sol[open] summary .lbl::after { content: " ✓"; }
.steps { list-style: none; counter-reset: s; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 26px 1fr; gap: 10px; font-size: 0.95rem; }
.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--paper); font-weight: 700; font-size: 0.8rem; display: grid; place-items: center; margin-top: 1px; }
.steps li.isnote::before { content: "!"; background: var(--orange); color: #fff; }
.crit { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 0.8rem; color: var(--muted); }
.crit .pts { font-size: 0.75rem; }
.note { background: var(--orange-soft); border-left: 4px solid var(--orange); border-radius: 8px; padding: 8px 12px; color: var(--ink); }
.note b { display: block; color: var(--orange); font-size: 0.82rem; }
.final { margin-top: 12px; border-radius: 10px; background: var(--ok-soft); padding: 10px 12px; font-size: 0.95rem; }
.final .eyebrow { color: var(--ok); }
.srcs { margin-top: 12px; font-size: 0.82rem; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
/* the official listening recording, at the top of an English exam (and of its listening exercise) */
.sv-audio { margin: 14px 0 18px; border: 1px solid var(--line); border-left: 4px solid var(--acc, var(--ink)); border-radius: 12px; background: var(--card); padding: 12px 14px; display: grid; gap: 10px; }
.sv-audio .audhead { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; }
.sv-audio h2 { margin: 0; font-family: var(--f-display); font-size: 1.15rem; }
.sv-audio .audwho { font-size: 0.86rem; color: var(--muted); font-weight: 600; }
.sv-audio audio { width: 100%; min-height: 44px; }
.sv-audio .audfoot { font-size: 0.82rem; color: var(--muted); display: flex; gap: 6px 12px; flex-wrap: wrap; justify-content: space-between; }
.sv-audio p { margin: 0; }
.howwent { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.howwent .q { font-weight: 700; font-size: 0.92rem; margin-right: 4px; }
.stub { border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 14px; font-size: 0.92rem; color: var(--ink-2); display: grid; gap: 10px; }
.stub a { font-weight: 600; }
.status { font-size: 0.78rem; font-weight: 700; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.status.ok { background: var(--ok-soft); color: var(--ok); }
.status.rev { background: var(--orange-soft); color: var(--orange); }
.status.todo { background: var(--paper-2); color: var(--muted); }

/* ---------- home ---------- */
.hero { padding: 26px 0 8px; }
.hero h1 { margin-bottom: 6px; }
.hero p { color: var(--ink-2); max-width: 60ch; }
.searchbox { position: relative; margin-top: 16px; }
.searchbox input { width: 100%; min-height: 58px; border-radius: 18px; border: 2px solid var(--ink); background: var(--card); padding: 0 48px 0 52px; font-size: 1.05rem; box-shadow: var(--shadow); }
.searchbox input::placeholder { color: var(--muted); }
.searchbox input:focus { outline: none; border-color: var(--blue); }
.searchbox > svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; color: var(--ink); pointer-events: none; }
.searchbox .clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--paper-2); font-size: 1.1rem; color: var(--ink-2); }
.hints { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hints button { border: 0; min-height: 36px; padding: 0 12px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 0.88rem; color: var(--ink-2); }
.results { margin-top: 16px; display: grid; gap: 18px; }
.rgroup h2 { font-size: 0.78rem; font-family: var(--f-body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
.rlist { display: grid; gap: 8px; }
.rrow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: var(--card); border-radius: 14px; padding: 11px 14px; box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; color: var(--ink); min-height: 58px; }
.rrow:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.rrow .main { flex: 1; min-width: 0; }
.rrow .t { font-weight: 700; line-height: 1.3; }
.rrow .s { font-size: 0.83rem; color: var(--muted); }
.rrow .n { font-size: 0.83rem; color: var(--ink-2); font-weight: 600; white-space: nowrap; text-align: right; }
.rrow mark { background: var(--sun-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.empty { color: var(--muted); padding: 8px 2px; }
.mods { margin-top: 8px; }
.mod { margin-top: 30px; }
.modhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 6px; margin-bottom: 12px; }
.modhead h2 { font-size: 1.15rem; }
.modhead .why2 { font-size: 0.84rem; color: var(--muted); }
.via { margin: 14px 0 8px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 980px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { display: flex; flex-direction: column; gap: 10px; text-align: left; background: var(--card); border-radius: 16px; padding: 14px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); min-height: 128px; color: var(--ink); text-decoration: none; }
.tile:hover { box-shadow: var(--shadow), inset 0 0 0 2px var(--ink); }
.tile .mono { width: 46px; height: 46px; font-size: 1.05rem; border-radius: 13px; }
.tile .nm { font-family: var(--f-display); font-weight: 700; line-height: 1.22; font-size: 0.98rem; }
.tile .st { font-size: 0.8rem; color: var(--muted); margin-top: auto; }
.tile .acc { align-self: flex-start; font-size: 0.7rem; font-weight: 700; border-radius: 999px; padding: 2px 8px; background: var(--sun-soft); color: var(--ink); }
.legendnote { font-size: 0.82rem; color: var(--muted); margin-top: 10px; }
.legendnote .acc { font-size: 0.7rem; font-weight: 700; border-radius: 999px; padding: 2px 8px; background: var(--sun-soft); color: var(--ink); }

/* ---------- subject (map) ---------- */
.subjhead { display: flex; gap: 14px; align-items: center; padding: 6px 0 4px; }
.subjhead .mono { width: 58px; height: 58px; font-size: 1.25rem; border-radius: 16px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 0.82rem; color: var(--muted); margin: 14px 0 4px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; }
.filter { position: relative; margin: 16px 0 6px; }
.filter input { width: 100%; min-height: 50px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--card); padding: 0 16px 0 44px; font-size: 1rem; }
.filter svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.block { margin-top: 26px; }
.blockhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--ink); padding-bottom: 6px; margin-bottom: 12px; }
.blockhead h2 { font-size: 1.1rem; }
.blockhead span { font-size: 0.84rem; color: var(--muted); white-space: nowrap; }
.ttiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.tt { grid-column: span 3; display: flex; flex-direction: column; gap: 6px; text-align: left; border-radius: 14px; padding: 12px; color: var(--ink); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); min-height: 86px; text-decoration: none; }
.tt:hover { box-shadow: inset 0 0 0 2px var(--ink); }
.tt .tn { font-weight: 700; font-size: 0.9rem; line-height: 1.25; }
.tt .tc { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 0.78rem; color: var(--ink-2); }
.tt.hot { grid-column: span 6; min-height: 104px; }
.tt.hot .tn { font-family: var(--f-display); font-size: 1.05rem; }
.tt.warm { background: var(--sun-soft); box-shadow: none; }
.tt.cool { grid-column: span 2; min-height: 70px; padding: 10px; }
.tt.cool .tn { font-size: 0.82rem; font-weight: 600; color: var(--ink-2); }
@media (min-width: 720px) { .tt.hot { grid-column: span 3; } .tt { grid-column: span 2; } .tt.cool { grid-column: span 1; } }

/* ---------- topic list ---------- */
.topichead { padding: 4px 0 8px; display: grid; gap: 10px; }
.topichead .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topichead .row .bar { flex: 1; min-width: 140px; }
.yearsec { margin-top: 6px; }
.yearhead { position: sticky; top: 0; z-index: 10; display: flex; align-items: baseline; gap: 10px; padding: 12px 0 8px; background: var(--paper); }
.yearhead .y { font-family: var(--f-display); font-weight: 800; font-size: 1.6rem; letter-spacing: -0.02em; }
.yearhead .n { font-size: 0.84rem; color: var(--muted); }
.rows { display: grid; gap: 8px; }
.xrow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--card); border-radius: 14px; padding: 12px 14px; min-height: 64px; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); text-decoration: none; }
.xrow:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.xrow .main { flex: 1; min-width: 0; }
.xrow .l1 { font-weight: 700; line-height: 1.3; }
.xrow .l2 { font-size: 0.84rem; color: var(--muted); }
.xrow .go { font-size: 1.2rem; color: var(--muted); }

/* ---------- focus view: the exercise takes the page, the list lives in a left rail ---------- */
body.focus { --rail: 56px; }
.rail { position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: var(--rail); background: var(--card); border-right: 1px solid var(--line-2); display: flex; flex-direction: column; overflow: hidden; transition: width 0.18s ease, box-shadow 0.18s ease; }
.rail .collapsed { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 0; height: 100%; cursor: pointer; }
.rail .collapsed .ic-s { background: transparent; color: var(--muted); }
.rail .pos { display: grid; justify-items: center; line-height: 1; margin-top: 4px; }
.rail .pos b { font-family: var(--f-display); font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.rail .pos small { font-size: 0.68rem; font-weight: 600; color: var(--muted); margin-top: 3px; }
.rail .prog { width: 32px; height: 4px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.rail .prog span { display: block; height: 100%; width: var(--p); background: var(--ok); }
.rail .yrs { display: grid; gap: 6px; justify-items: center; overflow: hidden; flex: 1; padding: 6px 0 8px; align-content: start; border-top: 1px solid var(--line); width: 40px; margin-top: 4px; }
.rail .yr { display: grid; justify-items: center; gap: 3px; width: 40px; padding: 4px 0; border-radius: 8px; }
.rail .yr span { font-size: 0.72rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.rail .yr.cur { background: var(--paper-2); }
.rail .yr.cur span { color: var(--ink); }
.rail .ticks { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; max-width: 30px; }
.rail .ticks i { width: 8px; height: 4px; border-radius: 2px; background: var(--line-2); }
.rail .ticks i.ok { background: var(--ok); }
.rail .ticks i.rev { background: var(--orange); }
.rail .ticks i.cur { background: var(--blue); }
.rail .collapsed .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--paper-2); display: grid; place-items: center; color: var(--ink); }
.rail .collapsed .ic svg { width: 18px; height: 18px; }
/* The open list is laid out at its final width from the first frame, so nothing re-wraps while the rail slides open. */
.rail { --rail-open: min(380px, 92vw); }
body.touch .rail { --rail-open: min(380px, 88vw); }
.rail .full { display: none; flex-direction: column; height: 100%; width: var(--rail-open); flex: 0 0 auto; }
.rail.open, .rail:focus-within { width: var(--rail-open); box-shadow: 18px 0 40px rgb(0 0 0 / 0.16); }
.rail.open .collapsed, .rail:focus-within .collapsed { display: none; }
.rail.open .full, .rail:focus-within .full { display: flex; }
body:not(.touch) .rail:hover { width: var(--rail-open); box-shadow: 18px 0 40px rgb(0 0 0 / 0.16); }
body:not(.touch) .rail:hover .collapsed { display: none; }
body:not(.touch) .rail:hover .full { display: flex; }
.railtop { padding: 14px 14px 10px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.railtop .filter { margin: 0; }
.railtop .filter input { min-height: 44px; font-size: 0.95rem; }
.railtop .tname { font-family: var(--f-display); font-weight: 700; font-size: 1rem; line-height: 1.25; }
.railtop .tname small { display: block; font-family: var(--f-body); font-weight: 600; font-size: 0.78rem; color: var(--muted); }
.railbody { overflow-y: auto; padding: 8px 10px 20px; flex: 1; overscroll-behavior: contain; }
.railbody .ry { font-family: var(--f-display); font-weight: 800; font-size: 0.95rem; margin: 12px 6px 4px; color: var(--ink-2); }
.rx { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.rx:hover { background: var(--paper-2); }
.rx.cur { background: var(--blue-soft); box-shadow: inset 0 0 0 2px var(--blue); }
.rx .main { flex: 1; min-width: 0; }
.rx .l1 { font-weight: 700; font-size: 0.9rem; line-height: 1.25; }
.rx .l2 { font-size: 0.78rem; color: var(--muted); }
.railres { display: grid; gap: 6px; }
.railres .rrow { min-height: 50px; padding: 9px 12px; }
.railres .rrow .t { font-size: 0.9rem; }
.handle { display: none; }
.scrim { display: none; }
body.touch.focus { --rail: 0px; }
body.touch .rail { width: 0; border-right: 0; }
body.touch .rail .collapsed { display: none; }
body.touch .rail.open { width: var(--rail-open); border-right: 1px solid var(--line-2); }
body.touch .handle { display: flex; }
body.touch .handle { position: fixed; z-index: 55; left: 0; top: auto; bottom: 18%; transform: none; flex-direction: column; align-items: center; gap: 6px; border: 0; border-radius: 0 14px 14px 0; background: var(--ink); color: var(--paper); padding: 10px 5px; box-shadow: var(--shadow); }
body.touch .handle svg { width: 18px; height: 18px; }
body.touch .handle span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
body.touch .scrim.on { display: block; position: fixed; inset: 0; z-index: 58; background: rgb(0 0 0 / 0.32); }
body.focus .page { margin-left: var(--rail); }
.fxtop { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.fxtop .in { display: flex; align-items: center; gap: 10px; min-height: 58px; }
.fxtop .crumbs { padding: 0; flex: 1; min-width: 0; flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
.fxtop .crumbs > * { overflow: hidden; text-overflow: ellipsis; }
.fxtop .count { font-weight: 700; font-size: 0.88rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.round { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--paper-2); font-size: 1.1rem; display: grid; place-items: center; flex: 0 0 auto; color: var(--ink); text-decoration: none; }
.round[aria-disabled="true"] { opacity: 0.3; pointer-events: none; }
.fx { max-width: 860px; margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-right, 0px)) 120px max(16px, env(safe-area-inset-left, 0px)); }
.fxhead { display: grid; gap: 6px; margin-bottom: 14px; }
.fxhead .y { font-family: var(--f-display); font-weight: 800; font-size: clamp(1.7rem, 6vw, 2.4rem); letter-spacing: -0.02em; line-height: 1.05; }
.fxhead .c { font-weight: 700; color: var(--ink-2); font-size: 1rem; }
.fxhead .e { color: var(--muted); font-size: 0.92rem; }
.fxhead .tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sheet { position: relative; cursor: zoom-in; }
.sheet .zoomhint { position: absolute; right: 10px; bottom: 10px; font-size: 0.76rem; font-weight: 700; background: var(--ink); color: var(--paper); border-radius: 999px; padding: 4px 10px; opacity: 0.85; }
.zoom { position: fixed; inset: 0; z-index: 90; background: rgb(15 14 11 / 0.92); overflow: auto; display: none; padding: 12px; }
.zoom.on { display: block; }
.zoom img { display: block; width: 100%; max-width: 1400px; min-width: 760px; margin: 0 auto; background: #fff; border-radius: 6px; }
@media (min-width: 900px) { .zoom img { min-width: 0; } }
.zoom button { position: fixed; top: 12px; right: 12px; z-index: 91; width: 46px; height: 46px; border-radius: 50%; border: 0; background: #fff; color: #15140F; font-size: 1.2rem; }
.fxnav { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* ---------- the solution ---------- */
.part { border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.partq { padding: 6px 16px 0; font-size: 0.96rem; color: var(--ink-2); }
.sol { padding: 4px 16px 14px; }
.rsteps { list-style: none; counter-reset: s; margin: 14px 0 0; padding: 0; display: grid; gap: 14px; }
.rstep { counter-increment: s; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; }
.rstep::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--paper); font-weight: 700; font-size: 0.82rem; display: grid; place-items: center; margin-top: 2px; }
.rstep.isnote::before { content: "!"; background: var(--orange); color: #fff; }
.rstep.isfig { counter-increment: none; grid-template-columns: minmax(0, 1fr); }
.rstep.isfig::before { display: none; }
.rbody { display: grid; gap: 8px; min-width: 0; }
.rtext { font-size: 0.97rem; line-height: 1.6; }
.rtext.lead { color: var(--ink); font-weight: 500; }
.rmath { display: grid; gap: 2px; background: var(--paper); border-radius: 10px; padding: 8px 12px; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.rmath .ml { text-align: center; min-width: min-content; }
.rmath .katex-display { margin: 0.35em 0; }
.rmath .katex { font-size: 1.08em; }
.rmath .raw { font-family: ui-monospace, monospace; font-size: 0.85rem; white-space: pre-wrap; }
.crit { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--muted); }
.crit .pts { font-size: 0.74rem; }
.note { background: var(--orange-soft); border-left: 4px solid var(--orange); border-radius: 8px; padding: 10px 12px; color: var(--ink); font-size: 0.95rem; }
.note b { display: block; color: var(--orange); font-size: 0.82rem; margin-bottom: 2px; }
.rfig { margin: 4px auto 0; width: 100%; max-width: 460px; }
.rfig svg { display: block; width: 100%; height: auto; }
.rfig figcaption { text-align: center; font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.final { margin-top: 16px; border-radius: 12px; background: var(--sun-soft); padding: 12px 14px; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--sun) 70%, transparent); }
.final .eyebrow { color: var(--ink); margin-bottom: 4px; }
.final .rmath { background: transparent; padding: 0; }
.final .katex { font-size: 1.12em; }
/* two buttons side by side: our solution (dark) and the official guide (outlined blue) */
.partbtns { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px 14px; }
.partbtns .soon { align-self: center; font-size: 0.85rem; color: var(--muted); } /* no rewritten solution yet: the official correction only */
.tgl { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 999px; font: inherit; font-weight: 700; font-size: 0.94rem; cursor: pointer; border: 0; }
.tgl-sol { background: var(--ink); color: var(--paper); }
.tgl-pau { background: transparent; color: var(--blue-ink); box-shadow: inset 0 0 0 2px var(--blue); }
.tgl[aria-expanded="true"]::after { content: "▴"; font-size: 0.8em; }
.tgl-sol[aria-expanded="true"] { background: var(--paper-2); color: var(--ink); }
.tgl-pau[aria-expanded="true"] { background: var(--blue-soft); }
.part > .sol { border-top: 1px solid var(--line); padding-top: 6px; }
/* the official guide: a distinct «document» box, so it never reads as our explanation */
.pauta { margin: 0 12px 14px; border-radius: 12px; background: var(--blue-soft); border: 1px solid color-mix(in srgb, var(--blue) 40%, transparent); padding: 12px 14px 14px; }
.pauhead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding-bottom: 8px; border-bottom: 1px solid color-mix(in srgb, var(--blue) 30%, transparent); }
.pautag { font-family: var(--f-display); font-weight: 800; font-size: 0.95rem; color: var(--blue-ink); }
.pauwho { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.crows { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.crows li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; background: var(--card); border-radius: 10px; padding: 9px 11px; }
.cpts { font-weight: 800; font-size: 0.8rem; color: var(--blue-ink); background: var(--blue-soft); border-radius: 999px; padding: 3px 9px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ctext { font-size: 0.93rem; line-height: 1.5; min-width: 0; overflow-wrap: anywhere; }
.cextra { margin-top: 4px; font-size: 0.85rem; color: var(--ink-2); }
.ctotal { margin-top: 10px; text-align: right; font-size: 0.88rem; color: var(--ink-2); }
.pauorig { margin-top: 10px; }
.pauorig > summary { cursor: pointer; font-weight: 700; color: var(--blue-ink); font-size: 0.92rem; min-height: 40px; display: flex; align-items: center; }
.pauorig[open] > summary { margin-bottom: 6px; }
.pausheet { margin: 4px 0 8px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.solsum { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px; margin-top: 10px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 700; font-size: 0.94rem; cursor: pointer; list-style: none; }
.solsum::-webkit-details-marker { display: none; }
details[open] > .solsum { background: var(--paper-2); color: var(--ink); }
details[open] > .solsum .lbl::after { content: " ✓"; }
.fig-ink { stroke: var(--ink); }
.fig-muted { fill: var(--muted); }
svg text { font-family: var(--f-body), 'Segoe UI Symbol', 'Noto Sans Math', 'DejaVu Sans', sans-serif; }
body.focus .brandbar { display: none; }

.fxtop .back { display: none; font-weight: 700; color: var(--ink); text-decoration: none; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .fxtop .crumbs { display: none; } .fxtop .back { display: block; } }
.railclose { display: none; justify-self: start; }
body.touch .railclose { display: inline-flex; }
body.touch.focus .fx { padding-left: max(30px, env(safe-area-inset-left, 0px)); }
@media (max-width: 480px) { .rmath .katex { font-size: 0.98em; } .rmath { padding: 8px 8px; } }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.rfig { max-width: 420px; }
.final .rtext { margin: 2px 0; }
@media (max-width: 520px) {
  .crows li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .cpts { justify-self: start; }
  .pauta { margin: 0 8px 12px; padding: 10px 10px 12px; }
}

.paufoot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
/* ---------- shared by every skin ---------- */
.mono .sic { display: none; width: 60%; height: 60%; }
.mono .lt { display: inline; }
/* ==========================================================================================================
   1 · QUADERN — the study notebook: dotted paper, ink, a highlighter, washi tape and pen doodles.
   Nunito for headings (round, friendly), Caveat only for small handwritten notes, Inter for reading.
   ========================================================================================================== */
body.sv {
  --paper: #F6F2E8; --paper-2: #ECE6D6; --card: #FFFEF9; --ink: #1C1B17; --ink-2: #45413A; --muted: #6A6458;
  --line: rgb(28 27 23 / 0.12); --line-2: rgb(28 27 23 / 0.24);
  --blue: #0A87B2; --blue-ink: #006689; --blue-soft: rgb(10 135 178 / 0.10);
  --sun: #FFDC45; --sun-soft: rgb(255 220 69 / 0.42); --marker: rgb(255 214 10 / 0.62);
  --orange: #C2410C; --orange-soft: rgb(194 65 12 / 0.10); --ok: #17803F; --ok-soft: rgb(23 128 63 / 0.12);
  --rose: rgb(214 69 69 / 0.45); --dotc: rgb(28 27 23 / 0.14); --grid: rgb(10 135 178 / 0.09);
  --shadow: none; --hard: 3px 3px 0 var(--ink);
  --f-display: 'Nunito', 'Segoe UI', system-ui, sans-serif; --f-hand: 'Caveat', 'Segoe Print', cursive;
  --acc: #9ED8F0;
  background-image: radial-gradient(var(--dotc) 1px, transparent 1.3px); background-size: 22px 22px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body.sv {
  --paper: #171612; --paper-2: #24221C; --card: #211F1A; --ink: #F2EDE2; --ink-2: #D3CCBE; --muted: #A69F91;
  --line: rgb(242 237 226 / 0.12); --line-2: rgb(242 237 226 / 0.26);
  --blue: #4CC3E6; --blue-ink: #86D8F0; --blue-soft: rgb(76 195 230 / 0.14);
  --sun: #E9C71C; --sun-soft: rgb(233 199 28 / 0.22); --marker: rgb(233 199 28 / 0.38);
  --orange: #FF8A5C; --orange-soft: rgb(255 138 92 / 0.14); --ok: #5BD08F; --ok-soft: rgb(91 208 143 / 0.15);
  --rose: rgb(255 120 120 / 0.38); --dotc: rgb(242 237 226 / 0.09); --grid: rgb(76 195 230 / 0.10); --sheet: #F7F5F0;
  --acc: #1E5A70;
} }
:root[data-theme="dark"] body.sv {
  --paper: #171612; --paper-2: #24221C; --card: #211F1A; --ink: #F2EDE2; --ink-2: #D3CCBE; --muted: #A69F91;
  --line: rgb(242 237 226 / 0.12); --line-2: rgb(242 237 226 / 0.26);
  --blue: #4CC3E6; --blue-ink: #86D8F0; --blue-soft: rgb(76 195 230 / 0.14);
  --sun: #E9C71C; --sun-soft: rgb(233 199 28 / 0.22); --marker: rgb(233 199 28 / 0.38);
  --orange: #FF8A5C; --orange-soft: rgb(255 138 92 / 0.14); --ok: #5BD08F; --ok-soft: rgb(91 208 143 / 0.15);
  --rose: rgb(255 120 120 / 0.38); --dotc: rgb(242 237 226 / 0.09); --grid: rgb(76 195 230 / 0.10); --sheet: #F7F5F0;
  --acc: #1E5A70;
}
[data-fam="comunes"] { --acc: #FFB9A6; }
[data-fam="ct"] { --acc: #9ED8F0; }
[data-fam="hcs"] { --acc: #CDBBFF; }
[data-fam="arts"] { --acc: #FFC4DD; }
[data-fam="gen"], [data-fam="old"] { --acc: #BDE7A6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) [data-fam="comunes"] { --acc: #7C3B2E; } }
:root[data-theme="dark"] [data-fam="comunes"] { --acc: #7C3B2E; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) [data-fam="ct"] { --acc: #1D5B72; } }
:root[data-theme="dark"] [data-fam="ct"] { --acc: #1D5B72; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) [data-fam="hcs"] { --acc: #4A3C86; } }
:root[data-theme="dark"] [data-fam="hcs"] { --acc: #4A3C86; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) [data-fam="arts"] { --acc: #7A3156; } }
:root[data-theme="dark"] [data-fam="arts"] { --acc: #7A3156; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) [data-fam="gen"], :root:not([data-theme="light"]) [data-fam="old"] { --acc: #34602A; } }
:root[data-theme="dark"] [data-fam="gen"], :root[data-theme="dark"] [data-fam="old"] { --acc: #34602A; }

h1 { font-weight: 900; letter-spacing: -0.015em; text-decoration: underline; text-decoration-color: var(--marker); text-decoration-thickness: 0.36em; text-underline-offset: -0.2em; text-decoration-skip-ink: none; }
h2, h3 { font-weight: 900; }
.eyebrow { font-family: var(--f-hand); font-size: 1.2rem; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--blue-ink); line-height: 1.1; }
.brandbar { background: color-mix(in srgb, var(--card) 85%, transparent); border-bottom: 2px dashed var(--line-2); }
.logo { font-weight: 900; }
.logo small { font-family: var(--f-hand); font-size: 1.15rem; font-weight: 700; color: var(--blue-ink); }
.hero { padding-top: 30px; }
.searchbox { margin-top: 38px; }
.searchbox::before { content: "escriu el tema que fas a classe ↓"; position: absolute; right: 10px; top: -30px; font-family: var(--f-hand); font-size: 1.25rem; font-weight: 700; color: var(--blue-ink); transform: rotate(-2deg); white-space: nowrap; }
.searchbox input { border-radius: 14px; box-shadow: var(--hard); }
.searchbox input:focus { border-color: var(--ink); box-shadow: 3px 3px 0 var(--blue); }
.hints button { background: transparent; box-shadow: none; border: 1.5px dashed var(--line-2); min-height: 40px; }
.hints button:hover { background: var(--marker); border-color: transparent; }
.rrow { border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.rrow:hover { box-shadow: var(--hard), inset 0 0 0 1.5px var(--ink); }
.rrow mark { background: var(--marker); }
.modhead, .blockhead { border-bottom: 0; padding-bottom: 12px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='8' viewBox='0 0 40 8'%3E%3Cpath d='M0 4 Q5 0 10 4 T20 4 T30 4 T40 4' fill='none' stroke='%231C1B17' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") left bottom / 40px 8px repeat-x; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .modhead, :root:not([data-theme="light"]) .blockhead { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='8' viewBox='0 0 40 8'%3E%3Cpath d='M0 4 Q5 0 10 4 T20 4 T30 4 T40 4' fill='none' stroke='%23F2EDE2' stroke-opacity='.7' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); } }
:root[data-theme="dark"] .modhead, :root[data-theme="dark"] .blockhead { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='8' viewBox='0 0 40 8'%3E%3Cpath d='M0 4 Q5 0 10 4 T20 4 T30 4 T40 4' fill='none' stroke='%23F2EDE2' stroke-opacity='.7' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
.modhead h2 { font-size: 1.35rem; }
.modhead .why2 { font-family: var(--f-hand); font-size: 1.15rem; font-weight: 600; color: var(--blue-ink); line-height: 1.15; }
.via { font-family: var(--f-hand); font-size: 1.25rem; text-transform: none; letter-spacing: 0; color: var(--ink); }
.tiles { gap: 14px; padding-top: 6px; }
.tile { position: relative; border-radius: 14px; box-shadow: var(--hard), inset 0 0 0 2px var(--ink); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.tile:nth-child(3n+1) { transform: rotate(-0.5deg); }
.tile:nth-child(3n+2) { transform: rotate(0.4deg); }
.tile:hover { transform: translate(-1px, -2px) rotate(0deg); box-shadow: 5px 5px 0 var(--ink), inset 0 0 0 2px var(--ink); }
.tile::before { content: ""; position: absolute; top: -8px; left: 50%; width: 52px; height: 16px; margin-left: -26px; background: color-mix(in srgb, var(--acc) 80%, transparent); transform: rotate(-3deg); border-radius: 2px; opacity: 0.9; }
.mono { background: var(--acc); color: var(--ink); border-radius: 46% 54% 50% 50% / 56% 44% 56% 44%; }
.mono .sic { display: block; filter: url(#pen); stroke-width: 1.7; }
.mono .lt { display: none; }
.tile .mono { width: 52px; height: 52px; }
.tile .nm { font-weight: 900; font-size: 1.02rem; }
.tile .acc, .legendnote .acc { font-family: var(--f-hand); font-size: 1.05rem; font-weight: 700; background: var(--marker); transform: rotate(-2deg); border-radius: 4px; padding: 0 8px; }
.subjhead .mono { width: 64px; height: 64px; }
.filter input { border-radius: 12px; border: 2px solid var(--ink); }
.tt { border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.tt:hover { box-shadow: var(--hard), inset 0 0 0 2px var(--ink); }
/* How often a topic comes up (Marc, 05-11-2026: black was too intense and needed a legend). One highlighter, three strengths, and the words on the card. */
.tt.hot { background: color-mix(in srgb, var(--sun) 72%, var(--card)); color: #1C1B17; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--sun) 45%, var(--ink)); }
.tt.hot:hover { box-shadow: var(--hard), inset 0 0 0 2px var(--ink); }
.tt.hot .tn { font-weight: 900; }
.tt.hot .tc { color: #33302A; }
.tt.hot .yrs i { background: transparent; box-shadow: inset 0 0 0 1px rgb(28 27 23 / 0.38); }
.tt.hot .yrs i.on { background: #1C1B17; box-shadow: none; }
.tt.warm { background: color-mix(in srgb, var(--sun) 30%, var(--card)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--sun) 75%, var(--ink)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tt.hot { background: color-mix(in srgb, var(--sun) 34%, var(--card)); color: var(--ink); box-shadow: inset 0 0 0 2px var(--sun); } }
:root[data-theme="dark"] .tt.hot { background: color-mix(in srgb, var(--sun) 34%, var(--card)); color: var(--ink); box-shadow: inset 0 0 0 2px var(--sun); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tt.hot .tc { color: var(--ink-2); } }
:root[data-theme="dark"] .tt.hot .tc { color: var(--ink-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tt.hot .yrs i { box-shadow: inset 0 0 0 1px var(--line-2); } }
:root[data-theme="dark"] .tt.hot .yrs i { box-shadow: inset 0 0 0 1px var(--line-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tt.hot .yrs i.on { background: var(--sun); } }
:root[data-theme="dark"] .tt.hot .yrs i.on { background: var(--sun); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tt.warm { background: color-mix(in srgb, var(--sun) 12%, var(--card)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--sun) 45%, transparent); } }
:root[data-theme="dark"] .tt.warm { background: color-mix(in srgb, var(--sun) 12%, var(--card)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--sun) 45%, transparent); }
.fq { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-hand); font-weight: 700; font-size: 1.12rem; line-height: 1; }
.tt.cool .fq { font-size: 1rem; color: var(--muted); white-space: nowrap; }
.tt.cool .pips { display: none; }
.pips { display: inline-flex; gap: 2px; }
.pips i { width: 7px; height: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1.2px currentColor; opacity: 0.55; }
.pips i.on { background: currentColor; opacity: 1; }
.yw { display: inline-flex; align-items: center; gap: 4px; }
.yw small { font-size: 0.68rem; font-weight: 600; opacity: 0.8; }
.yrs i { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.yrs i.on { background: var(--blue-ink); box-shadow: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .yrs i.on { background: var(--blue); } }
:root[data-theme="dark"] .yrs i.on { background: var(--blue); }
.tt .tc { flex-wrap: wrap; }
.last { font-size: 0.8rem; line-height: 1.3; color: var(--ink-2); }
.tt.hot .last { color: #33302A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tt.hot .last { color: var(--ink-2); } }
:root[data-theme="dark"] .tt.hot .last { color: var(--ink-2); }
.last b { font-weight: 800; color: var(--ink); }
.tt.hot .last b { color: #1C1B17; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tt.hot .last b { color: var(--ink); } }
:root[data-theme="dark"] .tt.hot .last b { color: var(--ink); }
@media (max-width: 719px) { .tt.cool .sit { display: none; } }
.tt.cool { background: transparent; box-shadow: none; border: 1.5px dashed var(--line-2); }
.yearhead { background: var(--paper); }
.yearhead .y { font-weight: 900; text-decoration: underline; text-decoration-color: var(--marker); text-decoration-thickness: 0.34em; text-underline-offset: -0.18em; text-decoration-skip-ink: none; }
.yearhead .n, .tag-new { font-family: var(--f-hand); font-size: 1.1rem; }
.tag-new { background: transparent; color: var(--blue-ink); border: 1.5px solid var(--blue); transform: rotate(-2deg); }
.xrow { border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.xrow:hover { box-shadow: var(--hard), inset 0 0 0 2px var(--ink); }
.btn, .tgl, .solsum { border-radius: 12px; }
.btn-ink, .tgl-sol { box-shadow: 3px 3px 0 var(--blue); }
.bar { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); height: 12px; padding: 2px; }
.bar i { border-radius: 99px; }
/* the exercise: the official sheet taped onto the notebook, our work on a lined page with a red margin */
.fxhead .y { font-weight: 900; text-decoration: underline; text-decoration-color: var(--marker); text-decoration-thickness: 0.32em; text-underline-offset: -0.16em; text-decoration-skip-ink: none; }
.sheet { margin-top: 18px; border-radius: 4px; box-shadow: 0 1px 0 var(--line-2), 4px 6px 0 -1px var(--line); }
.sheet::before, .pausheet::before { content: ""; position: absolute; z-index: 2; top: -13px; left: 18px; width: 70px; height: 20px; background: color-mix(in srgb, var(--acc) 75%, transparent); transform: rotate(-4deg); }
.sheet::after { content: ""; position: absolute; z-index: 2; top: -12px; right: 22px; width: 60px; height: 20px; background: color-mix(in srgb, var(--acc) 75%, transparent); transform: rotate(5deg); }
.part { border: 0; border-radius: 14px; box-shadow: var(--hard), inset 0 0 0 2px var(--ink); background-image: linear-gradient(90deg, transparent 7px, var(--rose) 7px, var(--rose) 8.5px, transparent 8.5px); }
.part > .sol { border-top: 1.5px dashed var(--line-2); }
.parthead b { font-family: var(--f-hand); font-size: 1.55rem; font-weight: 700; line-height: 1; }
.pts { background: var(--marker); color: var(--ink); border-radius: 6px; transform: rotate(-2deg); }
.rstep::before { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); border-radius: 48% 52% 45% 55% / 55% 45% 55% 45%; font-family: var(--f-hand); font-size: 1.15rem; }
.rmath { background-color: var(--card); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 14px 14px; box-shadow: inset 0 0 0 1px var(--line); }
.crit { font-family: var(--f-hand); font-size: 1.05rem; color: var(--ink-2); }
.crit .pts { font-family: var(--f-body); }
.note { background: #FFF0B8; color: #1C1B17; border-left: 0; border-radius: 3px; box-shadow: 2px 3px 0 rgb(0 0 0 / 0.12); transform: rotate(-0.4deg); }
.note b { color: #9A3412; font-family: var(--f-hand); font-size: 1.15rem; }
.rstep.isnote::before { background: #FFF0B8; color: #9A3412; box-shadow: inset 0 0 0 2px #9A3412; }
.final { background: var(--marker); box-shadow: none; border-radius: 6px; }
.final .eyebrow { font-size: 1.35rem; color: var(--ink); }
.final .rmath { background: transparent; box-shadow: none; padding: 0; } /* the result's formulas sit on the marker itself, no inner box */
.pauta { position: relative; border: 2px dashed color-mix(in srgb, var(--blue) 60%, transparent); background: color-mix(in srgb, var(--blue) 6%, var(--card)); border-radius: 10px; }
.pauhead { padding-right: 34px; } /* room for the paperclip */
.pauta::before { content: ""; position: absolute; top: -14px; right: 20px; width: 18px; height: 40px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 40'%3E%3Cpath d='M5 13V6a4 4 0 0 1 8 0v24a6 6 0 0 1-12 0V10' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.pautag { font-weight: 900; }
.pauwho { font-family: var(--f-hand); font-size: 1.05rem; }
.howwent .q { font-family: var(--f-hand); font-size: 1.35rem; }
.rail { background-color: var(--card); background-image: radial-gradient(var(--dotc) 1px, transparent 1.3px); background-size: 16px 16px; border-right: 2px solid var(--ink); }
.rail .pos b { font-weight: 900; }
.rail .yr span { font-family: var(--f-hand); font-size: 1rem; }
.rail .yr.cur { background: var(--marker); }
.rail .collapsed .ic { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--ink); }
.railbody .ry { font-weight: 900; }
.rx.cur { background: var(--marker); box-shadow: inset 0 0 0 2px var(--ink); }
.fxtop { border-bottom: 2px dashed var(--line-2); }
.skinsw { box-shadow: var(--hard), inset 0 0 0 2px var(--ink); }


@media (prefers-reduced-motion: reduce) { .tile { transform: none; } }
/* Phones: equations a touch smaller so most lines fit without scrolling inside their box. */
@media (max-width: 480px) { .rmath .katex { font-size: 0.94em; } .rmath { padding-left: 10px; padding-right: 10px; } }
/* A long equation is served twice: on one line, and broken at its relations for narrow screens (lib/selectivitat/math.js). */
.ml .tn-narrow { display: none; }
@media (max-width: 560px) { .ml.has-narrow .tn-wide { display: none; } .ml.has-narrow .tn-narrow { display: block; } }
/* ---------- around the map: private notice, academy links, whole exams, plain pages ---------- */
.sv-private { background: var(--sun); color: #1C1B17; text-align: center; font-size: 0.82rem; font-weight: 600; padding: 6px 12px; }
.sv-foot { max-width: 1100px; margin: 40px auto 0; padding: 22px 18px 34px; border-top: 1px dashed var(--line-2); font-size: 0.8rem; color: var(--muted); }
.sv-foot p { margin: 0 0 6px; }
.sv-foot a { color: var(--ink-2); }
body.focus .sv-foot { display: none; }
.sv-examlist ul { list-style: none; margin: 8px 0 4px; padding: 0; display: grid; gap: 4px; }
.sv-examlist a { color: var(--blue-ink); font-size: 0.88rem; }
.sv-prose { max-width: 720px; }
.sv-prose h1 { margin-bottom: 14px; }
.sv-prose p { line-height: 1.6; }
.sv-exgroup { margin-top: 30px; padding-top: 18px; border-top: 2px dashed var(--line-2); }
.sv-exgroup h2 { font-size: 1.2rem; margin: 0 0 12px; }
.sv-perlist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.sv-perlist a { color: var(--blue-ink); }

/* Subject page: «Per temes» | «Seleccionar per any i sèrie» (Marc, 13-11-2026). */
.modes { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.modes button { min-height: 42px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--ink); background: var(--card); color: var(--ink); font-weight: 800; font-size: 0.95rem; cursor: pointer; }
.modes button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.byyear { margin-top: 14px; }
.byyear .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.byyear .step { margin: 14px 0 8px; font-weight: 800; color: var(--ink-2); }
.yearpick, .series { display: flex; flex-wrap: wrap; gap: 8px; }
.yearpick button { min-width: 72px; min-height: 44px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink); font-weight: 800; font-size: 1rem; cursor: pointer; }
.yearpick button[aria-pressed="true"] { border: 2px solid var(--ink); background: color-mix(in srgb, var(--sun) 72%, var(--card)); color: #1C1B17; }
.sitrow { padding: 10px 0; border-top: 1px solid var(--line); }
.sitrow h3 { font-size: 0.95rem; margin: 0 0 8px; }
.series a { display: inline-flex; align-items: center; min-height: 42px; padding: 0 14px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line-2); color: var(--ink); font-weight: 700; text-decoration: none; }
.series a:hover { box-shadow: var(--hard), inset 0 0 0 2px var(--ink); }

/* «Vols treballar-ho amb un professor?» banner (Marc, 16-11-2026): an exam sheet that fills in, ticks, scores and gets its 10. */
.sv-cta { position: relative; margin: 34px 0 0; padding: 18px 20px; border-radius: 16px; background: var(--card); box-shadow: var(--hard), inset 0 0 0 2px var(--ink);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 20px; align-items: center; }
.sv-cta::before { content: ""; position: absolute; top: -9px; left: 38px; width: 70px; height: 18px; background: color-mix(in srgb, var(--sun) 85%, transparent); transform: rotate(-4deg); border-radius: 2px; }
.cta-sheet { width: 190px; height: auto; display: block; overflow: visible; }
.cta-sheet .pp { fill: var(--paper); stroke: var(--ink); stroke-width: 1.6; transform: rotate(-3deg); transform-origin: 67px 70px; }
.cta-sheet .hd { font-family: var(--f-display); font-weight: 900; font-size: 9px; fill: var(--muted); letter-spacing: 0.04em; }
.cta-sheet .w, .cta-sheet .t, .cta-sheet .ring { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.cta-sheet .w { stroke: var(--ink-2); stroke-width: 2; }
.cta-sheet .t { stroke: var(--ok); stroke-width: 3; }
.cta-sheet .p { font-family: var(--f-hand); font-weight: 700; font-size: 17px; fill: var(--blue-ink); }
.cta-sheet .ring { stroke: var(--orange); stroke-width: 3; }
.cta-sheet .g { font-family: var(--f-hand); font-weight: 700; font-size: 27px; fill: var(--orange); text-anchor: middle; }
.cta-sheet .p, .cta-sheet .g { transform-box: fill-box; transform-origin: center; }
.cta-txt { min-width: 0; }
.cta-eye { margin: 0; font-family: var(--f-hand); font-size: 1.3rem; font-weight: 700; color: var(--blue-ink); line-height: 1.1; transform: rotate(-1.5deg); transform-origin: left; }
.cta-h { margin: 2px 0 4px; font-family: var(--f-display); font-weight: 900; font-size: 1.3rem; line-height: 1.2; text-wrap: balance; }
.cta-sub { margin: 0; font-size: 0.92rem; color: var(--ink-2); max-width: 62ch; }
.cta-go { white-space: nowrap; }
.cta-go .arr { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .sv-cta .w, .sv-cta .t, .sv-cta .ring, .sv-cta .p, .sv-cta .g { animation-duration: 9s; animation-iteration-count: infinite; animation-timing-function: ease-out; }
  .cta-go .arr { animation: cta-nudge 1.6s ease-in-out infinite; }
  .cta-go:hover .arr { animation-duration: 0.6s; }
  .sv-cta .w1 { animation-name: cta-w1; }
  .sv-cta .t1 { animation-name: cta-t1; }
  .sv-cta .p1 { animation-name: cta-p1; }
  .sv-cta .w2 { animation-name: cta-w2; }
  .sv-cta .t2 { animation-name: cta-t2; }
  .sv-cta .p2 { animation-name: cta-p2; }
  .sv-cta .w3 { animation-name: cta-w3; }
  .sv-cta .t3 { animation-name: cta-t3; }
  .sv-cta .p3 { animation-name: cta-p3; }
  .sv-cta .ring { animation-name: cta-ring; }
  .sv-cta .g { animation-name: cta-g; }
  @keyframes cta-w1 { 0%, 4% { stroke-dashoffset: 1; opacity: 1; } 14%, 90% { stroke-dashoffset: 0; opacity: 1; } 97%, 100% { stroke-dashoffset: 0; opacity: 0; } }
  @keyframes cta-t1 { 0%, 15% { stroke-dashoffset: 1; opacity: 1; } 18%, 90% { stroke-dashoffset: 0; opacity: 1; } 97%, 100% { stroke-dashoffset: 0; opacity: 0; } }
  @keyframes cta-p1 { 0%, 17% { opacity: 0; transform: scale(0.3); } 20% { opacity: 1; transform: scale(1.3); } 22%, 90% { opacity: 1; transform: scale(1); } 97%, 100% { opacity: 0; transform: scale(1); } }
  @keyframes cta-w2 { 0%, 23% { stroke-dashoffset: 1; opacity: 1; } 33%, 90% { stroke-dashoffset: 0; opacity: 1; } 97%, 100% { stroke-dashoffset: 0; opacity: 0; } }
  @keyframes cta-t2 { 0%, 34% { stroke-dashoffset: 1; opacity: 1; } 37%, 90% { stroke-dashoffset: 0; opacity: 1; } 97%, 100% { stroke-dashoffset: 0; opacity: 0; } }
  @keyframes cta-p2 { 0%, 36% { opacity: 0; transform: scale(0.3); } 39% { opacity: 1; transform: scale(1.3); } 41%, 90% { opacity: 1; transform: scale(1); } 97%, 100% { opacity: 0; transform: scale(1); } }
  @keyframes cta-w3 { 0%, 42% { stroke-dashoffset: 1; opacity: 1; } 52%, 90% { stroke-dashoffset: 0; opacity: 1; } 97%, 100% { stroke-dashoffset: 0; opacity: 0; } }
  @keyframes cta-t3 { 0%, 53% { stroke-dashoffset: 1; opacity: 1; } 56%, 90% { stroke-dashoffset: 0; opacity: 1; } 97%, 100% { stroke-dashoffset: 0; opacity: 0; } }
  @keyframes cta-p3 { 0%, 55% { opacity: 0; transform: scale(0.3); } 58% { opacity: 1; transform: scale(1.3); } 60%, 90% { opacity: 1; transform: scale(1); } 97%, 100% { opacity: 0; transform: scale(1); } }
  @keyframes cta-ring { 0%, 62% { stroke-dashoffset: 1; opacity: 1; } 74%, 90% { stroke-dashoffset: 0; opacity: 1; } 97%, 100% { stroke-dashoffset: 0; opacity: 0; } }
  @keyframes cta-g { 0%, 72% { opacity: 0; transform: scale(0.3); } 75% { opacity: 1; transform: scale(1.3); } 77%, 90% { opacity: 1; transform: scale(1); } 97%, 100% { opacity: 0; transform: scale(1); } }
  @keyframes cta-nudge { 0%, 60%, 100% { transform: translateX(0); } 30% { transform: translateX(5px); } }
}
@media (max-width: 720px) {
  .sv-cta { grid-template-columns: auto minmax(0, 1fr); padding: 16px; }
  .cta-sheet { width: 124px; align-self: start; }
  .cta-go { grid-column: 1 / -1; justify-self: stretch; }
  .cta-h { font-size: 1.12rem; }
}

/* The exam's named parts (Listening, Comprensió lectora…): links to their section pages (Marc, 17-11-2026). */
.secnav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 4px; }
.secnav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line-2); color: var(--ink); font-weight: 700; font-size: 0.92rem; text-decoration: none; }
.secnav a:hover { box-shadow: var(--hard), inset 0 0 0 2px var(--ink); }
