/* Forzar a que la página nunca sea más ancha que la pantalla */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

body { 
    font-family: 'Inter', sans-serif; 
    background-color: #f8fafc; /* Fondo claro base */
}

html.dark body {
    background-color: #0f172a; /* Fondo oscuro base */
}

/* Cambiamos 100vw por 100% para evitar conflictos con la barra de scroll */
#universe-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0; 
    pointer-events: none;
}

.content-layer {
    position: relative;
    z-index: 10;
    width: 100%;
    overflow-x: hidden; /* Bloquea cualquier desbordamiento de los hijos */
}

/* Componentes editoriales añadidos para el manual y documentos legales POS Simple B.P */
.doc-h2 { font-size: 1.35rem; line-height: 1.35; font-weight: 800; color: #1e3a8a; margin: 0 0 .85rem; }
.dark .doc-h2 { color: #f8fafc; }
.doc-h3 { font-size: 1.05rem; font-weight: 800; color: #1e3a8a; margin: 0 0 .4rem; }
.dark .doc-h3 { color: #f8fafc; }
.doc-list { list-style: disc; padding-left: 1.35rem; margin-top: .7rem; display: grid; gap: .5rem; }
.doc-steps { list-style: decimal; padding-left: 1.45rem; margin-top: .8rem; display: grid; gap: .65rem; }
.doc-link { color: #ea580c; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.doc-link:hover { color: #c2410c; }
.dark .doc-link { color: #fdba74; }
.doc-notice { border-radius: 1rem; padding: 1rem 1.15rem; border: 1px solid; }
.doc-notice-warn { background: #fffbeb; color: #78350f; border-color: #fcd34d; }
.dark .doc-notice-warn { background: rgba(120,53,15,.25); color: #fde68a; border-color: #92400e; }
.doc-notice-info { background: #eff6ff; color: #1e3a8a; border-color: #bfdbfe; }
.dark .doc-notice-info { background: rgba(30,58,138,.25); color: #bfdbfe; border-color: #1d4ed8; }
.doc-chip { display: inline-flex; align-items: center; border-radius: 999px; padding: .35rem .7rem; background: #eff6ff; color: #1e40af; font-weight: 700; }
.dark .doc-chip { background: #1e3a8a; color: #dbeafe; }
.doc-sidebar { max-height: calc(100vh - 8rem); overflow: auto; }
.doc-toc { display: grid; gap: .2rem; font-size: .88rem; }
.doc-toc a { display: block; padding: .42rem .55rem; border-radius: .55rem; color: #475569; text-decoration: none; }
.doc-toc a:hover { background: #fff7ed; color: #c2410c; }
.dark .doc-toc a { color: #cbd5e1; }
.dark .doc-toc a:hover { background: rgba(124,45,18,.25); color: #fdba74; }
.doc-section { scroll-margin-top: 6.5rem; }
.doc-mini { display: flex; flex-direction: column; gap: .25rem; padding: .9rem 1rem; border-radius: .9rem; border: 1px solid #e2e8f0; background: rgba(248,250,252,.75); }
.doc-mini strong { color: #1e3a8a; }
.doc-mini span { font-size: .9rem; }
.dark .doc-mini { background: rgba(15,23,42,.45); border-color: #334155; }
.dark .doc-mini strong { color: #f8fafc; }
.doc-faq { border: 1px solid #e2e8f0; border-radius: .9rem; padding: .95rem 1.1rem; background: rgba(248,250,252,.75); }
.doc-faq summary { cursor: pointer; font-weight: 800; color: #1e3a8a; }
.doc-faq p { margin-top: .7rem; }
.dark .doc-faq { background: rgba(15,23,42,.45); border-color: #334155; }
.dark .doc-faq summary { color: #f8fafc; }
@media (max-width: 640px) { .doc-sidebar { max-height: none; position: static; } .doc-h2 { font-size: 1.2rem; } }

/* Contacto del manual: jerarquía visual explícita entre título, tipo de dato y dirección. */
.doc-contact-card { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; min-width: 0; padding: 1.1rem 1.15rem; border: 1px solid #cbd5e1; border-radius: 1rem; background: rgba(248,250,252,.92); }
.doc-contact-title { margin: 0 0 .2rem; color: #1e3a8a; font-size: 1rem; font-weight: 800; line-height: 1.35; }
.doc-contact-label { display: block; color: #64748b; font-size: .76rem; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.doc-contact-email { display: block; margin-top: .1rem; color: #c2410c; font-size: .98rem; font-weight: 800; line-height: 1.5; overflow-wrap: anywhere; }
.doc-contact-email:hover { text-decoration: underline; text-underline-offset: 3px; }
.doc-contact-static { cursor: text; }
.doc-contact-note { margin: .25rem 0 0; color: #475569; font-size: .86rem; line-height: 1.5; }
.dark .doc-contact-card { border-color: #475569; background: rgba(15,23,42,.7); }
.dark .doc-contact-title { color: #f8fafc; }
.dark .doc-contact-label { color: #94a3b8; }
.dark .doc-contact-email { color: #fdba74; }
.dark .doc-contact-note { color: #cbd5e1; }


/* Jerarquía editorial común para manual, privacidad y términos. */
main article > section, .doc-section { margin-bottom: 2rem; }
main article > section > h2, .doc-section > h2 { padding-bottom: .55rem; border-bottom: 1px solid rgba(148,163,184,.35); }
main article > section > p, .doc-section > p { margin-top: .75rem; line-height: 1.8; }
main article > section > ul, main article > section > ol { margin-top: .85rem; }
.doc-section > h3, main article > section > h3 { margin-top: 1.1rem; margin-bottom: .45rem; line-height: 1.45; }
.doc-contact-card { line-height: 1.55; }
.doc-contact-card h3, .doc-contact-card .doc-contact-label, .doc-contact-card a, .doc-contact-card p { max-width: 100%; }
