/* =========================================================
   TRV V52 · compatibilidad Windows + Apple, biblioteca de
   archivos, guía sin solapamientos y tema claro/oscuro real.
   ========================================================= */

:root{
  --trv-font:"Segoe UI Variable","Segoe UI",Inter,system-ui,-apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif;
  --v52-glass:color-mix(in srgb,var(--v44-panel,#0b1118) 72%,transparent);
  --v52-soft:color-mix(in srgb,var(--v44-panel-2,#101720) 86%,transparent);
}
*{box-sizing:border-box}
html,body,button,input,select,textarea{font-family:var(--trv-font)!important}
html,body{width:100%;max-width:100%;overflow-x:hidden}
button,input,select,textarea{min-width:0}
input,select,textarea{font-size:16px}
.trv43-workspace,.trv43-main,.section,.panel,.record44,.record-entry-card{min-width:0!important;max-width:100%!important}

/* ---------- CABECERA ESTABLE EN EDGE/CHROME/SAFARI ---------- */
.trv43-topbar{width:100%!important;max-width:100vw!important;position:sticky!important;top:0!important;z-index:5000!important}
.trv43-primary-row{display:grid!important;grid-template-columns:minmax(240px,1fr) auto!important;align-items:center!important;gap:18px!important;padding:16px 28px 10px!important}
.trv43-brand{display:none!important}
.trv43-heading{min-width:0!important}
.trv43-heading .page-title{min-width:0!important}
.trv43-heading h1{max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
.trv43-quick-actions{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:8px!important;min-width:0!important;flex-wrap:nowrap!important}
.access-user-chip{flex:0 1 194px!important;min-width:154px!important;max-width:210px!important}
.trv43-home-link,.trv43-guide-link{flex:0 0 auto!important;min-width:84px!important;padding-inline:16px!important}
.trv43-nav-row{display:flex!important;align-items:center!important;gap:18px!important;padding:0 28px 14px!important;min-width:0!important}
.trv43-nav-scroll{min-width:0!important;flex:1 1 auto!important;overflow:visible!important}
.trv43-nav{display:flex!important;align-items:center!important;min-width:max-content!important}
.trv43-search{flex:0 1 330px!important;min-width:220px!important;max-width:360px!important}
.module-cluster-trigger{font-family:var(--trv-font)!important}
.module-cluster-popover{font-family:var(--trv-font)!important}

/* Windows no interpreta exactamente igual backdrop-filter; el fondo mantiene contraste. */
.access-user-chip,.trv43-home-link,.trv43-guide-link,.trv43-search,.module-cluster-popover{
  background-color:var(--v52-glass)!important;
  -webkit-backdrop-filter:blur(24px) saturate(155%)!important;
  backdrop-filter:blur(24px) saturate(155%)!important;
}

/* ---------- FORMULARIOS ---------- */
.record44-form input,.record44-form select,.record44-form textarea,
.collection-automation input,.collection-automation select,.collection-automation textarea,
.sys49-settings input,.sys49-settings select,.access42 input,.access42 select{
  pointer-events:auto!important;user-select:text!important;-webkit-user-select:text!important;
  appearance:auto!important;-webkit-appearance:auto!important;
}
.record44-savebar{
  position:static!important;bottom:auto!important;top:auto!important;
  margin-top:24px!important;z-index:2!important;
  box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
}
/* espacio final: la barra ya no atraviesa los campos mientras se escribe */
.record44-flow{padding-bottom:20px!important}

/* ---------- BIBLIOTECA VISIBLE EN CADA MÓDULO ---------- */
.module-record-item{align-items:flex-start!important}
.module-record-item>div{min-width:0!important}
.record-file-library{display:grid!important;gap:7px!important;margin-top:12px!important;padding-top:10px!important;border-top:1px solid var(--v44-line)!important}
.record-file-library-title{font-size:9px!important;font-weight:950!important;letter-spacing:.12em!important;text-transform:uppercase!important;color:var(--v44-muted)!important}
.record-file-chip{
  display:grid!important;grid-template-columns:minmax(120px,1fr) auto auto auto!important;
  gap:8px!important;align-items:center!important;min-height:38px!important;
  padding:7px 9px!important;border:1px solid var(--v44-line)!important;
  background:var(--v44-panel-2)!important;color:var(--v44-text)!important;
}
.record-file-chip b{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;font-size:10px!important}
.record-file-chip em{font-style:normal!important;color:var(--v44-muted)!important;font-size:9px!important}
.record-file-chip a{color:var(--module-accent,#2d6cdf)!important;font-size:9px!important;font-weight:900!important;text-decoration:none!important;border:1px solid var(--v44-line)!important;padding:5px 8px!important;white-space:nowrap!important}
.record-file-chip a:hover{text-decoration:underline!important}

/* ---------- ARCHIVOS DESCARGABLES EN LA IA ---------- */
.ai-downloads{display:grid!important;gap:8px!important;margin-top:14px!important;padding-top:12px!important;border-top:1px solid rgba(255,255,255,.10)!important}
.ai-downloads-title{font-size:9px!important;letter-spacing:.14em!important;text-transform:uppercase!important;font-weight:950!important;color:#9fb2c4!important}
.ai-downloads article{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;gap:12px!important;padding:10px 12px!important;border:1px solid rgba(255,255,255,.11)!important;background:rgba(255,255,255,.035)!important;border-radius:10px!important}
.ai-downloads article>div{display:grid!important;min-width:0!important}
.ai-downloads b{font-size:11px!important;color:#f7f9fc!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
.ai-downloads small{font-size:9px!important;color:#92a5b8!important;margin-top:2px!important}
.ai-downloads article>span{display:flex!important;gap:6px!important}
.ai-downloads a{padding:7px 9px!important;border:1px solid rgba(255,255,255,.12)!important;border-radius:8px!important;color:#f7f9fc!important;text-decoration:none!important;font-size:9px!important;font-weight:900!important}
.ai-downloads a:last-child{background:var(--module-accent,#2d6cdf)!important;border-color:transparent!important}

/* ---------- GUÍA: NUNCA DEBE TAPAR LO QUE EXPLICA ---------- */
body.guide-open{overflow:auto!important}
.guide-card{
  z-index:9500!important;
  overflow-y:auto!important;overflow-x:hidden!important;
  overscroll-behavior:contain!important;
  scrollbar-gutter:stable!important;
}
.guide-card[data-placement="free"]{
  left:var(--guide-left,18px)!important;top:var(--guide-top,180px)!important;
  right:auto!important;bottom:auto!important;
  width:var(--guide-width,420px)!important;max-width:min(var(--guide-width,420px),calc(100vw - 36px))!important;
  max-height:var(--guide-maxh,480px)!important;
}
.guide-card[data-placement="form-left"]{
  left:var(--guide-left,18px)!important;top:var(--guide-top,160px)!important;right:auto!important;bottom:auto!important;
  width:var(--guide-width,390px)!important;max-width:390px!important;max-height:var(--guide-maxh,calc(100dvh - 180px))!important;
}
body.guide-open .guide-target-live{z-index:9340!important}
body.guide-open .guide-shade{z-index:9300!important}
.guide-focus{z-index:9330!important;pointer-events:none!important}
.guide-actions{position:sticky!important;bottom:-1px!important}
@media(min-width:900px){
  body.guide-form-mode .guide-form-shell-live.record-entry-card,
  body.guide-form-mode .guide-form-shell-live.collection-automation,
  body.guide-form-mode .guide-form-shell-live.access42-editor,
  body.guide-form-mode .guide-form-shell-live.sys49-settings{
    margin-left:420px!important;width:calc(100% - 420px)!important;
    min-width:0!important;transition:none!important;
  }
}

/* Ayuda y asistente SIEMPRE abajo a la derecha salvo cuando la guía está abierta. */
.floating-assist-stack{
  position:fixed!important;inset:auto max(18px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) auto!important;
  transform:none!important;z-index:9050!important;
}
body.guide-open .floating-assist-stack{opacity:0!important;visibility:hidden!important;pointer-events:none!important}

/* Asistente encima de mapas, popovers, formularios y Leaflet. */
.assistant{z-index:9800!important}
.assistant.open{z-index:9800!important}
.leaflet-pane,.leaflet-control{z-index:auto!important}
.leaflet-container{z-index:1!important}

/* ---------- TEMA CLARO COMPLETO ---------- */
html[data-theme="light"] body{background:#f3f5f7!important;color:#11161c!important}
html[data-theme="light"] .trv43-topbar{background:rgba(247,249,251,.94)!important}
html[data-theme="light"] .trv43-heading h1,
html[data-theme="light"] .module-hero h2,
html[data-theme="light"] .section h2,
html[data-theme="light"] .section h3,
html[data-theme="light"] .panel h3,
html[data-theme="light"] .record44 h3,
html[data-theme="light"] .record44 h4,
html[data-theme="light"] .record-field-title b,
html[data-theme="light"] .module-record-item strong,
html[data-theme="light"] .module-record-item b{color:#11161c!important}
html[data-theme="light"] .section,
html[data-theme="light"] .panel,
html[data-theme="light"] .module-hero,
html[data-theme="light"] .module-intel,
html[data-theme="light"] .record44,
html[data-theme="light"] .record-entry-card,
html[data-theme="light"] .record44-form,
html[data-theme="light"] .module-record-history,
html[data-theme="light"] .exec40-brief,
html[data-theme="light"] .exec40-map,
html[data-theme="light"] .exec40-inbox,
html[data-theme="light"] .exec40-semaphore,
html[data-theme="light"] .exec40-payables,
html[data-theme="light"] .exec40-trend{background:#fff!important;color:#11161c!important;border-color:rgba(16,30,45,.12)!important}
html[data-theme="light"] .record44-form input,
html[data-theme="light"] .record44-form select,
html[data-theme="light"] .record44-form textarea,
html[data-theme="light"] .collection-automation input,
html[data-theme="light"] .collection-automation select,
html[data-theme="light"] .collection-automation textarea,
html[data-theme="light"] .sys49-settings input,
html[data-theme="light"] .sys49-settings select,
html[data-theme="light"] .access42 input,
html[data-theme="light"] .access42 select{
  background:#f7f9fb!important;color:#11161c!important;border-color:rgba(16,30,45,.17)!important;
}
html[data-theme="light"] input::placeholder,html[data-theme="light"] textarea::placeholder{color:#778494!important;opacity:1!important}
html[data-theme="light"] .record-file-chip{background:#f7f9fb!important;color:#11161c!important;border-color:rgba(16,30,45,.12)!important}
html[data-theme="light"] .module-cluster-popover{background:rgba(255,255,255,.96)!important;color:#11161c!important}
html[data-theme="light"] .assistant{background:linear-gradient(160deg,#f7fbff,#eef5fb)!important;color:#11161c!important;border-color:rgba(30,66,96,.18)!important}
html[data-theme="light"] .assistant-head{background:rgba(244,249,253,.94)!important;border-color:rgba(30,66,96,.12)!important}
html[data-theme="light"] .assistant-head h3,
html[data-theme="light"] .assistant-head p,
html[data-theme="light"] .message.ai,
html[data-theme="light"] .ai-answer,
html[data-theme="light"] .ai-answer p,
html[data-theme="light"] .ai-answer h4,
html[data-theme="light"] .ai-answer h5{color:#17222c!important}
html[data-theme="light"] .message.ai .ai-wrap{background:rgba(255,255,255,.72)!important;border-color:rgba(30,66,96,.14)!important}
html[data-theme="light"] .assistant-form{background:rgba(244,249,253,.95)!important;border-color:rgba(30,66,96,.12)!important}
html[data-theme="light"] #assistantInput{background:#fff!important;color:#11161c!important;border-color:rgba(30,66,96,.20)!important}
html[data-theme="light"] .ai-downloads{border-color:rgba(30,66,96,.12)!important}
html[data-theme="light"] .ai-downloads article{background:#fff!important;border-color:rgba(30,66,96,.14)!important}
html[data-theme="light"] .ai-downloads b,html[data-theme="light"] .ai-downloads a{color:#17222c!important}
html[data-theme="light"] .ai-downloads small,html[data-theme="light"] .ai-downloads-title{color:#66788a!important}
html[data-theme="light"] .guide-card{background:linear-gradient(160deg,#f7fbff,#e9f2f9)!important;color:#14212d!important;border-color:rgba(30,66,96,.18)!important}
html[data-theme="light"] .guide-card h3,html[data-theme="light"] .guide-card>p,html[data-theme="light"] .guide-example p{color:#14212d!important}
html[data-theme="light"] .guide-example{background:#fff!important;border-color:rgba(30,66,96,.14)!important}
html[data-theme="light"] .guide-actions{background:linear-gradient(transparent,#eef6fb 22%,#eef6fb 100%)!important;border-color:rgba(30,66,96,.12)!important}
html[data-theme="light"] .guide-actions button{background:#fff!important;color:#14212d!important;border-color:rgba(30,66,96,.17)!important}
html[data-theme="light"] .guide-actions .next{background:var(--module-accent,#2d6cdf)!important;color:#fff!important}
html[data-theme="light"] .floating-guide-launcher,
html[data-theme="light"] .assistant-launcher{background:rgba(244,249,253,.92)!important;color:#17222c!important;border-color:rgba(30,66,96,.16)!important}

/* ---------- WINDOWS LAPTOP / DESKTOP ---------- */
@media (min-width:1180px) and (max-width:1600px){
  .trv43-primary-row{padding-inline:22px!important;gap:14px!important}
  .trv43-nav-row{padding-inline:22px!important;gap:12px!important}
  .trv43-heading h1{font-size:28px!important}
  .access-user-chip{max-width:188px!important}
  .trv43-home-link,.trv43-guide-link{min-width:76px!important;padding-inline:13px!important}
  .trv43-search{flex-basis:280px!important;max-width:300px!important}
  .module-cluster-trigger{padding-inline:10px!important}
  .cluster-label b{font-size:11px!important}
  .trv43-main{padding-inline:22px!important}
}
/* 1280x720 / 1366x768: mantener todo utilizable sin amontonar. */
@media (min-width:980px) and (max-width:1179px){
  .trv43-primary-row{grid-template-columns:minmax(220px,1fr) auto!important;padding:12px 16px 8px!important}
  .trv43-quick-actions{gap:6px!important}
  .access-user-chip{min-width:54px!important;width:54px!important;max-width:54px!important;padding:4px!important}
  .access-user-chip>span:last-child{display:none!important}
  .trv43-home-link,.trv43-guide-link{min-width:68px!important;padding-inline:10px!important}
  .trv43-nav-row{padding:0 16px 10px!important}
  .trv43-nav-scroll{overflow-x:auto!important;overflow-y:visible!important;scrollbar-width:thin}
  .trv43-search{display:none!important}
  .trv43-main{padding:18px 16px 110px!important}
  .record44-commandbar{grid-template-columns:minmax(180px,.7fr) minmax(160px,.55fr) minmax(240px,1.1fr)!important}
}
@media (max-width:979px){
  .trv43-primary-row{grid-template-columns:minmax(0,1fr) auto!important;padding:10px 12px 8px!important}
  .trv43-heading h1{font-size:23px!important}
  .access-user-chip{min-width:46px!important;width:46px!important;max-width:46px!important;padding:3px!important}
  .access-user-chip>span:last-child{display:none!important}
  .trv43-home-link{display:none!important}
  .trv43-guide-link{min-width:66px!important}
  .trv43-nav-row{padding:0 12px 9px!important}
  .trv43-nav-scroll{overflow-x:auto!important;overflow-y:visible!important}
  .trv43-search{display:none!important}
  .record-file-chip{grid-template-columns:minmax(0,1fr) auto auto!important}
  .record-file-chip em{display:none!important}
}
@media(max-width:759px){
  body.guide-form-mode .guide-form-shell-live.record-entry-card,
  body.guide-form-mode .guide-form-shell-live.collection-automation,
  body.guide-form-mode .guide-form-shell-live.access42-editor,
  body.guide-form-mode .guide-form-shell-live.sys49-settings{margin-left:0!important;width:100%!important}
  .guide-card[data-placement="free"],.guide-card[data-placement="form-left"]{
    left:10px!important;right:10px!important;top:auto!important;bottom:10px!important;width:auto!important;max-width:none!important;max-height:min(50dvh,430px)!important
  }
  .record-file-chip{display:flex!important;flex-wrap:wrap!important}
  .record-file-chip b{width:100%!important}
}

/* Fine pointer: scrollbars visibles y discretos en Windows. */
@media(pointer:fine){
  *{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--module-accent,#2d6cdf) 38%,var(--v44-muted)) transparent}
  *::-webkit-scrollbar{width:10px;height:10px}
  *::-webkit-scrollbar-track{background:transparent}
  *::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--module-accent,#2d6cdf) 32%,#6c7884);border:3px solid transparent;background-clip:padding-box;border-radius:999px}
}

/* =========================================================
   TRV V53 · corrección estructural final de guía, formularios,
   biblioteca de archivos y contraste claro/oscuro.
   ========================================================= */

/* La cabecera de captura y la tira Orden/Ruta/Equipo/... ya NO persiguen al
   usuario al hacer scroll. Forman parte del documento y permanecen en su lugar. */
.record44-card .record-entry-head,
.record44-jumps{
  position:static!important;
  top:auto!important;
  bottom:auto!important;
  z-index:auto!important;
  transform:none!important;
}
.record44-jumps{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
.record44-savebar{position:static!important;inset:auto!important;margin-top:26px!important}

/* -------- Guía V53: capa única, sin quedar detrás del contenido -------- */
body.guide-open .guide-target-live{position:relative!important;z-index:auto!important;isolation:auto!important}
body.guide-open .guide-target-live *{z-index:auto}
body.guide-open .guide-shade{z-index:30000!important}
body.guide-open .guide-focus{z-index:30010!important}
body.guide-open .guide-card{z-index:30050!important;display:flex!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;transform:none!important}
.guide-card{
  flex-direction:column!important;
  overflow:auto!important;
  overscroll-behavior:contain!important;
  min-height:0!important;
  box-shadow:0 34px 110px rgba(0,0,0,.62),inset 0 1px rgba(255,255,255,.05)!important;
}
.guide-card[data-placement="content-right"],
.guide-card[data-placement="form-left"]{
  left:var(--guide-left)!important;
  right:auto!important;
  top:var(--guide-top)!important;
  bottom:auto!important;
  width:var(--guide-width)!important;
  max-width:calc(100vw - 36px)!important;
  max-height:var(--guide-maxh)!important;
}
.guide-card[data-placement="mobile-bottom"]{
  left:12px!important;right:12px!important;top:auto!important;bottom:12px!important;
  width:auto!important;max-height:56dvh!important;
}
.guide-actions{flex:0 0 auto!important;margin-top:auto!important;z-index:3!important}

/* En contenido informativo la página reserva un carril real a la derecha.
   Así el cuadro NO se monta sobre el bloque que está explicando. */
@media(min-width:1100px){
  body.guide-content-mode .trv43-workspace{padding-right:438px!important;transition:none!important}
  body.guide-content-mode .trv43-topbar{width:calc(100vw - 438px)!important;max-width:calc(100vw - 438px)!important}
  body.guide-content-mode .trv43-main{width:100%!important;padding-right:24px!important}
  body.guide-form-mode .guide-form-shell-live.record-entry-card,
  body.guide-form-mode .guide-form-shell-live.collection-automation,
  body.guide-form-mode .guide-form-shell-live.access42-editor,
  body.guide-form-mode .guide-form-shell-live.sys49-settings{
    margin-left:420px!important;
    width:calc(100% - 420px)!important;
    max-width:calc(100% - 420px)!important;
  }
}
@media(max-width:1099px){
  body.guide-content-mode .trv43-workspace,
  body.guide-form-mode .trv43-workspace{padding-right:0!important}
  body.guide-form-mode .guide-form-shell-live{margin-left:0!important;width:100%!important;max-width:100%!important}
}

/* -------- Biblioteca: cada archivo tiene Abrir + Descargar visibles -------- */
.memory-item{display:grid!important;grid-template-columns:auto minmax(0,1fr) auto!important;gap:12px!important;align-items:center!important}
.memory-item-copy{min-width:0!important;display:grid!important;gap:3px!important}
.memory-item-copy strong{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
.memory-item-actions{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:6px!important;flex-wrap:wrap!important}
.memory-item-actions a,.memory-item-actions button{
  min-height:34px!important;padding:0 10px!important;border:1px solid var(--v44-line-strong)!important;
  background:var(--v44-panel-2)!important;color:var(--v44-text)!important;text-decoration:none!important;
  font-size:9px!important;font-weight:900!important;border-radius:8px!important;display:inline-flex!important;align-items:center!important;
}
.memory-item-actions a:last-of-type{color:var(--module-accent,#2d6cdf)!important}
.memory-item-actions .memory-delete{width:34px!important;padding:0!important;justify-content:center!important}
@media(max-width:760px){.memory-item{grid-template-columns:auto minmax(0,1fr)!important}.memory-item-actions{grid-column:1/-1!important;justify-content:flex-start!important}}

/* -------- Modo claro: contraste completo, no sólo fondos -------- */
html[data-theme="light"]{
  --bg:#f4f6f8!important;--surface:#ffffff!important;--surface-2:#f7f9fb!important;
  --text:#11161c!important;--muted:#627080!important;--line:rgba(18,34,49,.14)!important;
  --v44-bg:#f4f6f8!important;--v44-panel:#ffffff!important;--v44-panel-2:#f6f8fa!important;
  --v44-text:#11161c!important;--v44-muted:#5f6d7c!important;--v44-line:rgba(18,34,49,.12)!important;--v44-line-strong:rgba(18,34,49,.20)!important;
}
html[data-theme="light"] body,
html[data-theme="light"] .trv43-main,
html[data-theme="light"] .record44-flow,
html[data-theme="light"] .record44-card,
html[data-theme="light"] .module-record-history,
html[data-theme="light"] .record44-form,
html[data-theme="light"] .record-step-panel,
html[data-theme="light"] .record44-commandbar,
html[data-theme="light"] .record44-jumps{background:#fff!important;color:#11161c!important}
html[data-theme="light"] .trv43-topbar{background:rgba(248,250,252,.96)!important;color:#11161c!important;border-color:rgba(18,34,49,.13)!important}
html[data-theme="light"] .module-cluster-trigger,
html[data-theme="light"] .module-cluster-trigger b,
html[data-theme="light"] .trv43-heading h1,
html[data-theme="light"] .page-title h1,
html[data-theme="light"] .record-entry-head h3,
html[data-theme="light"] .record-step-panel strong,
html[data-theme="light"] .record44-jumps button.is-active,
html[data-theme="light"] .record-field-title b,
html[data-theme="light"] label,
html[data-theme="light"] .exec40-groups strong,
html[data-theme="light"] .exec40-groups h3,
html[data-theme="light"] .exec40-semaphore strong,
html[data-theme="light"] .exec40-semaphore b,
html[data-theme="light"] .memory-item strong,
html[data-theme="light"] .memory-item-actions a,
html[data-theme="light"] .memory-item-actions button{color:#11161c!important}
html[data-theme="light"] .record-entry-head p,
html[data-theme="light"] .record-step-panel small,
html[data-theme="light"] .record44-jumps button,
html[data-theme="light"] .record-field>small,
html[data-theme="light"] .record-field-title small,
html[data-theme="light"] .module-record-item small,
html[data-theme="light"] .memory-item small,
html[data-theme="light"] .memory-item span{color:#607080!important}
html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select{
  background:#fff!important;color:#11161c!important;border-color:rgba(18,34,49,.20)!important;
  -webkit-text-fill-color:#11161c!important;
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder{color:#748292!important;opacity:1!important;-webkit-text-fill-color:#748292!important}
html[data-theme="light"] option{background:#fff!important;color:#11161c!important}
html[data-theme="light"] .module-cluster-popover,
html[data-theme="light"] .record44-card .record-entry-head,
html[data-theme="light"] .record44-jumps,
html[data-theme="light"] .access-user-chip,
html[data-theme="light"] .trv43-home-link,
html[data-theme="light"] .trv43-guide-link{
  background:#fff!important;color:#11161c!important;border-color:rgba(18,34,49,.14)!important;
}
html[data-theme="light"] .nav-app-icon b{color:#17202a!important}
html[data-theme="light"] .guide-card{background:linear-gradient(160deg,#fbfdff,#edf5fb)!important;color:#13202b!important;border-color:rgba(32,70,102,.20)!important}
html[data-theme="light"] .guide-card h3,
html[data-theme="light"] .guide-card>p,
html[data-theme="light"] .guide-example p{color:#13202b!important}
html[data-theme="light"] .guide-example{background:#fff!important;border-color:rgba(32,70,102,.16)!important}
html[data-theme="light"] .guide-actions{background:linear-gradient(transparent,#edf5fb 24%,#edf5fb 100%)!important;border-color:rgba(32,70,102,.12)!important}
html[data-theme="light"] .guide-actions button{background:#fff!important;color:#13202b!important;border-color:rgba(32,70,102,.18)!important}
html[data-theme="light"] .guide-actions .next{background:var(--module-accent,#2d6cdf)!important;color:#fff!important}
html[data-theme="light"] .guide-shade{background:rgba(39,55,70,.35)!important}

/* Windows 1280/1366: evita que la cabecera aplaste contenido y que los
   botones se salgan. */
@media (min-width:901px) and (max-width:1366px){
  .trv43-primary-row{padding-left:18px!important;padding-right:18px!important;gap:12px!important}
  .trv43-quick-actions{gap:6px!important}
  .access-user-chip{max-width:178px!important;min-width:140px!important}
  .trv43-home-link,.trv43-guide-link{min-width:70px!important;padding-inline:12px!important}
  .trv43-nav-row{padding-left:18px!important;padding-right:18px!important}
}

/* Legibilidad adicional para textos heredados que tenían blanco forzado. */
html[data-theme="light"] .trv43-main h1,
html[data-theme="light"] .trv43-main h2,
html[data-theme="light"] .trv43-main h3,
html[data-theme="light"] .trv43-main h4,
html[data-theme="light"] .trv43-main h5,
html[data-theme="light"] .trv43-main strong,
html[data-theme="light"] .trv43-main b,
html[data-theme="light"] .trv43-main th,
html[data-theme="light"] .trv43-main td,
html[data-theme="light"] .trv43-main label{color:#11161c!important}
html[data-theme="light"] .trv43-main p,
html[data-theme="light"] .trv43-main small,
html[data-theme="light"] .trv43-main .muted,
html[data-theme="light"] .trv43-main .record-empty{color:#617181!important}
html[data-theme="light"] .status.red,
html[data-theme="light"] .red{color:#d72532!important}
html[data-theme="light"] .status.green,
html[data-theme="light"] .green{color:#177e58!important}
html[data-theme="light"] .status.amber,
html[data-theme="light"] .amber{color:#9a6500!important}
