/* Scoped to the two Spanish legal documents; no shared shell redesign. */
html.v4-legacy body.bravo-v3.legal-document-layout {
  --legal-width: min(1100px, calc(100% - 48px));
}
html:root.v4-legacy body.bravo-v3.legal-document-layout > header.hero,
html:root.v4-legacy body.bravo-v3.legal-document-layout > main#contenido,
html:root.v4-legacy body.bravo-v3.legal-document-layout > nav.legalnav > div {
  width: var(--legal-width) !important;
  max-width: 1100px !important;
  margin-inline: auto !important;
  padding-inline: 0 !important;
  box-sizing: border-box;
}
html:root.v4-legacy body.bravo-v3.legal-document-layout > header.hero {
  margin-top: 20px !important;
  padding-block: 24px !important;
}
html.v4-legacy body.bravo-v3.legal-document-layout > nav.legalnav > div {
  gap: 8px 24px;
  align-items: center;
}
html.v4-legacy body.bravo-v3.legal-document-layout #contenido > .box {
  margin: 0 0 28px;
  max-width: none;
}
html.v4-legacy body.bravo-v3.legal-document-layout .legal-cuerpo {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
html.v4-legacy body.bravo-v3.legal-document-layout .legal-cuerpo > .toc {
  position: static;
  margin: 0;
  padding: 20px 24px;
  max-height: none;
  background: var(--v4-surface) !important;
  color: var(--v4-ink) !important;
  border-radius: 6px;
}
html.v4-legacy body.bravo-v3.legal-document-layout .toc ol {
  columns: 2;
  margin: 0 0 0 22px;
  column-gap: 32px;
}
html.v4-legacy body.bravo-v3.legal-document-layout .toc h2 {
  font-size: 1rem !important;
  margin: 0 0 14px;
}
html.v4-legacy body.bravo-v3.legal-document-layout .legal-secciones > section {
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: 0 0 28px;
  margin: 0 0 28px;
  scroll-margin-top: 140px;
}
html.v4-legacy body.bravo-v3.legal-document-layout .legal-secciones > section > :is(h2, h3, p, ul, ol) {
  width: auto;
  max-width: none;
  overflow-wrap: anywhere;
}
html.v4-legacy body.bravo-v3.legal-document-layout .legal-secciones > section > h2 {
  font-size: clamp(1.5rem, 2.2vw, 1.95rem);
  line-height: 1.3;
  margin-bottom: 18px;
}
/* The optional prompt otherwise covers the lower-right reading column. */
html.v4-legacy body.bravo-v3.legal-document-layout :is(.bchat-mini, .bravo-clara-teaser) { display: none !important; }
/* QA 2026-10-09: the dock used to sit in document flow after the footer, but
   javier-shell.js hides it (visibility) whenever the footer is in view, which
   is always the case there. It never showed and left an empty 88-106px band
   under the footer. The footer already carries phone and contact links. */
html.v4-legacy body.bravo-v3.legal-document-layout .bravo-contact {
  display: none;
}
@media (min-width: 1100px) {
  html.v4-legacy body.bravo-v3.legal-document-layout .legal-cuerpo {
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 40px;
  }
  html.v4-legacy body.bravo-v3.legal-document-layout .legal-cuerpo > .toc {
    position: sticky;
    top: 140px;
    max-height: calc(100dvh - 240px);
    overflow-y: auto;
    scrollbar-gutter: stable;
  }
  html.v4-legacy body.bravo-v3.legal-document-layout .toc ol { columns: 1; }
}
@media (max-width: 640px) {
  html.v4-legacy body.bravo-v3.legal-document-layout { --legal-width: calc(100% - 32px); }
  html.v4-legacy body.bravo-v3.legal-document-layout .legal-cuerpo > .toc { padding: 20px; }
  html.v4-legacy body.bravo-v3.legal-document-layout .toc ol { columns: 1; }
}
