/* =========================================================
   Professor de socials — Hi-fi redesign
   Built on Què Estudiar Design System tokens
   ========================================================= */
@import url('qe-tokens.css');
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,500&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }

html { scroll-behavior: smooth; }
body {
  font-family: var(--qe-font-body);
  font-size: var(--qe-fs-base);
  line-height: var(--qe-lh-normal);
  color: var(--qe-fg);
  background: var(--qe-bg);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--qe-container);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 48px);
}
.container-narrow { max-width: 880px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 48px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 248, 242, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--qe-border);
}
.site-header .inner {
  max-width: var(--qe-container);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 48px);
  height: var(--qe-header-h);
  display: flex; align-items: center; gap: 24px;
}
.brand {
  font-family: var(--qe-font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--qe-fg);
  text-decoration: none;
  display: flex; align-items: center; gap: 4px;
}
.brand .star { color: var(--qe-yellow-600); font-style: italic; }
.brand small { display: none; }

.nav-main { display: none; gap: 4px; align-items: center; }
@media (min-width: 900px) { .nav-main { display: flex; } }
.nav-main a {
  font-size: 14px;
  font-weight: 500;
  color: var(--qe-fg);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--qe-radius-md);
  transition: background var(--qe-dur-1) var(--qe-ease);
}
.nav-main a:hover { background: var(--qe-stone-50); }
.nav-main a.active { color: var(--qe-fg-brand); }

.search-box {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--qe-bg-elevated);
  border: 1px solid var(--qe-border);
  border-radius: var(--qe-radius-pill);
  padding: 6px 14px 6px 12px;
  min-width: 220px;
  color: var(--qe-fg-subtle);
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--qe-dur-1) var(--qe-ease);
}
.search-box:hover { border-color: var(--qe-blue-300); }
.search-box svg { width: 16px; height: 16px; flex-shrink: 0; }
.search-box kbd {
  margin-left: auto;
  font-family: var(--qe-font-mono);
  font-size: 10px;
  background: var(--qe-stone-50);
  border: 1px solid var(--qe-border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--qe-fg-muted);
}

/* ---------- Strip / banner ---------- */
.banner-edition {
  background: var(--qe-blue-900);
  color: var(--qe-paper);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}
.banner-edition .inner {
  max-width: var(--qe-container);
  margin: 0 auto;
  padding: 8px clamp(20px, 5vw, 48px);
  display: flex; align-items: center; gap: 16px;
}
.banner-edition .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--qe-yellow-500); }
.banner-edition .pill-new { background: var(--qe-yellow-500); color: var(--qe-blue-900); padding: 1px 8px; border-radius: 999px; font-weight: 700; }
.banner-edition a { color: var(--qe-yellow-500); text-decoration: none; margin-left: auto; }
.banner-edition a:hover { text-decoration: underline; }

/* ---------- Hero (home) ---------- */
.hero {
  padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 64px);
  border-bottom: 1px solid var(--qe-border);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(var(--qe-stone-200) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: 0 0;
  opacity: 0.5;
  pointer-events: none;
  mask-image: radial-gradient(circle at 80% 20%, black 0%, transparent 60%);
}
.hero .inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 64px);
  align-items: center;
}
@media (max-width: 900px) { .hero .inner { grid-template-columns: 1fr; } }

.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--qe-fg-muted);
  margin-bottom: 18px;
}
.hero .eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--qe-yellow-500); }
.hero h1 {
  font-family: var(--qe-font-display);
  font-weight: 600;
  font-size: clamp(40px, 6vw, 80px);
  line-height: 0.96;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  max-width: 14ch;
  color: var(--qe-fg);
}
.hero h1 em {
  font-style: italic;
  color: var(--qe-blue-600);
  font-weight: 500;
}
.hero h1 .mark {
  background: linear-gradient(transparent 62%, var(--qe-yellow-300) 62%);
  padding: 0 4px;
}
.hero .lede {
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.55;
  color: var(--qe-fg-muted);
  max-width: 56ch;
  margin: 0 0 28px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hero-actions .micro {
  font-size: 12px;
  color: var(--qe-fg-muted);
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 4px;
}

.hero-side {
  position: relative;
  border-left: 1px solid var(--qe-border);
  padding-left: clamp(24px, 4vw, 48px);
}
@media (max-width: 900px) { .hero-side { border-left: none; padding-left: 0; padding-top: 24px; border-top: 1px solid var(--qe-border); } }
.hero-side .label-caps {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--qe-fg-muted);
  margin: 0 0 14px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.hero-side .label-caps a { color: var(--qe-blue-600); text-decoration: none; }
.hero-side .label-caps a:hover { text-decoration: underline; }

.feat-list { display: flex; flex-direction: column; }
.feat-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--qe-stone-100);
  text-decoration: none;
  color: inherit;
  transition: padding var(--qe-dur-1) var(--qe-ease);
}
.feat-row:last-child { border-bottom: none; }
.feat-row:hover { padding-left: 4px; }
.feat-row .thumb {
  width: 64px; height: 48px;
  background: var(--qe-stone-100);
  border-radius: var(--qe-radius-sm);
  background-size: cover; background-position: center;
  border: 1px solid var(--qe-border);
}
.feat-row .meta {
  font-size: 11px;
  color: var(--qe-fg-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}
.feat-row .ttl {
  font-family: var(--qe-font-display);
  font-weight: 500;
  font-size: 19px;
  line-height: 1.15;
  color: var(--qe-fg);
  margin-top: 2px;
}
.feat-row .arrow {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--qe-border);
  display: grid; place-items: center;
  color: var(--qe-fg-muted);
  transition: all var(--qe-dur-1) var(--qe-ease);
}
.feat-row:hover .arrow { background: var(--qe-blue-600); border-color: var(--qe-blue-600); color: white; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--qe-font-body);
  font-weight: 500;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: var(--qe-radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--qe-dur-1) var(--qe-ease);
  line-height: 1;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--qe-blue-600);
  color: var(--qe-paper);
}
.btn-primary:hover { background: var(--qe-blue-700); }
.btn-primary:active { background: var(--qe-blue-800); transform: translateY(1px); }
.btn-secondary {
  background: var(--qe-bg-elevated);
  color: var(--qe-fg);
  border-color: var(--qe-border);
}
.btn-secondary:hover { background: var(--qe-stone-50); border-color: var(--qe-border-strong); }
.btn-ghost {
  background: transparent;
  color: var(--qe-fg);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--qe-stone-50); }
.btn-accent {
  background: var(--qe-yellow-500);
  color: var(--qe-blue-900);
  font-weight: 600;
}
.btn-accent:hover { background: var(--qe-yellow-600); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.btn-icon {
  width: 36px; height: 36px; padding: 0;
  display: grid; place-items: center;
}

/* ---------- Stats strip ---------- */
.stats-strip {
  background: var(--qe-paper-2);
  border-bottom: 1px solid var(--qe-border);
  padding: 28px 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
@media (max-width: 800px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-cell {
  display: flex; flex-direction: column; gap: 4px;
}
.stat-cell .num {
  font-family: var(--qe-font-display);
  font-weight: 600;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--qe-fg);
}
.stat-cell .num small {
  font-size: 0.5em;
  font-weight: 500;
  color: var(--qe-fg-muted);
  margin-left: 4px;
}
.stat-cell .lbl {
  font-size: 13px;
  color: var(--qe-fg-muted);
  font-weight: 500;
}

/* ---------- Section ---------- */
.section {
  padding: clamp(48px, 7vw, 88px) 0;
}
.section-head {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between;
  gap: 18px;
  margin-bottom: 32px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--qe-border);
}
.section-head h2 {
  font-family: var(--qe-font-display);
  font-weight: 600;
  font-size: clamp(28px, 3.5vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 22ch;
}
.section-head .section-sub {
  font-size: 14px;
  color: var(--qe-fg-muted);
  max-width: 36ch;
}

/* ---------- Currículum matrix ---------- */
.matrix-wrap { padding-bottom: 12px; }
.matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--qe-bg-elevated);
  border: 1px solid var(--qe-border);
  border-radius: var(--qe-radius-lg);
  overflow: hidden;
  box-shadow: var(--qe-shadow-sm);
}
.matrix-table th, .matrix-table td {
  text-align: left;
  padding: 18px 18px;
  border-right: 1px solid var(--qe-stone-100);
  border-bottom: 1px solid var(--qe-stone-100);
  vertical-align: middle;
}
.matrix-table th:last-child, .matrix-table td:last-child { border-right: none; }
.matrix-table tr:last-child td { border-bottom: none; }
.matrix-table thead th {
  background: var(--qe-blue-900);
  color: var(--qe-paper);
  font-family: var(--qe-font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.matrix-table thead th:first-child { background: var(--qe-blue-900); }
.matrix-table tbody th {
  background: var(--qe-paper-2);
  font-family: var(--qe-font-display);
  font-weight: 600;
  font-size: 18px;
  width: 130px;
}
.matrix-cell {
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
  min-height: 64px;
  transition: background var(--qe-dur-1) var(--qe-ease);
}
.matrix-cell:hover { background: var(--qe-blue-50); }
.matrix-cell .count {
  font-family: var(--qe-font-display);
  font-weight: 600;
  font-size: 28px;
  line-height: 1;
  color: var(--qe-fg);
}
.matrix-cell .count-lbl {
  font-size: 12px;
  color: var(--qe-fg-muted);
  margin-top: 4px;
}
.matrix-cell.empty .count { color: var(--qe-fg-subtle); }
.matrix-cell.empty .count-lbl { color: var(--qe-fg-subtle); font-style: italic; }
.matrix-cell .badge-new {
  position: absolute; top: 12px; right: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--qe-yellow-500);
  color: var(--qe-blue-900);
  padding: 2px 8px;
  border-radius: 999px;
}
.matrix-table td.has-content { cursor: pointer; }

/* ---------- Editor's note ---------- */
.editor-note {
  margin-top: 36px;
  padding: 32px clamp(24px, 4vw, 48px);
  background: var(--qe-blue-900);
  color: var(--qe-paper);
  border-radius: var(--qe-radius-xl);
  position: relative;
  overflow: hidden;
}
.editor-note::before {
  content: """;
  position: absolute;
  top: -28px; left: 24px;
  font-family: var(--qe-font-display);
  font-size: 220px;
  line-height: 1;
  color: var(--qe-yellow-500);
  opacity: 0.7;
  font-style: italic;
  pointer-events: none;
}
.editor-note .text {
  position: relative;
  font-family: var(--qe-font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.3;
  max-width: 38ch;
  margin: 0 0 18px;
}
.editor-note .sig {
  font-family: var(--qe-font-body);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0.8;
  position: relative;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--qe-blue-900);
  color: var(--qe-paper);
  padding: clamp(48px, 6vw, 80px) 0 32px;
  margin-top: 80px;
}
.site-footer .inner {
  max-width: var(--qe-container);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 48px);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-col h4 {
  font-family: var(--qe-font-body);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--qe-yellow-500);
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.footer-col a {
  color: var(--qe-paper);
  text-decoration: none;
  font-size: 14px;
  opacity: 0.85;
}
.footer-col a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.footer-brand .brand-big {
  font-family: var(--qe-font-display);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.footer-brand .brand-big .star { color: var(--qe-yellow-500); font-style: italic; }
.footer-brand p {
  font-size: 14px;
  opacity: 0.75;
  max-width: 32ch;
  line-height: 1.55;
  margin: 0;
}
.footer-bottom {
  border-top: 1px solid rgba(251, 248, 242, 0.15);
  padding-top: 24px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 12px;
  opacity: 0.7;
  font-family: var(--qe-font-mono);
  letter-spacing: 0.04em;
}

/* ---------- Generic page header (interior pages) ---------- */
.crumbs {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--qe-fg-muted);
  margin-bottom: 12px;
}
.crumbs a { color: var(--qe-fg-muted); text-decoration: none; }
.crumbs a:hover { color: var(--qe-blue-600); }
.crumbs .sep { margin: 0 6px; opacity: 0.5; }

/* ---------- Tag / chip ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--qe-stone-50);
  border: 1px solid var(--qe-border);
  color: var(--qe-fg);
}
.chip.brand { background: var(--qe-blue-50); border-color: var(--qe-blue-200); color: var(--qe-blue-700); }
.chip.accent { background: var(--qe-yellow-100); border-color: var(--qe-yellow-300); color: var(--qe-yellow-700); }
.chip.success { background: var(--qe-green-50); border-color: rgba(24,165,107,0.3); color: var(--qe-green-700); }
.chip.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Unit cards (used in lists) ---------- */
.unit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 1000px) { .unit-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .unit-grid { grid-template-columns: 1fr; } }

.unit-card {
  display: flex; flex-direction: column;
  background: var(--qe-bg-elevated);
  border: 1px solid var(--qe-border);
  border-radius: var(--qe-radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform var(--qe-dur-2) var(--qe-ease), box-shadow var(--qe-dur-2) var(--qe-ease);
  box-shadow: var(--qe-shadow-sm);
}
.unit-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--qe-shadow-lg);
}
.unit-card .cover {
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  background-color: var(--qe-stone-100);
  position: relative;
  overflow: hidden;
}
.unit-card .cover::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(11,24,64,0.55) 100%);
}
.unit-card .num {
  position: absolute; top: 14px; left: 14px;
  font-family: var(--qe-font-mono);
  font-size: 11px;
  font-weight: 500;
  background: var(--qe-paper);
  color: var(--qe-blue-700);
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  z-index: 1;
}
.unit-card .badge-new {
  position: absolute; top: 14px; right: 14px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--qe-yellow-500);
  color: var(--qe-blue-900);
  padding: 3px 8px;
  border-radius: 999px;
  z-index: 1;
}
.unit-card .body {
  padding: 18px 20px 20px;
  display: flex; flex-direction: column; gap: 10px;
  flex: 1;
}
.unit-card .body .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.unit-card h3 {
  font-family: var(--qe-font-display);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--qe-fg);
}
.unit-card .desc {
  font-size: 13.5px;
  color: var(--qe-fg-muted);
  line-height: 1.5;
  margin: 0;
}
.unit-card .feet {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px;
  margin-top: auto;
  border-top: 1px solid var(--qe-stone-100);
  font-size: 12px;
  color: var(--qe-fg-muted);
}
.unit-card .feet .includes { display: flex; gap: 8px; align-items: center; }
.unit-card .feet svg { width: 14px; height: 14px; }

/* ---------- Pull stat / Big number ---------- */
.pull-stat {
  display: flex; flex-wrap: wrap; gap: 24px;
  padding: 22px 28px;
  background: var(--qe-yellow-100);
  border: 1px solid var(--qe-yellow-300);
  border-radius: var(--qe-radius-lg);
  margin: 24px 0;
}
.pull-stat .item { display: flex; flex-direction: column; }
.pull-stat .num {
  font-family: var(--qe-font-display);
  font-weight: 600;
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--qe-blue-900);
}
.pull-stat .lbl {
  font-size: 13px;
  color: var(--qe-blue-800);
  margin-top: 4px;
}

/* ---------- Misc utilities ---------- */
.divider {
  height: 1px;
  background: var(--qe-border);
  margin: 40px 0;
}
.text-mono { font-family: var(--qe-font-mono); font-variant-numeric: tabular-nums; }
.text-muted { color: var(--qe-fg-muted); }
.text-caps { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; }

/* ---------- Mobile menu (hidden by default, no JS for now) ---------- */
.mobile-toggle { display: none; }
@media (max-width: 900px) {
  .nav-main { display: none; }
  .search-box { min-width: 0; }
  .search-box span:not(.kbd) { display: none; }
  .search-box kbd { display: none; }
}

/* ====== unitat-poblacio ====== */
    /* === UNIT-PAGE SPECIFIC === */
    .unit-hero {
      position: relative;
      padding: 56px 0 64px;
      background: var(--qe-blue-900);
      color: var(--qe-paper);
      overflow: hidden;
      border-bottom: 4px solid var(--qe-yellow-500);
    }
    .unit-hero::before {
      content: "";
      position: absolute; inset: 0;
      background-image: url('https://upload.wikimedia.org/wikipedia/commons/thumb/3/35/World_population_density_1994.png/1600px-World_population_density_1994.png');
      background-size: cover;
      background-position: center;
      opacity: 0.18;
      mix-blend-mode: screen;
      filter: contrast(1.1);
    }
    .unit-hero .inner { position: relative; max-width: var(--qe-container); margin: 0 auto; padding: 0 clamp(20px, 5vw, 48px); }
    .unit-hero .crumbs { color: rgba(251,248,242,0.6); margin-bottom: 28px; }
    .unit-hero .crumbs a { color: rgba(251,248,242,0.85); }
    .unit-hero .num {
      font-family: var(--qe-font-mono);
      font-size: 13px;
      letter-spacing: 0.1em;
      color: var(--qe-yellow-500);
      margin-bottom: 12px;
    }
    .unit-hero h1 {
      font-family: var(--qe-font-display);
      font-weight: 600;
      font-size: clamp(40px, 6vw, 72px);
      line-height: 0.98;
      letter-spacing: -0.02em;
      margin: 0 0 18px;
      max-width: 18ch;
    }
    .unit-hero .lede {
      font-size: 19px;
      line-height: 1.5;
      max-width: 60ch;
      color: rgba(251,248,242,0.85);
      margin: 0 0 28px;
    }
    .unit-hero .meta-row {
      display: flex; flex-wrap: wrap; gap: 24px;
      padding-top: 24px;
      border-top: 1px solid rgba(251,248,242,0.18);
      font-size: 13.5px;
    }
    .unit-hero .meta-row .item { display: flex; flex-direction: column; gap: 2px; }
    .unit-hero .meta-row .k { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--qe-yellow-500); }
    .unit-hero .meta-row .v { font-weight: 500; }
    .unit-hero .actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; }

    /* Sticky TOC layout */
    .unit-body {
      max-width: var(--qe-container);
      margin: 0 auto;
      padding: 56px clamp(20px, 5vw, 48px) 80px;
      display: grid;
      grid-template-columns: 240px minmax(0, 1fr) 240px;
      gap: 48px;
    }
    @media (max-width: 1100px) { .unit-body { grid-template-columns: 200px minmax(0, 1fr); } .toc-right { display: none; } }
    @media (max-width: 800px) { .unit-body { grid-template-columns: 1fr; } .toc-left { display: none; } }

    .toc-left {
      position: sticky; top: calc(var(--qe-header-h) + 24px);
      align-self: start;
      max-height: calc(100vh - var(--qe-header-h) - 48px);
      overflow-y: auto;
    }
    .toc-left h4 {
      font-size: 11px;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      font-weight: 600;
      color: var(--qe-fg-muted);
      margin: 0 0 14px;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--qe-border);
    }
    .toc-left ol {
      list-style: none;
      padding: 0;
      margin: 0;
      display: flex; flex-direction: column;
    }
    .toc-left ol li {
      display: flex;
      gap: 10px;
      padding: 8px 0;
      font-size: 13.5px;
      line-height: 1.4;
      counter-increment: toc;
      position: relative;
    }
    .toc-left ol li::before {
      content: counter(toc, decimal-leading-zero);
      font-family: var(--qe-font-mono);
      font-size: 11px;
      color: var(--qe-fg-subtle);
      flex-shrink: 0;
      width: 22px;
      padding-top: 2px;
    }
    .toc-left ol { counter-reset: toc; }
    .toc-left a { color: var(--qe-fg); text-decoration: none; transition: color var(--qe-dur-1) var(--qe-ease); }
    .toc-left a:hover { color: var(--qe-blue-600); }
    .toc-left li.active::before { color: var(--qe-blue-600); font-weight: 600; }
    .toc-left li.active a { color: var(--qe-blue-600); font-weight: 600; }
    .toc-left li.active::after {
      content: "";
      position: absolute;
      left: -16px; top: 12px;
      width: 3px; height: 16px;
      background: var(--qe-blue-600);
      border-radius: 2px;
    }
    .toc-progress {
      margin-top: 18px;
      height: 4px;
      background: var(--qe-stone-100);
      border-radius: 2px;
      overflow: hidden;
    }
    .toc-progress div { height: 100%; background: var(--qe-blue-600); width: 28%; }
    .toc-progress + .lbl { font-size: 11px; color: var(--qe-fg-muted); margin-top: 6px; }

    /* Article body */
    .article {
      font-size: 17px;
      line-height: 1.65;
      color: var(--qe-fg);
      max-width: 65ch;
    }
    .article h2 {
      font-family: var(--qe-font-display);
      font-weight: 600;
      font-size: 32px;
      line-height: 1.1;
      letter-spacing: -0.02em;
      margin: 56px 0 18px;
      scroll-margin-top: calc(var(--qe-header-h) + 24px);
    }
    .article h2:first-child { margin-top: 0; }
    .article h2 .num {
      font-family: var(--qe-font-mono);
      font-size: 14px;
      font-weight: 500;
      color: var(--qe-blue-600);
      display: block;
      margin-bottom: 6px;
      letter-spacing: 0.04em;
    }
    .article h3 {
      font-family: var(--qe-font-display);
      font-weight: 600;
      font-size: 22px;
      line-height: 1.2;
      margin: 32px 0 12px;
    }
    .article p { margin: 0 0 18px; }
    .article p.lede-p {
      font-size: 20px;
      line-height: 1.5;
      color: var(--qe-fg);
      font-family: var(--qe-font-display);
      font-weight: 400;
      max-width: 30ch;
      letter-spacing: -0.005em;
    }
    .article p.lede-p::first-letter {
      font-size: 4em;
      float: left;
      line-height: 0.85;
      margin: 6px 8px 0 0;
      font-weight: 600;
      color: var(--qe-blue-600);
    }
    .article ul, .article ol { padding-left: 22px; margin: 0 0 18px; }
    .article li { margin-bottom: 8px; }
    .article strong { font-weight: 600; }
    .article a { color: var(--qe-blue-600); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }

    .article figure {
      margin: 32px 0;
      padding: 0;
    }
    .article figure img {
      width: 100%;
      border-radius: var(--qe-radius-md);
      border: 1px solid var(--qe-border);
    }
    .article figcaption {
      font-size: 13px;
      color: var(--qe-fg-muted);
      margin-top: 10px;
      line-height: 1.45;
      padding-left: 12px;
      border-left: 2px solid var(--qe-yellow-500);
    }

    /* Concept callout */
    .callout {
      margin: 28px 0;
      padding: 22px 24px;
      background: var(--qe-paper-2);
      border: 1px solid var(--qe-border);
      border-left: 4px solid var(--qe-yellow-500);
      border-radius: var(--qe-radius-md);
    }
    .callout .lbl {
      font-size: 11px;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      font-weight: 600;
      color: var(--qe-yellow-700);
      margin-bottom: 6px;
    }
    .callout h4 {
      font-family: var(--qe-font-display);
      font-weight: 600;
      font-size: 18px;
      margin: 0 0 6px;
    }
    .callout p { font-size: 15px; line-height: 1.55; margin: 0; color: var(--qe-fg-muted); }

    /* Activity card embedded in article */
    .activity-embed {
      margin: 32px 0;
      padding: 24px;
      background: var(--qe-bg-elevated);
      border: 1px solid var(--qe-border);
      border-radius: var(--qe-radius-lg);
      box-shadow: var(--qe-shadow-sm);
    }
    .activity-embed .head {
      display: flex; gap: 14px; align-items: center;
      margin-bottom: 12px;
    }
    .activity-embed .head .icon {
      width: 36px; height: 36px;
      background: var(--qe-blue-600);
      color: white;
      border-radius: 8px;
      display: grid; place-items: center;
      font-family: var(--qe-font-mono);
      font-size: 13px;
      font-weight: 600;
    }
    .activity-embed .head .ttl {
      font-family: var(--qe-font-display);
      font-weight: 600;
      font-size: 19px;
      margin: 0;
    }
    .activity-embed .head .ttl .lvl {
      font-family: var(--qe-font-body);
      font-size: 11px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      font-weight: 600;
      color: var(--qe-fg-muted);
      margin-left: 8px;
    }
    .activity-embed p { font-size: 15px; line-height: 1.55; color: var(--qe-fg-muted); margin: 0 0 14px; }
    .activity-embed .levels {
      display: flex; gap: 6px; flex-wrap: wrap;
      padding-top: 14px;
      border-top: 1px solid var(--qe-stone-100);
    }
    .activity-embed .levels a {
      font-size: 13px;
      font-weight: 500;
      padding: 6px 12px;
      border-radius: 999px;
      border: 1px solid var(--qe-border);
      text-decoration: none;
      color: var(--qe-fg);
      transition: all var(--qe-dur-1) var(--qe-ease);
    }
    .activity-embed .levels a:hover { background: var(--qe-blue-50); border-color: var(--qe-blue-300); color: var(--qe-blue-700); }
    .activity-embed .levels a .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

    /* Right rail */
    .toc-right {
      position: sticky; top: calc(var(--qe-header-h) + 24px);
      align-self: start;
      display: flex; flex-direction: column; gap: 20px;
    }
    .rail-card {
      padding: 18px;
      background: var(--qe-bg-elevated);
      border: 1px solid var(--qe-border);
      border-radius: var(--qe-radius-md);
    }
    .rail-card h4 {
      font-size: 11px;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      font-weight: 600;
      color: var(--qe-fg-muted);
      margin: 0 0 10px;
    }
    .rail-card .stat {
      font-family: var(--qe-font-display);
      font-weight: 600;
      font-size: 28px;
      line-height: 1;
      margin: 0 0 4px;
    }
    .rail-card .lbl-sm { font-size: 12px; color: var(--qe-fg-muted); }
    .rail-card.dark { background: var(--qe-blue-900); color: var(--qe-paper); border-color: var(--qe-blue-900); }
    .rail-card.dark h4 { color: var(--qe-yellow-500); }

    /* Pager footer */
    .unit-pager {
      max-width: var(--qe-container);
      margin: 0 auto;
      padding: 32px clamp(20px, 5vw, 48px) 60px;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
    }
    @media (max-width: 700px) { .unit-pager { grid-template-columns: 1fr; } }
    .pager-link {
      padding: 22px 24px;
      background: var(--qe-bg-elevated);
      border: 1px solid var(--qe-border);
      border-radius: var(--qe-radius-lg);
      text-decoration: none;
      color: inherit;
      transition: all var(--qe-dur-1) var(--qe-ease);
    }
    .pager-link:hover { transform: translateY(-2px); box-shadow: var(--qe-shadow-md); border-color: var(--qe-blue-300); }
    .pager-link .dir { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--qe-fg-muted); margin-bottom: 4px; }
    .pager-link h4 { font-family: var(--qe-font-display); font-weight: 600; font-size: 19px; margin: 0; line-height: 1.2; }
    .pager-link .num { font-family: var(--qe-font-mono); font-size: 12px; color: var(--qe-blue-600); margin-bottom: 6px; }
    .pager-link.next { text-align: right; }

    /* === MODE AULA (full-screen overlay) === */
    .aula-overlay {
      position: fixed; inset: 0;
      background: var(--qe-blue-900);
      color: var(--qe-paper);
      z-index: 1000;
      display: none;
      flex-direction: column;
      padding: 0;
      overflow: hidden;
    }
    .aula-overlay.active { display: flex; }
    .aula-top {
      display: flex; align-items: center; gap: 20px;
      padding: 18px 32px;
      border-bottom: 1px solid rgba(251,248,242,0.15);
      flex-shrink: 0;
    }
    .aula-top .pill {
      font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700;
      background: var(--qe-yellow-500); color: var(--qe-blue-900);
      padding: 4px 10px; border-radius: 999px;
    }
    .aula-top .ttl { font-family: var(--qe-font-display); font-weight: 500; font-size: 16px; opacity: 0.85; }
    .aula-top .right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
    .aula-top .step-counter { font-family: var(--qe-font-mono); font-size: 13px; opacity: 0.7; }
    .aula-close {
      background: transparent; border: 1px solid rgba(251,248,242,0.3);
      color: var(--qe-paper);
      width: 36px; height: 36px; border-radius: 50%;
      display: grid; place-items: center; cursor: pointer;
    }
    .aula-stage {
      flex: 1;
      display: grid;
      place-items: center;
      padding: 40px 80px;
      position: relative;
      overflow: hidden;
    }
    .aula-slide { display: none; max-width: 1200px; width: 100%; }
    .aula-slide.on { display: block; }
    .aula-slide .num {
      font-family: var(--qe-font-mono);
      font-size: 14px;
      letter-spacing: 0.1em;
      color: var(--qe-yellow-500);
      margin-bottom: 14px;
    }
    .aula-slide h2 {
      font-family: var(--qe-font-display);
      font-weight: 600;
      font-size: clamp(48px, 6vw, 88px);
      line-height: 0.98;
      letter-spacing: -0.02em;
      margin: 0 0 24px;
    }
    .aula-slide p {
      font-size: clamp(20px, 1.6vw, 26px);
      line-height: 1.45;
      max-width: 38ch;
      color: rgba(251,248,242,0.9);
      margin: 0 0 16px;
    }
    .aula-slide ul {
      font-size: clamp(18px, 1.4vw, 22px);
      line-height: 1.5;
      padding-left: 24px;
      max-width: 50ch;
    }
    .aula-slide ul li { margin-bottom: 12px; }
    .aula-slide.with-image {
      display: none;
      grid-template-columns: 1fr 1fr;
      gap: 64px;
      align-items: center;
    }
    .aula-slide.with-image.on { display: grid; }
    .aula-slide.with-image .visual {
      aspect-ratio: 4/3;
      background-size: cover; background-position: center;
      border-radius: var(--qe-radius-lg);
      border: 4px solid var(--qe-yellow-500);
    }
    .aula-nav {
      position: absolute;
      bottom: 32px; left: 50%;
      transform: translateX(-50%);
      display: flex; align-items: center; gap: 8px;
      background: rgba(251,248,242,0.08);
      backdrop-filter: blur(10px);
      padding: 6px 6px 6px 16px;
      border-radius: 999px;
      border: 1px solid rgba(251,248,242,0.15);
    }
    .aula-nav .label { font-family: var(--qe-font-mono); font-size: 12px; opacity: 0.8; padding-right: 8px; }
    .aula-nav button {
      background: transparent;
      color: var(--qe-paper);
      border: none;
      width: 36px; height: 36px;
      border-radius: 50%;
      cursor: pointer;
      display: grid; place-items: center;
    }
    .aula-nav button:hover { background: rgba(251,248,242,0.15); }
    .aula-progress {
      position: absolute;
      top: 0; left: 0; right: 0;
      height: 3px;
      background: rgba(251,248,242,0.1);
    }
    .aula-progress .bar {
      height: 100%;
      background: var(--qe-yellow-500);
      transition: width 300ms ease;
    }

/* ====== fitxa-detall ====== */
    .fitxa-hero { padding: 56px 0 32px; background: var(--qe-paper-2); border-bottom: 1px solid var(--qe-border); }
    .fitxa-hero h1 { font-family: var(--qe-font-display); font-weight: 600; font-size: clamp(36px, 5vw, 56px); line-height: 1.02; letter-spacing: -0.02em; margin: 12px 0 14px; max-width: 22ch; }
    .fitxa-hero .lede { font-size: 17px; color: var(--qe-fg-muted); max-width: 60ch; line-height: 1.55; margin: 0; }

    .level-tabs {
      display: flex; gap: 4px; align-items: stretch;
      background: var(--qe-bg-elevated);
      border: 1px solid var(--qe-border);
      border-radius: var(--qe-radius-md);
      padding: 4px;
      margin-top: 28px;
      width: fit-content;
    }
    .level-tabs button {
      display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
      border: 0; background: transparent;
      padding: 10px 18px;
      border-radius: 8px;
      cursor: pointer;
      text-align: left;
      transition: background var(--qe-dur-1) var(--qe-ease);
    }
    .level-tabs button .lvl-dot { width: 8px; height: 8px; border-radius: 50%; }
    .level-tabs button .lvl-name { font-weight: 600; font-size: 14px; color: var(--qe-fg); display: flex; align-items: center; gap: 8px; }
    .level-tabs button .lvl-desc { font-size: 12px; color: var(--qe-fg-muted); }
    .level-tabs button.on { background: var(--qe-blue-900); }
    .level-tabs button.on .lvl-name, .level-tabs button.on .lvl-desc { color: var(--qe-paper); }

    .fitxa-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; padding: 56px 0 80px; }
    @media (max-width: 900px) { .fitxa-body { grid-template-columns: 1fr; } }

    .ex {
      background: var(--qe-bg-elevated);
      border: 1px solid var(--qe-border);
      border-radius: var(--qe-radius-lg);
      padding: 28px 32px;
      margin-bottom: 18px;
    }
    .ex .ex-num { font-family: var(--qe-font-mono); font-size: 12px; color: var(--qe-blue-600); margin-bottom: 8px; letter-spacing: 0.04em; }
    .ex h3 { font-family: var(--qe-font-display); font-weight: 600; font-size: 22px; line-height: 1.2; margin: 0 0 12px; }
    .ex p { font-size: 16px; line-height: 1.55; color: var(--qe-fg); margin: 0 0 14px; }
    .ex .input-line { display: block; padding: 12px 14px; background: var(--qe-paper-2); border: 1px dashed var(--qe-border-strong); border-radius: 8px; min-height: 60px; font-size: 14px; color: var(--qe-fg-subtle); }
    .ex .input-table {
      width: 100%; border-collapse: collapse; margin-top: 12px;
    }
    .ex .input-table th, .ex .input-table td {
      border: 1px solid var(--qe-border);
      padding: 10px 12px;
      font-size: 14px;
      text-align: left;
    }
    .ex .input-table th { background: var(--qe-paper-2); font-weight: 600; }
    .ex .input-table td.fill { background: var(--qe-stone-50); color: var(--qe-fg-subtle); font-style: italic; font-size: 13px; }

    .fitxa-side {
      position: sticky; top: calc(var(--qe-header-h) + 24px);
      align-self: start;
      display: flex; flex-direction: column; gap: 18px;
    }
    .side-card { background: var(--qe-bg-elevated); border: 1px solid var(--qe-border); border-radius: var(--qe-radius-md); padding: 18px; }
    .side-card h4 { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; color: var(--qe-fg-muted); margin: 0 0 10px; }
    .side-card .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13.5px; border-bottom: 1px solid var(--qe-stone-100); }
    .side-card .row:last-child { border: none; }
    .side-card .row .k { color: var(--qe-fg-muted); }
    .side-card .row .v { font-weight: 600; }

    .level-banner {
      padding: 14px 20px;
      border-radius: var(--qe-radius-md);
      margin-bottom: 24px;
      font-size: 14px;
      display: flex; align-items: center; gap: 12px;
    }
    .level-banner .icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: white; flex-shrink: 0; font-size: 13px; font-weight: 600; font-family: var(--qe-font-mono); }
    .level-banner.adapt { background: var(--qe-green-50); border: 1px solid rgba(24,165,107,0.3); color: var(--qe-green-700); }
    .level-banner.adapt .icon { background: var(--qe-green-600); }
    .level-banner.basic { background: var(--qe-blue-50); border: 1px solid var(--qe-blue-200); color: var(--qe-blue-700); display: none; }
    .level-banner.basic .icon { background: var(--qe-blue-600); }
    .level-banner.amp { background: var(--qe-yellow-100); border: 1px solid var(--qe-yellow-300); color: var(--qe-yellow-700); display: none; }
    .level-banner.amp .icon { background: var(--qe-yellow-600); }
    body[data-level="basic"] .level-banner.adapt { display: none; }
    body[data-level="basic"] .level-banner.basic { display: flex; }
    body[data-level="amp"] .level-banner.adapt { display: none; }
    body[data-level="amp"] .level-banner.amp { display: flex; }

    /* Different ex content per level — show only matching */
    .lvl-only { display: none; }
    body[data-level="adapt"] .lvl-adapt { display: block; }
    body[data-level="basic"] .lvl-basic { display: block; }
    body[data-level="amp"] .lvl-amp { display: block; }

/* ====== situacio-aprenentatge ====== */
    .sa-hero {
      padding: 64px 0;
      background: linear-gradient(135deg, var(--qe-blue-900) 0%, var(--qe-blue-700) 100%);
      color: var(--qe-paper);
      position: relative;
      overflow: hidden;
    }
    .sa-hero::before {
      content: ""; position: absolute; inset: 0;
      background: url('https://upload.wikimedia.org/wikipedia/commons/thumb/c/c2/Roma-vista-desde-el-Pincio.jpg/1600px-Roma-vista-desde-el-Pincio.jpg') center/cover;
      opacity: 0.18;
    }
    .sa-hero .inner { position: relative; max-width: var(--qe-container); margin: 0 auto; padding: 0 clamp(20px,5vw,48px); }
    .sa-hero .crumbs { color: rgba(251,248,242,0.6); }
    .sa-hero .crumbs a { color: rgba(251,248,242,0.85); }
    .sa-hero .pill {
      display: inline-flex; align-items: center; gap: 8px;
      font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700;
      background: var(--qe-yellow-500); color: var(--qe-blue-900);
      padding: 5px 12px; border-radius: 999px;
      margin: 24px 0 14px;
    }
    .sa-hero h1 { font-family: var(--qe-font-display); font-weight: 600; font-size: clamp(44px, 6.5vw, 80px); line-height: 0.98; letter-spacing: -0.02em; margin: 0 0 18px; max-width: 18ch; }
    .sa-hero .lede { font-size: 19px; line-height: 1.5; max-width: 60ch; color: rgba(251,248,242,0.9); margin: 0 0 32px; }
    .sa-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding-top: 24px; border-top: 1px solid rgba(251,248,242,0.18); }
    @media (max-width: 700px) { .sa-meta { grid-template-columns: repeat(2, 1fr); } }
    .sa-meta .k { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--qe-yellow-500); margin-bottom: 4px; }
    .sa-meta .v { font-family: var(--qe-font-display); font-weight: 600; font-size: 22px; }

    /* Challenge card */
    .challenge {
      margin-top: -40px; position: relative; z-index: 2;
      background: var(--qe-bg-elevated);
      border: 1px solid var(--qe-border);
      border-radius: var(--qe-radius-xl);
      padding: 36px 40px;
      box-shadow: var(--qe-shadow-lg);
      max-width: 980px;
      margin-left: auto; margin-right: auto;
      display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center;
    }
    @media (max-width: 700px) { .challenge { grid-template-columns: 1fr; padding: 28px; } }
    .challenge .big { font-family: var(--qe-font-display); font-weight: 600; font-size: 88px; line-height: 0.85; color: var(--qe-blue-600); letter-spacing: -0.04em; }
    .challenge h2 { font-family: var(--qe-font-display); font-weight: 600; font-size: 28px; line-height: 1.15; margin: 0 0 8px; }
    .challenge p { font-size: 16px; line-height: 1.55; color: var(--qe-fg-muted); margin: 0; }

    /* Sessions timeline */
    .sessions { padding: 80px 0; }
    .session {
      display: grid;
      grid-template-columns: 120px minmax(0, 1fr) 280px;
      gap: 32px;
      padding: 32px 0;
      border-bottom: 1px solid var(--qe-border);
      align-items: start;
    }
    @media (max-width: 900px) { .session { grid-template-columns: 80px 1fr; } .session .deliv { grid-column: 1 / -1; padding-left: 112px; } }
    @media (max-width: 600px) { .session { grid-template-columns: 1fr; } .session .deliv { padding-left: 0; } }
    .session .num-col { font-family: var(--qe-font-mono); font-size: 12px; color: var(--qe-fg-muted); letter-spacing: 0.06em; }
    .session .num-col .big { font-family: var(--qe-font-display); font-weight: 600; font-size: 56px; line-height: 0.85; color: var(--qe-fg); display: block; margin-bottom: 8px; letter-spacing: -0.02em; }
    .session h3 { font-family: var(--qe-font-display); font-weight: 600; font-size: 24px; line-height: 1.2; margin: 0 0 8px; }
    .session p.session-desc { font-size: 15px; line-height: 1.6; color: var(--qe-fg-muted); margin: 0 0 14px; }
    .session ul.actions-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
    .session ul.actions-list li { display: flex; gap: 8px; align-items: baseline; color: var(--qe-fg); }
    .session ul.actions-list li::before { content: "→"; color: var(--qe-blue-600); font-weight: 600; }
    .deliv { padding: 16px 18px; background: var(--qe-paper-2); border: 1px solid var(--qe-border); border-radius: var(--qe-radius-md); }
    .deliv .lbl { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--qe-yellow-700); font-weight: 600; margin-bottom: 6px; }
    .deliv .item { font-size: 14px; font-weight: 500; }
    .deliv .item + .item { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--qe-stone-100); }

    .rubric-wrap { padding: 64px 0 80px; background: var(--qe-paper-2); border-top: 1px solid var(--qe-border); }
    .rubric-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--qe-bg-elevated); border: 1px solid var(--qe-border); border-radius: var(--qe-radius-lg); overflow: hidden; box-shadow: var(--qe-shadow-sm); }
    .rubric-table th, .rubric-table td { padding: 14px 16px; text-align: left; vertical-align: top; border-right: 1px solid var(--qe-stone-100); border-bottom: 1px solid var(--qe-stone-100); font-size: 13.5px; line-height: 1.5; }
    .rubric-table thead th { background: var(--qe-blue-900); color: var(--qe-paper); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
    .rubric-table tbody th { background: var(--qe-paper-2); font-family: var(--qe-font-display); font-size: 16px; }

/* ====== cerca ====== */
    .search-hero { padding: 56px 0 32px; border-bottom: 1px solid var(--qe-border); }
    .search-hero h1 { font-family: var(--qe-font-display); font-weight: 600; font-size: clamp(36px, 5vw, 56px); line-height: 1.02; letter-spacing: -0.02em; margin: 12px 0 14px; }
    .search-input-wrap {
      display: flex; align-items: center; gap: 12px;
      padding: 18px 24px;
      background: var(--qe-bg-elevated);
      border: 2px solid var(--qe-blue-600);
      border-radius: var(--qe-radius-md);
      box-shadow: var(--qe-shadow-md);
      max-width: 720px;
    }
    .search-input-wrap svg { width: 22px; height: 22px; color: var(--qe-blue-600); flex-shrink: 0; }
    .search-input-wrap input { flex: 1; border: 0; font-size: 19px; background: transparent; outline: none; font-family: var(--qe-font-body); color: var(--qe-fg); }
    .search-input-wrap kbd { font-family: var(--qe-font-mono); font-size: 11px; background: var(--qe-stone-50); border: 1px solid var(--qe-border); border-radius: 4px; padding: 2px 6px; color: var(--qe-fg-muted); }
    .search-meta { color: var(--qe-fg-muted); font-size: 14px; margin-top: 16px; }

    .search-body { display: grid; grid-template-columns: 240px 1fr; gap: 48px; padding: 40px 0 80px; }
    @media (max-width: 900px) { .search-body { grid-template-columns: 1fr; } .search-side { display: none; } }
    .search-side h4 { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; color: var(--qe-fg-muted); margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--qe-border); }
    .search-side ul { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
    .search-side a { color: var(--qe-fg); text-decoration: none; padding: 4px 0; display: flex; justify-content: space-between; }
    .search-side a:hover { color: var(--qe-blue-600); }
    .search-side a .count { font-family: var(--qe-font-mono); font-size: 12px; color: var(--qe-fg-muted); }
    .search-side a.on { color: var(--qe-blue-600); font-weight: 600; }

    .res {
      padding: 22px 0;
      border-bottom: 1px solid var(--qe-stone-100);
      display: grid;
      grid-template-columns: 100px 1fr;
      gap: 24px;
      text-decoration: none;
      color: inherit;
    }
    .res:hover { background: var(--qe-paper-2); padding-left: 12px; padding-right: 12px; border-radius: var(--qe-radius-md); border-bottom-color: transparent; }
    .res .thumb { aspect-ratio: 4/3; background-size: cover; background-position: center; border-radius: var(--qe-radius-sm); border: 1px solid var(--qe-border); }
    .res .kind {
      display: inline-block;
      font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
      padding: 2px 8px; border-radius: 999px;
      margin-bottom: 6px;
    }
    .res .kind.unit { background: var(--qe-blue-50); color: var(--qe-blue-700); }
    .res .kind.sa { background: var(--qe-yellow-100); color: var(--qe-yellow-700); }
    .res .kind.fitxa { background: var(--qe-green-50); color: var(--qe-green-700); }
    .res .kind.note { background: var(--qe-stone-100); color: var(--qe-fg-muted); }
    .res h3 { font-family: var(--qe-font-display); font-weight: 600; font-size: 22px; line-height: 1.2; margin: 0 0 6px; }
    .res h3 mark { background: var(--qe-yellow-300); padding: 0 2px; }
    .res p { font-size: 14.5px; line-height: 1.5; color: var(--qe-fg-muted); margin: 0 0 8px; max-width: 70ch; }
    .res p mark { background: var(--qe-yellow-200); padding: 0 2px; color: var(--qe-fg); }
    .res .crumbs-mini { font-size: 12px; color: var(--qe-fg-muted); font-family: var(--qe-font-mono); }

/* ====== sobre ====== */
    .about-hero { padding: 96px 0 64px; border-bottom: 1px solid var(--qe-border); }
    .about-hero h1 { font-family: var(--qe-font-display); font-weight: 600; font-size: clamp(48px, 7vw, 88px); line-height: 0.95; letter-spacing: -0.02em; margin: 18px 0 24px; max-width: 18ch; }
    .about-hero h1 em { font-style: italic; color: var(--qe-blue-600); font-weight: 500; }
    .about-hero .lede { font-family: var(--qe-font-display); font-weight: 400; font-style: italic; font-size: clamp(20px, 2vw, 26px); line-height: 1.4; max-width: 38ch; color: var(--qe-fg-muted); margin: 0; }

    .manifesto { padding: 80px 0; }
    .manifesto-grid { display: grid; grid-template-columns: 200px 1fr; gap: 48px; align-items: start; }
    @media (max-width: 800px) { .manifesto-grid { grid-template-columns: 1fr; gap: 16px; } }
    .manifesto-num { font-family: var(--qe-font-display); font-weight: 600; font-size: 96px; line-height: 0.85; color: var(--qe-blue-600); letter-spacing: -0.04em; }
    .manifesto-block { padding-bottom: 48px; border-bottom: 1px solid var(--qe-border); margin-bottom: 48px; }
    .manifesto-block:last-child { border: none; }
    .manifesto-block h2 { font-family: var(--qe-font-display); font-weight: 600; font-size: 32px; line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 16px; max-width: 22ch; }
    .manifesto-block p { font-size: 17px; line-height: 1.6; color: var(--qe-fg-muted); max-width: 60ch; margin: 0 0 14px; }
    .manifesto-block p strong { color: var(--qe-fg); font-weight: 600; }

    .author-card {
      display: grid; grid-template-columns: 200px 1fr; gap: 32px;
      padding: 40px;
      background: var(--qe-blue-900);
      color: var(--qe-paper);
      border-radius: var(--qe-radius-xl);
      align-items: center;
    }
    @media (max-width: 700px) { .author-card { grid-template-columns: 1fr; text-align: center; } }
    .author-card .avatar {
      width: 200px; height: 200px;
      background: linear-gradient(135deg, var(--qe-yellow-500), var(--qe-yellow-700));
      border-radius: 50%;
      display: grid; place-items: center;
      font-family: var(--qe-font-display);
      font-weight: 600;
      font-size: 96px;
      color: var(--qe-blue-900);
      letter-spacing: -0.04em;
      margin: 0 auto;
    }
    .author-card h3 { font-family: var(--qe-font-display); font-weight: 600; font-size: 28px; margin: 0 0 6px; }
    .author-card .role { color: var(--qe-yellow-500); font-size: 14px; letter-spacing: 0.04em; margin: 0 0 12px; }
    .author-card p { font-size: 15px; line-height: 1.6; opacity: 0.85; max-width: 56ch; margin: 0; }

    .pillars { padding: 80px 0; background: var(--qe-paper-2); border-top: 1px solid var(--qe-border); border-bottom: 1px solid var(--qe-border); }
    .pillars-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
    @media (max-width: 800px) { .pillars-grid { grid-template-columns: 1fr; } }
    .pillar { background: var(--qe-bg-elevated); border: 1px solid var(--qe-border); border-radius: var(--qe-radius-lg); padding: 28px; }
    .pillar .icon { font-family: var(--qe-font-display); font-weight: 600; font-size: 36px; color: var(--qe-blue-600); margin-bottom: 12px; line-height: 1; }
    .pillar h3 { font-family: var(--qe-font-display); font-weight: 600; font-size: 22px; line-height: 1.15; margin: 0 0 8px; }
    .pillar p { font-size: 14.5px; line-height: 1.55; color: var(--qe-fg-muted); margin: 0; }

    .timeline { padding: 80px 0; }
    .tl-row { display: grid; grid-template-columns: 120px 1fr; gap: 32px; padding: 18px 0; border-bottom: 1px solid var(--qe-stone-100); align-items: baseline; }
    .tl-row .year { font-family: var(--qe-font-display); font-weight: 600; font-size: 28px; color: var(--qe-fg); }
    .tl-row p { margin: 0; color: var(--qe-fg-muted); font-size: 16px; line-height: 1.55; max-width: 60ch; }
    .tl-row p strong { color: var(--qe-fg); }

/* ====== geografia ====== */
    /* Page-specific */
    .subj-hero {
      padding: 56px 0 40px;
      background: var(--qe-paper-2);
      border-bottom: 1px solid var(--qe-border);
    }
    .subj-hero .grid {
      display: grid;
      grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
      gap: 48px;
      align-items: end;
    }
    @media (max-width: 800px) { .subj-hero .grid { grid-template-columns: 1fr; gap: 24px; } }
    .subj-hero h1 {
      font-family: var(--qe-font-display);
      font-weight: 600;
      font-size: clamp(40px, 6vw, 64px);
      line-height: 0.98;
      letter-spacing: -0.02em;
      margin: 14px 0 16px;
      color: var(--qe-fg);
    }
    .subj-hero .lede {
      font-size: 17px;
      line-height: 1.55;
      color: var(--qe-fg-muted);
      max-width: 60ch;
      margin: 0;
    }
    .subj-meta {
      display: grid;
      gap: 14px;
      font-size: 13.5px;
    }
    .subj-meta .row {
      display: flex; justify-content: space-between;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--qe-border);
    }
    .subj-meta .row:last-child { border-bottom: none; }
    .subj-meta .row .k { color: var(--qe-fg-muted); }
    .subj-meta .row .v { font-weight: 600; color: var(--qe-fg); }

    .toolbar {
      position: sticky; top: var(--qe-header-h);
      z-index: 30;
      background: rgba(251, 248, 242, 0.92);
      backdrop-filter: blur(10px);
      border-bottom: 1px solid var(--qe-border);
      padding: 14px 0;
    }
    .toolbar .inner {
      display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
      max-width: var(--qe-container);
      margin: 0 auto;
      padding: 0 clamp(20px, 5vw, 48px);
    }
    .toolbar .group { display: flex; gap: 6px; align-items: center; }
    .toolbar .label-mini { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; color: var(--qe-fg-muted); margin-right: 4px; }
    .seg {
      display: inline-flex;
      background: var(--qe-bg-elevated);
      border: 1px solid var(--qe-border);
      border-radius: var(--qe-radius-pill);
      padding: 3px;
    }
    .seg button {
      border: 0; background: transparent;
      font-size: 13px; font-weight: 500;
      padding: 6px 12px;
      border-radius: 999px;
      color: var(--qe-fg-muted);
    }
    .seg button.on {
      background: var(--qe-blue-900);
      color: var(--qe-paper);
    }
    .filter-chip {
      display: inline-flex; align-items: center; gap: 6px;
      font-size: 13px;
      font-weight: 500;
      padding: 6px 12px;
      border-radius: 999px;
      background: var(--qe-bg-elevated);
      border: 1px solid var(--qe-border);
      color: var(--qe-fg);
      cursor: pointer;
    }
    .filter-chip.on {
      background: var(--qe-blue-900);
      color: var(--qe-paper);
      border-color: var(--qe-blue-900);
    }
    .filter-chip .x { opacity: 0.6; font-size: 11px; }
    .toolbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

    /* Course cluster */
    .course-cluster { padding: 56px 0; border-bottom: 1px solid var(--qe-border); }
    .course-cluster:last-of-type { border-bottom: none; }
    .course-head {
      display: flex; align-items: end; gap: 24px; flex-wrap: wrap;
      margin-bottom: 28px;
    }
    .course-head .num {
      font-family: var(--qe-font-display);
      font-weight: 600;
      font-size: 88px;
      line-height: 0.85;
      letter-spacing: -0.04em;
      color: var(--qe-blue-900);
    }
    .course-head .meta {
      flex: 1; min-width: 0;
    }
    .course-head .meta h2 {
      font-family: var(--qe-font-display);
      font-weight: 600;
      font-size: 32px;
      line-height: 1.05;
      margin: 0 0 4px;
    }
    .course-head .meta .sub {
      color: var(--qe-fg-muted);
      font-size: 14.5px;
      max-width: 60ch;
      margin: 0;
    }
    .course-head .meta .badges {
      margin-top: 8px;
      display: flex; gap: 6px; flex-wrap: wrap;
    }
    .course-head .actions { display: flex; gap: 8px; }

    /* Unit row layout — alternative to card grid: numbered list */
    .unit-list {
      border-top: 1px solid var(--qe-border);
    }
    .unit-row {
      display: grid;
      grid-template-columns: 56px minmax(0, 1.4fr) minmax(0, 1.2fr) auto auto;
      gap: 18px;
      padding: 22px 0;
      border-bottom: 1px solid var(--qe-stone-100);
      align-items: center;
      text-decoration: none;
      color: inherit;
      transition: background var(--qe-dur-1) var(--qe-ease);
    }
    @media (max-width: 800px) {
      .unit-row { grid-template-columns: 40px 1fr auto; }
      .unit-row .col-desc, .unit-row .col-meta { display: none; }
    }
    .unit-row:hover { background: var(--qe-paper-2); padding-left: 8px; padding-right: 8px; border-radius: var(--qe-radius-md); border-bottom-color: transparent; }
    .unit-row .col-num {
      font-family: var(--qe-font-mono);
      font-size: 13px;
      color: var(--qe-fg-muted);
      letter-spacing: 0.04em;
    }
    .unit-row .col-title h3 {
      font-family: var(--qe-font-display);
      font-weight: 500;
      font-size: 22px;
      line-height: 1.15;
      margin: 0 0 4px;
      color: var(--qe-fg);
    }
    .unit-row .col-title .tags { display: flex; gap: 6px; flex-wrap: wrap; }
    .unit-row .col-desc {
      font-size: 14px;
      color: var(--qe-fg-muted);
      line-height: 1.5;
    }
    .unit-row .col-meta {
      display: flex; flex-direction: column; gap: 2px;
      font-size: 12px;
      color: var(--qe-fg-muted);
      text-align: right;
    }
    .unit-row .col-meta .strong {
      color: var(--qe-fg);
      font-weight: 600;
      font-size: 13px;
    }
    .unit-row .col-arrow {
      width: 32px; height: 32px;
      border-radius: 50%;
      border: 1px solid var(--qe-border);
      display: grid; place-items: center;
      color: var(--qe-fg-muted);
      transition: all var(--qe-dur-1) var(--qe-ease);
    }
    .unit-row:hover .col-arrow { background: var(--qe-blue-600); border-color: var(--qe-blue-600); color: white; }

    /* Two-column layout: list + filter sidebar */
    .list-layout {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 260px;
      gap: 48px;
      align-items: start;
    }
    @media (max-width: 1000px) { .list-layout { grid-template-columns: 1fr; } .filter-side { display: none; } }
    .filter-side {
      position: sticky; top: calc(var(--qe-header-h) + 90px);
      padding: 24px;
      background: var(--qe-bg-elevated);
      border: 1px solid var(--qe-border);
      border-radius: var(--qe-radius-lg);
    }
    .filter-side h4 {
      font-size: 11px;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      font-weight: 600;
      color: var(--qe-fg-muted);
      margin: 0 0 12px;
    }
    .filter-side ul { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-direction: column; gap: 10px; }
    .filter-side li label {
      display: flex; align-items: center; gap: 10px;
      font-size: 14px;
      color: var(--qe-fg);
      cursor: pointer;
    }
    .filter-side li label .count {
      margin-left: auto;
      font-family: var(--qe-font-mono);
      font-size: 12px;
      color: var(--qe-fg-muted);
    }
    .filter-side input[type="checkbox"] {
      appearance: none;
      width: 16px; height: 16px;
      border: 1.5px solid var(--qe-border-strong);
      border-radius: 4px;
      cursor: pointer;
      flex-shrink: 0;
      position: relative;
    }
    .filter-side input[type="checkbox"]:checked {
      background: var(--qe-blue-600);
      border-color: var(--qe-blue-600);
    }
    .filter-side input[type="checkbox"]:checked::after {
      content: ""; position: absolute;
      left: 4px; top: 1px;
      width: 5px; height: 9px;
      border: solid white;
      border-width: 0 2px 2px 0;
      transform: rotate(45deg);
    }
