/* Shared visual treatment. Screen layout and role-specific controls live in their modules. */
body {
  background-color: var(--hv-bg);
}

:is(.screen .brandbar, .hid-brandbar):not(:has(.visualWave)) {
  isolation: isolate;
  color: white;
  background: radial-gradient(ellipse at 88% 85%, #2d668e, transparent 64%),
              linear-gradient(150deg, #193c61, #174f75);
  border-radius: 0;
  padding-bottom: 33px;
}

:is(.screen .brandbar, .hid-brandbar):not(:has(.visualWave))::before,
:is(.screen .brandbar, .hid-brandbar):not(:has(.visualWave))::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
}

:is(.screen .brandbar, .hid-brandbar):not(:has(.visualWave))::before {
  right: 28%;
  bottom: 0;
  width: clamp(72px, 19%, 142px);
  aspect-ratio: 1;
  opacity: .2;
  transform: rotate(-12deg);
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%239ddaf1'%3E%3Cellipse cx='4.6' cy='9.2' rx='2.7' ry='3.5' transform='rotate(-27 4.6 9.2)'/%3E%3Cellipse cx='9.4' cy='5.4' rx='2.6' ry='3.6'/%3E%3Cellipse cx='15' cy='5.4' rx='2.6' ry='3.6'/%3E%3Cellipse cx='19.8' cy='9.2' rx='2.7' ry='3.5' transform='rotate(27 19.8 9.2)'/%3E%3Cpath d='M12 10.5c2.4 0 3.1 2.5 5.2 4.3 3.4 3 2.3 6.9-1 6.9-1.7 0-2.7-1-4.2-1s-2.5 1-4.2 1c-3.3 0-4.4-3.9-1-6.9 2.1-1.8 2.8-4.3 5.2-4.3Z'/%3E%3C/svg%3E");
}

:is(.screen .brandbar, .hid-brandbar):not(:has(.visualWave))::after {
  inset: auto 0 -1px;
  height: clamp(20px, 5vw, 42px);
  background: center / 100% 100% no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 75' preserveAspectRatio='none'%3E%3Cpath fill='%23f6fafd' d='M0 18C125 80 220 1 372 14S669 116 900 12V75H0Z'/%3E%3C/svg%3E");
}

.hid-brandbar.hid-brandbar {
  position: relative;
  border-radius: 0;
}

/* Keep the artwork above data-heavy content and away from interactive controls. */
:is(.huellaIllustratedCard, .phStoryHeader, .storyLearningLead, .dashboardTeamCard)
  :is(h2, h3)::after {
  content: "";
  display: inline-block;
  width: 1.08em;
  height: 1.08em;
  margin-inline-start: .35em;
  vertical-align: -.15em;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23bd6509' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 19 5 13a3.6 3.6 0 0 1 5-5l1 1 1-1a3.6 3.6 0 0 1 5 5zM18 6l1-2m1 4 2-1'/%3E%3C/svg%3E");
  pointer-events: none;
}

.screen .brandbar h1 { font-size: clamp(1.35rem, 5.6vw, 2.15rem); }
.screen .brandbar .eyebrow { letter-spacing: .16em; color: #a6e4f8; }
.screen .brandbar .sub { color: #d9f1fa; }

#login .login {
  background: radial-gradient(ellipse at 88% 85%, #2d668e, transparent 64%),
              linear-gradient(150deg, #193c61, #174f75);
}

#tutorStory .phStoryHeader,
#tutorFreeLearn .storyLearningLead {
  background: linear-gradient(145deg, #fff, #edf8fc);
  border: 1px solid #d9edf6;
}

#tutorMore > button.card:not([hidden]) .iconbtn {
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--hv-sky);
}

#operationalDashboard .dashboardPeriod {
  background: var(--hv-sky);
}

/* Keep state-specific backgrounds, borders and text colors supplied by each feature. */
.screen :where(.card),
.modalWrap :where(.modal) {
  border-radius: 23px;
  box-shadow: var(--hv-shadow);
}

.screen :where(.btn.blue),
.modalWrap :where(.btn.blue) {
  background: linear-gradient(140deg, #0c83a9, #087898);
  color: white;
}

.screen :where(.btn.light, .iconbtn),
.modalWrap :where(.btn.light, .iconbtn) {
  background: var(--hv-sky);
  color: var(--hv-ink);
}

:where(.screen, .modalWrap, .bottomnav) :is(button, input, textarea, select, a, summary):focus-visible {
  outline: 2px solid #087898;
  outline-offset: 2px;
}

:where(#trainerGlobalNav, #academyGlobalNav) {
  background: #fff;
  box-shadow: 0 -5px 22px #193d5d10;
}

:is(#trainerGlobalNav, #academyGlobalNav) .navitem { color: var(--hv-muted); }
:is(#trainerGlobalNav, #academyGlobalNav) .navitem.active {
  background: #def2fa;
  color: #006f9a;
  border-radius: 24px;
}

:is(#trainerGlobalNav, #academyGlobalNav) .navitem b svg {
  display: block;
  width: 20px;
  height: 20px;
  margin: auto;
}

@media (max-width: 767px) {
  :is(#trainerGlobalNav, #academyGlobalNav) { border-radius: 22px 22px 0 0; }
  :is(#trainerGlobalNav, #academyGlobalNav) .navitem { min-height: 44px; }
  #trainerGlobalNav:not(.hidden) {
    display: flex;
    gap: 2px;
  }
  #trainerGlobalNav .navitem {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    overflow-wrap: anywhere;
  }
}

/* Team labels stay whole; crowded bars wrap into accessible rows, not letters. */
@media (max-width: 899px) {
 #trainerGlobalNav:not(.hidden) { flex-wrap:wrap; justify-content:center; }
 #trainerGlobalNav .navitem { flex:1 0 70px; min-width:70px; min-height:48px; font-size:11px; overflow-wrap:normal; word-break:normal; white-space:nowrap; }
}
