/* PROJECTE.CSS - Predicció d'una vida econòmica · web de presentació del TR
   Mateix sistema que l'eina (Human Interface Guidelines d'Apple): tipografia del sistema amb l'escala d'Apple,
   barra lateral que es plega en pantalles estretes, llistes agrupades, apariència clara/fosca del sistema,
   color d'accent només per a accions i estat, i contrastos ≥ 4,5:1. */

:root {
  color-scheme: light dark;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --bg: #f2f2f7;
  --card: #ffffff;
  --fill: rgba(120, 120, 128, .12);
  --label: #1d1d1f;
  --label-2: #5c5c63;
  --sep: rgba(60, 60, 67, .18);
  --tint: #0066cc;
  --btn: #0066cc;
  --tint-weak: rgba(0, 102, 204, .12);
  --good: #1d7a3a;
  --warn: #a85a00;
  --bad: #c62828;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06);
  --bar-bg: rgba(242, 242, 247, .82);
  --side-bg: #ececf1;
  --radius: 12px;
  --side-w: 264px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d0f;
    --card: #1c1c1e;
    --fill: rgba(120, 120, 128, .24);
    --label: #f5f5f7;
    --label-2: #b6b6bc;
    --sep: rgba(84, 84, 88, .65);
    --tint: #4da3ff;
    --btn: #0a6cdc;
    --tint-weak: rgba(77, 163, 255, .18);
    --good: #32d74b;
    --warn: #ff9f0a;
    --bad: #ff6961;
    --shadow: none;
    --bar-bg: rgba(13, 13, 15, .78);
    --side-bg: #151517;
  }
}
@media (prefers-reduced-transparency: reduce) { :root { --bar-bg: var(--bg); } }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--label); font-family: var(--font); font-size: 1.0625rem; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5 { margin: 0; color: var(--label); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
.tool-app h2, .tool-app h3, .tool-app h4 { font-family: var(--font); letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
a { color: var(--tint); text-underline-offset: 3px; }
em { font-style: italic; }
:focus-visible { outline: 3px solid var(--tint); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--label); color: var(--bg); padding: 10px 16px; z-index: 300; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---- Barra superior ---- */
.bar { position: sticky; top: 0; z-index: 60; background: var(--bar-bg); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: .5px solid var(--sep); }
.bar-in { min-height: 52px; padding: 0 16px; display: flex; align-items: center; gap: 12px; }
.side-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: var(--tint); border-radius: 10px; cursor: pointer; }
.side-btn:hover { background: var(--fill); }
.brand { color: var(--label); font-weight: 600; text-decoration: none; letter-spacing: -0.01em; margin-right: auto; }
.bar-cta { background: var(--btn); color: #fff; text-decoration: none; font-weight: 600; font-size: .9375rem; padding: 0 16px; min-height: 36px; display: inline-flex; align-items: center; border-radius: 999px; }
.bar-cta:hover { filter: brightness(1.1); }
.progress { position: absolute; left: 0; bottom: -.5px; height: 2px; width: 0; background: var(--tint); }

/* ---- Estructura: barra lateral + contingut ---- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: calc(100vh - 52px); }
.shell.side-off { grid-template-columns: 0 minmax(0, 1fr); }
.side { position: sticky; top: 52px; align-self: start; height: calc(100vh - 52px); overflow-y: auto; background: var(--side-bg); border-right: .5px solid var(--sep); padding: 16px 12px 32px; transition: transform .25s ease; }
.shell.side-off .side { transform: translateX(-100%); visibility: hidden; border: 0; padding: 0; }
.side-g { margin-bottom: 18px; }
.side-h { margin: 0 12px 4px; font-size: .8125rem; font-weight: 600; color: var(--label-2); }
.side a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--label); text-decoration: none; font-size: 1rem; }
.side a:hover { background: var(--fill); }
.side a[aria-current="page"] { background: var(--tint-weak); color: var(--tint); font-weight: 600; }
.side a[aria-current="page"] .ico { background: var(--tint); color: #fff; }
.shell.no-side { grid-template-columns: minmax(0, 1fr); }
.scrim { display: none; }
.content { min-width: 0; padding: 0 clamp(16px, 4vw, 56px) 48px; }
.doc { max-width: 720px; margin-inline: auto; }
@media (max-width: 900px) {
  .shell, .shell.side-off { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 70; top: 52px; left: 0; width: min(300px, 86vw); height: calc(100vh - 52px); transform: translateX(-100%); visibility: hidden; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  .shell.side-open .side { transform: none; visibility: visible; }
  .shell.side-open .scrim { display: block; position: fixed; inset: 52px 0 0 0; z-index: 65; background: rgba(0, 0, 0, .45); }
  .shell.side-off .side { padding: 16px 12px 32px; border-right: .5px solid var(--sep); }
}

/* ---- Cap de document (títol gran) ---- */
.doc-head { padding: 40px 0 8px; }
.doc-head h1 { font-size: clamp(2rem, 4.4vw, 2.5rem); letter-spacing: -0.03em; }
.deck { color: var(--label-2); font-size: 1.1875rem; line-height: 1.45; margin: 12px 0 0; max-width: 56ch; }

/* ---- Seccions (substitueixen les bandes) ---- */
.band { padding: 0; margin: 48px 0 0; background: none; color: var(--label); --fg: var(--label); --mut: var(--label-2); --ln: var(--sep); --surf: var(--card); --gd: var(--good); --ac: var(--tint); --track: var(--fill); }
.band.tight { margin-top: 32px; }
.wrap { width: auto; margin: 0; }
.rail { display: block; }
.rail-l { display: none; }
.eyebrow { display: block; margin: 0 16px 8px; font-size: .8125rem; font-weight: 400; text-transform: uppercase; letter-spacing: .02em; color: var(--label-2); }
.rail-r h2, .band h2 { font-size: 1.75rem; letter-spacing: -0.025em; margin: 0 0 12px; max-width: none; }
.rail-r h3, .band h3 { font-size: 1.375rem; margin: 32px 0 10px; }
.band h4 { font-size: 1.0625rem; }
.lead { font-size: 1.1875rem; line-height: 1.5; color: var(--label-2); max-width: 56ch; margin: 0 0 20px; }
.prose { max-width: 66ch; color: var(--label); }
.prose p { color: var(--label); }
.mut { color: var(--label-2); }

/* ---- Portada ---- */
.hero { padding: 44px 0 0; }
.hero-grid { display: block; }
.hero .eyebrow { margin: 0 0 10px; font-weight: 600; color: var(--tint); text-transform: none; letter-spacing: 0; }
.hero h1 { font-size: clamp(2.2rem, 5.2vw, 3.25rem); line-height: 1.1; letter-spacing: -0.02em; }
.hero h1 em { font-style: normal; color: var(--tint); }
.hero .lead { margin: 16px 0 0; max-width: 52ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0 0; }
.author { margin-top: 20px; font-size: .9375rem; color: var(--label-2); display: block; padding: 0; border: 0; }
.author b { color: var(--label); font-weight: 600; }
.hero-fig { margin: 32px 0 0; padding: 12px 14px 8px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-fig svg { width: 100%; height: auto; display: block; }
.hero-fig figcaption { font-size: .8125rem; line-height: 1.38; color: var(--label-2); margin: 4px 4px 4px; }
.fan text { font-family: var(--font); font-size: 15px; fill: var(--label-2); }
.fan .gl { stroke: var(--sep); stroke-width: .8; }
.fan .b90 { fill: var(--tint); opacity: .16; }
.fan .b50 { fill: var(--tint); opacity: .30; }
.fan .med { fill: none; stroke: var(--label); stroke-width: 2.4; stroke-linejoin: round; }
.fan .tg { fill: none; stroke: var(--bad); stroke-width: 2.2; stroke-dasharray: 6 5; }
.fan text.tgl { fill: var(--bad); font-weight: 600; font-size: 16px; }
.fan .pt { fill: var(--card); stroke: var(--label); stroke-width: 2.2; }

/* ---- Botons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 0; border-radius: 12px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: filter .15s; }
.btn.solid { background: var(--btn); color: #fff; }
.btn.line { background: var(--fill); color: var(--tint); }
.btn:hover { filter: brightness(1.08); }

/* ---- Notes (crida d'atenció amb to) ---- */
.note { margin: 20px 0; padding: 14px 16px; border-radius: 12px; background: var(--tint-weak); color: var(--label); font-size: .9688rem; max-width: 66ch; border: 0; }
.note b { color: var(--label); }
.note.warn { background: rgba(255, 159, 10, .16); }
@media (prefers-color-scheme: light) { .note.warn { background: rgba(168, 90, 0, .12); } }
.pull { font-size: clamp(1.3rem, 2.6vw, 1.75rem); line-height: 1.3; letter-spacing: -0.02em; font-weight: 600; max-width: 34ch; color: var(--label); margin: 0 0 12px; }
.pull em { font-style: normal; color: var(--tint); }

/* ---- Dades en llista agrupada (substitueix les targetes de número gran) ---- */
.figs { display: block; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin: 20px 0; border: 0; }
.fig { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-items: center; padding: 12px 16px; border: 0; border-top: .5px solid var(--sep); background: none; border-radius: 0; }
.fig:first-child { border-top: 0; }
.fig .l { grid-column: 1; grid-row: 1; margin: 0; font-size: 1.0625rem; font-weight: 400; color: var(--label); }
.fig .s { grid-column: 1; grid-row: 2; margin: 0; font-size: .875rem; line-height: 1.38; color: var(--label-2); }
.fig .v { grid-column: 2; grid-row: 1 / span 2; font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; color: var(--label); line-height: 1.2; }
.fig .v small { font-size: .7em; font-weight: 500; color: var(--label-2); margin-left: 2px; }

/* ---- Barres ---- */
.cbars { margin: 20px 0; max-width: none; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px 10px; }
.cbars h4 { font-size: .8125rem; font-weight: 600; color: var(--label-2); margin: 0 0 12px; letter-spacing: 0; }
.cb { display: grid; grid-template-columns: minmax(110px, 190px) 1fr 64px; gap: 12px; align-items: center; margin-bottom: 10px; font-size: .9688rem; }
.cb .n { color: var(--label); }
.cb .t { height: 8px; background: var(--fill); border-radius: 4px; overflow: hidden; }
.cb .f { display: block; height: 100%; width: 0; background: var(--good); border-radius: 4px; transition: width .8s cubic-bezier(.2, .7, .2, 1); }
.cb .f.warn { background: var(--warn); } .cb .f.bad { background: var(--bad); } .cb .f.dim { background: var(--label-2); opacity: .6; }
.cb .x { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.cbars .src { font-size: .8125rem; color: var(--label-2); margin: 4px 0 4px; }
@media (max-width: 640px) { .cb { grid-template-columns: 1fr 56px; } .cb .t { grid-column: 1 / -1; order: 3; } }

/* ---- Control segmentat i selector ---- */
.tabs { display: inline-flex; flex-wrap: wrap; padding: 2px; background: var(--fill); border-radius: 9px; margin: 4px 0 12px; border: 0; }
.tabs button { background: none; border: 0; color: var(--label); padding: 0 18px; min-height: 36px; font: inherit; font-size: .9375rem; font-weight: 500; border-radius: 7px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--card); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.tabs button[aria-selected="true"]::after { display: none; }
.tabpanel[hidden] { display: none; }
.picker { display: grid; grid-template-columns: 220px minmax(0, 1fr); background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-top: 8px; }
.picker-nav { border-right: .5px solid var(--sep); padding: 8px; background: none; }
.picker-nav button { display: flex; gap: 10px; align-items: baseline; width: 100%; text-align: left; background: none; border: 0; min-height: 44px; padding: 0 12px; color: var(--label); cursor: pointer; font: inherit; border-radius: 8px; }
.picker-nav button i:not(.ico) { display: none; }
.picker-nav button b { font-weight: 500; }
.picker-nav button[aria-selected="true"] { background: var(--tint-weak); color: var(--tint); }
.picker-nav button[aria-selected="true"] b { font-weight: 600; }
.picker-body { padding: 20px 22px; }
.picker-body h3 { font-size: 1.375rem; margin: 0 0 10px; }
.picker-body .two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 16px; }
.picker-body h5 { font-size: .8125rem; font-weight: 600; color: var(--tint); margin: 0 0 4px; letter-spacing: 0; }
.picker-body .two p { color: var(--label-2); font-size: .9688rem; margin: 0; }
@media (max-width: 700px) { .picker { grid-template-columns: 1fr; } .picker-nav { display: flex; overflow-x: auto; border-right: 0; border-bottom: .5px solid var(--sep); } .picker-nav button { white-space: nowrap; flex: none; width: auto; } .picker-body .two { grid-template-columns: 1fr; } }

/* ---- Eines interactives ---- */
.tool { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px 16px; margin: 20px 0; border: 0; }
.tool-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.tool-head h3 { margin: 0; font-size: 1.1875rem; }
.tool-head span { font-size: .8125rem; color: var(--label-2); }
.ctl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 28px; }
.ctl label { display: flex; justify-content: space-between; gap: 10px; font-size: .9688rem; margin-bottom: 4px; color: var(--label); }
.ctl label output, .ctl label b { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--label); }
.ctl input[type=range] { width: 100%; accent-color: var(--tint); height: 32px; }
.ctl input[type=number], .ctl select { width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--fill); color: var(--tint); font: inherit; font-size: 1.0625rem; }
.ctl input:focus-visible, .ctl select:focus-visible { outline: 3px solid var(--tint); outline-offset: 1px; }
.ctl select option { color: #111; background: #fff; }
.out { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 20px; margin-top: 18px; border-top: .5px solid var(--sep); padding-top: 12px; }
.out > div { padding: 4px 0; background: none; border-radius: 0; }
.out .k { font-size: .8125rem; color: var(--label-2); line-height: 1.38; font-weight: 400; }
.out .v { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.25; color: var(--label); }
.out .v.good { color: var(--good); } .out .v.bad { color: var(--bad); } .out .v.warn { color: var(--warn); }
.verdict { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--tint-weak); color: var(--label); font-size: .9688rem; }
.stackbar { display: flex; height: 36px; border-radius: 8px; overflow: hidden; margin: 14px 0 8px; }
.stackbar div { display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .875rem; color: #0d0d0f; transition: width .3s ease; min-width: 0; overflow: hidden; }
.legend { display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: .875rem; color: var(--label-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.c-good { background: var(--good); } .c-warn { background: var(--warn); } .c-bad { background: var(--bad); } .c-mut { background: var(--label-2); } .c-tint { background: var(--tint); }
.chart { width: 100%; height: auto; display: block; margin-top: 12px; }
.chart text { font-family: var(--font); font-size: 12px; fill: var(--label-2); }
.chart .grid { stroke: var(--sep); stroke-width: .8; }
.chart .ln { fill: none; stroke-width: 2.4; stroke-linejoin: round; }
.gauge-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 20px; }
.ring { width: 84px; height: 84px; flex: none; transform: rotate(-90deg); }
.ring .bg { fill: none; stroke: var(--fill); stroke-width: 10; }
.ring .fg { fill: none; stroke: currentColor; stroke-width: 10; stroke-linecap: round; stroke-dasharray: 314.16; stroke-dashoffset: 314.16; }
.zone { position: relative; height: 10px; background: var(--fill); border-radius: 5px; margin: 30px 0 8px; }
.zone .ok, .zone .mid, .zone .hi { position: absolute; top: 0; bottom: 0; }
.zone .ok { left: 0; width: 60%; background: var(--good); opacity: .55; border-radius: 5px 0 0 5px; }
.zone .mid { left: 60%; width: 10%; background: var(--warn); opacity: .7; }
.zone .hi { left: 70%; right: 0; background: var(--bad); opacity: .55; border-radius: 0 5px 5px 0; }
.zone .pin { position: absolute; top: -7px; width: 4px; height: 24px; background: var(--label); border-radius: 2px; transition: left .3s ease; }
.zone-l { display: flex; justify-content: space-between; font-size: .8125rem; color: var(--label-2); }

/* ---- Línia de temps, passos, llistes ---- */
.hline { display: block; margin: 20px 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 0; overflow: hidden; }
.hline > div { padding: 12px 16px; border-top: .5px solid var(--sep); position: relative; }
.hline > div:first-child { border-top: 0; }
.hline > div::before { display: none; }
.hline time { font-size: .8125rem; color: var(--label-2); font-weight: 400; }
.hline h4 { font-size: 1.0625rem; margin: 2px 0 2px; }
.hline p { font-size: .9688rem; color: var(--label-2); margin: 0; }
.hline > div.up h4::after { content: " ↑"; color: var(--bad); }
.steps { display: block; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin: 20px 0; counter-reset: s; border: 0; }
.steps > div { counter-increment: s; position: relative; padding: 12px 16px 12px 54px; border: 0; border-top: .5px solid var(--sep); background: none; border-radius: 0; }
.steps > div:first-child { border-top: 0; }
.steps > div::before { content: counter(s); position: absolute; left: 16px; top: 12px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--tint-weak); color: var(--tint); font-weight: 700; font-size: .875rem; margin: 0; }
.steps h4 { font-size: 1.0625rem; margin: 0 0 2px; }
.steps p { font-size: .9688rem; color: var(--label-2); margin: 0; }
.chips { display: block; list-style: none; margin: 12px 0; padding: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.chips li { border: 0; border-top: .5px solid var(--sep); border-radius: 0; padding: 10px 16px; font-size: 1rem; color: var(--label); background: none; }
.chips li:first-child { border-top: 0; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.cols h3 { margin-top: 0 !important; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; gap: 4px; } }
.eq { display: grid; gap: 8px; margin: 20px 0; }
.eq > div { padding: 12px 16px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); font-size: .9688rem; color: var(--label-2); }
.eq b { display: block; font-size: 1.0625rem; color: var(--label); margin-bottom: 2px; }
.eq .op { background: none; box-shadow: none; padding: 0; text-align: center; font-size: 1.4rem; color: var(--label-2); line-height: 1; }
.eq .res { background: var(--tint-weak); box-shadow: none; color: var(--label); }
.formulas { display: block; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin: 16px 0; border: 0; }
.formulas > div { padding: 12px 16px; border: 0; border-top: .5px solid var(--sep); font-family: Cambria, "Times New Roman", serif; font-size: 1.1875rem; color: var(--label); }
.formulas > div:first-child { border-top: 0; }
.formulas small { display: block; font-family: var(--font); font-size: .8125rem; color: var(--label-2); margin-bottom: 2px; }

/* ---- Índex de la portada (llista de navegació amb indicador de disclosure) ---- */
.toc2 { display: block; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-top: 8px; }
.toc2 a { display: grid; grid-template-columns: 40px minmax(0, 1fr) 16px; gap: 0 12px; align-items: center; padding: 10px 16px; border-top: .5px solid var(--sep); text-decoration: none; color: var(--label); min-height: 56px; background: none; border-radius: 0; }
.toc2 a:first-child { border-top: 0; }
.toc2 a:hover { background: var(--fill); }
.toc2 .n { display: none; }
.toc2 .ico { grid-column: 1; grid-row: 1 / span 2; }
.toc2 h3 { grid-column: 2; font-size: 1.0625rem; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.toc2 p { grid-column: 2; margin: 0; font-size: .875rem; color: var(--label-2); }
.toc2 a::after { content: "›"; grid-column: 3; grid-row: 1 / span 2; font-size: 1.5rem; color: var(--label-2); text-align: right; }

/* ---- Taules ---- */
.matrix-wrap, .table-wrap { overflow-x: auto; margin: 20px 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 0; }
.matrix, table.data { width: 100%; border-collapse: collapse; font-size: .9688rem; }
.matrix { min-width: 700px; } table.data { min-width: 540px; }
.matrix th, .matrix td, table.data th, table.data td { padding: 11px 14px; border-bottom: .5px solid var(--sep); vertical-align: top; color: var(--label); }
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child, table.data th, table.data td { text-align: left; }
.matrix thead th, table.data th { font-size: .8125rem; font-weight: 600; color: var(--label-2); background: none; vertical-align: bottom; }
.matrix tbody tr:last-child td, table.data tbody tr:last-child td { border-bottom: 0; }
.matrix td small { display: block; color: var(--label-2); font-size: .8125rem; }
.matrix .y { color: var(--good); font-weight: 700; } .matrix .nn { color: var(--label-2); opacity: .5; } .matrix .p { color: var(--label-2); font-style: italic; }
.matrix tr.us td { background: var(--tint-weak); font-weight: 600; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; margin: 20px 0; padding: 2px 2px 8px; scroll-snap-type: x proximity; border: 0; }
.strip > div { padding: 14px 16px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); scroll-snap-align: start; border: 0; }
.strip .who { display: block; font-size: 1.0625rem; font-weight: 700; color: var(--label); margin: 2px 0; }
.strip .yr { font-size: .8125rem; font-weight: 600; color: var(--tint); }
.strip p { margin: 6px 0 0; font-size: .9375rem; color: var(--label-2); }

/* ---- Paginació i peu ---- */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 720px; margin: 56px auto 0; }
.pg { display: block; padding: 14px 16px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; min-height: 44px; }
.pg:hover { background: var(--fill); }
.pg + .pg { text-align: right; }
.pg small { display: block; font-size: .8125rem; color: var(--label-2); }
.pg strong { font-size: 1.0625rem; color: var(--tint); }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; } .pg + .pg { text-align: left; } }
.foot { max-width: 720px; margin: 32px auto 0; font-size: .875rem; color: var(--label-2); }
.foot p { margin: 0 0 4px; }

/* ---- Revelació suau (només opacitat) ---- */
.js .reveal { opacity: 0; transition: opacity .5s ease; }
.js .reveal.in { opacity: 1; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .js .reveal { opacity: 1; transition: none; } .cb .f, .side { transition: none; } }
@media print { .bar, .side, .pager, .skip, .tabs, .picker-nav { display: none !important; } .shell { display: block; } body { background: #fff; color: #000; } .js .reveal { opacity: 1 !important; } }


/* ===== Icones, il·lustracions i gràfics visuals ===== */
.ico { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--label-2); background: var(--fill); flex: none; }
.ico svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side a { gap: 12px; }
.side .ico { width: 28px; height: 28px; border-radius: 7px; }
.side .ico svg { width: 17px; height: 17px; }
.toc2 .ico { width: 36px; height: 36px; border-radius: 9px; }
.toc2 .ico svg { width: 21px; height: 21px; }
.picker-nav button { align-items: center; gap: 12px; }
.picker-nav .ico { width: 28px; height: 28px; border-radius: 7px; }
.strip .ico { width: 34px; height: 34px; border-radius: 9px; margin-bottom: 8px; }
.strip .ico svg { width: 20px; height: 20px; }
.doc-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.doc-head-t { min-width: 0; }
.art { width: 200px; height: auto; flex: none; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.a-ft { fill: var(--tint-weak); } .a-st { stroke: var(--tint); } .a-sm { stroke: var(--label-2); } .a-sg { stroke: var(--good); } .a-sb { stroke: var(--bad); } .a-sw { stroke: var(--warn); }
.a-fg { fill: var(--good); stroke: none; } .a-fg2 { fill: var(--tint); stroke: none; } .a-fb { fill: var(--bad); stroke: none; } .a-fw { fill: var(--warn); stroke: none; } .a-fw2 { fill: var(--warn); stroke: var(--card); opacity: .85; }
.a-fg3 { fill: rgba(50, 215, 75, .14); } .a-fw3 { fill: rgba(255, 159, 10, .14); } .a-fcore { fill: var(--tint); opacity: .9; stroke: none; } .a-fc { fill: var(--card); } .a-dash { stroke-dasharray: 6 6; }
@media (max-width: 720px) { .art { display: none; } }
.chartfig, .donutfig { margin: 20px 0; padding: 14px 16px 12px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.chartfig svg { width: 100%; height: auto; display: block; }
.chartfig figcaption, .donutfig .src { font-size: .8125rem; line-height: 1.38; color: var(--label-2); margin: 8px 2px 0; }
.rate text { font-family: var(--font); font-size: 14px; fill: var(--label-2); }
.rate .gl { stroke: var(--sep); stroke-width: .8; }
.rate .up { fill: none; stroke: var(--tint); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.rate .pt { fill: var(--card); stroke: var(--tint); stroke-width: 2.5; }
.rate .vl { fill: var(--label); font-weight: 600; font-size: 14px; }
.donutfig { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut { width: 160px; height: 160px; flex: none; }
.donut circle { fill: none; stroke-width: 18; }
.donut .c-tint { stroke: var(--tint); background: none; } .donut .c-good { stroke: var(--good); background: none; } .donut .c-warn { stroke: var(--warn); background: none; } .donut .c-mut { stroke: var(--label-2); opacity: .5; background: none; }
.donut .dn { font-size: 20px; font-weight: 700; fill: var(--label); } .donut .dl { font-size: 9px; fill: var(--label-2); }
.donutfig figcaption { flex: 1 1 220px; }
.dh { font-size: .8125rem; font-weight: 600; color: var(--label-2); margin: 0 0 8px; }
.dleg { list-style: none; margin: 0; padding: 0; }
.dleg li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: .5px solid var(--sep); font-size: .9688rem; color: var(--label); }
.dleg li:first-child { border-top: 0; }
.dleg li i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dleg li span { flex: 1; } .dleg li b { font-variant-numeric: tabular-nums; }
.iarr-wrap { margin: 22px 0 6px; }
.iarr { display: grid; grid-template-columns: repeat(20, 1fr); gap: 4px; --on: var(--tint); }
.iarr i { aspect-ratio: 1; border-radius: 3px; background: var(--fill); transition: background .3s; }
.iarr i.on { background: var(--on); }
.iarr-cap { font-size: .9375rem; color: var(--label-2); margin: 8px 0 0; }


/* ===== Menú emergent propi (substitueix la llista nativa dels <select>) ===== */
.pd-native { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; border: 0 !important; opacity: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; pointer-events: none !important; }
.pd { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; min-height: 44px; max-width: 100%; margin-left: auto; padding: 0 0 0 8px; background: none; border: 0; color: var(--tint); font: inherit; text-align: right; cursor: pointer; min-width: 0; }
.pd-v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-ch { width: 10px; height: 14px; flex: none; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pd[aria-expanded="true"] { opacity: .7; }
.pd-menu { position: fixed; z-index: 3000; max-width: calc(100vw - 16px); max-height: min(60vh, 380px); overflow: auto; padding: 6px; background: var(--card); color: var(--label); border-radius: 14px; box-shadow: 0 0 0 .5px var(--sep), 0 14px 44px rgba(0, 0, 0, .38); outline: none; transform-origin: top right; animation: pdin .12s ease-out; font-size: 1.0625rem; line-height: 1.3; }
@keyframes pdin { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.pd-opt { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 8px; border-radius: 9px; cursor: pointer; }
.pd-opt .pd-ck { width: 16px; height: 16px; flex: none; stroke: var(--tint); stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.pd-opt[aria-selected="true"] .pd-ck { visibility: visible; }
.pd-opt[aria-selected="true"] { font-weight: 600; }
.pd-opt.on { background: var(--tint-weak); }
@media (prefers-reduced-motion: reduce) { .pd-menu { animation: none; } }

.ctl .pd { width: 100%; justify-content: space-between; margin-left: 0; min-height: 44px; padding: 0 12px; background: var(--fill); border-radius: 10px; text-align: left; font-size: 1.0625rem; }
.ctl .pd-v { flex: 1; }


/* ===== Àlies de les variables antigues que fa servir l'assistent flotant (ai.css) ===== */
:root {
  --primary: var(--tint); --primary-hover: var(--tint); --primary-light: var(--tint-weak); --primary-border: var(--tint); --primary-gradient: var(--btn);
  --bg-main: var(--bg); --bg-surface: var(--card); --bg-subtle: var(--fill);
  --border-subtle: var(--sep); --border-strong: var(--sep);
  --text-main: var(--label); --text-muted: var(--label-2); --text-dim: var(--label-2);
  --success: var(--good); --warning: var(--warn); --danger: var(--bad);
  --danger-bg: rgba(255, 105, 97, .12); --danger-border: rgba(255, 105, 97, .4);
  --radius-xs: 4px; --radius-sm: 8px; --radius-md: 10px; --radius-lg: 14px; --radius-full: 999px;
  --shadow-sm: none; --shadow-md: none; --shadow-lg: 0 12px 32px rgba(0, 0, 0, .3); --shadow-xl: 0 16px 40px rgba(0, 0, 0, .35);
}

/* =====================================================================
   DISSENY AMPLE DE TOT EL WEB: en pantalles grans el contingut ocupa gairebe tot l'ample i el text es fa una mica mes gran
   ===================================================================== */
@media (min-width: 1000px) {
  .content { padding: 0 clamp(28px, 4.5vw, 84px) 64px; }
  .doc, .pager, .foot { max-width: 1280px; }
  .doc-head { padding-top: 52px; }
  .doc-head h1 { font-size: clamp(2.5rem, 3.6vw, 3.4rem); }
  .deck, .lead, .hero .lead { max-width: 76ch; font-size: 1.3125rem; }
  .prose { max-width: 90ch; font-size: 1.125rem; line-height: 1.6; }
  .note { max-width: 90ch; }
  .band { margin-top: 64px; }
  .band.tight { margin-top: 44px; }
  .rail-r h2, .band h2 { font-size: 2.25rem; margin-bottom: 16px; }
  .rail-r h3, .band h3 { font-size: 1.625rem; }
  .pull { max-width: 52ch; font-size: clamp(1.6rem, 2.4vw, 2.2rem); }
  .cols { gap: 36px; }
  .picker-body { padding: 28px 32px; }
  .picker-body h3 { font-size: 1.75rem; }
  .picker-body .two p { font-size: 1.0625rem; }
  .cbars { padding: 22px 26px 16px; }
}
@media (min-width: 1280px) { html { font-size: 106%; } }
@media (min-width: 1600px) { html { font-size: 112%; } .doc, .pager, .foot { max-width: 1440px; } }
