/* AI Project Universe V6.10 — compact viewer controls, reliable mobile drawers, and dark-theme contrast */

/* Root viewer toolbar: one swipeable row, no empty controls. */
@media (max-width:760px){
  .viewer .viewer__bar{
    display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:9px!important;
    min-height:64px!important;padding:8px 10px!important;overflow-x:auto!important;overflow-y:hidden!important;
    flex-wrap:nowrap!important;scroll-snap-type:x proximity!important;overscroll-behavior-x:contain!important;
    -webkit-overflow-scrolling:touch!important;scrollbar-width:thin!important;
  }
  .viewer .viewer__bar>div:first-child{
    display:flex!important;align-items:center!important;gap:8px!important;flex:0 0 auto!important;min-width:max-content!important;
    scroll-snap-align:start!important;
  }
  .viewer .viewer__bar>div:first-child strong{
    display:block!important;max-width:clamp(190px,48vw,390px)!important;overflow:hidden!important;
    text-overflow:ellipsis!important;white-space:nowrap!important;color:#111!important;
  }
  .viewer .viewer__actions{
    display:flex!important;align-items:center!important;gap:8px!important;flex:0 0 auto!important;
    width:max-content!important;min-width:max-content!important;margin-left:auto!important;flex-wrap:nowrap!important;
  }
  .viewer .viewer__display-controls{display:flex!important;align-items:center!important;gap:8px!important;flex:0 0 auto!important;width:auto!important;flex-wrap:nowrap!important}
  .viewer .viewer__theme-control,
  .viewer .apu-v69-language-button,
  .viewer #viewerStandalone,
  .viewer #viewerDownload,
  .viewer #viewerMusic,
  .viewer #viewerClose{
    display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 auto!important;
    height:44px!important;min-height:44px!important;max-height:44px!important;margin:0!important;padding:0 10px!important;
    border:3px solid #111!important;border-radius:10px!important;background:#fff!important;color:#111!important;
    box-shadow:none!important;font:900 12px/1 system-ui,-apple-system,"Segoe UI",sans-serif!important;
    white-space:nowrap!important;text-decoration:none!important;opacity:1!important;-webkit-text-fill-color:#111!important;
    scroll-snap-align:start!important;
  }
  .viewer .viewer__theme-control{width:46px!important;min-width:46px!important;padding:0!important}
  .viewer .viewer__theme-control #viewerThemeLabel{display:none!important}
  .viewer .viewer__theme-control .viewer__control-icon{font-size:19px!important}
  .viewer .apu-v69-language-button{width:46px!important;min-width:46px!important;padding:0!important;font-size:21px!important}
  .viewer #viewerStandalone{width:58px!important;min-width:58px!important}
  .viewer #viewerDownload{width:58px!important;min-width:58px!important}
  .viewer #viewerMusic{width:48px!important;min-width:48px!important;padding:0!important;font-size:20px!important}
  .viewer #viewerClose{width:48px!important;min-width:48px!important;padding:0!important;background:#ff2b76!important;color:#fff!important;-webkit-text-fill-color:#fff!important;font-size:23px!important}
  .viewer #viewerClose::before,.viewer #viewerClose::after{content:none!important;display:none!important}
  .viewer .viewer__language-control{display:none!important}
}

/* Translation chooser must always be solid and readable. */
.apu-v69-language-menu{
  position:fixed!important;z-index:2147483646!important;display:none!important;
  width:min(250px,calc(100vw - 20px))!important;max-height:min(420px,calc(100dvh - 24px))!important;
  padding:8px!important;overflow-x:hidden!important;overflow-y:auto!important;
  border:3px solid #fff!important;border-radius:14px!important;box-shadow:0 22px 60px rgba(0,0,0,.62)!important;
  opacity:1!important;background-color:#07111f!important;background-image:none!important;color:#fff!important;
  backdrop-filter:none!important;-webkit-backdrop-filter:none!important;isolation:isolate!important;-webkit-overflow-scrolling:touch!important;
}
.apu-v69-language-menu.is-open{display:grid!important;gap:6px!important}
.apu-v69-language-menu button{
  width:100%!important;min-height:44px!important;padding:10px 12px!important;text-align:left!important;
  border:1px solid #31445f!important;border-radius:9px!important;opacity:1!important;background:#12243d!important;color:#fff!important;
  -webkit-text-fill-color:#fff!important;font:750 14px/1.2 system-ui,-apple-system,"Segoe UI",sans-serif!important;cursor:pointer!important;
}
.apu-v69-language-menu button:hover,.apu-v69-language-menu button:focus-visible,.apu-v69-language-menu button[aria-current="true"]{background:#1e4d87!important;border-color:#5fa2ef!important;outline:none!important}

/* Malaysia-style nav used by Computer Vision and Text Sentiment. */
@media (max-width:54rem){
  html[data-apu-v69-native-nav="true"] .apu-v69-malaysia-nav{z-index:2147483500!important}
  html[data-apu-v69-native-nav="true"] .apu-v69-malaysia-menu{
    position:fixed!important;left:0!important;right:0!important;top:76px!important;bottom:0!important;z-index:2147483450!important;
    width:100%!important;max-width:none!important;max-height:calc(100dvh - 76px)!important;
    padding:12px 10px max(22px,env(safe-area-inset-bottom))!important;overflow-x:hidden!important;overflow-y:auto!important;
    overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important;scrollbar-gutter:stable!important;
    background:#ffffff!important;color:#18313d!important;opacity:1!important;box-shadow:0 22px 44px rgba(0,0,0,.24)!important;
  }
  html[data-apu-v69-native-nav="true"] .apu-v69-malaysia-menu:not(.is-open){display:none!important}
  html[data-apu-v69-native-nav="true"] .apu-v69-malaysia-menu.is-open{display:grid!important;align-content:start!important;gap:8px!important}
  html[data-apu-v69-menu-open="true"],html[data-apu-v69-menu-open="true"] body{overflow:hidden!important}
  html[data-apu-v69-menu-open="true"] .apu-v69-native-toggle{font-size:0!important}
  html[data-apu-v69-menu-open="true"] .apu-v69-native-toggle::after{content:'X'!important;font:900 29px/1 system-ui,sans-serif!important}

  /* Incident Monitoring: remove the original permanent sidebar and keep the shared hamburger drawer only. */
  html[data-scroll-theme="incident-monitoring"] #root aside,
  html[data-scroll-theme="incident-monitoring"] #root [data-apu-final-original-sidebar="true"],
  html[data-scroll-theme="incident-monitoring"] #root [data-apu-v610-incident-sidebar="true"]{display:none!important}
  html[data-scroll-theme="incident-monitoring"] #root,
  html[data-scroll-theme="incident-monitoring"] #root>div,
  html[data-scroll-theme="incident-monitoring"] #root main{
    width:100%!important;max-width:100%!important;min-width:0!important;margin-left:0!important;padding-left:0!important;
  }
  html[data-scroll-theme="incident-monitoring"] .apu-final-mobile-exit{
    font-size:0!important;color:#fff!important;background:#132640!important;
  }
  html[data-scroll-theme="incident-monitoring"] .apu-final-mobile-exit::after{content:'X'!important;font:900 25px/1 system-ui,sans-serif!important}

  /* Network Subnet: brand and menu remain visible in dark mode. */
  html[data-scroll-theme="network-subnet"] .app-header{
    background:#0d1a2e!important;color:#fff!important;border-bottom:1px solid #2a4566!important;box-shadow:0 10px 28px rgba(0,0,0,.24)!important;
  }
  html[data-scroll-theme="network-subnet"] .app-header .brand,
  html[data-scroll-theme="network-subnet"] .app-header .brand strong{
    color:#fff!important;-webkit-text-fill-color:#fff!important;opacity:1!important;
  }
  html[data-scroll-theme="network-subnet"] .app-header .brand small{
    color:#aebed2!important;-webkit-text-fill-color:#aebed2!important;opacity:1!important;
  }
  html[data-scroll-theme="network-subnet"] .app-header .brand-icon{
    color:#fff!important;background:linear-gradient(145deg,#0f7f89,#0fb7a7)!important;opacity:1!important;
  }
  html[data-scroll-theme="network-subnet"] .app-header .menu-toggle{
    color:#fff!important;-webkit-text-fill-color:#fff!important;background:#132640!important;border:1px solid #3a5b82!important;
    opacity:1!important;text-shadow:none!important;
  }
  html[data-scroll-theme="network-subnet"] .app-header .main-nav{
    background:#0d1a2e!important;color:#fff!important;border-color:#2a4566!important;
  }
  html[data-scroll-theme="network-subnet"] .app-header .main-nav a{color:#d7e5f6!important;-webkit-text-fill-color:#d7e5f6!important}
  html[data-scroll-theme="network-subnet"] .app-header .main-nav a[aria-current="page"],
  html[data-scroll-theme="network-subnet"] .app-header .main-nav a.active{background:#17345f!important;color:#fff!important}

  /* AI Architect: the complete drawer, including Contact, scrolls vertically. */
  html[data-scroll-theme="ai-architect"] .ai-architect-drawer{
    height:100dvh!important;max-height:100dvh!important;overflow-x:hidden!important;overflow-y:auto!important;
    overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important;scrollbar-gutter:stable!important;
    touch-action:pan-y!important;
  }
  html[data-scroll-theme="ai-architect"] .ai-architect-drawer>div,
  html[data-scroll-theme="ai-architect"] .ai-architect-drawer nav{
    height:auto!important;min-height:max-content!important;max-height:none!important;overflow:visible!important;
  }
  html[data-scroll-theme="ai-architect"] .ai-architect-drawer nav{
    display:flex!important;flex-direction:column!important;padding-bottom:max(34px,env(safe-area-inset-bottom))!important;
  }
  html[data-scroll-theme="ai-architect"] .ai-architect-drawer nav>a{flex:0 0 auto!important;min-height:50px!important}
  html[data-scroll-theme="ai-architect"] .ai-architect-drawer nav>a.apu-v69-contact-link{
    position:static!important;margin:10px 0 12px!important;flex:0 0 auto!important;
  }
}

/* Model Evaluation visibility guarantee. */
html[data-scroll-theme="sentiment-analysis"][data-apu-model-evaluation="true"] body{background:#030711!important;color:#e7eef9!important}
html[data-scroll-theme="sentiment-analysis"][data-apu-model-evaluation="true"] #apuV69ModelEvaluation,
html[data-scroll-theme="sentiment-analysis"][data-apu-model-evaluation="true"] .apu-v610-model-fallback{
  display:block!important;visibility:visible!important;opacity:1!important;min-height:100dvh!important;background:#030711!important;
}
.apu-v610-model-fallback{padding:22px 14px 80px;color:#e7eef9;background:#030711;font-family:Inter,system-ui,sans-serif}
.apu-v610-model-fallback__inner{width:min(1120px,100%);margin:auto}
.apu-v610-model-fallback h1{margin:0 0 10px;color:#fff;font-size:clamp(2rem,8vw,4rem)}
.apu-v610-model-fallback p{color:#9fb1c8;line-height:1.6}
.apu-v610-model-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:20px 0}
.apu-v610-model-card,.apu-v610-model-panel{border:1px solid #29415f;border-radius:14px;background:#0d1829;color:#fff;padding:16px;box-shadow:0 14px 32px rgba(0,0,0,.22)}
.apu-v610-model-card small{display:block;color:#8ea4bf;text-transform:uppercase;font-size:10px;letter-spacing:.08em}.apu-v610-model-card strong{display:block;margin-top:8px;font-size:1.8rem}
.apu-v610-model-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.apu-v610-model-panel h2{margin:0 0 12px}.apu-v610-model-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}.apu-v610-model-table{width:100%;min-width:520px;border-collapse:collapse}.apu-v610-model-table th,.apu-v610-model-table td{padding:9px;border-bottom:1px solid #243b58;text-align:left;color:#dce8f8}.apu-v610-model-table th{color:#91a7c2;font-size:.72rem;text-transform:uppercase}
@media(max-width:760px){.apu-v610-model-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.apu-v610-model-grid{grid-template-columns:1fr}}
