/* Hailei English mobile shell. The desktop templates keep their own layout. */
#hl-ms-header,
#hl-ms-drawer,
#hl-ms-actions { display: none; }

@media (max-width: 900px) {
  body.hl-ms-ready .hl-ms-legacy-header,
  body.hl-ms-ready #mobileMenu,
  body.hl-ms-ready #navMobile,
  body.hl-ms-ready #navLinks,
  body.hl-ms-ready #hl-contact-actions,
  body.hl-ms-ready #hl-cta-bar,
  body.hl-ms-ready #hl-cta-fab {
    display: none !important;
  }

  body.hl-ms-ready {
    padding-top: 60px !important;
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
  }

  #hl-ms-header,
  #hl-ms-header *,
  #hl-ms-drawer,
  #hl-ms-drawer *,
  #hl-ms-actions,
  #hl-ms-actions * { box-sizing: border-box; }

  #hl-ms-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-height: 60px;
    padding: 7px 12px;
    background: #fff;
    color: #0a2744;
    border-bottom: 1px solid #dce6f0;
    box-shadow: 0 4px 15px rgba(10, 39, 68, .08);
    font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  }

  #hl-ms-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: calc(100% - 82px);
    color: #0a2744;
    text-decoration: none;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: .01em;
    white-space: nowrap;
  }

  #hl-ms-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0b5fc0, #2f8b41);
    color: #fff;
    font-size: 18px;
    font-weight: 900;
  }

  #hl-ms-brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #hl-ms-toggle {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex: 0 0 74px;
    width: 74px;
    min-width: 74px;
    height: 44px;
    min-height: 44px;
    padding: 0 6px;
    border: 1px solid #cbdcf0;
    border-radius: 9px;
    background: #fff;
    color: #0b5fc0;
    cursor: pointer;
    font: 800 13px/1 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  }

  #hl-ms-toggle svg { width: 17px; height: 17px; flex: 0 0 17px; }
  #hl-ms-toggle:focus-visible,
  #hl-ms-brand:focus-visible,
  #hl-ms-panel a:focus-visible,
  #hl-ms-actions :is(a, button):focus-visible {
    outline: 3px solid #e8a020;
    outline-offset: 2px;
  }

  #hl-ms-drawer:not([hidden]) {
    position: fixed;
    inset: 60px 0 0;
    z-index: 1099;
    display: block;
    font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  }

  #hl-ms-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 25, 45, .48);
  }

  #hl-ms-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: min(86vw, 360px);
    height: 100%;
    max-height: calc(100dvh - 60px);
    padding: 14px 14px calc(18px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    box-shadow: 10px 0 26px rgba(10, 39, 68, .2);
  }

  #hl-ms-panel a {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 44px;
    padding: 9px 13px;
    border: 1px solid #dce6f0;
    border-radius: 9px;
    background: #fff;
    color: #0a2744;
    text-decoration: none;
    font: 700 15px/1.25 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  }

  #hl-ms-panel a[aria-current="page"] {
    background: #eaf3fc;
    border-color: #8fbce5;
  }

  #hl-ms-panel #hl-ms-quote-link {
    background: #0b5fc0;
    border-color: #0b5fc0;
    color: #fff;
  }

  #hl-ms-language-links:empty { display: none; }
  #hl-ms-language-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid #dce6f0;
  }

  #hl-ms-language-links a { justify-content: center; font-size: 13px; }

  #hl-ms-actions {
    position: fixed;
    inset: auto 0 0;
    z-index: 1098;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    min-height: calc(58px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #0a2744;
    box-shadow: 0 -4px 18px rgba(10, 39, 68, .18);
    font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  }

  #hl-ms-actions :is(a, button) {
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 58px;
    margin: 0;
    padding: 4px 2px;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, .16);
    border-radius: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    font: 750 12px/1.15 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    white-space: normal;
  }

  #hl-ms-actions :is(a, button):last-child { border-right: 0; }
  #hl-ms-actions #hl-ms-action-quote { background: #e8a020; color: #0a2744; }

  body.hl-ms-menu-open #hl-ms-actions,
  body.hl-ms-keyboard-open #hl-ms-actions { display: none !important; }

  /* Only inquiry forms are restyled; the Turnstile script and endpoint stay intact. */
  body.hl-ms-ready .hl-ms-inquiry-form :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="submit"]):not([name="_honey"]):not([name="website_url_extra"]), select, textarea) {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    font-size: 16px !important;
    line-height: 1.35;
  }

  body.hl-ms-ready .hl-ms-inquiry-form textarea { min-height: 90px; }
  body.hl-ms-ready .hl-ms-inquiry-form .field label,
  body.hl-ms-ready .hl-ms-inquiry-form label > span { font-size: 14px !important; line-height: 1.4; }

  body.hl-ms-ready .hl-ms-inquiry-form :is(button[type="submit"], input[type="submit"]) {
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    height: auto;
    margin: 8px 0 0;
    padding: 12px 16px;
    border: 0;
    border-radius: 8px;
    background: #0b5fc0;
    color: #fff;
    cursor: pointer;
    font: 800 16px/1.3 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    text-align: center;
  }

  body.hl-ms-ready .hl-ms-inquiry-form .hl-ms-consent-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-top: 14px;
  }

  body.hl-ms-ready .hl-ms-inquiry-form .consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
  }

  body.hl-ms-ready .hl-ms-inquiry-form .consent input[type="checkbox"] {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
  }

  body.hl-ms-ready .hl-ms-inquiry-form .inquiry-turnstile-widget,
  body.hl-ms-ready .hl-ms-inquiry-form .inquiry-turnstile-status {
    width: 100%;
    max-width: 100%;
    grid-column: 1 / -1;
  }

  /* Compact the home hierarchy while retaining readable body copy. */
  :is(body.hl-ms-ready.hl-home-v2, body.hl-ms-ready .hl-home-v2) .hero { padding: 0 !important; }
  :is(body.hl-ms-ready.hl-home-v2, body.hl-ms-ready .hl-home-v2) .hero-grid {
    padding: 28px 0 32px;
    gap: 24px;
  }
  :is(body.hl-ms-ready.hl-home-v2, body.hl-ms-ready .hl-home-v2) .hero h1 { font-size: clamp(30px, 8.2vw, 38px) !important; line-height: 1.13 !important; }
  :is(body.hl-ms-ready.hl-home-v2, body.hl-ms-ready .hl-home-v2) .hero-lead { margin-top: 16px; }
  :is(body.hl-ms-ready.hl-home-v2, body.hl-ms-ready .hl-home-v2) .hero-actions { margin-top: 20px; }
  :is(body.hl-ms-ready.hl-home-v2, body.hl-ms-ready .hl-home-v2) .hero-points { margin-top: 20px; }
  :is(body.hl-ms-ready.hl-home-v2, body.hl-ms-ready .hl-home-v2) .hero-desc { margin-bottom: 20px !important; }
  :is(body.hl-ms-ready.hl-home-v2, body.hl-ms-ready .hl-home-v2) .hero-badge { margin-bottom: 12px !important; }

  /* Page headings have one consistent typeface; body text keeps template sizes. */
  body.hl-ms-ready :is(h1, h2) {
    font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif !important;
  }

  /* The English RFQ checklist follows the form on a narrow screen. */
  body.hl-ms-ready.hl-quote-page > div[style*="max-width"] {
    padding: 24px 16px !important;
  }
  body.hl-ms-ready.hl-quote-page main.wrap {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 0 !important;
  }
  body.hl-ms-ready.hl-quote-page main.wrap > .form {
    order: 0;
    min-width: 0;
    padding: 0 !important;
  }
  body.hl-ms-ready.hl-quote-page .form .field { margin-bottom: 16px; }
  body.hl-ms-ready.hl-quote-page .form .field label { margin-bottom: 7px; }
  body.hl-ms-ready.hl-quote-page .form .field :is(input, select, textarea) { border-radius: 6px; }
  body.hl-ms-ready.hl-quote-page #inquiry-form { scroll-margin-top: 76px; }
  body.hl-ms-ready.hl-quote-page main.wrap > .panel {
    order: 1;
    min-width: 0;
    padding: 18px !important;
  }
  body.hl-ms-ready.hl-quote-page main.wrap > .panel h2 { font-size: 20px !important; }
  body.hl-ms-ready.hl-quote-page main.wrap > .panel .chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  /* The contact page currently has unspaced document-style text. */
  body.hl-ms-ready.hl-contact-page main#main-content { padding: 0 !important; }
  body.hl-ms-ready.hl-contact-page main#main-content > div[style*="max-width"] {
    padding: 24px 16px !important;
  }
  body.hl-ms-ready.hl-contact-page main > div:not(.top-bar):not(.mobile-menu) {
    line-height: 1.6;
  }
  body.hl-ms-ready.hl-contact-page main > div:not(.top-bar):not(.mobile-menu) > h2 {
    margin: 0 0 12px;
    font-size: 30px;
    line-height: 1.2;
  }
  body.hl-ms-ready.hl-contact-page main > div:not(.top-bar):not(.mobile-menu) > h3 {
    margin: 28px 0 10px;
    font-size: 22px;
    line-height: 1.25;
  }
  body.hl-ms-ready.hl-contact-page main > div:not(.top-bar):not(.mobile-menu) > p {
    margin: 0 0 14px;
  }
  body.hl-ms-ready.hl-contact-page main > div:not(.top-bar):not(.mobile-menu) > ul {
    margin: 8px 0 18px;
    padding-left: 22px;
  }
  body.hl-ms-ready.hl-contact-page main > div:not(.top-bar):not(.mobile-menu) > ul li {
    margin-bottom: 7px;
  }
}

@media (max-width: 360px) {
  #hl-ms-brand { font-size: 13px; }
  #hl-ms-toggle { flex-basis: 70px; width: 70px; min-width: 70px; }
  #hl-ms-actions :is(a, button) { font-size: 11px; }
}
