/* AI Project Universe V6.4 — colorful Helpdesk-aligned design system. */
:root{
  --apu-hd-radius-sm:10px;
  --apu-hd-radius:14px;
  --apu-hd-radius-lg:18px;
  --apu-hd-transition:180ms cubic-bezier(.2,.8,.2,1);
}

/* Every project keeps an individual accent while sharing the same Helpdesk structure. */
html[data-scroll-theme='it-helpdesk']{--apu-hd-accent:#2563eb;--apu-hd-accent-2:#06b6d4;--apu-hd-accent-rgb:37,99,235;--apu-hd-accent-hsl:221 83% 53%;--apu-hd-accent2-hsl:189 94% 43%;}
html[data-scroll-theme='computer-vision']{--apu-hd-accent:#0f766e;--apu-hd-accent-2:#06b6d4;--apu-hd-accent-rgb:15,118,110;--apu-hd-accent-hsl:175 77% 26%;--apu-hd-accent2-hsl:189 94% 43%;}
html[data-scroll-theme='incident-monitoring']{--apu-hd-accent:#dc2626;--apu-hd-accent-2:#f59e0b;--apu-hd-accent-rgb:220,38,38;--apu-hd-accent-hsl:0 72% 51%;--apu-hd-accent2-hsl:38 92% 50%;}
html[data-scroll-theme='kotlin-policy']{--apu-hd-accent:#7c3aed;--apu-hd-accent-2:#10b981;--apu-hd-accent-rgb:124,58,237;--apu-hd-accent-hsl:263 70% 50%;--apu-hd-accent2-hsl:160 84% 39%;}
html[data-scroll-theme='malaysia-cost']{--apu-hd-accent:#0f766e;--apu-hd-accent-2:#f59e0b;--apu-hd-accent-rgb:15,118,110;--apu-hd-accent-hsl:175 77% 26%;--apu-hd-accent2-hsl:38 92% 50%;}
html[data-scroll-theme='network-subnet']{--apu-hd-accent:#0369a1;--apu-hd-accent-2:#06b6d4;--apu-hd-accent-rgb:3,105,161;--apu-hd-accent-hsl:201 96% 32%;--apu-hd-accent2-hsl:189 94% 43%;}
html[data-scroll-theme='sentiment-analysis']{--apu-hd-accent:#7c3aed;--apu-hd-accent-2:#ec4899;--apu-hd-accent-rgb:124,58,237;--apu-hd-accent-hsl:263 70% 50%;--apu-hd-accent2-hsl:330 81% 60%;}
html[data-scroll-theme='url-shortener']{--apu-hd-accent:#4f46e5;--apu-hd-accent-2:#ec4899;--apu-hd-accent-rgb:79,70,229;--apu-hd-accent-hsl:243 75% 59%;--apu-hd-accent2-hsl:330 81% 60%;}
html[data-scroll-theme='academic-evidence']{--apu-hd-accent:#1d4ed8;--apu-hd-accent-2:#d97706;--apu-hd-accent-rgb:29,78,216;--apu-hd-accent-hsl:224 76% 48%;--apu-hd-accent2-hsl:32 95% 44%;}
html[data-scroll-theme='ai-architect']{--apu-hd-accent:#4f46e5;--apu-hd-accent-2:#c026d3;--apu-hd-accent-rgb:79,70,229;--apu-hd-accent-hsl:243 75% 59%;--apu-hd-accent2-hsl:293 69% 49%;}
html[data-scroll-theme='student-performance']{--apu-hd-accent:#6d28d9;--apu-hd-accent-2:#0f9f91;--apu-hd-accent-rgb:109,40,217;--apu-hd-accent-hsl:263 69% 50%;--apu-hd-accent2-hsl:174 83% 34%;}

html[data-apu-theme='light'][data-apu-project-scroll]{
  color-scheme:light;
  --apu-hd-bg:#f4f7fb;
  --apu-hd-bg-2:#eaf0f8;
  --apu-hd-surface:#ffffff;
  --apu-hd-surface-2:#f8fafc;
  --apu-hd-text:#172033;
  --apu-hd-text-soft:#334155;
  --apu-hd-muted:#64748b;
  --apu-hd-border:#dce5f0;
  --apu-hd-border-strong:#c5d2e2;
  --apu-hd-shadow:0 10px 28px rgba(15,23,42,.08);
  --apu-hd-shadow-lg:0 22px 55px rgba(15,23,42,.13);
  --apu-hd-overlay:rgba(255,255,255,.86);
  --apu-hd-on-accent:#ffffff;
}
html[data-apu-theme='dark'][data-apu-project-scroll]{
  color-scheme:dark;
  --apu-hd-bg:#07101f;
  --apu-hd-bg-2:#0b1729;
  --apu-hd-surface:#101d31;
  --apu-hd-surface-2:#17263c;
  --apu-hd-text:#f8fafc;
  --apu-hd-text-soft:#dbe7f6;
  --apu-hd-muted:#9fb0c6;
  --apu-hd-border:#273a53;
  --apu-hd-border-strong:#3a506d;
  --apu-hd-shadow:0 12px 34px rgba(0,0,0,.31);
  --apu-hd-shadow-lg:0 25px 65px rgba(0,0,0,.42);
  --apu-hd-overlay:rgba(10,22,39,.88);
  --apu-hd-on-accent:#ffffff;
}

/* Override the legacy monochrome contract. */
html[data-apu-project-scroll]{
  --apu-bg:var(--apu-hd-bg)!important;
  --apu-bg-2:var(--apu-hd-bg-2)!important;
  --apu-surface:var(--apu-hd-surface)!important;
  --apu-surface-2:var(--apu-hd-surface-2)!important;
  --apu-surface-glass:var(--apu-hd-overlay)!important;
  --apu-text:var(--apu-hd-text)!important;
  --apu-text-soft:var(--apu-hd-text-soft)!important;
  --apu-muted:var(--apu-hd-muted)!important;
  --apu-border:var(--apu-hd-border)!important;
  --apu-border-strong:var(--apu-hd-border-strong)!important;
  --apu-accent:var(--apu-hd-accent)!important;
  --apu-accent-rgb:var(--apu-hd-accent-rgb)!important;
  --apu-accent-contrast:var(--apu-hd-on-accent)!important;
  --apu-shadow:var(--apu-hd-shadow)!important;
  accent-color:var(--apu-hd-accent)!important;
}
html[data-apu-theme='dark'][data-apu-project-scroll] body>#root,
html[data-apu-theme='dark'][data-apu-project-scroll] #root{
  filter:none!important;
}
html[data-apu-project-scroll] body{
  color:var(--apu-hd-text)!important;
  background:
    radial-gradient(circle at 8% -10%,rgba(var(--apu-hd-accent-rgb),.18),transparent 32rem),
    radial-gradient(circle at 100% 0%,color-mix(in srgb,var(--apu-hd-accent-2) 12%,transparent),transparent 28rem),
    linear-gradient(180deg,var(--apu-hd-bg),var(--apu-hd-bg-2))!important;
}
html[data-apu-project-scroll] .apu-grid-overlay-v62{
  background-image:
    linear-gradient(color-mix(in srgb,var(--apu-hd-accent) 6%,transparent) 1px,transparent 1px),
    linear-gradient(90deg,color-mix(in srgb,var(--apu-hd-accent) 6%,transparent) 1px,transparent 1px)!important;
  background-size:42px 42px!important;
  opacity:.72!important;
}

/* HSL variable apps (Tailwind/shadcn) use the same Helpdesk palette. */
html[data-apu-project-scroll]:is(
  [data-scroll-theme='computer-vision'],[data-scroll-theme='incident-monitoring'],
  [data-scroll-theme='sentiment-analysis'],[data-scroll-theme='url-shortener'],
  [data-scroll-theme='academic-evidence'],[data-scroll-theme='ai-architect']
){
  --primary:var(--apu-hd-accent-hsl)!important;
  --primary-foreground:0 0% 100%!important;
  --ring:var(--apu-hd-accent-hsl)!important;
  --sidebar-primary:var(--apu-hd-accent-hsl)!important;
  --sidebar-primary-foreground:0 0% 100%!important;
}
html[data-apu-theme='light'][data-apu-project-scroll]:is(
  [data-scroll-theme='computer-vision'],[data-scroll-theme='incident-monitoring'],
  [data-scroll-theme='sentiment-analysis'],[data-scroll-theme='url-shortener'],
  [data-scroll-theme='academic-evidence'],[data-scroll-theme='ai-architect']
){
  --background:216 33% 97%!important;--foreground:222 41% 14%!important;
  --card:0 0% 100%!important;--card-foreground:222 41% 14%!important;
  --popover:0 0% 100%!important;--popover-foreground:222 41% 14%!important;
  --secondary:214 37% 94%!important;--secondary-foreground:222 35% 20%!important;
  --muted:214 37% 94%!important;--muted-foreground:215 18% 42%!important;
  --accent:var(--apu-hd-accent2-hsl)!important;--accent-foreground:0 0% 100%!important;
  --border:214 30% 87%!important;--input:214 30% 87%!important;
  --sidebar-background:0 0% 100%!important;--sidebar-foreground:222 41% 14%!important;
  --sidebar-accent:214 45% 94%!important;--sidebar-accent-foreground:222 41% 14%!important;
  --sidebar-border:214 30% 87%!important;
}
html[data-apu-theme='dark'][data-apu-project-scroll]:is(
  [data-scroll-theme='computer-vision'],[data-scroll-theme='incident-monitoring'],
  [data-scroll-theme='sentiment-analysis'],[data-scroll-theme='url-shortener'],
  [data-scroll-theme='academic-evidence'],[data-scroll-theme='ai-architect']
){
  --background:216 62% 7%!important;--foreground:210 40% 98%!important;
  --card:216 50% 13%!important;--card-foreground:210 40% 98%!important;
  --popover:216 50% 13%!important;--popover-foreground:210 40% 98%!important;
  --secondary:215 40% 19%!important;--secondary-foreground:210 40% 98%!important;
  --muted:215 40% 19%!important;--muted-foreground:215 24% 72%!important;
  --accent:var(--apu-hd-accent2-hsl)!important;--accent-foreground:0 0% 100%!important;
  --border:214 31% 24%!important;--input:214 31% 24%!important;
  --sidebar-background:216 50% 11%!important;--sidebar-foreground:210 40% 98%!important;
  --sidebar-accent:215 40% 19%!important;--sidebar-accent-foreground:210 40% 98%!important;
  --sidebar-border:214 31% 24%!important;
}

/* Native-variable projects. */
html[data-scroll-theme='it-helpdesk']{
  --primary:var(--apu-hd-accent)!important;--primary-dark:#1d4ed8!important;
  --secondary:#64748b!important;--success:#16a34a!important;--warning:#f59e0b!important;--danger:#ef4444!important;--info:#06b6d4!important;
  --bg-primary:var(--apu-hd-bg)!important;--bg-secondary:var(--apu-hd-surface)!important;
  --text-primary:var(--apu-hd-text)!important;--text-secondary:var(--apu-hd-muted)!important;--border:var(--apu-hd-border)!important;
}
html[data-scroll-theme='malaysia-cost']{
  --bg:var(--apu-hd-bg)!important;--surface:var(--apu-hd-surface)!important;--surface-soft:var(--apu-hd-surface-2)!important;
  --ink:var(--apu-hd-text)!important;--muted:var(--apu-hd-muted)!important;--line:var(--apu-hd-border)!important;
  --brand:var(--apu-hd-accent)!important;--brand-deep:#075d73!important;--brand2:#14b8a6!important;--accent:#f59e0b!important;--danger:#ef4444!important;
}
html[data-scroll-theme='network-subnet']{
  --bg:var(--apu-hd-bg)!important;--panel:var(--apu-hd-surface)!important;--panel-2:var(--apu-hd-surface-2)!important;
  --surface:var(--apu-hd-surface)!important;--surface-2:var(--apu-hd-surface-2)!important;--ink:var(--apu-hd-text)!important;
  --muted:var(--apu-hd-muted)!important;--line:var(--apu-hd-border)!important;--blue:var(--apu-hd-accent)!important;--blue2:var(--apu-hd-accent-2)!important;
  --navy:#0b1324!important;--green:#059669!important;--amber:#d97706!important;--red:#dc2626!important;
}
html[data-scroll-theme='student-performance']{
  --bg:var(--apu-hd-bg)!important;--panel:var(--apu-hd-surface)!important;--panel-2:var(--apu-hd-surface-2)!important;--panel-3:var(--apu-hd-bg-2)!important;
  --line:var(--apu-hd-border)!important;--text:var(--apu-hd-text)!important;--muted:var(--apu-hd-muted)!important;
  --brand:var(--apu-hd-accent)!important;--brand-2:var(--apu-hd-accent-2)!important;--cyan:#0891b2!important;--green:#059669!important;--amber:#d97706!important;--red:#e11d48!important;
}
html[data-scroll-theme='kotlin-policy']{
  --bg-primary:var(--apu-hd-bg)!important;--bg-secondary:var(--apu-hd-surface)!important;
  --text-primary:var(--apu-hd-text)!important;--text-secondary:var(--apu-hd-muted)!important;
  --border-color:var(--apu-hd-border)!important;--accent:var(--apu-hd-accent)!important;
}

/* Shared IT Helpdesk visual language: clean surfaces, compact radii, visible hierarchy. */
html[data-apu-project-scroll] :where(
  header,.app-header,.app-header-bar,.topbar,.top-bar,.navbar,.nav-header,
  [class*='sticky'][class*='top-0']
){
  border-color:var(--apu-hd-border)!important;
}
html[data-apu-project-scroll] :where(
  .card,.panel,.stat-card,.metric-card,.chart-card,.table-card,.detail-card,.summary-card,
  [class*='rounded-xl'][class*='border'],[class*='rounded-2xl'][class*='border'],
  [data-radix-popper-content-wrapper] > div
){
  border-color:var(--apu-hd-border)!important;
  box-shadow:var(--apu-hd-shadow)!important;
}
html[data-apu-project-scroll] :where(.card,.panel,.stat-card,.metric-card,.chart-card,.table-card,.detail-card,.summary-card){
  border-radius:var(--apu-hd-radius)!important;
}
html[data-apu-project-scroll] :where(aside,.sidebar,[data-sidebar='sidebar'],.side-nav,.app-sidebar){
  border-color:var(--apu-hd-border)!important;
  box-shadow:8px 0 28px rgba(15,23,42,.055)!important;
}
html[data-apu-theme='dark'][data-apu-project-scroll] :where(aside,.sidebar,[data-sidebar='sidebar'],.side-nav,.app-sidebar){
  box-shadow:10px 0 32px rgba(0,0,0,.24)!important;
}
html[data-apu-project-scroll] :where(nav a,.nav a,.sidebar a,[data-sidebar='menu-button']){
  border-radius:10px!important;
  transition:background-color var(--apu-hd-transition),color var(--apu-hd-transition),transform var(--apu-hd-transition)!important;
}
html[data-apu-project-scroll] :where(nav a,.nav a,.sidebar a,[data-sidebar='menu-button']):hover{
  background:color-mix(in srgb,var(--apu-hd-accent) 11%,transparent)!important;
}
html[data-apu-project-scroll] :where(nav a.active,.nav a.active,.sidebar a.active,[aria-current='page'],[data-active='true']){
  color:var(--apu-hd-accent)!important;
  background:color-mix(in srgb,var(--apu-hd-accent) 14%,transparent)!important;
}
html[data-apu-theme='dark'][data-apu-project-scroll] :where(nav a.active,.nav a.active,.sidebar a.active,[aria-current='page'],[data-active='true']){
  color:#ffffff!important;
}
html[data-apu-project-scroll] :where(input:not([type='checkbox']):not([type='radio']),textarea,select){
  color:var(--apu-hd-text)!important;
  background-color:var(--apu-hd-surface)!important;
  border-color:var(--apu-hd-border-strong)!important;
  border-radius:10px!important;
}
html[data-apu-project-scroll] :where(input,textarea,select)::placeholder{color:var(--apu-hd-muted)!important;opacity:.95!important;}
html[data-apu-project-scroll] :where(select option){color:var(--apu-hd-text)!important;background:var(--apu-hd-surface)!important;}
html[data-apu-project-scroll] :where(table){border-color:var(--apu-hd-border)!important;}
html[data-apu-project-scroll] :where(th){color:var(--apu-hd-text-soft)!important;background:color-mix(in srgb,var(--apu-hd-accent) 8%,var(--apu-hd-surface-2))!important;}
html[data-apu-project-scroll] :where(td,th){border-color:var(--apu-hd-border)!important;}
html[data-apu-project-scroll] :where(button,[role='button']){border-radius:10px!important;}
html[data-apu-project-scroll] :where(.btn-primary,button.bg-primary,[class*='bg-primary']){
  box-shadow:0 8px 18px rgba(var(--apu-hd-accent-rgb),.18)!important;
}
html[data-apu-project-scroll] :where(a,button,input,select,textarea,[role='button']):focus-visible{
  outline:3px solid color-mix(in srgb,var(--apu-hd-accent) 35%,transparent)!important;
  outline-offset:2px!important;
}

/* Translation/theme menu: same container style and guaranteed light/dark contrast. */
#apu-ui-dock-v62{
  color:var(--apu-hd-text)!important;
  background:var(--apu-hd-overlay)!important;
  border:1px solid var(--apu-hd-border-strong)!important;
  border-radius:16px!important;
  box-shadow:var(--apu-hd-shadow-lg)!important;
  gap:8px!important;
  padding:7px!important;
}
#apu-ui-dock-v62 .apu-chunky-v62,
#apu-ui-dock-v62 .apu-ui-theme-v62,
#apu-ui-dock-v62 .apu-ui-language-wrap-v62{
  min-height:44px!important;
  color:var(--apu-hd-text)!important;
  background:var(--apu-hd-surface)!important;
  border:1px solid var(--apu-hd-border-strong)!important;
  border-radius:11px!important;
  box-shadow:none!important;
}
#apu-ui-dock-v62 .apu-ui-theme-v62:hover,
#apu-ui-dock-v62 .apu-ui-language-wrap-v62:hover{
  color:var(--apu-hd-on-accent)!important;
  background:var(--apu-hd-accent)!important;
  border-color:var(--apu-hd-accent)!important;
  transform:translateY(-1px)!important;
  box-shadow:0 8px 18px rgba(var(--apu-hd-accent-rgb),.20)!important;
}
#apu-ui-dock-v62 .apu-ui-language-wrap-v62{min-width:238px!important;overflow:hidden!important;}
#apu-ui-dock-v62 .apu-ui-language-v62{
  width:100%!important;min-width:238px!important;max-width:none!important;min-height:42px!important;
  color:inherit!important;background:transparent!important;border:0!important;border-radius:inherit!important;
  padding:0 40px 0 44px!important;font-weight:750!important;
}
#apu-ui-dock-v62 .apu-ui-language-v62 option{
  color:var(--apu-hd-text)!important;
  background:var(--apu-hd-surface)!important;
}
html[data-apu-theme='dark'] #apu-ui-dock-v62 .apu-ui-language-v62 option{color:#ffffff!important;background:#101d31!important;}
html[data-apu-theme='light'] #apu-ui-dock-v62 .apu-ui-language-v62 option{color:#172033!important;background:#ffffff!important;}
#apu-ui-dock-v62 .apu-ui-language-wrap-v62>svg,
#apu-ui-dock-v62 .apu-ui-language-wrap-v62::after{color:inherit!important;}
#apu-ui-dock-v62[data-apu-inline='true']{margin:10px 12px!important;max-width:calc(100% - 24px)!important;}

/* Sentiment Analysis must contain only the original upper SentiScope application. */
html[data-scroll-theme='sentiment-analysis'] :where(#apuSentimentStudio,.apu-studio-jump,#apuSentimentToast){display:none!important;}

/* Ensure dark theme never leaves dark text on dark project surfaces. */
html[data-apu-theme='dark'][data-apu-project-scroll] :where(
  .bg-white,.bg-gray-50,.bg-gray-100,.bg-slate-50,.bg-slate-100,
  [class~='text-gray-900'],[class~='text-slate-900'],[class~='text-zinc-900']
){color:var(--apu-hd-text)!important;}
html[data-apu-theme='light'][data-apu-project-scroll] :where(
  .bg-black,.bg-gray-950,.bg-gray-900,.bg-slate-950,.bg-slate-900,
  [class~='text-white']
){color:var(--apu-hd-text)!important;}

@media(max-width:900px){
  html[data-apu-project-scroll] :where(.card,.panel,.stat-card,.metric-card,.chart-card,.table-card,.detail-card,.summary-card){border-radius:12px!important;}
  #apu-ui-dock-v62{border-radius:14px!important;}
}
@media(max-width:620px){
  #apu-ui-dock-v62[data-apu-inline='true']{width:calc(100% - 16px)!important;max-width:none!important;margin:8px!important;}
  #apu-ui-dock-v62[data-apu-inline='true'] .apu-ui-theme-v62{flex:1 1 100px!important;}
  #apu-ui-dock-v62[data-apu-inline='true'] .apu-ui-language-wrap-v62{flex:2 1 190px!important;min-width:180px!important;}
  #apu-ui-dock-v62 .apu-ui-language-v62{min-width:180px!important;}
}
@media(prefers-reduced-motion:reduce){
  html[data-apu-project-scroll] *,html[data-apu-project-scroll] *::before,html[data-apu-project-scroll] *::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;}
}
