/* ==========================================================================
   RadarTAE — Sistema de diseño
   Tokens, componentes y utilidades. Un único archivo para todo el sitio.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}
body { min-height: 100svh; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg, video, canvas { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; }
ul, ol { padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
:target { scroll-margin-top: 96px; }
[hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   2. Tokens
   -------------------------------------------------------------------------- */
:root {
  --bg:            #F6F5F1;
  --bg-tint:       #EEEDE7;
  --surface:       #FFFFFF;
  --surface-2:     #F4F3EE;
  --surface-3:     #E9E7DF;
  --border:        #E3E0D7;
  --border-strong: #CDC9BC;

  --text:    #14181A;
  --text-2:  #575F5C;
  --text-3:  #6A716D;

  --brand:        #0E5C43;
  --brand-strong: #0A4633;
  --brand-soft:   #E2F0EA;
  --brand-line:   #BEDCD0;
  --accent:       #0FA97C;
  --accent-soft:  #DFF5EC;

  --gold:      #8A6109;
  --gold-soft: #FBF0D8;
  --gold-line: #EBD9A8;
  --danger:      #A62B22;
  --danger-soft: #FBEAE7;
  --info:       #1F4FA8;
  --info-soft:  #E7EEFB;

  --r-xs: 6px;  --r-sm: 9px;  --r-md: 13px;  --r-lg: 18px;  --r-xl: 26px;  --r-full: 999px;

  --sh-1: 0 1px 2px rgba(20,24,26,.05), 0 1px 1px rgba(20,24,26,.03);
  --sh-2: 0 4px 12px -2px rgba(20,24,26,.08), 0 2px 4px -2px rgba(20,24,26,.04);
  --sh-3: 0 16px 36px -12px rgba(20,24,26,.16), 0 4px 10px -4px rgba(20,24,26,.06);
  --sh-4: 0 32px 64px -20px rgba(20,24,26,.26);
  --ring: 0 0 0 3px rgba(15,169,124,.35);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --header-h: 66px;
  --gutter: clamp(16px, 4vw, 32px);
  --maxw: 1240px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg:            #0A0D0C;
  --bg-tint:       #0E1211;
  --surface:       #131816;
  --surface-2:     #1A201D;
  --surface-3:     #222926;
  --border:        #2B3431;
  --border-strong: #414C47;

  --text:   #ECEFEC;
  --text-2: #9DA7A2;
  --text-3: #8A948F;

  --brand:        #3BD79B;
  --brand-strong: #6FE7B8;
  --brand-soft:   #10241C;
  --brand-line:   #1D4335;
  --accent:       #3BD79B;
  --accent-soft:  #10241C;

  --gold:      #E7BE5C;
  --gold-soft: #241D0C;
  --gold-line: #46381A;
  --danger:      #F08B80;
  --danger-soft: #2A1512;
  --info:       #8FB3F5;
  --info-soft:  #101A2C;

  --sh-1: 0 1px 2px rgba(0,0,0,.4);
  --sh-2: 0 4px 12px -2px rgba(0,0,0,.5);
  --sh-3: 0 16px 36px -12px rgba(0,0,0,.6);
  --sh-4: 0 32px 64px -20px rgba(0,0,0,.7);
  --ring: 0 0 0 3px rgba(59,215,155,.3);

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   3. Base
   -------------------------------------------------------------------------- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }

h1, h2, h3, h4, h5 { line-height: 1.15; font-weight: 640; letter-spacing: -.021em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 1.35rem + 3.2vw, 3.6rem); letter-spacing: -.032em; }
h2 { font-size: clamp(1.55rem, 1.2rem + 1.5vw, 2.25rem); letter-spacing: -.026em; }
h3 { font-size: clamp(1.14rem, 1.03rem + .5vw, 1.38rem); }
h4 { font-size: 1.02rem; }
p  { text-wrap: pretty; }

.dsp {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -.005em;
  color: var(--brand);
}
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -.04em; }

::selection { background: var(--brand); color: #fff; }
:root[data-theme="dark"] ::selection { color: #06120D; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 300;
  padding: 10px 16px; border-radius: var(--r-sm);
  background: var(--brand); color: #fff; font-weight: 600; font-size: .9rem; text-decoration: none;
  transform: translateY(-180%); transition: transform .18s ease;
}
.skip-link:focus { transform: translateY(0); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* --------------------------------------------------------------------------
   4. Layout
   -------------------------------------------------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.container-narrow { max-width: 780px; }
.container-mid { max-width: 1000px; }

.section { padding-block: clamp(48px, 7vw, 92px); }
.section-tight { padding-block: clamp(32px, 4.5vw, 56px); }
.section-alt { background: var(--bg-tint); }

.section-head { max-width: 680px; margin-bottom: clamp(24px, 3vw, 40px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head p { color: var(--text-2); font-size: 1.05rem; margin-top: 12px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 14px;
}
.eyebrow::before { content: ''; width: 18px; height: 1.5px; background: currentColor; border-radius: 2px; }
.section-head.center .eyebrow::before { display: none; }

.grid { display: grid; gap: clamp(14px, 1.6vw, 22px); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .g-3, .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .g-2, .g-3, .g-4 { grid-template-columns: minmax(0, 1fr); } }

/* --------------------------------------------------------------------------
   5. Cabecera
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 90;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
}
.site-header.is-stuck { border-bottom-color: var(--border); background: color-mix(in srgb, var(--bg) 95%, transparent); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 18px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.03em; font-size: 1.12rem; text-decoration: none; flex-shrink: 0; }
.brand-mark { width: 30px; height: 30px; color: var(--brand); flex-shrink: 0; }
.brand-mark .sweep { transform-origin: 16px 16px; animation: radar 6s linear infinite; }
@keyframes radar { to { transform: rotate(360deg); } }

.main-nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.main-nav a {
  padding: 8px 12px; border-radius: var(--r-sm); font-size: .92rem; font-weight: 520;
  color: var(--text-2); text-decoration: none; transition: color .15s, background .15s; white-space: nowrap;
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); font-weight: 600; }

.header-tools { display: flex; align-items: center; gap: 8px; margin-left: 10px; }
@media (max-width: 960px) { .header-tools { margin-left: auto; } }

.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text-2);
  transition: color .15s, border-color .15s, transform .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }

.nav-burger { display: none; }
@media (max-width: 960px) {
  .main-nav { display: none; }
  .nav-burger { display: grid; }
  .header-tools .header-cta { display: none; }
}

.mobile-panel {
  position: fixed; inset: 0; z-index: 120;
  background: var(--bg);
  display: flex; flex-direction: column;
  padding: 14px var(--gutter) calc(24px + env(safe-area-inset-bottom));
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.mobile-panel.is-open { opacity: 1; visibility: visible; transform: none; }
.mobile-panel-top { display: flex; align-items: center; justify-content: space-between; height: calc(var(--header-h) - 14px); }
.mobile-panel nav { margin-top: 20px; display: flex; flex-direction: column; }
.mobile-panel nav a {
  padding: 15px 4px; font-size: 1.26rem; font-weight: 600; letter-spacing: -.02em;
  text-decoration: none; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.mobile-panel nav a[aria-current="page"] { color: var(--brand); }
.mobile-panel nav a svg { width: 16px; height: 16px; color: var(--text-3); }
.mobile-panel-foot { margin-top: auto; padding-top: 24px; display: flex; flex-direction: column; gap: 10px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  display: none; align-items: stretch;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 9px 2px 8px; font-size: .68rem; font-weight: 600;
  color: var(--text-3); text-decoration: none;
}
.tabbar a svg { width: 21px; height: 21px; stroke-width: 1.7; }
.tabbar a[aria-current="page"] { color: var(--brand); }
@media (max-width: 760px) {
  .tabbar { display: flex; }
  body { padding-bottom: 60px; }
}

/* --------------------------------------------------------------------------
   6. Botones
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--brand); --btn-fg: #fff; --btn-bd: var(--brand);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--r-sm);
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
  font-size: .94rem; font-weight: 600; letter-spacing: -.01em; text-decoration: none;
  transition: transform .14s ease, box-shadow .16s ease, background .16s ease, border-color .16s;
  white-space: nowrap;
}
:root[data-theme="dark"] .btn { --btn-fg: #06120D; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--sh-2); }
.btn:not(.btn-secondary):not(.btn-ghost):not(.btn-soft):hover { --btn-bg: var(--brand-strong); --btn-bd: var(--brand-strong); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }

.btn-secondary { --btn-bg: var(--surface); --btn-fg: var(--text); --btn-bd: var(--border-strong); }
:root[data-theme="dark"] .btn-secondary { --btn-fg: var(--text); }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--text-2); --btn-bd: transparent; }
:root[data-theme="dark"] .btn-ghost { --btn-fg: var(--text-2); }
.btn-ghost:hover { --btn-bg: var(--surface-2); --btn-fg: var(--text); box-shadow: none; }
.btn-soft { --btn-bg: var(--brand-soft); --btn-fg: var(--brand); --btn-bd: transparent; }
:root[data-theme="dark"] .btn-soft { --btn-fg: var(--brand); }
.btn-lg { padding: 15px 26px; font-size: 1rem; border-radius: var(--r-md); }
.btn-sm { padding: 8px 14px; font-size: .84rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--brand); font-weight: 600; font-size: .94rem; text-decoration: none;
}
.link-arrow svg { width: 15px; height: 15px; transition: transform .16s ease; }
.link-arrow:hover svg { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   7. Superficies, chips y etiquetas
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: clamp(18px, 2.2vw, 26px);
  box-shadow: var(--sh-1);
}
.card-flat { box-shadow: none; }
.card-link { text-decoration: none; display: block; transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.card-link:hover { transform: translateY(-3px); box-shadow: var(--sh-3); border-color: var(--border-strong); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: var(--r-full);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: .76rem; font-weight: 560; color: var(--text-2); white-space: nowrap;
}
.chip svg { width: 13px; height: 13px; }
.chip-brand  { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }
.chip-gold   { background: var(--gold-soft);  border-color: var(--gold-line);  color: var(--gold); }
.chip-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.chip-info   { background: var(--info-soft); border-color: transparent; color: var(--info); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-xs);
  font-size: .68rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase;
  background: var(--brand); color: #fff;
}
:root[data-theme="dark"] .badge { color: #06120D; }
.badge-gold { background: var(--gold); color: #fff; }
:root[data-theme="dark"] .badge-gold { color: #1A1406; }
.badge-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); }

.live-dot {
  width: 7px; height: 7px; border-radius: 99px; background: var(--accent); flex-shrink: 0;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.bank-avatar {
  width: 42px; height: 42px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: .8rem; font-weight: 750; letter-spacing: -.03em; color: var(--text-2);
}
.bank-avatar-sm { width: 32px; height: 32px; font-size: .68rem; border-radius: var(--r-sm); }
/* Color propio por entidad: el tono (--h) lo calcula RT.avatar a partir del nombre. */
.bank-avatar[style*="--h"] {
  background: hsl(var(--h) 46% 93%); border-color: hsl(var(--h) 38% 84%); color: hsl(var(--h) 52% 27%);
}
:root[data-theme="dark"] .bank-avatar[style*="--h"] {
  background: hsl(var(--h) 30% 15%); border-color: hsl(var(--h) 26% 25%); color: hsl(var(--h) 62% 78%);
}

.divider { height: 1px; background: var(--border); border: 0; }

.callout {
  border: 1px solid var(--border); border-left: 3px solid var(--brand);
  background: var(--surface-2); border-radius: var(--r-md);
  padding: 16px 18px; margin: 24px 0; font-size: .95rem; color: var(--text-2);
}
.callout strong { color: var(--text); }
.callout > * + * { margin-top: .7em; }
.callout-warn { border-left-color: var(--gold); background: var(--gold-soft); border-color: var(--gold-line); }
.callout-info { border-left-color: var(--info); background: var(--info-soft); border-color: transparent; }

/* --------------------------------------------------------------------------
   8. Formularios
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .field-label {
  font-size: .8rem; font-weight: 640; color: var(--text-2);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.field-label b { color: var(--text); font-family: var(--font-mono); font-size: .86rem; font-weight: 700; letter-spacing: -.04em; }
.field-hint { font-size: .78rem; color: var(--text-3); }

.input, .select, textarea.input {
  width: 100%; padding: 11px 13px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: .95rem; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--text-3); }
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236A716D' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 15px;
}
.input-money { position: relative; }
.input-money .input { padding-right: 34px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: -.03em; }
.input-money::after {
  content: '€'; position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); font-weight: 600; pointer-events: none;
}
.input-search { position: relative; }
.input-search .input { padding-left: 38px; }
.input-search > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-3); pointer-events: none; }

.range { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 5px; border-radius: 99px; background: var(--surface-3); }
.range::-moz-range-track { height: 5px; border-radius: 99px; background: var(--surface-3); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7.5px; border-radius: 99px;
  background: var(--surface); border: 2.5px solid var(--brand); box-shadow: var(--sh-2); transition: transform .12s;
}
.range::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 99px; border: 2.5px solid var(--brand);
  background: var(--surface); box-shadow: var(--sh-2);
}
.range:active::-webkit-slider-thumb { transform: scale(1.12); }
.range-scale { display: flex; justify-content: space-between; font-size: .72rem; color: var(--text-3); margin-top: -2px; }

.switch { display: flex; align-items: center; gap: 11px; cursor: pointer; padding: 3px 0; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 38px; height: 22px; border-radius: 99px; background: var(--surface-3);
  border: 1px solid var(--border); position: relative; flex-shrink: 0; transition: background .18s, border-color .18s;
}
.switch-track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 99px;
  background: var(--surface); box-shadow: var(--sh-1); transition: transform .18s cubic-bezier(.4,0,.2,1);
}
.switch input:checked + .switch-track { background: var(--brand); border-color: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + .switch-track { box-shadow: var(--ring); }
.switch-label { font-size: .88rem; color: var(--text-2); }
.switch input:checked ~ .switch-label { color: var(--text); font-weight: 560; }

.segmented {
  display: inline-flex; padding: 3px; gap: 2px; width: 100%;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
}
.segmented button {
  flex: 1; padding: 8px 12px; border-radius: var(--r-sm);
  font-size: .85rem; font-weight: 580; color: var(--text-2); white-space: nowrap;
  transition: background .16s, color .16s, box-shadow .16s;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-selected="true"], .segmented button[aria-pressed="true"] {
  background: var(--surface); color: var(--text); box-shadow: var(--sh-1); font-weight: 640;
}

.pill-check { position: relative; display: inline-block; }
.pill-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.pill-check span {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--r-full); background: var(--surface);
  font-size: .84rem; font-weight: 550; color: var(--text-2); transition: all .16s;
}
.pill-check span:hover { border-color: var(--border-strong); color: var(--text); }
.pill-check input:checked + span { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); font-weight: 640; }
.pill-check input:focus-visible + span { box-shadow: var(--ring); }

/* --------------------------------------------------------------------------
   9. Tablas y prosa
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.table { font-size: .92rem; }
.table th, .table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--border); }
.table thead th {
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-3); background: var(--surface-2); white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table td strong { font-weight: 640; }

.prose { font-size: 1.04rem; line-height: 1.75; color: var(--text-2); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 {
  color: var(--text); margin-top: 2.1em; margin-bottom: .55em;
  padding-top: .9em; border-top: 1px solid var(--border); font-size: clamp(1.38rem, 1.2rem + .9vw, 1.8rem);
}
.prose > h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.prose h3 { color: var(--text); margin-top: 1.8em; margin-bottom: .5em; }
.prose strong { color: var(--text); font-weight: 640; }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; text-decoration-color: var(--brand-line); }
.prose a:hover { text-decoration-color: var(--brand); }
.prose ul, .prose ol { display: flex; flex-direction: column; gap: .5em; }
.prose ul { list-style: none; padding-left: 0; }
.prose ul > li { position: relative; padding-left: 1.5em; }
.prose ul > li::before {
  content: ''; position: absolute; left: .35em; top: .62em;
  width: 6px; height: 6px; border-radius: 99px; background: var(--brand-line);
}
.prose ol { list-style: decimal; padding-left: 1.3em; }
.prose ol > li::marker { color: var(--brand); font-weight: 700; }
.prose table { font-size: .93rem; margin-block: 1.6em; }
.prose table th, .prose table td { padding: 11px 14px; border-bottom: 1px solid var(--border); text-align: left; }
.prose table th { background: var(--surface-2); color: var(--text); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; }
.prose blockquote {
  border-left: 3px solid var(--brand); padding: 4px 0 4px 18px;
  font-family: var(--font-display); font-size: 1.22rem; font-style: italic; color: var(--text);
}
.prose code {
  font-family: var(--font-mono); font-size: .88em; padding: 2px 6px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-xs);
}
.prose figure { margin-block: 1.8em; }
.prose figcaption { font-size: .84rem; color: var(--text-3); margin-top: .7em; }

.toc { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 20px 22px; }
.toc h4 { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 12px; }
.toc ol { counter-reset: toc; display: flex; flex-direction: column; gap: 9px; list-style: none; padding: 0; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 10px; font-size: .93rem; color: var(--text-2); text-decoration: none; }
.toc a::before { content: counter(toc, decimal-leading-zero); font-family: var(--font-mono); font-size: .78rem; color: var(--brand); font-weight: 600; }
.toc a:hover { color: var(--brand); }

/* --------------------------------------------------------------------------
   10. Acordeón
   -------------------------------------------------------------------------- */
.accordion { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.accordion + .accordion { margin-top: 10px; }
.accordion summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 17px 20px; cursor: pointer; font-weight: 600; font-size: 1rem; list-style: none;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: ''; flex-shrink: 0; width: 18px; height: 18px;
  background: var(--text-3);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;
  transition: transform .2s ease;
}
.accordion[open] summary::after { transform: rotate(180deg); background: var(--brand); }
.accordion[open] summary { color: var(--brand); }
.accordion-body { padding: 0 20px 20px; color: var(--text-2); font-size: .97rem; }
.accordion-body > * + * { margin-top: .9em; }

/* --------------------------------------------------------------------------
   11. Estados
   -------------------------------------------------------------------------- */
.skeleton {
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%);
  background-size: 220% 100%; animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-xs); color: transparent !important; pointer-events: none; user-select: none;
}
@keyframes shimmer { to { background-position: -120% 0; } }

.empty-state { text-align: center; padding: clamp(36px, 6vw, 64px) 20px; }
.empty-state svg { width: 40px; height: 40px; color: var(--text-3); margin: 0 auto 16px; }
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { color: var(--text-2); max-width: 420px; margin: 0 auto 20px; }

.toast-host { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (max-width: 760px) { .toast-host { bottom: 76px; } }
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 18px; border-radius: var(--r-full);
  background: var(--text); color: var(--bg); font-size: .88rem; font-weight: 560;
  box-shadow: var(--sh-3); animation: toastIn .26s cubic-bezier(.2,.9,.3,1.3);
}
.toast svg { width: 16px; height: 16px; }
.toast.is-out { animation: toastOut .22s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* El contenido solo se oculta si el JS de animación está activo: sin JS, todo se ve. */
:root.js-reveal .reveal { opacity: 0; transform: translateY(10px); transition: opacity .3s ease, transform .3s cubic-bezier(.2,.7,.3,1); }
:root.js-reveal .reveal.is-in { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   12. Pie
   -------------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-tint); padding-block: clamp(40px, 5vw, 64px) 28px; margin-top: clamp(40px, 6vw, 80px); }
.footer-grid { display: grid; grid-template-columns: 1.7fr repeat(3, 1fr); gap: clamp(24px, 3vw, 44px); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand p { color: var(--text-2); font-size: .92rem; margin: 14px 0 16px; max-width: 42ch; }
.footer-meta { font-family: var(--font-mono); font-size: .73rem; color: var(--text-3); letter-spacing: -.02em; }
.footer-col h4 { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 14px; }
.footer-col ul { display: flex; flex-direction: column; gap: 9px; }
.footer-col a { font-size: .9rem; color: var(--text-2); text-decoration: none; }
.footer-col a:hover { color: var(--brand); }
.footer-bottom {
  margin-top: clamp(28px, 4vw, 48px); padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between;
  font-size: .82rem; color: var(--text-3);
}
.footer-disclaimer { font-size: .8rem; color: var(--text-3); line-height: 1.65; margin-top: 18px; max-width: 80ch; }

/* --------------------------------------------------------------------------
   13. Utilidades
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-40 { margin-top: 40px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }
.text-center { text-align: center; }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-brand { color: var(--brand); }
.fs-sm { font-size: .88rem; } .fs-xs { font-size: .8rem; }
.fw-6 { font-weight: 640; } .fw-7 { font-weight: 720; }
.full { width: 100%; }
.no-wrap { white-space: nowrap; }
@media (max-width: 760px) { .hide-mobile { display: none !important; } }
@media (min-width: 761px) { .only-mobile { display: none !important; } }

/* --------------------------------------------------------------------------
   14. Impresión
   -------------------------------------------------------------------------- */
@media print {
  .site-header, .tabbar, .site-footer, .filters, .cmp-tray, .skip-link, .btn { display: none !important; }
  body { background: #fff; color: #000; padding-bottom: 0; }
  .card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
}
