/* LEGASIST / IDENTIDAD UI FINAL / HOSTGATOR V3 (16 OCT 2026)
   Capa compartida que cierra cascada DESPUÉS de estilos de módulos.
   Claro: lienzo blanco, tinta oscura, encabezados azules con texto blanco.
   Oscuro: lienzo azul marino, paneles azules, texto blanco.
   Los componentes con fondo blanco siempre muestran texto oscuro.
   No altera lógica de pagos, permisos, sesiones, datos ni rutas. */

:root,html:not([data-theme="royal-dark"]){
  color-scheme:light;
  --ui-canvas:#ffffff;--ui-surface:#ffffff;--ui-surface-alt:#ffffff;
  --ui-text:#142337;--ui-muted:#405570;--ui-heading:#0d4c95;
  --ui-primary:#1257a6;--ui-primary-hover:#0c4384;--ui-contrast:#ffffff;
  --ui-header:#0b468e;--ui-header-text:#ffffff;
  --ui-line:#d1e0f1;--ui-focus:#297be4;--ui-shadow:0 6px 22px rgba(9,52,103,.075);
  --bg:#fff!important;--bg-2:#fff!important;--surface:#fff!important;--surface-soft:#fff!important;
  --surface-blue:#fff!important;--text:#142337!important;--muted:#405570!important;
  --navy:#0d4c95!important;--primary:#1257a6!important;--primary-2:#1257a6!important;
  --border:#d1e0f1!important;--border-strong:#b3cee9!important;
  --dash-bg:#fff!important;--dash-surface:#fff!important;--dash-surface-2:#fff!important;
  --dash-text:#142337!important;--dash-muted:#405570!important;--dash-line:#d1e0f1!important;
  --dash-primary:#1257a6!important;--dash-sidebar:#0b468e!important;--dash-sidebar-2:#0d4c95!important;
  --law-ink:#142337!important;--law-panel:#fff!important;--law-panel-soft:#fff!important;
  --law-muted:#405570!important;--law-blue:#1257a6!important;--law-blue-2:#1257a6!important;
  --login-bg:#fff!important;--login-card:#fff!important;--login-soft:#fff!important;
  --login-text:#142337!important;--login-muted:#405570!important;--login-primary:#1257a6!important;
  --ls-surface:#fff!important;--ls-surface-2:#fff!important;--ls-text:#142337!important;
  --ls-muted:#405570!important;--ls-border:#d1e0f1!important;
  --op-bg:#fff!important;--op-card:#fff!important;--op-primary-soft:#fff!important;
  --op-text:#142337!important;--op-muted:#405570!important;--op-border:#d1e0f1!important;
  --op-primary:#1257a6!important;--op-primary-strong:#0c4384!important;
  --lg-canvas:#fff!important;--lg-paper:#fff!important;--lg-inset:#fff!important;
  --lg-heading:#0d4c95!important;--lg-foreground:#142337!important;--lg-secondary:#405570!important;
  --lg-header:#0b468e!important;--lg-header-foreground:#fff!important;
  --lg-accent:#1257a6!important;--lg-accent-foreground:#fff!important;
  --lg-line:#d1e0f1!important;--lg-blue-050:#fff!important;--lg-blue-100:#fff!important;
  --lg-blue-200:#d1e0f1!important;
}
html[data-theme="royal-dark"]{
  color-scheme:dark!important;
  --ui-canvas:#071a32;--ui-surface:#102b4c;--ui-surface-alt:#102b4c;
  --ui-text:#ffffff;--ui-muted:#d8e8fa;--ui-heading:#ffffff;
  --ui-primary:#2472b9;--ui-primary-hover:#1b609e;--ui-contrast:#ffffff;
  --ui-header:#06172f;--ui-header-text:#ffffff;
  --ui-line:#355b80;--ui-focus:#76c5ff;--ui-shadow:0 6px 22px rgba(0,0,0,.16);
  --bg:#071a32!important;--bg-2:#071a32!important;
  --surface:#102b4c!important;--surface-soft:#102b4c!important;
  --surface-blue:#143557!important;--text:#fff!important;--muted:#d8e8fa!important;
  --navy:#fff!important;--primary:#9bd4ff!important;--primary-2:#9bd4ff!important;
  --border:#355b80!important;--border-strong:#557fa4!important;
  --dash-bg:#071a32!important;--dash-surface:#102b4c!important;
  --dash-surface-2:#102b4c!important;--dash-text:#fff!important;
  --dash-muted:#d8e8fa!important;--dash-line:#355b80!important;
  --dash-primary:#9bd4ff!important;--dash-sidebar:#06172f!important;--dash-sidebar-2:#0b2443!important;
  --law-ink:#fff!important;--law-panel:#102b4c!important;--law-panel-soft:#102b4c!important;
  --law-muted:#d8e8fa!important;--law-blue:#9bd4ff!important;--law-blue-2:#9bd4ff!important;
  --login-bg:#071a32!important;--login-card:#102b4c!important;--login-soft:#102b4c!important;
  --login-text:#fff!important;--login-muted:#d8e8fa!important;--login-primary:#9bd4ff!important;
  --ls-surface:#102b4c!important;--ls-surface-2:#102b4c!important;--ls-text:#fff!important;
  --ls-muted:#d8e8fa!important;--ls-border:#355b80!important;
  --op-bg:#071a32!important;--op-card:#102b4c!important;--op-primary-soft:#102b4c!important;
  --op-text:#fff!important;--op-muted:#d8e8fa!important;--op-border:#355b80!important;
  --op-primary:#9bd4ff!important;--op-primary-strong:#d3edff!important;
  --lg-canvas:#071a32!important;--lg-paper:#102b4c!important;--lg-inset:#102b4c!important;
  --lg-heading:#fff!important;--lg-foreground:#fff!important;--lg-secondary:#d8e8fa!important;
  --lg-header:#06172f!important;--lg-header-foreground:#fff!important;
  --lg-accent:#2472b9!important;--lg-accent-foreground:#fff!important;
  --lg-line:#355b80!important;--lg-blue-050:#071a32!important;
  --lg-blue-100:#102b4c!important;--lg-blue-200:#355b80!important;
}
/* Una familia formal en etiquetas textuales y controles, sin destruir fuentes internas de iconos. */
html,body,
body :is(h1,h2,h3,h4,h5,h6,p,span,small,li,dt,dd,a,button,input,select,textarea,label,legend,summary,th,td,blockquote,time,b,strong,em){
  font-family:Plus Jakarta Sans,Arial,sans-serif!important;
}
html{scroll-behavior:smooth;scroll-padding-top:90px}
body{line-height:1.52;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased}
*,*::before,*::after{box-sizing:border-box}
body :is(img,svg,video,canvas){max-width:100%}
body :is(.container,.law-container,.dash-main,.support-stage,.legal-wrap,.workspace-main,.payment-layout){min-width:0}
/* Quitar grises opacos, degradados de superficie y fondos decorativos en la versión clara. */
html:not([data-theme="royal-dark"]) :is(body,main,.dash-main,.dash-layout,.directory-page,.flow-lawyer,.funnel-main,.funnel-layout,.support-stage,.payment-layout,.login-role-page,.law-section,.directory-section,.page-wrap,.app-shell,.workspace,.case-workspace){background-color:#fff!important}
html:not([data-theme="royal-dark"]) :is(.panel,.card,.dash-card,.content-card,.stat-card,.metric-card,.dashboard-card,.action-card,.profile-card,.info-card,.result-card,.search-card,.search-panel,.trust-card,.law-card,.law-preview,.plan-card,.pricing-card,.payment-panel,.order-panel,.bill-card,.receipt-card,.contact-card,.support-section,.support-contact-card,.faq-item,.legal-card,.modal-content,.form-section,.login-card,.login-form,.lawyer-login-form-panel,.profile-form-grid,.workspace-main,.workspace-side,.ai-panel,.ai-chat-box,.source-card,.case-header,.case-card,.panelx,.form-panel,.form-card,.menu-card,.table-card,.note-card,.notes-card,.payment-method-note,.free-banner,.payment-config-alert,.manual-payment-card,.manual-payment-step,.payment-tabpanel,.empty-state,.empty,.bill-kv,.history-row,.help,.helper-card,.step-card,.stepper,.register-redirect,.profile-support-help,.field-help,.fee-partial-block,.fee-partial-summary){
  background:#fff!important;background-image:none!important;color:#142337!important;
  border-color:var(--ui-line)!important;backdrop-filter:none!important;
}
html:not([data-theme="royal-dark"]) :is(.payment-tabs,.payment-tab,.payment-status,.flow-payment-badge,.filter-chip,.quick-chip,.directory-chips a,.law-kicker,.sec-tag,.login-kicker,.badge-soft,.pill,.profile-badge){background:#fff!important;background-image:none!important;border-color:var(--ui-line)!important;color:#0d4c95!important}
html:not([data-theme="royal-dark"]) :is(.payment-tabs,.payment-tab.active,.payment-tab:hover){background:#fff!important}
html:not([data-theme="royal-dark"]) :is(.panel,.card,.dash-card,.content-card,.stat-card,.metric-card,.result-card,.search-card,.payment-panel,.order-panel,.support-section,.support-contact-card,.legal-card,.form-section,.source-card,.case-header){box-shadow:var(--ui-shadow)!important}
html:not([data-theme="royal-dark"]) :is(.panel,.card,.dash-card,.content-card,.stat-card,.metric-card,.dashboard-card,.action-card,.profile-card,.info-card,.result-card,.search-card,.search-panel,.trust-card,.law-card,.law-preview,.plan-card,.pricing-card,.payment-panel,.order-panel,.bill-card,.receipt-card,.contact-card,.support-section,.support-contact-card,.faq-item,.legal-card,.modal-content,.form-section,.login-card,.lawyer-login-form-panel,.workspace-main,.workspace-side,.ai-panel,.source-card,.case-header,.case-card,.panelx,.form-panel,.form-card,.table-card,.note-card,.notes-card,.payment-method-note,.manual-payment-step,.empty-state,.bill-kv,.history-row,.help,.helper-card,.step-card,.stepper,.register-redirect,.fee-partial-block)
:is(p,small,li,b,strong,span,label,legend,summary,td,dt,dd){color:#142337!important}
html:not([data-theme="royal-dark"]) :is(h1,h2,h3,h4,h5,h6){color:#0d4c95!important}
html:not([data-theme="royal-dark"]) :is(p,li,label,legend,summary){color:#142337}
html:not([data-theme="royal-dark"]) :is(.muted,.hint,.text-muted,.helper,.subtitle,.field-help,.form-hint){color:#405570!important}
/* Modo oscuro: ÚNICAMENTE matices azules. Los módulos no vuelven a gris. */
html[data-theme="royal-dark"] :is(body,main,.dash-main,.dash-layout,.directory-page,.flow-lawyer,.funnel-main,.support-stage,.payment-layout,.login-role-page,.law-section,.directory-section,.page-wrap,.app-shell,.workspace,.case-workspace){background:#071a32!important;color:#fff!important}
html[data-theme="royal-dark"] :is(.panel,.card,.dash-card,.content-card,.stat-card,.metric-card,.dashboard-card,.action-card,.profile-card,.info-card,.result-card,.search-card,.search-panel,.trust-card,.law-card,.law-preview,.plan-card,.pricing-card,.payment-panel,.order-panel,.bill-card,.receipt-card,.contact-card,.support-section,.support-contact-card,.faq-item,.legal-card,.modal-content,.form-section,.login-card,.login-form,.lawyer-login-form-panel,.profile-form-grid,.workspace-main,.workspace-side,.ai-panel,.ai-chat-box,.source-card,.case-header,.case-card,.panelx,.form-panel,.form-card,.menu-card,.table-card,.note-card,.notes-card,.payment-method-note,.free-banner,.payment-config-alert,.manual-payment-card,.manual-payment-step,.payment-tabpanel,.empty-state,.empty,.bill-kv,.history-row,.help,.helper-card,.step-card,.stepper,.register-redirect,.profile-support-help,.field-help,.fee-partial-block,.fee-partial-summary,.payment-tabs,.payment-tab,.flow-payment-badge,.filter-chip,.quick-chip,.directory-chips a,.law-kicker,.sec-tag,.login-kicker,.badge-soft,.pill,.profile-badge){
  background:#102b4c!important;background-image:none!important;color:#fff!important;
  border-color:#355b80!important;backdrop-filter:none!important;
}
html[data-theme="royal-dark"] :is(h1,h2,h3,h4,h5,h6,p,li,label,legend,summary,small,blockquote,dt,dd){color:#fff!important}
html[data-theme="royal-dark"] :is(.muted,.hint,.text-muted,.helper,.subtitle,.field-help,.form-hint){color:#d8e8fa!important}
html[data-theme="royal-dark"] :is(.panel,.card,.dash-card,.content-card,.stat-card,.metric-card,.dashboard-card,.action-card,.profile-card,.info-card,.result-card,.search-card,.payment-panel,.order-panel,.bill-card,.receipt-card,.support-section,.support-contact-card,.legal-card,.form-section,.source-card,.case-header,.case-card,.panelx,.form-card,.note-card,.notes-card)
:is(p,small,li,b,strong,span,label,legend,summary,td,dt,dd){color:#fff!important}
/* Cabeceras, sidebar, banners, call-to-action: fondo azul y TODO texto blanco. */
html:not([data-theme="royal-dark"]) :is(.topbar,.law-topbar,.dash-topbar,.dash-sidebar,.app-header,.app-topbar,.page-header,.section-header,.funnel-head,.receipt-head,.register-banner,.welcome-card,.registration-intro,.law-final,.funnel-side--formal,.professional-cta__inner,.login-role-abogado .lawyer-login-copy.lawyer-login-image-only,.dash-header,.sidebar-header,.top-header){background:#0b468e!important;background-image:none!important;border-color:#0b468e!important;color:#fff!important}
html[data-theme="royal-dark"] :is(.topbar,.law-topbar,.dash-topbar,.dash-sidebar,.app-header,.app-topbar,.page-header,.section-header,.funnel-head,.receipt-head,.register-banner,.welcome-card,.registration-intro,.law-final,.funnel-side--formal,.professional-cta__inner,.login-role-abogado .lawyer-login-copy.lawyer-login-image-only,.dash-header,.sidebar-header,.top-header){background:#06172f!important;background-image:none!important;border-color:#355b80!important;color:#fff!important}
html :is(.topbar,.law-topbar,.dash-topbar,.dash-sidebar,.app-header,.app-topbar,.page-header,.section-header,.funnel-head,.receipt-head,.register-banner,.welcome-card,.registration-intro,.law-final,.funnel-side--formal,.professional-cta__inner,.login-role-abogado .lawyer-login-copy.lawyer-login-image-only,.dash-header,.sidebar-header,.top-header)
:is(h1,h2,h3,h4,h5,h6,p,small,span,b,strong,li,a,label,summary,time,.muted,.subtitle,.hint,.top-title p,.profile-badge,.dash-profile p){color:#fff!important;-webkit-text-fill-color:#fff!important;text-shadow:none!important}
html :is(.topbar,.law-topbar,.dash-topbar,.dash-sidebar,.app-header,.app-topbar,.page-header,.section-header,.funnel-head,.receipt-head,.register-banner,.welcome-card,.registration-intro,.law-final,.funnel-side--formal,.professional-cta__inner,.login-role-abogado .lawyer-login-copy.lawyer-login-image-only,.dash-header,.sidebar-header,.top-header) :is(svg,.ui-icon){color:#fff;stroke:currentColor}
/* Evita pintar en blanco letras de tarjetas blancas internas en un encabezado. */
html:not([data-theme="royal-dark"]) :is(.topbar,.law-topbar,.dash-topbar,.dash-sidebar,.register-banner,.welcome-card,.registration-intro) :is(.card,.panel,.search-panel,.form-section,.dropdown-menu,.contact-choice__menu,.nav-dropdown,.sub-menu)
:is(h1,h2,h3,h4,p,small,span,b,strong,li,a,label){color:#142337!important;-webkit-text-fill-color:#142337!important}
html :is(.topbar,.law-topbar,.dash-topbar) :is(.nav-links,.law-nav,.top-actions){background:transparent!important}
html :is(.topbar,.law-topbar,.dash-topbar) :is(.brand-logo-img,.law-brand__logo){filter:brightness(0) invert(1)}
html :is(.dash-sidebar,.dash-topbar,.topbar,.law-topbar) :is(a,.dash-menu a,.sidebar-action){text-decoration:none}
html :is(.dash-sidebar,.dash-topbar,.topbar,.law-topbar) :is(a,.dash-menu a,.sidebar-action):hover{opacity:1;filter:brightness(1.1)}
html :is(.dash-sidebar,.topbar,.law-topbar,.dash-topbar) :is(.dash-menu a.active,.nav-links a.active){background:#2464ab!important;color:#fff!important;border-color:#5088cc!important}
html :is(.dash-sidebar,.topbar,.law-topbar,.dash-topbar) :is(.dash-menu a.active,.nav-links a.active) :is(span,b,strong,svg){color:#fff!important}
/* CTA/acciones coloreadas: siempre blanco y nunca icono negro dentro. */
html :is(.button.primary,.btn.primary,.dash-btn.primary,.law-btn--primary,.primary-btn,.btn-primary,.login-button,.search-submit,.professional-access-link,.payment-button,.checkout-button,.pay-button,button[type="submit"]:not(.ghost):not(.secondary),input[type="submit"]){
 background:#1257a6!important;background-image:none!important;border-color:#1257a6!important;color:#fff!important;-webkit-text-fill-color:#fff!important;text-decoration:none;
}
html[data-theme="royal-dark"] :is(.button.primary,.btn.primary,.dash-btn.primary,.law-btn--primary,.primary-btn,.btn-primary,.login-button,.search-submit,.professional-access-link,.payment-button,.checkout-button,.pay-button,button[type="submit"]:not(.ghost):not(.secondary),input[type="submit"]){background:#2472b9!important;border-color:#70bfff!important}
html :is(.button.primary,.btn.primary,.dash-btn.primary,.law-btn--primary,.primary-btn,.btn-primary,.login-button,.search-submit,.professional-access-link,.payment-button,.checkout-button,.pay-button,button[type="submit"]:not(.ghost):not(.secondary)) :is(span,small,b,strong,i,svg){color:#fff!important;-webkit-text-fill-color:#fff!important}
/* Botones secundarios blancos, no gris claro que dificulta leer el texto. */
html:not([data-theme="royal-dark"]) :is(.button.ghost,.button.secondary,.btn-secondary,.dash-btn.secondary,.law-btn--ghost,.ghost,.secondary-btn,.btn-outline,.btn.ghost,.back-link,.support-nav a,.topbar .button.ghost,.law-topbar .law-btn--ghost){background:#fff!important;background-image:none!important;color:#0b468e!important;-webkit-text-fill-color:#0b468e!important;border:1px solid #abc9eb!important}
html:not([data-theme="royal-dark"]) :is(.button.ghost,.button.secondary,.btn-secondary,.dash-btn.secondary,.law-btn--ghost,.ghost,.secondary-btn,.btn-outline,.btn.ghost,.back-link,.support-nav a) :is(span,b,strong,svg){color:#0b468e!important;-webkit-text-fill-color:#0b468e!important}
html[data-theme="royal-dark"] :is(.button.ghost,.button.secondary,.btn-secondary,.dash-btn.secondary,.law-btn--ghost,.ghost,.secondary-btn,.btn-outline,.btn.ghost,.back-link,.support-nav a){background:#2472b9!important;color:#fff!important;-webkit-text-fill-color:#fff!important;border:1px solid #70bfff!important}
html[data-theme="royal-dark"] :is(.button.ghost,.button.secondary,.btn-secondary,.dash-btn.secondary,.law-btn--ghost,.ghost,.secondary-btn,.btn-outline,.btn.ghost,.back-link,.support-nav a) :is(span,b,strong,svg){color:#fff!important;-webkit-text-fill-color:#fff!important}
/* Campos y listas de selección: fondo blanco y letra oscura / fondo azul y letra blanca. */
html:not([data-theme="royal-dark"]) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),textarea,select,[contenteditable="true"],.inp){background:#fff!important;color:#142337!important;-webkit-text-fill-color:#142337!important;border-color:#acc9e7!important;box-shadow:none}
html[data-theme="royal-dark"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),textarea,select,[contenteditable="true"],.inp){background:#102b4c!important;color:#fff!important;-webkit-text-fill-color:#fff!important;border-color:#557fa4!important;box-shadow:none}
html:not([data-theme="royal-dark"]) :is(input,textarea)::placeholder{color:#526b86!important;opacity:1!important}
html[data-theme="royal-dark"] :is(input,textarea)::placeholder{color:#c8dff4!important;opacity:1!important}
html:not([data-theme="royal-dark"]) :is(select option){background:#fff!important;color:#142337!important}
html[data-theme="royal-dark"] :is(select option){background:#102b4c!important;color:#fff!important}
html:not([data-theme="royal-dark"]) :is(input,select,textarea):is(:disabled,[readonly]){background:#fff!important;color:#50647d!important;-webkit-text-fill-color:#50647d!important;opacity:1!important}
html[data-theme="royal-dark"] :is(input,select,textarea):is(:disabled,[readonly]){background:#183b60!important;color:#e5f2ff!important;-webkit-text-fill-color:#e5f2ff!important;opacity:1!important}
html body :is(button,a,input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid var(--ui-focus)!important;outline-offset:3px!important}
html body :is(button,a,.button,.btn,.dash-btn,.law-btn){transition:background-color .16s ease,border-color .16s ease,box-shadow .16s ease}
html body :is(button,a,.button,.btn,.dash-btn,.law-btn):disabled{cursor:not-allowed;opacity:.62!important}
/* Tarjetas de estatus y pestañas: blanco en claro, azul en oscuro. */
html:not([data-theme="royal-dark"]) :is(.payment-tab,.payment-tab.active,.payment-status,.notice,.alert,.profile-alert,.support-notice,.tag,.chip,.status,.badge,.payment-method-note,.payment-config-alert,.profile-support-notice){background:#fff!important;background-image:none!important;border-color:#c9dbef!important}
html[data-theme="royal-dark"] :is(.payment-tab,.payment-tab.active,.payment-status,.notice,.alert,.profile-alert,.support-notice,.tag,.chip,.status,.badge,.payment-method-note,.payment-config-alert,.profile-support-notice){background:#102b4c!important;background-image:none!important;border-color:#426b91!important;color:#fff!important}
html[data-theme="royal-dark"] :is(.payment-tab,.payment-status,.notice,.alert,.profile-alert,.support-notice,.tag,.chip,.status,.badge,.payment-method-note,.payment-config-alert,.profile-support-notice) :is(span,b,strong,p,small){color:#fff!important}
/* Evitar fondos grises en tablas y formularios; preservar contraste por fila. */
html:not([data-theme="royal-dark"]) :is(table,thead,tbody,tr,th,td,.table-wrap,.table-responsive,.bill-row,.dash-table,.history-row){background-color:#fff!important;background-image:none!important}
html[data-theme="royal-dark"] :is(table,thead,tbody,tr,th,td,.table-wrap,.table-responsive,.bill-row,.dash-table,.history-row){background-color:#102b4c!important;background-image:none!important;color:#fff!important}
html:not([data-theme="royal-dark"]) :is(th,td){color:#142337!important;border-color:#d1e0f1!important}
html[data-theme="royal-dark"] :is(th,td){color:#fff!important;border-color:#355b80!important}
html:not([data-theme="royal-dark"]) thead th{background:#0b468e!important;color:#fff!important}
html:not([data-theme="royal-dark"]) thead th :is(span,b,strong,small){color:#fff!important}
html[data-theme="royal-dark"] thead th{background:#06172f!important;color:#fff!important}
/* Declarar color de encabezados en tarjetas azules, sin sombreado gris. */
html :is(.dash-topbar,.topbar,.law-topbar,.dash-sidebar,.register-banner,.receipt-head,.funnel-head,.welcome-card,.registration-intro,.professional-cta__inner,.funnel-side--formal,.law-final) :is(.muted,.hint,.text-muted,.helper,.subtitle,.field-help){color:#fff!important}
/* Bloques coloreados con style inline: se evita que sus hijos con color explícito queden oscuros. */
html body :is(.profile-support-help,.law-final,.register-banner,.welcome-card,.receipt-head,.funnel-head,.lawyer-login-copy.lawyer-login-image-only,.dash-profile,.dash-menu) :is(h1,h2,h3,h4,p,small,span,b,strong,li){color:inherit}
/* Footer azul institucional con enlaces blancos en ambas opciones. */
html :is(footer,.footer,.law-footer,.flow-footer,.op-contact-strip){background:#0b468e!important;color:#fff!important;border-color:#0b468e!important}
html[data-theme="royal-dark"] :is(footer,.footer,.law-footer,.flow-footer,.op-contact-strip){background:#06172f!important;border-color:#355b80!important}
html :is(footer,.footer,.law-footer,.flow-footer,.op-contact-strip) :is(h1,h2,h3,h4,p,small,span,b,strong,a,li){color:#fff!important;-webkit-text-fill-color:#fff!important}
html :is(footer,.footer,.law-footer,.flow-footer,.op-contact-strip) :is(.brand-logo-img,.law-brand__logo){filter:brightness(0) invert(1)}
/* La barra lateral y los botones sobre fondo oscuro tienen blanco real. */
html .dash-sidebar :is(.dash-profile,.dash-menu,.dash-menu a,.sidebar-foot,.sidebar-action,.profile-badge) :is(h2,h3,b,strong,small,span,p,svg){color:#fff!important}
html .dash-sidebar .dash-menu a{color:#fff!important}
/* Tema siempre localizable, sin ocultar controles ni superponer campos. */
html .legasist-theme-toggle{position:fixed!important;right:18px!important;bottom:18px!important;z-index:9990!important;display:grid!important;place-items:center!important;width:46px!important;height:46px!important;min-width:46px!important;min-height:46px!important;border:1px solid #b7d3f1!important;border-radius:50%!important;background:#0b468e!important;color:#fff!important;box-shadow:0 5px 16px rgba(10,48,91,.22)!important;cursor:pointer!important}
html[data-theme="royal-dark"] .legasist-theme-toggle{background:#2472b9!important;color:#fff!important;border-color:#9bd4ff!important}
html .legasist-theme-toggle svg{color:#fff!important;width:22px;height:22px}
html body .menu-toggle,html body .legasist-menu-toggle{min-width:42px;min-height:42px;align-items:center;justify-content:center}
html body .legasist-sidebar-close{color:#fff!important;background:#145398!important}
html .table-responsive,html .legasist-auto-table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
html .table-responsive table{width:100%}
html :is(.login-role-page,.registration-page,.dashboard-body,.flow-lawyer) :is(form,.form-grid,.profile-form-grid,.support-form,.fields-grid){min-width:0}
html :is(.form-grid,.profile-form-grid,.support-form,.fields-grid) > *{min-width:0}
html .dash-main{max-width:100%;overflow-x:clip}
html body :is(input,select,textarea){max-width:100%}
html .dash-topbar .top-title{min-width:0}
html body :is(.dash-btn,.button,.btn,.law-btn,.login-button){line-height:1.32}
html body a{text-underline-offset:3px}
/* Respetar componentes específicos de marcas de tarjetas y visualizador de archivos. */
html body :is(.brand-strip,.payment-brand-list,.payment-brand) img{filter:none!important}
@media(max-width:780px){
  html{scroll-padding-top:70px}
  html body :is(.dash-main,.payment-panel,.order-panel,.support-section,.legal-card,.panelx){padding-left:max(14px,env(safe-area-inset-left));padding-right:max(14px,env(safe-area-inset-right))}
  html body :is(.payment-layout,.workspace,.case-workspace,.fields-grid,.support-form){grid-template-columns:minmax(0,1fr)!important}
  html body :is(.fields-grid,.support-form) .full{grid-column:auto}
  html body :is(.payment-tabs,.flow-payment-badges){overflow-x:auto;max-width:100%;-webkit-overflow-scrolling:touch}
  html body :is(.dash-topbar,.topbar__inner,.law-topbar__inner){gap:10px}
  html body .legasist-theme-toggle{right:12px!important;bottom:12px!important}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}html *,html *::before,html *::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
/* Menú público móvil real: evita que desaparezcan los enlaces del acceso y registro. */
html .lg-public-menu-toggle{display:none!important}
@media(max-width:850px){
 html :is(.topbar,.law-topbar){position:relative!important;z-index:110}
 html :is(.topbar__inner,.law-topbar__inner){display:flex;align-items:center;justify-content:space-between;flex-wrap:nowrap}
 html .lg-public-menu-toggle{display:inline-flex!important;align-items:center;justify-content:center;min-width:44px;min-height:44px;border-radius:11px;border:1px solid rgba(255,255,255,.5);background:#1257a6!important;color:#fff!important;cursor:pointer;font-size:24px}
 html :is(.topbar,.law-topbar) :is(.nav-links,.law-nav){display:none!important}
 html :is(.topbar,.law-topbar).lg-public-nav-open :is(.nav-links,.law-nav){display:flex!important;position:absolute;z-index:111;left:12px;right:12px;top:calc(100% + 3px);max-width:none;width:auto;flex-direction:column;align-items:stretch;gap:3px;padding:12px;border-radius:12px;background:#0b468e!important;border:1px solid #5e91c7;box-shadow:0 14px 32px rgba(9,39,79,.18)}
 html[data-theme="royal-dark"] :is(.topbar,.law-topbar).lg-public-nav-open :is(.nav-links,.law-nav){background:#06172f!important}
 html :is(.topbar,.law-topbar).lg-public-nav-open :is(.nav-links,.law-nav)>a{display:flex!important;min-height:41px;align-items:center;padding:9px 12px;margin:0;color:#fff!important}
 html :is(.topbar,.law-topbar).lg-public-nav-open :is(.nav-links,.law-nav)>a:is(.button,.law-btn){justify-content:center}
}
/* Pantallas de LegasistNotas/IA: antes usaban una tercera paleta verde/gris. */
:root,html:not([data-theme="royal-dark"]){
 --leg-bg:#fff!important;--leg-deep:#0b468e!important;--leg-mid:#0b468e!important;
 --leg-input:#fff!important;--leg-card:#fff!important;--leg-card-2:#fff!important;
 --leg-line:#d1e0f1!important;--leg-blue:#1257a6!important;--leg-blue-soft:#1257a6!important;
 --leg-green:#1257a6!important;--leg-green-dark:#1257a6!important;
 --leg-purple:#1257a6!important;--leg-yellow:#1257a6!important;
 --leg-text:#142337!important;--leg-muted:#405570!important;--leg-soft:#405570!important;
}
html[data-theme="royal-dark"]{
 --leg-bg:#071a32!important;--leg-deep:#06172f!important;--leg-mid:#06172f!important;
 --leg-input:#102b4c!important;--leg-card:#102b4c!important;--leg-card-2:#102b4c!important;
 --leg-line:#355b80!important;--leg-blue:#2472b9!important;--leg-blue-soft:#fff!important;
 --leg-green:#2472b9!important;--leg-green-dark:#2472b9!important;
 --leg-purple:#2472b9!important;--leg-yellow:#2472b9!important;
 --leg-text:#fff!important;--leg-muted:#d8e8fa!important;--leg-soft:#d8e8fa!important;
}
html:not([data-theme="royal-dark"]) body.legasist-tool-body{background:#fff!important;background-image:none!important;color:#142337!important}
html[data-theme="royal-dark"] body.legasist-tool-body{background:#071a32!important;background-image:none!important;color:#fff!important}
html:not([data-theme="royal-dark"]) :is(.tool-main,.tool-profile,.tool-credits,.panel-tool,.note-card,.source-card,.consult-card,.summary-box,.consult-result,.recorder,.audio-format-card,.tool-menu a.active,.tool-menu a:hover,.tool-actions .tool-btn:not(.primary),.law-mini .metric,.tool-layout .notice,.tool-layout .empty-state){background:#fff!important;background-image:none!important;border-color:#d1e0f1!important;color:#142337!important}
html[data-theme="royal-dark"] :is(.tool-main,.tool-profile,.tool-credits,.panel-tool,.note-card,.source-card,.consult-card,.summary-box,.consult-result,.recorder,.audio-format-card,.tool-actions .tool-btn:not(.primary),.law-mini .metric,.tool-layout .notice,.tool-layout .empty-state){background:#102b4c!important;background-image:none!important;border-color:#355b80!important;color:#fff!important}
html :is(.tool-sidebar,.tool-topbar){background:#0b468e!important;background-image:none!important;color:#fff!important;border-color:#0b468e!important}
html[data-theme="royal-dark"] :is(.tool-sidebar,.tool-topbar){background:#06172f!important;border-color:#355b80!important}
html :is(.tool-sidebar,.tool-topbar) :is(h1,h2,h3,p,span,small,b,strong,label,a,.tool-title p,.tool-menu a,.tool-brand){color:#fff!important;-webkit-text-fill-color:#fff!important}
html :is(.tool-sidebar,.tool-topbar) :is(.brand-logo-img){filter:brightness(0) invert(1)!important}
html .tool-sidebar :is(.tool-profile,.tool-credits,.tool-menu a:hover,.tool-menu a.active){background:#14569e!important;border-color:#477eb7!important}
html .tool-sidebar :is(.tool-profile,.tool-credits,.tool-menu a:hover,.tool-menu a.active) :is(h3,p,span,b,strong){color:#fff!important}
html :is(.tool-btn.primary,.tool-btn.green,.tool-btn.purple,.tool-btn.danger,.record-circle,.tool-brand span,.tool-avatar){background:#1257a6!important;background-image:none!important;color:#fff!important;border-color:#1257a6!important}
html[data-theme="royal-dark"] :is(.tool-btn.primary,.tool-btn.green,.tool-btn.purple,.tool-btn.danger,.record-circle,.tool-brand span,.tool-avatar){background:#2472b9!important;color:#fff!important}
/* Agenda y calendarios: ninguno de los estados neutros usa gris como superficie. */
html:not([data-theme="royal-dark"]) body.dashboard-body :is(.agenda-hero,.calendar-board,.calendar-head,.day-panel,.day-cell,.agenda-day-card,.agenda-form-section,.agenda-info-list,.selected-date,.calendar-notice,.transcript-box,.google-status,.agenda-legend span,.upload-card,.calendar-today,.day-number,.event-chip,.quick-chip,.credit-table .highlight,.security-pill,.lawyer-register-note,.declaration,.order-feature){background:#fff!important;background-image:none!important;border-color:#d1e0f1!important;color:#142337!important}
html[data-theme="royal-dark"] body.dashboard-body :is(.agenda-hero,.calendar-board,.calendar-head,.day-panel,.day-cell,.agenda-day-card,.agenda-form-section,.agenda-info-list,.selected-date,.calendar-notice,.transcript-box,.google-status,.agenda-legend span,.upload-card,.day-number,.event-chip,.quick-chip){background:#102b4c!important;background-image:none!important;border-color:#355b80!important;color:#fff!important}
html:not([data-theme="royal-dark"]) body.dashboard-body :is(.agenda-hero,.calendar-board,.day-panel) :is(h1,h2,h3,p,span,small,b,strong){color:#142337!important}
html[data-theme="royal-dark"] body.dashboard-body :is(.agenda-hero,.calendar-board,.day-panel) :is(h1,h2,h3,p,span,small,b,strong){color:#fff!important}
html:not([data-theme="royal-dark"]) :is(.quick-card,.list-item,.time-item,.kanban-col,.mini-note,.chart-bars,.db-kv,.selected-date span,.notes-list .note-card,.fee-partial-summary,.mini-calendar span){background:#fff!important;background-image:none!important;border-color:#d1e0f1!important;color:#142337!important}
html[data-theme="royal-dark"] :is(.quick-card,.list-item,.time-item,.kanban-col,.mini-note,.chart-bars,.db-kv,.selected-date span,.notes-list .note-card,.fee-partial-summary,.mini-calendar span){background:#102b4c!important;background-image:none!important;border-color:#355b80!important;color:#fff!important}
/* Cabeceras de secciones: azul/blanco consistente, sustituyendo velos grises. */
html:not([data-theme="royal-dark"]) :is(.panel-head,.panel-tool .panel-head,.section-bar,.table-heading,.calendar-head){background:#0b468e!important;background-image:none!important;color:#fff!important;border-color:#0b468e!important}
html[data-theme="royal-dark"] :is(.panel-head,.panel-tool .panel-head,.section-bar,.table-heading,.calendar-head){background:#06172f!important;background-image:none!important;color:#fff!important;border-color:#355b80!important}
html :is(.panel-head,.panel-tool .panel-head,.section-bar,.table-heading,.calendar-head) :is(h1,h2,h3,h4,p,small,span,b,strong,li,button:not(.button):not(.btn):not(.dash-btn)){color:#fff!important;-webkit-text-fill-color:#fff!important}
html :is(.panel-head,.panel-tool .panel-head) :is(h2,h3){margin-top:0!important}
html body :is(.panel,.panel-tool) .panel-head{padding:18px 22px!important}
html body :is(.panel,.panel-tool) .panel-body{padding:20px 22px!important}
html .dash-sidebar .profile-badge{background:#14569e!important;border-color:#477eb7!important;color:#fff!important}
/* Acciones sobre un encabezado no deben tener texto blanco en superficie blanca. */
html :is(.dash-topbar,.topbar,.law-topbar,.panel-head,.tool-topbar) :is(.dash-btn,.tool-btn,.mini-button){background:#2464ab!important;border-color:#538bc8!important;color:#fff!important}
html :is(.dash-topbar,.topbar,.law-topbar,.panel-head,.tool-topbar) :is(.dash-btn,.tool-btn,.mini-button) :is(span,b,strong,svg){color:#fff!important}
html:not([data-theme="royal-dark"]) :is(.panel-head,.tool-topbar) :is(input,textarea,select){background:#fff!important;color:#142337!important;-webkit-text-fill-color:#142337!important}
@media(max-width:650px){html body :is(.panel,.panel-tool) .panel-head{padding:15px 16px!important}html body :is(.panel,.panel-tool) .panel-body{padding:16px!important}}


/* ===== LEGASIST HOSTGATOR V4 | 16 OCT 2026 =====
   Corrección final de contraste en tema claro:
   - evita texto blanco sobre fondos claros en CTA, footer y bloques internos
   - mejora legibilidad de botones y tarjetas anidadas dentro de paneles azules
   - aumenta ligeramente el logotipo sin tocar lógica ni configuración */
html:not([data-theme="royal-dark"]) .professional-cta__inner .cta-actions :is(.button,.law-btn),
html:not([data-theme="royal-dark"]) .law-final :is(.button,.law-btn),
html:not([data-theme="royal-dark"]) .register-banner :is(.button,.law-btn),
html:not([data-theme="royal-dark"]) .receipt-head :is(.button,.law-btn){
  min-height:44px!important;padding:0 20px!important;border-radius:14px!important;font-weight:800!important;
}
html:not([data-theme="royal-dark"]) .professional-cta__inner .cta-actions .button.primary,
html:not([data-theme="royal-dark"]) .law-final .button.primary,
html:not([data-theme="royal-dark"]) .law-final .law-btn--primary,
html:not([data-theme="royal-dark"]) .professional-cta__inner .law-btn--primary,
html:not([data-theme="royal-dark"]) .receipt-head .button.primary,
html:not([data-theme="royal-dark"]) .register-banner .button.primary{
  background:#ffffff!important;border-color:#ffffff!important;color:#0b468e!important;-webkit-text-fill-color:#0b468e!important;
  box-shadow:0 10px 24px rgba(0,0,0,.08)!important;
}
html:not([data-theme="royal-dark"]) .professional-cta__inner .cta-actions .button.primary :is(span,b,strong),
html:not([data-theme="royal-dark"]) .law-final .button.primary :is(span,b,strong),
html:not([data-theme="royal-dark"]) .law-final .law-btn--primary :is(span,b,strong),
html:not([data-theme="royal-dark"]) .professional-cta__inner .law-btn--primary :is(span,b,strong),
html:not([data-theme="royal-dark"]) .receipt-head .button.primary :is(span,b,strong),
html:not([data-theme="royal-dark"]) .register-banner .button.primary :is(span,b,strong){
  color:#0b468e!important;-webkit-text-fill-color:#0b468e!important;
}
html:not([data-theme="royal-dark"]) .professional-cta__inner .cta-actions .button.ghost,
html:not([data-theme="royal-dark"]) .law-final .button.ghost,
html:not([data-theme="royal-dark"]) .law-final .law-btn--ghost,
html:not([data-theme="royal-dark"]) .professional-cta__inner .law-btn--ghost,
html:not([data-theme="royal-dark"]) .receipt-head .button.ghost,
html:not([data-theme="royal-dark"]) .register-banner .button.ghost{
  background:transparent!important;border-color:rgba(255,255,255,.58)!important;color:#ffffff!important;-webkit-text-fill-color:#ffffff!important;
}
html:not([data-theme="royal-dark"]) .professional-cta__inner .cta-actions .button.ghost :is(span,b,strong),
html:not([data-theme="royal-dark"]) .law-final .button.ghost :is(span,b,strong),
html:not([data-theme="royal-dark"]) .law-final .law-btn--ghost :is(span,b,strong),
html:not([data-theme="royal-dark"]) .professional-cta__inner .law-btn--ghost :is(span,b,strong),
html:not([data-theme="royal-dark"]) .receipt-head .button.ghost :is(span,b,strong),
html:not([data-theme="royal-dark"]) .register-banner .button.ghost :is(span,b,strong){
  color:#ffffff!important;-webkit-text-fill-color:#ffffff!important;
}
html:not([data-theme="royal-dark"]) .registration-intro .mini-benefit,
html:not([data-theme="royal-dark"]) .registration-intro .benefit-stack > article,
html:not([data-theme="royal-dark"]) .welcome-card .mini-benefit{
  background:rgba(255,255,255,.16)!important;background-image:none!important;
  border:1px solid rgba(255,255,255,.30)!important;
  box-shadow:none!important;
}
html:not([data-theme="royal-dark"]) .registration-intro .mini-benefit :is(b,p,span,small,strong),
html:not([data-theme="royal-dark"]) .registration-intro .benefit-stack > article :is(b,p,span,small,strong),
html:not([data-theme="royal-dark"]) .welcome-card .mini-benefit :is(b,p,span,small,strong){
  color:#ffffff!important;-webkit-text-fill-color:#ffffff!important;
}
html:not([data-theme="royal-dark"]) .registration-intro .mini-benefit .check,
html:not([data-theme="royal-dark"]) .registration-intro .benefit-stack > article .check,
html:not([data-theme="royal-dark"]) .welcome-card .mini-benefit .check{
  background:rgba(255,255,255,.20)!important;border-color:rgba(255,255,255,.35)!important;color:#ffffff!important;
}
html:not([data-theme="royal-dark"]) .footer .footer-links .professional-access-link,
html:not([data-theme="royal-dark"]) .footer .footer-links a.button,
html:not([data-theme="royal-dark"]) .footer .footer-links .register-visible-link{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  min-height:40px!important;padding:0 16px!important;border-radius:999px!important;
  background:#135eb5!important;border:1px solid #135eb5!important;color:#ffffff!important;-webkit-text-fill-color:#ffffff!important;
}
html:not([data-theme="royal-dark"]) .footer .footer-links .professional-access-link :is(span,b,strong),
html:not([data-theme="royal-dark"]) .footer .footer-links a.button :is(span,b,strong),
html:not([data-theme="royal-dark"]) .footer .footer-links .register-visible-link :is(span,b,strong){
  color:#ffffff!important;-webkit-text-fill-color:#ffffff!important;
}
html:not([data-theme="royal-dark"]) :is(.footer,.law-footer,.flow-footer){background:#ffffff!important}
html:not([data-theme="royal-dark"]) :is(.footer,.law-footer,.flow-footer) .footer-inner,
html:not([data-theme="royal-dark"]) .law-footer__inner{row-gap:16px!important}
html body :is(.brand-logo-img,.law-brand__logo){height:46px!important;max-width:220px!important;width:auto!important;object-fit:contain!important}
html body .topbar .brand-logo-img,
html body .law-topbar .law-brand__logo{height:50px!important;max-width:236px!important}
html body .footer .brand-logo-img,
html body .law-footer .law-brand__logo{height:52px!important;max-width:245px!important}
html body .dash-sidebar .brand-logo-img{height:42px!important;max-width:190px!important}
@media(max-width:768px){
  html body :is(.brand-logo-img,.law-brand__logo){height:42px!important;max-width:200px!important}
  html body .topbar .brand-logo-img,
  html body .law-topbar .law-brand__logo,
  html body .footer .brand-logo-img,
  html body .law-footer .law-brand__logo{height:45px!important;max-width:210px!important}
  html:not([data-theme="royal-dark"]) .professional-cta__inner .cta-actions,
  html:not([data-theme="royal-dark"]) .law-final{width:100%!important}
}
