/* CBET Mobile Header and Navigation V215
 * Mobile-only correction. Desktop/laptop layout is intentionally untouched.
 */
@media screen and (max-width: 767px),
       screen and (max-width: 1024px) and (hover: none) and (pointer: coarse) {
  html,
  body,
  body #root {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  html body #root .portal-header-tight.portal-like-website,
  html body #root .portal-header-tight.portal-like-website.portal-header-arranged {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  /* Account controls: one compact, readable row. */
  html body #root .portal-header-tight.portal-like-website .portal-top-strip,
  html body #root .portal-header-tight.portal-like-website.dkut-header .portal-top-strip {
    position: relative !important;
    inset: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: auto !important;
    min-height: 48px !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 6px 10px !important;
    overflow: visible !important;
    background: #0d1930 !important;
  }

  html body #root .portal-header-tight.portal-like-website .portal-public-strip,
  html body #root .portal-header-tight.portal-like-website .portal-public-link,
  html body #root .portal-header-tight.portal-like-website .portal-user-line > span:first-child {
    display: none !important;
  }

  html body #root .portal-header-tight.portal-like-website .portal-user-line {
    position: static !important;
    inset: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 4px 10px !important;
    color: #ffffff !important;
  }

  html body #root .portal-header-tight.portal-like-website .portal-message-alert-centre {
    position: relative !important;
    margin: 0 !important;
  }

  html body #root .portal-header-tight.portal-like-website .portal-message-alert-button,
  html body #root .portal-header-tight.portal-like-website .classic-user-password,
  html body #root .portal-header-tight.portal-like-website .classic-logout {
    position: static !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 40px !important;
    min-height: 36px !important;
    margin: 0 !important;
    padding: 6px 9px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
  }

  html body #root .portal-header-tight.portal-like-website .classic-user-password {
    color: #ffffff !important;
  }

  html body #root .portal-header-tight.portal-like-website .classic-logout {
    color: #fecaca !important;
  }

  /* Crest: natural height, fully visible logo and wrapping title. */
  html body #root .portal-header-tight.portal-like-website .portal-crest,
  html body #root .portal-header-tight.portal-like-website.dkut-header .portal-crest {
    position: relative !important;
    inset: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 78px !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    overflow: visible !important;
    background: #ffffff !important;
  }

  html body #root .portal-header-tight.portal-like-website .portal-logo-box,
  html body #root .portal-header-tight.portal-like-website .dkut-brand.portal-logo-box,
  html body #root .portal-header-tight.portal-like-website .public-brand.portal-logo-box {
    display: grid !important;
    grid-template-columns: 52px minmax(0, 1fr) !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 10px !important;
    overflow: visible !important;
  }

  html body #root .portal-header-tight.portal-like-website .portal-logo-box img,
  html body #root .portal-header-tight.portal-like-website .dkut-brand img,
  html body #root .portal-header-tight.portal-like-website .public-brand img {
    display: block !important;
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    margin: 0 !important;
    object-fit: contain !important;
  }

  html body #root .portal-header-tight.portal-like-website .portal-title-strip,
  html body #root .portal-header-tight.portal-like-website .dkut-brand-text {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    text-align: left !important;
  }

  html body #root .portal-header-tight.portal-like-website .portal-title-strip strong,
  html body #root .portal-header-tight.portal-like-website .dkut-brand-text strong {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    color: #08456f !important;
    font-size: clamp(15px, 4.6vw, 20px) !important;
    line-height: 1.12 !important;
    letter-spacing: 0 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
  }

  html body #root .portal-header-tight.portal-like-website .portal-title-strip em,
  html body #root .portal-header-tight.portal-like-website .dkut-brand-text em {
    display: block !important;
    margin: 3px 0 0 !important;
    color: #087895 !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    overflow: visible !important;
  }

  /* Primary modules: one clean horizontal strip with touch scrolling. */
  html body #root .portal-header-tight.portal-like-website .classic-module-bar.portal-website-nav,
  html body #root .portal-header-tight.portal-like-website .dkut-nav.portal-website-nav,
  html body #root .portal-header-tight.portal-like-website .public-nav.portal-website-nav {
    position: relative !important;
    inset: auto !important;
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x proximity !important;
    scrollbar-width: thin !important;
    -webkit-overflow-scrolling: touch !important;
    background: #075985 !important;
  }

  html body #root .portal-header-tight.portal-like-website .classic-module-bar.portal-website-nav > a,
  html body #root .portal-header-tight.portal-like-website .classic-module-bar.portal-website-nav > span {
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: max-content !important;
    max-width: none !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    margin: 0 !important;
    padding: 0 14px !important;
    border: 0 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.24) !important;
    border-radius: 0 !important;
    color: #ffffff !important;
    font-size: 12px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    scroll-snap-align: start !important;
  }

  html body #root .portal-header-tight.portal-like-website .classic-module-bar.portal-website-nav > a.active {
    background: #164e78 !important;
    box-shadow: inset 0 -4px #ffffff !important;
  }

  /* Secondary module menu remains available as a touch-scroll row. */
  html body #root .classic-body {
    display: block !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  html body #root .classic-sidebar {
    position: static !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 7px !important;
    overflow: hidden !important;
  }

  html body #root .classic-sidebar .side-section-title,
  html body #root .classic-sidebar .classic-side-footer,
  html body #root .classic-side-menu .classic-side-section-heading {
    display: none !important;
  }

  html body #root .classic-side-menu {
    display: flex !important;
    flex-flow: row nowrap !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 7px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: thin !important;
    -webkit-overflow-scrolling: touch !important;
  }

  html body #root .classic-side-menu .classic-side-link {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: max-content !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 8px 12px !important;
    border: 1px solid #9bc3e8 !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    color: #174f86 !important;
    white-space: nowrap !important;
  }

  html body #root .classic-side-menu .classic-side-link.active {
    border-color: #2372c1 !important;
    background: #2372c1 !important;
    color: #ffffff !important;
  }
}
