/* Textos legales generados (estándar de portales §4.2). Claro por defecto; oscuro cuando el
   portal guardó esa elección (legal.js quita .theme-light). Sin fuentes externas. */
:root {
  --c-bg: #061320; --c-surface: #0e2a40; --c-border: #1d4766;
  --c-text: #eef5fa; --c-text-muted: #b8c7d6; --c-accent: #67e8f9;
  color-scheme: dark;
}
:root.theme-light {
  --c-bg: #f4f7fb; --c-surface: #ffffff; --c-border: #dee7f2;
  --c-text: #16212e; --c-text-muted: #42566b; --c-accent: #1a5276;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--c-bg); color: var(--c-text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--c-accent); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible { outline: 3px solid #06b6d4; outline-offset: 2px; border-radius: 4px; }
.envoltura { width: 100%; max-width: 820px; margin: 0 auto; padding: 0 16px; }

.cab { border-bottom: 1px solid var(--c-border); background: var(--c-surface); }
.cab .envoltura { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.marca { font-weight: 800; font-size: 1.1rem; color: var(--c-text); text-decoration: none; }
.volver { display: inline-flex; align-items: center; min-height: 44px; font-size: 0.95rem; font-weight: 600; }

main { flex: 1; padding-top: 2.5rem; padding-bottom: 4rem; }
.antetitulo { margin: 0 0 0.5rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-text-muted); }
h1 { margin: 0; font-size: clamp(2rem, 6vw, 2.75rem); line-height: 1.15; letter-spacing: -0.01em; }
.entradilla { margin: 1rem 0 0; font-size: 1.1rem; color: var(--c-text-muted); }
.revision { margin: 0.5rem 0 2rem; font-size: 0.9rem; font-weight: 600; color: var(--c-text-muted); }
h2 { margin: 2.25rem 0 0.75rem; font-size: 1.3rem; line-height: 1.3; }
h3 { margin: 1.5rem 0 0.4rem; font-size: 1.05rem; }
p, li { color: var(--c-text-muted); }
p strong, li strong { color: var(--c-text); }
code { font-size: 0.9em; padding: 0.1em 0.35em; border-radius: 6px; background: var(--c-surface); border: 1px solid var(--c-border); color: var(--c-text); }

.titular { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.5rem; margin: 1rem 0; padding: 1.1rem 1.25rem; border: 1px solid var(--c-border); border-radius: 14px; background: var(--c-surface); }
.titular dt { font-weight: 700; }
.titular dd { margin: 0; color: var(--c-text-muted); overflow-wrap: anywhere; }

.tabla { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--c-border); border-radius: 14px; background: var(--c-surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
caption { padding: 0.75rem 1rem 0; text-align: left; font-weight: 700; }
th, td { padding: 0.65rem 1rem; text-align: left; vertical-align: top; border-top: 1px solid var(--c-border); }
th { color: var(--c-text); }
td { color: var(--c-text-muted); }

button.enlace, .pie button {
  padding: 0; border: 0; background: none; font: inherit; color: var(--c-accent);
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.pie { border-top: 1px solid var(--c-border); background: var(--c-surface); padding: 1.25rem 0 1.5rem; font-size: 0.875rem; }
.pie nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.pie nav a, .pie nav button { display: inline-flex; align-items: center; min-height: 44px; color: var(--c-text-muted); }
.pie p { margin: 0.5rem 0 0; color: var(--c-text-muted); }

@media (max-width: 560px) {
  .titular { grid-template-columns: 1fr; gap: 0.15rem; }
  .titular dd { margin-bottom: 0.5rem; }
}
