/*
  Stage 105.3N CLEAN — Page Heading Prepaint / Legacy Flash Suppression
  Built cleanly from confirmed Stage 105.3M CLEAN v4.

  The 105.3M v4 nested hero guard works, but it classifies legacy headings after the
  delayed/old render chain. That can leave a small visual flash of the old dark/plain header.
  This prepaint stylesheet targets the same known legacy first-header shapes immediately,
  before the JS classifier settles.

  Customer 360 / tabbed profile pages are excluded. Visual-only CSS. No route, API, backend,
  popup, save, billing, SageOne, RADIUS, prepaid, product, asset, job-card, calendar,
  Android or worker logic changes.
*/

:root{
  --ui1053n-title: #071127;
  --ui1053n-text: #172033;
  --ui1053n-muted: #536277;
  --ui1053n-border: rgba(148,163,184,.25);
  --ui1053n-panel: rgba(255,255,255,.965);
  --ui1053n-blue: #2563eb;
  --ui1053n-teal: #0ea5a2;
  --ui1053n-radius: 24px;
  --ui1053n-shadow: 0 16px 36px rgba(15,23,42,.065);
}

html[data-theme="dark"],
body.dark,
body.theme-dark{
  --ui1053n-title: #e8f0fb;
  --ui1053n-text: #dbe7f5;
  --ui1053n-muted: #a9b8ca;
  --ui1053n-border: rgba(148,163,184,.24);
  --ui1053n-panel: rgba(15,23,42,.94);
  --ui1053n-blue: #60a5fa;
  --ui1053n-teal: #2dd4bf;
  --ui1053n-shadow: 0 18px 42px rgba(0,0,0,.26);
}

/* Direct legacy first header/hero shapes. Kept deliberately near the top of the page only. */
html.stage1053n-heading-prepaint #app-screen > main#page.page:not(:has(.stage1052c-tabbed-profile, .stage1052c-tab-list, .stage822-header-card, .stage822-card)) > :is(
  .s1012q-hero, .s1012p-hero, .s1012o-hero, .s1012m-hero, .s1012l-hero, .s1012k-hero, .s1012j-hero,
  .s1013a-hero, .s1013b-hero, .s1013d-hero, .s1013e-hero, .s1013f-hero, .s1013g-hero,
  .s1013j-hero, .s1013n-hero, .s1013p-hero, .s1013q-hero, .s1013r-hero,
  .s1014h-hero, .s1014i-hero, .s1014o-hero, .s1015g-hero, .s1016c-hero,
  .s1018a-hero, .s1018b-hero, .s1018i-hero, .s1018lv3-hero,
  .s1036f-hero, .s1036i-hero, .s1036k-hero, .s1036s-hero,
  .s853-hero, .s952-hero, .s953-hero, .s955-hero, .s957-hero, .s958-hero,
  .stage844-hero, .page-header, .page-hero, .stage-page-hero, .ui-page-hero,
  .workbench-header, .module-header, .dashboard-header, .page-title-card
):first-child,
html.stage1053n-heading-prepaint main#page:not(:has(.stage1052c-tabbed-profile, .stage1052c-tab-list, .stage822-header-card, .stage822-card)) > :is(
  .s1012q-hero, .s1012p-hero, .s1012o-hero, .s1012m-hero, .s1012l-hero, .s1012k-hero, .s1012j-hero,
  .s1013a-hero, .s1013b-hero, .s1013d-hero, .s1013e-hero, .s1013f-hero, .s1013g-hero,
  .s1013j-hero, .s1013n-hero, .s1013p-hero, .s1013q-hero, .s1013r-hero,
  .s1014h-hero, .s1014i-hero, .s1014o-hero, .s1015g-hero, .s1016c-hero,
  .s1018a-hero, .s1018b-hero, .s1018i-hero, .s1018lv3-hero,
  .s1036f-hero, .s1036i-hero, .s1036k-hero, .s1036s-hero,
  .s853-hero, .s952-hero, .s953-hero, .s955-hero, .s957-hero, .s958-hero,
  .stage844-hero, .page-header, .page-hero, .stage-page-hero, .ui-page-hero,
  .workbench-header, .module-header, .dashboard-header, .page-title-card
):first-child,
/* Wrapped legacy page shapes such as .s1012q-page > .s1012q-hero. */
html.stage1053n-heading-prepaint #app-screen > main#page.page:not(:has(.stage1052c-tabbed-profile, .stage1052c-tab-list, .stage822-header-card, .stage822-card)) > :is(
  .s1012q-page, .s842-wrap, .stage841-wrap, .s843-wrap, .s1012-page, .s1013-page,
  .stage-page, .page-wrap, .page-wrapper, .content-wrap, .module-page, .workbench-page, .ui-page
):first-child > :is(
  .s1012q-hero, .s1012p-hero, .s1012o-hero, .s1012m-hero, .s1012l-hero, .s1012k-hero, .s1012j-hero,
  .s1013a-hero, .s1013b-hero, .s1013d-hero, .s1013e-hero, .s1013f-hero, .s1013g-hero,
  .s1013j-hero, .s1013n-hero, .s1013p-hero, .s1013q-hero, .s1013r-hero,
  .s1014h-hero, .s1014i-hero, .s1014o-hero, .s1015g-hero, .s1016c-hero,
  .s1018a-hero, .s1018b-hero, .s1018i-hero, .s1018lv3-hero,
  .s1036f-hero, .s1036i-hero, .s1036k-hero, .s1036s-hero,
  .s853-hero, .s952-hero, .s953-hero, .s955-hero, .s957-hero, .s958-hero,
  .stage844-hero, .page-header, .page-hero, .stage-page-hero, .ui-page-hero,
  .workbench-header, .module-header, .dashboard-header, .page-title-card
):first-child,
html.stage1053n-heading-prepaint main#page:not(:has(.stage1052c-tabbed-profile, .stage1052c-tab-list, .stage822-header-card, .stage822-card)) > :is(
  .s1012q-page, .s842-wrap, .stage841-wrap, .s843-wrap, .s1012-page, .s1013-page,
  .stage-page, .page-wrap, .page-wrapper, .content-wrap, .module-page, .workbench-page, .ui-page
):first-child > :is(
  .s1012q-hero, .s1012p-hero, .s1012o-hero, .s1012m-hero, .s1012l-hero, .s1012k-hero, .s1012j-hero,
  .s1013a-hero, .s1013b-hero, .s1013d-hero, .s1013e-hero, .s1013f-hero, .s1013g-hero,
  .s1013j-hero, .s1013n-hero, .s1013p-hero, .s1013q-hero, .s1013r-hero,
  .s1014h-hero, .s1014i-hero, .s1014o-hero, .s1015g-hero, .s1016c-hero,
  .s1018a-hero, .s1018b-hero, .s1018i-hero, .s1018lv3-hero,
  .s1036f-hero, .s1036i-hero, .s1036k-hero, .s1036s-hero,
  .s853-hero, .s952-hero, .s953-hero, .s955-hero, .s957-hero, .s958-hero,
  .stage844-hero, .page-header, .page-hero, .stage-page-hero, .ui-page-hero,
  .workbench-header, .module-header, .dashboard-header, .page-title-card
):first-child{
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 106px !important;
  margin: 0 0 20px 0 !important;
  padding: clamp(22px, 2.2vw, 34px) clamp(24px, 2.35vw, 38px) clamp(22px, 2.2vw, 32px) clamp(34px, 2.6vw, 46px) !important;
  border: 1px solid var(--ui1053n-border) !important;
  border-radius: var(--ui1053n-radius) !important;
  background: linear-gradient(135deg, rgba(255,255,255,.98) 0%, rgba(240,253,250,.88) 55%, rgba(245,243,255,.78) 100%) !important;
  background-color: var(--ui1053n-panel) !important;
  color: var(--ui1053n-text) !important;
  -webkit-text-fill-color: initial !important;
  box-shadow: var(--ui1053n-shadow) !important;
  overflow: visible !important;
  position: relative !important;
  isolation: isolate !important;
  text-shadow: none !important;
  transition: none !important;
  animation: none !important;
}

html.stage1053n-heading-prepaint body.theme-dark #app-screen > main#page.page:not(:has(.stage1052c-tabbed-profile, .stage1052c-tab-list, .stage822-header-card, .stage822-card)) :is(.s1012q-hero,.page-header,.page-hero,.stage-page-hero,.ui-page-hero,.workbench-header,.module-header,.dashboard-header,.page-title-card):first-child,
html.stage1053n-heading-prepaint body.dark #app-screen > main#page.page:not(:has(.stage1052c-tabbed-profile, .stage1052c-tab-list, .stage822-header-card, .stage822-card)) :is(.s1012q-hero,.page-header,.page-hero,.stage-page-hero,.ui-page-hero,.workbench-header,.module-header,.dashboard-header,.page-title-card):first-child{
  background: linear-gradient(135deg, rgba(15,23,42,.96) 0%, rgba(30,41,59,.88) 58%, rgba(49,46,129,.44) 100%) !important;
  background-color: var(--ui1053n-panel) !important;
}

html.stage1053n-heading-prepaint #app-screen > main#page.page:not(:has(.stage1052c-tabbed-profile, .stage1052c-tab-list, .stage822-header-card, .stage822-card)) :is(.s1012q-hero,.page-header,.page-hero,.stage-page-hero,.ui-page-hero,.workbench-header,.module-header,.dashboard-header,.page-title-card):first-child::before,
html.stage1053n-heading-prepaint main#page:not(:has(.stage1052c-tabbed-profile, .stage1052c-tab-list, .stage822-header-card, .stage822-card)) :is(.s1012q-hero,.page-header,.page-hero,.stage-page-hero,.ui-page-hero,.workbench-header,.module-header,.dashboard-header,.page-title-card):first-child::before{
  content: "" !important;
  position: absolute !important;
  left: clamp(18px, 1.7vw, 30px) !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 8px !important;
  height: clamp(34px, 4vw, 58px) !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, var(--ui1053n-teal), var(--ui1053n-blue)) !important;
  box-shadow: 0 0 0 7px rgba(37,99,235,.045) !important;
  z-index: 0 !important;
}

html.stage1053n-heading-prepaint #app-screen > main#page.page:not(:has(.stage1052c-tabbed-profile, .stage1052c-tab-list, .stage822-header-card, .stage822-card)) :is(.s1012q-hero,.page-header,.page-hero,.stage-page-hero,.ui-page-hero,.workbench-header,.module-header,.dashboard-header,.page-title-card):first-child > *,
html.stage1053n-heading-prepaint main#page:not(:has(.stage1052c-tabbed-profile, .stage1052c-tab-list, .stage822-header-card, .stage822-card)) :is(.s1012q-hero,.page-header,.page-hero,.stage-page-hero,.ui-page-hero,.workbench-header,.module-header,.dashboard-header,.page-title-card):first-child > *{
  position: relative !important;
  z-index: 1 !important;
}

html.stage1053n-heading-prepaint #app-screen > main#page.page:not(:has(.stage1052c-tabbed-profile, .stage1052c-tab-list, .stage822-header-card, .stage822-card)) :is(.s1012q-hero,.page-header,.page-hero,.stage-page-hero,.ui-page-hero,.workbench-header,.module-header,.dashboard-header,.page-title-card):first-child :is(h1,.page-title,.hero-title,.title):not(.stage1052c-tab-title):not(.tab-title),
html.stage1053n-heading-prepaint main#page:not(:has(.stage1052c-tabbed-profile, .stage1052c-tab-list, .stage822-header-card, .stage822-card)) :is(.s1012q-hero,.page-header,.page-hero,.stage-page-hero,.ui-page-hero,.workbench-header,.module-header,.dashboard-header,.page-title-card):first-child :is(h1,.page-title,.hero-title,.title):not(.stage1052c-tab-title):not(.tab-title){
  margin: 0 0 8px 0 !important;
  color: var(--ui1053n-title) !important;
  -webkit-text-fill-color: var(--ui1053n-title) !important;
  background: transparent !important;
  font-size: clamp(30px, 2.45vw, 46px) !important;
  line-height: 1.04 !important;
  letter-spacing: -.048em !important;
  font-weight: 950 !important;
  text-shadow: none !important;
}

html.stage1053n-heading-prepaint #app-screen > main#page.page:not(:has(.stage1052c-tabbed-profile, .stage1052c-tab-list, .stage822-header-card, .stage822-card)) :is(.s1012q-hero,.page-header,.page-hero,.stage-page-hero,.ui-page-hero,.workbench-header,.module-header,.dashboard-header,.page-title-card):first-child :is(p,.page-subtitle,.hero-subtitle,.subtitle,.description,.muted,.helper-text,small):not(.badge):not(.pill):not(.status-pill),
html.stage1053n-heading-prepaint main#page:not(:has(.stage1052c-tabbed-profile, .stage1052c-tab-list, .stage822-header-card, .stage822-card)) :is(.s1012q-hero,.page-header,.page-hero,.stage-page-hero,.ui-page-hero,.workbench-header,.module-header,.dashboard-header,.page-title-card):first-child :is(p,.page-subtitle,.hero-subtitle,.subtitle,.description,.muted,.helper-text,small):not(.badge):not(.pill):not(.status-pill){
  margin: 0 !important;
  color: var(--ui1053n-muted) !important;
  -webkit-text-fill-color: var(--ui1053n-muted) !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
  max-width: 980px !important;
  text-shadow: none !important;
}
