/* ========================================================================
   EQOLEAN v13 — Visual Consistency Layer
   Purpose: normalize shared brand, typography and base theme treatment
   without changing page data, workflow logic, IDs or page-specific layout.
   Loaded last on every screen so old prototype layers cannot recolor/crop the
   shared shell or silently fall back to different system fonts.
   ======================================================================== */
:root{
  --eqo-font-body:"IBM Plex Sans Thai","Noto Sans Thai",Tahoma,Arial,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --eqo-font-display:"Kanit","IBM Plex Sans Thai","Noto Sans Thai",Tahoma,Arial,system-ui,sans-serif;
  --eqo-v13-purple-0:#10041d;
  --eqo-v13-purple-1:#1d0939;
  --eqo-v13-purple-2:#2a0e50;
  --eqo-v13-white-0:#fcfbff;
  --eqo-v13-white-1:#f6f3fd;
  --eqo-v13-ink:#f8f5ff;
  --eqo-v13-ink-light:#352944;
  --eqo-v13-muted:#b9add0;
  --eqo-v13-muted-light:#776a86;
}

html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body[data-eqo-page]{
  font-family:var(--eqo-font-body)!important;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
}
body[data-eqo-page] :is(button,input,select,textarea){font-family:var(--eqo-font-body)}
body[data-eqo-page] :is(h1,h2,h3,h4,h5,h6,.page-title,.section-title,.m-title,.rl-card-title){
  font-family:var(--eqo-font-display);
}

/* One atmospheric base per appearance. Individual cards/scenes keep their own
   styling; this only removes the page-to-page jump in the canvas behind them. */
html[data-eqo-theme="purple"] body.eqo-master-enabled,
html:not([data-eqo-theme="white"]) body.eqo-master-enabled{
  color-scheme:dark;
  color:var(--eqo-v13-ink);
  background:
    radial-gradient(920px 640px at 84% -7%,rgba(142,88,255,.24),transparent 64%),
    radial-gradient(780px 650px at 47% 54%,rgba(91,52,183,.16),transparent 68%),
    radial-gradient(700px 620px at 4% 100%,rgba(100,74,195,.15),transparent 71%),
    linear-gradient(145deg,var(--eqo-v13-purple-0) 0%,var(--eqo-v13-purple-1) 44%,var(--eqo-v13-purple-2) 100%)!important;
}
html[data-eqo-theme="white"] body.eqo-master-enabled{
  color-scheme:light;
  color:var(--eqo-v13-ink-light);
  background:
    radial-gradient(760px 520px at 84% -7%,rgba(122,83,216,.10),transparent 64%),
    radial-gradient(680px 520px at 8% 100%,rgba(143,112,218,.07),transparent 70%),
    linear-gradient(180deg,var(--eqo-v13-white-0) 0%,var(--eqo-v13-white-1) 100%)!important;
}
body.eqo-master-enabled > :is(.app,.app-shell,.shell){background:transparent!important}

/* Shared page-title rhythm. Dashboard scene heroes intentionally retain their
   larger editorial sizing; standard workspace/management headers do not jump. */
body.eqo-master-enabled :is(.page-head h1,.page-title,.m-title,.rl-hero h1){
  font-family:var(--eqo-font-display)!important;
  font-size:clamp(28px,2.15vw,31px)!important;
  font-weight:500!important;
  line-height:1.22!important;
  letter-spacing:-.025em!important;
}
body:is(.eqx-workflow,.eqx-responsibility)[data-eqo-page] .main .topbar h1,
body[data-eqo-page^="settings-"] h1,
body[data-eqo-page="settings"] h1,
body[data-eqo-page^="access-roles"] h1,
body[data-eqo-page="system-log"] h1,
body[data-eqo-page="organization"] h1,
body[data-eqo-page^="organization-"] h1:not(.page-title){
  font-family:var(--eqo-font-display)!important;
  font-size:20px!important;
  font-weight:500!important;
  line-height:1.3!important;
  letter-spacing:-.01em!important;
}

/* Shared shell brand: one source, one crop box, one wordmark scale. */
#eqoMasterNav .eqo-master-brand{
  min-height:76px!important;
  padding:7px 9px 18px!important;
  gap:12px!important;
  overflow:visible!important;
}
#eqoMasterNav .eqo-master-logo{
  display:block!important;
  width:46px!important;
  height:46px!important;
  min-width:46px!important;
  max-width:46px!important;
  max-height:46px!important;
  flex:0 0 46px!important;
  object-fit:contain!important;
  object-position:center!important;
  overflow:visible!important;
  clip-path:none!important;
  border-radius:0!important;
  transform:none!important;
}
#eqoMasterNav .eqo-master-wordmark{
  min-width:0!important;
  line-height:1!important;
}
#eqoMasterNav .eqo-master-wordmark strong{
  font-family:var(--eqo-font-display)!important;
  font-size:15px!important;
  font-weight:600!important;
  line-height:1.08!important;
  letter-spacing:.135em!important;
  white-space:nowrap!important;
}
#eqoMasterNav .eqo-master-wordmark small{
  font-family:var(--eqo-font-body)!important;
  margin-top:4px!important;
  font-size:9px!important;
  font-weight:500!important;
  line-height:1.15!important;
  letter-spacing:.015em!important;
  white-space:nowrap!important;
}
html[data-eqo-theme="purple"] body #eqoMasterNav .eqo-master-logo,
html:not([data-eqo-theme="white"]) body #eqoMasterNav .eqo-master-logo{
  filter:drop-shadow(0 7px 13px rgba(8,1,28,.22))!important;
  opacity:1!important;
}
html[data-eqo-theme="white"] body #eqoMasterNav .eqo-master-logo{
  filter:brightness(0) saturate(100%) invert(29%) sepia(55%) saturate(2093%) hue-rotate(238deg) brightness(91%) contrast(96%) drop-shadow(0 4px 7px rgba(94,56,180,.10))!important;
  opacity:1!important;
}

/* Keep navigation typography independent from old page-local CSS. */
#eqoMasterNav,#eqoMasterTopbar,#eqoMenuTooltip,.eqo-nav-help-dialog{
  font-family:var(--eqo-font-body)!important;
}
#eqoMasterNav :is(.eqo-master-link,.eqo-master-group-head,.eqo-master-current,.eqo-master-help,.eqo-master-collapse),
#eqoMasterTopbar :is(button,.eqo-master-search,.eqo-master-profile){
  font-family:var(--eqo-font-body)!important;
}
#eqoMasterNav .eqo-master-link{font-size:12px!important;line-height:1.25!important}
#eqoMasterNav .eqo-master-group-label{font-size:9px!important;line-height:1.15!important}
#eqoMasterNav .eqo-master-current-copy strong{font-size:10.5px!important;line-height:1.25!important}
#eqoMasterNav .eqo-master-current-copy small{font-size:8.5px!important;line-height:1.25!important}
#eqoMasterTopbar .eqo-master-profile strong{font-size:10.5px!important;line-height:1.2!important}
#eqoMasterTopbar .eqo-master-profile small{font-size:8.5px!important;line-height:1.2!important}

/* White shell should always use the same neutral-violet ink regardless of
   page-specific white-theme files loaded earlier. */
html[data-eqo-theme="white"] body #eqoMasterNav .eqo-master-wordmark strong{color:#2f2342!important}
html[data-eqo-theme="white"] body #eqoMasterNav .eqo-master-wordmark small{color:#7d708b!important}
html[data-eqo-theme="white"] body #eqoMasterNav .eqo-master-link{color:#655873!important}
html[data-eqo-theme="white"] body #eqoMasterNav .eqo-master-link:hover{color:#40304f!important}
html[data-eqo-theme="white"] body #eqoMasterNav .eqo-master-link.active{color:#553485!important}
html[data-eqo-theme="white"] body #eqoMasterNav .eqo-master-group-head{color:#776986!important}

/* Prevent accidental clipping and baseline jumps in shared shell SVG/image UI. */
#eqoMasterNav img,#eqoMasterNav svg,#eqoMasterTopbar svg{vertical-align:middle}
#eqoMasterNav .eqo-master-brand img{overflow:visible!important}

/* Login uses the same type source while preserving its original composition. */
body.eqo-workmap-login{font-family:var(--eqo-font-body)!important}
body.eqo-workmap-login :is(h1,h2,h3,.eqo-auth-title){font-family:var(--eqo-font-display)!important}
body.eqo-workmap-login :is(button,input,select,textarea){font-family:var(--eqo-font-body)!important}

@media(max-width:760px){
  body.eqo-master-enabled :is(.page-head h1,.page-title,.m-title,.rl-hero h1){font-size:26px!important}
  #eqoMasterNav .eqo-master-logo{width:40px!important;height:40px!important;min-width:40px!important;max-width:40px!important;max-height:40px!important;flex-basis:40px!important}
}
body.eqo-master-collapsed #eqoMasterNav .eqo-master-logo{
  width:40px!important;height:40px!important;min-width:40px!important;max-width:40px!important;max-height:40px!important;flex-basis:40px!important;
}
