/* Páginas legales y de ayuda (privacy, terms, support, delete-account).
   Va DESPUÉS de home.css: reutiliza sus tokens, cabecera y pie. */

.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }

.legal {
  max-width: var(--wrap); margin: 0 auto; padding: 40px 20px 88px;
  display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; align-items: start;
}
.legal.noToc { grid-template-columns: minmax(0, 1fr); }
.legal.noToc .doc { margin: 0 auto; }

/* Índice: lateral fijo en escritorio, bloque normal arriba en móvil */
.toc { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow: auto; padding-right: 6px; }
.tocTitle { font: 700 12px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); margin: 6px 0 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.toc li { margin: 0; }
.toc a {
  display: block; padding: 7px 0 7px 14px; margin-left: -2px; border-left: 2px solid transparent;
  color: var(--ink-soft); text-decoration: none; font-size: 14px; line-height: 1.35;
}
.toc a:hover { color: var(--ink); border-left-color: var(--border); }
.toc a.on { color: var(--accent-ink); border-left-color: var(--accent); font-weight: 600; }

/* Documento: ancho de lectura ~70 caracteres */
.doc { max-width: 70ch; min-width: 0; font-size: 17px; line-height: 1.7; }
.back { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-soft); text-decoration: none; font-size: 15px; font-weight: 600; }
.back:hover { color: var(--accent-ink); }
.doc h1 { font-size: clamp(34px, 5vw, 48px); font-weight: 800; margin: 8px 0 12px; }
.meta { color: var(--ink-soft); font-size: 15px; margin: 0 0 8px; }
.meta strong { color: var(--ink); font-weight: 600; }
.meta a { color: var(--ink); }
.printBtn {
  font: 600 14px/1 var(--font); color: var(--ink); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; min-height: 40px; padding: 0 16px; cursor: pointer; margin: 6px 0 20px;
}
.printBtn:hover { background: var(--bg-deep); }

.doc h2 { font-size: 26px; font-weight: 800; margin: 48px 0 12px; padding-top: 4px; scroll-margin-top: 88px; }
.doc h3 { font-size: 19px; font-weight: 700; margin: 28px 0 8px; letter-spacing: -.01em; }
.doc p { margin: 0 0 16px; }
.doc ul, .doc ol { padding-left: 1.3em; margin: 0 0 18px; }
.doc li { margin-bottom: 8px; }
.doc a { color: var(--accent-ink); text-underline-offset: 3px; }
.doc strong { font-weight: 700; }

.doc .box {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 14px; padding: 18px 20px; margin: 22px 0;
}
.doc .box p:last-child { margin-bottom: 0; }

.doc .wrap { overflow-x: auto; margin: 16px 0 22px; padding: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.doc tr:last-child td { border-bottom: 0; }
.doc th { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); background: var(--bg-deep); }
.doc td:first-child { font-weight: 600; width: 38%; }

.tocInline { display: none; }
@media (max-width: 900px) {
  .legal { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 16px; }
  .legal > .toc { display: none; }
  .tocInline { display: block; position: static; max-height: none; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 18px 8px; margin: 0 0 8px; }
}
@media (max-width: 560px) {
  .doc { font-size: 16px; }
  .doc h2 { font-size: 23px; margin-top: 40px; }
  .doc td:first-child { width: auto; }
  .doc table, .doc thead, .doc tbody, .doc tr, .doc th, .doc td { display: block; }
  .doc tr:first-child { display: none; }
  .doc tr { border-bottom: 1px solid var(--border); padding: 10px 0; }
  .doc tr:last-child { border-bottom: 0; }
  .doc td { border: 0; padding: 2px 14px; }
}

/* Impresión: solo el documento, sin cabecera, pie, índice ni botones */
@media print {
  .offer, .top, .foot, .toc, .back, .printBtn, .skip { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .legal { display: block; padding: 0; max-width: none; }
  .doc { max-width: none; font-size: 11pt; line-height: 1.5; }
  .doc h1 { font-size: 20pt; }
  .doc h2 { font-size: 14pt; margin-top: 18pt; break-after: avoid; }
  .doc h3 { break-after: avoid; }
  .doc p, .doc li, .doc tr { break-inside: avoid; orphans: 3; widows: 3; }
  .doc .box { border: 1px solid #999; background: none; }
  .doc a { color: #000; }
  .doc a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
}
.doc .tocInline a { color: var(--ink); text-decoration: none; padding: 6px 0 6px 12px; font-size: 15px; }
.doc .tocInline li { margin: 0; }
