/* =========================================================
   Header conversion actions / 2026-08-20
   - Desktop (1551px+): phone + three horizontal actions
   - Compact desktop/tablet (768px-1550px): three right-edge tabs
   - Mobile (768px-) and short viewport: tabs / floating phone hidden

   Legacy note:
   `.header-demo-btn` is the existing document-request button.
   The dedicated demo application uses `.header-demo-apply-btn`.
   ========================================================= */

:root {
  --header-action-unified: #1a2b5c;
  --header-action-border: #b6cae9;
}

/* Keep all three conversion actions visually equal. */
.header .header-demo-btn,
.header .header-demo-apply-btn,
.header .header-contact-btn {
  color: var(--header-action-unified);
  background: #fff;
  border: 1px solid var(--header-action-border);
  box-shadow: 0 6px 18px rgba(22, 88, 160, .08);
}

.header .header-demo-btn::before,
.header .header-demo-apply-btn::before,
.header .header-contact-btn::before {
  content: none;
  background: transparent;
}

.header .header-contact-btn {
  order: 1;
}

.header .header-demo-btn {
  order: 2;
}

.header .header-demo-apply-btn {
  order: 3;
}

.header .header-demo-btn:hover,
.header .header-demo-apply-btn:hover,
.header .header-contact-btn:hover {
  color: var(--header-action-unified);
  background: #fbfdff;
  border-color: var(--header-action-unified);
  box-shadow: 0 9px 22px rgba(22, 88, 160, .13);
}

.header .header-action-item i {
  color: currentColor;
}

.header .header-action-item:focus-visible,
.header .header-tel-btn:focus-visible {
  outline: 3px solid #1e8fc9;
  outline-offset: 3px;
}

/* The ten-item navigation and three actions both fit without collision. */
@media (min-width: 1551px) {
  .header .header-inner {
    column-gap: 14px;
  }

  .header .header-actions {
    gap: 8px;
  }

  .header .header-tel-btn {
    padding-right: 5px;
    padding-left: 5px;
  }

  .header .header-action-item {
    width: 116px;
    flex: 0 0 116px;
    font-size: 13px;
    letter-spacing: 0;
    white-space: nowrap;
  }
}

/* The original 123px header returns above 1800px. Keep its nav compact. */
@media (min-width: 1801px) {
  .header .nav {
    gap: 20px;
  }

  .header .nav a {
    font-size: 14px;
  }

  .header .header-action-item {
    width: 126px;
    flex-basis: 126px;
    font-size: 14px;
  }

  .header .header-tel-number {
    font-size: 20px;
  }
}

/* Right-edge conversion rail. This deliberately overrides no-side-tabs. */
@media (min-width: 769px) and (max-width: 1550px) {
  .header .header-inner {
    padding-right: 68px !important;
  }

  .header .header-actions,
  body.no-side-tabs .header .header-actions {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    display: flex;
    flex-direction: column;
    flex: none;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    transform: none;
    pointer-events: none;
  }

  .header .header-action-item {
    position: relative;
    display: inline-flex;
    width: 50px;
    height: auto;
    min-height: 132px;
    padding: 36px 3px 8px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    writing-mode: vertical-rl;
    font-size: 14px;
    line-height: 1.2;
    letter-spacing: .12em;
    white-space: nowrap;
    border-width: 1px 0 1px 1px;
    border-radius: 8px 0 0 8px;
    box-shadow: -3px 3px 10px rgba(9, 40, 79, .18);
    transform: none;
    transform-origin: right center;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
    pointer-events: auto;
  }

  .header .header-action-item::before,
  .header .header-action-item i {
    display: none;
  }

  /* Match the three symbols used by the bottom conversion CTA. */
  .header .header-action-item::after {
    content: "";
    position: absolute;
    top: 9px;
    left: 50%;
    display: block;
    width: 22px;
    height: 22px;
    background-color: currentColor;
    transform: translateX(-50%);
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    pointer-events: none;
  }

  .header .header-demo-btn::after {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3h12l5 5v21H8z'/%3E%3Cpath d='M20 3v6h5M12 15h9M12 20h9M12 25h6'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3h12l5 5v21H8z'/%3E%3Cpath d='M20 3v6h5M12 15h9M12 20h9M12 25h6'/%3E%3C/svg%3E");
  }

  .header .header-demo-apply-btn::after {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='25' height='17' rx='2'/%3E%3Cpath d='M11 28h10M16 22v6M12.5 10l8 4-8 4z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='25' height='17' rx='2'/%3E%3Cpath d='M11 28h10M16 22v6M12.5 10l8 4-8 4z'/%3E%3C/svg%3E");
  }

  .header .header-contact-btn::after {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='6' width='25' height='20' rx='2'/%3E%3Cpath d='m5.5 9 10.5 8L26.5 9'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='6' width='25' height='20' rx='2'/%3E%3Cpath d='m5.5 9 10.5 8L26.5 9'/%3E%3C/svg%3E");
  }

  .header .header-action-item:hover {
    transform: translateX(-4px);
    box-shadow: -5px 5px 15px rgba(9, 40, 79, .24);
  }

  .header .header-demo-btn:hover,
  .header .header-demo-apply-btn:hover,
  .header .header-contact-btn:hover {
    color: var(--header-action-unified);
    background: #fbfdff;
    border-color: var(--header-action-unified);
  }

  .header .tel-widget,
  body.no-side-tabs .header .tel-widget {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: auto;
    z-index: 320;
    display: block;
    transform: none;
    pointer-events: auto;
  }

  /* Keep the original dismissible phone card throughout the ear-tab range. */
  .header .telx {
    position: absolute;
    top: -10px;
    left: -10px;
    z-index: 2;
    display: flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    line-height: 1;
    background: #1a1a1a;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
    cursor: pointer;
  }

  .header .telx::before {
    content: "×";
    display: block;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
  }

  .header .telx > i {
    display: none;
  }

  .header .header-tel-btn {
    display: flex;
    width: auto;
    padding: 13px 20px;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #1a1a1a;
    background: #fff;
    border: 1px solid #112e56;
    border-radius: 6px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
    transform: none;
  }

  .header .header-tel-btn .header-tel-icon {
    display: block;
    margin-top: 0;
    color: #112e56;
    font-size: 22px;
  }

  .header .header-tel-textcol {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    line-height: 1.2;
  }

  .header .header-tel-number {
    font-size: 18px;
    line-height: 1.15;
    letter-spacing: 0;
    white-space: nowrap;
  }

  .header .header-tel-label {
    margin-top: 2px;
    font-size: 10px;
  }

  .header .telx-cb:checked ~ .header-tel-btn,
  .header .telx-cb:checked ~ .telx {
    display: none;
  }
}

/* Keep icon-bearing tabs clear of the dismissible phone card on short screens. */
@media (min-width: 769px) and (max-width: 1550px) and (min-height: 521px) and (max-height: 580px) {
  .header .header-actions,
  body.no-side-tabs .header .header-actions {
    justify-content: flex-start;
    padding-top: 8px;
    box-sizing: border-box;
  }

  .header .header-action-item {
    min-height: 116px;
    padding: 28px 3px 6px;
    font-size: 13px;
    line-height: 1.1;
    letter-spacing: .06em;
  }

  .header .header-action-item::after {
    top: 8px;
    width: 16px;
    height: 16px;
  }
}

/* Align the ten-item navigation with the ear rail and give it more presence. */
@media (min-width: 769px) and (max-width: 1550px) and (min-height: 521px) {
  .header .header-inner {
    padding-right: 50px !important;
  }

  .header .nav {
    justify-content: flex-end;
  }

  .header .nav > a {
    font-size: 14px;
  }
}

/* At the exact short-height boundary, sit the phone card below the ear rail. */
@media (min-width: 769px) and (max-width: 1550px) and (min-height: 521px) and (max-height: 540px) {
  .header .tel-widget,
  body.no-side-tabs .header .tel-widget {
    bottom: 0;
  }
}

/* Mobile uses the page's compact header; edge tabs must not cover content. */
@media (max-width: 768px) {
  .header .header-inner {
    padding-right: var(--pad) !important;
  }

  .header .header-actions,
  .header .tel-widget,
  body.no-side-tabs .header .header-actions,
  body.no-side-tabs .header .tel-widget {
    display: none !important;
  }

  body.subpage .container {
    padding-right: var(--pad);
  }
}

/* Icon-bearing tabs and the phone card need at least 521px viewport height. */
@media (min-width: 769px) and (max-width: 1550px) and (max-height: 520px) {
  .header .header-inner {
    padding-right: var(--pad) !important;
  }

  .header .header-actions,
  .header .tel-widget,
  body.no-side-tabs .header .header-actions,
  body.no-side-tabs .header .tel-widget {
    display: none !important;
  }

  body.subpage .container {
    padding-right: var(--pad);
  }
}

@media (prefers-reduced-motion: reduce) {
  .header .header-action-item,
  .header .header-action-item::before {
    transition: none !important;
  }

  .header .header-action-item:hover {
    transform: none;
  }
}
