/* =========================================================
   INDUSTRIAL HEADER V4 — SAAS WHITE HEADER
   AI page only
   White header · 5% purple blend · SaaS actions · global green free CTA
========================================================= */

/* ================= HEADER SHELL ================= */

.aih-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  width: 100%;

  background:
    linear-gradient(180deg, #ffffff 0%, #fbf9ff 100%);
  border-bottom: 1px solid rgba(111, 31, 229, 0.12);

  box-shadow: 0 10px 28px rgba(42, 1, 70, 0.08);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.aih-header::before {
  display: none;
}

.aih-bar {
  position: relative;
  z-index: 1;
  width: 100%;
}

.aih-inner {
  position: relative;
  width: min(1580px, calc(100% - 40px));
  min-height: 88px;
  margin: 0 auto;

  display: flex;
  align-items: center;
  gap: 22px;
}

/* ================= BRAND ================= */

.aih-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 245px;

  text-decoration: none;
  color: #160038;
  flex: 0 0 auto;
}

.aih-logo {
  width: 42px;
  height: 42px;
  display: block;
  object-fit: contain;
  filter: none;
}

.aih-brand-copy {
  display: grid;
  gap: 2px;
  line-height: 1;
}

.aih-brand-name {
  display: inline-flex;
  align-items: baseline;

  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.aih-brand-name .brand-webs,
.brand-webs {
  color: #1f9bd1;
  font-size: 25px;
  font-weight: 760;
  text-shadow: none;
}

.aih-brand-name .brand-docs,
.brand-docs {
  color: #4b5870;
  font-size: 23px;
  font-weight: 760;
}

.aih-product-label {
  color: #667187;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* ================= NAV CORE ================= */

.aih-nav-check {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.aih-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

.aih-link,
.aih-dropdown > summary {
  min-height: 40px;

  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 0 12px;
  border-radius: 999px;

  color: #4b5870;
  background: transparent;
  text-decoration: none;

  font-size: 1.01rem;
  font-weight: 700;
  line-height: 1;

  cursor: pointer;
  list-style: none;
  white-space: nowrap;

  transition:
    color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.aih-dropdown > summary::-webkit-details-marker {
  display: none;
}

.aih-link:hover,
.aih-link:focus-visible,
.aih-dropdown[open] > summary {
  color: #160038;
  background: rgba(111, 31, 229, 0.08);
  box-shadow: inset 0 0 0 1px rgba(111, 31, 229, 0.14);
  outline: none;
  transform: translateY(-1px);
}

.aih-arrow {
  color: #6f1fe5;
  font-size: 0.91rem;
  line-height: 1;
  transform: translateY(-1px);
}

/* ================= DROPDOWNS ================= */

.aih-dropdown {
  position: relative;
}

.aih-dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;

  width: min(370px, calc(100vw - 34px));
  padding: 10px;
  border-radius: 18px;

  background:
    linear-gradient(180deg, #ffffff 0%, #fbf9ff 100%);
  border: 1px solid rgba(111, 31, 229, 0.14);

  box-shadow:
    0 24px 60px rgba(42, 1, 70, 0.14),
    0 8px 22px rgba(42, 1, 70, 0.07);

  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);

  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s ease;
}

.aih-dropdown[open] .aih-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.aih-dropdown-menu a {
  display: grid;
  gap: 5px;

  padding: 13px 14px;
  border-radius: 14px;

  text-decoration: none;
  color: #160038;

  transition:
    background-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.aih-dropdown-menu a:hover,
.aih-dropdown-menu a:focus-visible {
  background: #f7f1ff;
  box-shadow: inset 0 0 0 1px rgba(111, 31, 229, 0.14);
  transform: translateY(-1px);
  outline: none;
}

.aih-dropdown-menu strong {
  color: #160038;
  font-size: 0.88rem;
  font-weight: 760;
  line-height: 1.25;
}

.aih-dropdown-menu span {
  color: #667187;
  font-size: 0.77rem;
  line-height: 1.45;
  font-weight: 500;
}

/* WebsDocs dropdown wider */
.aih-webdocs .aih-dropdown-menu {
  left: auto;
  right: 0;
  width: min(470px, calc(100vw - 34px));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ================= ACTIONS ================= */

.aih-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.aih-action {
  min-height: 44px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0 20px;
  border-radius: 999px;

  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
}

.aih-action:hover,
.aih-action:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

/* Primary managed / paid / main product CTA */
.aih-action-primary {
  color: #ffffff;
  background:
    linear-gradient(135deg, #6f1fe5 0%, #2563eb 58%, #00c0f3 100%);
  border: 1px solid rgba(111, 31, 229, 0.24);
  box-shadow: 0 14px 28px rgba(90, 19, 199, 0.22);
}

.aih-action-primary:hover,
.aih-action-primary:focus-visible {
  background:
    linear-gradient(135deg, #5a13c7 0%, #1d4ed8 58%, #0891b2 100%);
  border-color: rgba(111, 31, 229, 0.34);
  box-shadow: 0 18px 36px rgba(90, 19, 199, 0.30);
}

/* Secondary / Demo CTA */
.aih-action-demo {
  color: #4f0fb8;
  background: #ffffff;
  border: 1px solid rgba(111, 31, 229, 0.16);
  box-shadow: 0 10px 22px rgba(42, 1, 70, 0.07);
}

.aih-action-demo:hover,
.aih-action-demo:focus-visible {
  color: #160038;
  background: #f7f1ff;
  border-color: rgba(111, 31, 229, 0.30);
}

/* Global free CTA — same identity as WebsDocs home */
.aih-action-free,
.aih-header .header-cta {
  color: #16210f;
  background: #b7df52;
  border: 1px solid #b7df52;
  box-shadow: 0 12px 26px rgba(183, 223, 82, 0.34);
}

.aih-action-free:hover,
.aih-action-free:focus-visible,
.aih-header .header-cta:hover,
.aih-header .header-cta:focus-visible {
  color: #11180d;
  background: #addb42;
  border-color: #addb42;
  box-shadow: 0 16px 30px rgba(183, 223, 82, 0.42);
}

/*
  IMPORTANT:
  .panel-toggle is styled by separate quick-access CSS.
  Do not style .panel-toggle here.
*/

/* ================= MOBILE MENU BUTTON ================= */

.aih-mobile-toggle {
  display: none;

  width: 42px;
  height: 42px;
  border-radius: 14px;

  border: 1px solid rgba(111, 31, 229, 0.16);
  background: #ffffff;

  box-shadow: 0 8px 18px rgba(42, 1, 70, 0.07);

  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;

  cursor: pointer;
}

.aih-mobile-toggle span {
  width: 19px;
  height: 2px;
  border-radius: 999px;
  background: #160038;

  transition:
    transform 0.18s ease,
    opacity 0.18s ease;
}

/* =========================================================
   RESPONSIVE — DESKTOP COMPRESS
========================================================= */

@media (max-width: 1360px) {
  .aih-inner {
    width: min(100% - 28px, 1580px);
    gap: 14px;
  }

  .aih-brand {
    min-width: 220px;
  }

  .aih-product-label {
    max-width: 172px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .aih-link,
  .aih-dropdown > summary {
    padding: 0 9px;
    font-size: 0.8rem;
  }

  .aih-action {
    padding: 0 16px;
    font-size: 0.8rem;
  }
}

/* =========================================================
   TABLET / MOBILE NAV
========================================================= */

@media (max-width: 1120px) {
  .aih-inner {
    min-height: 72px;
  }

  .aih-mobile-toggle {
    display: inline-flex;
  }

  .aih-action {
    display: none;
  }

  .aih-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .aih-nav {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;

    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;

    padding: 12px;
    border-radius: 20px;

    background:
      linear-gradient(180deg, #ffffff 0%, #fbf9ff 100%);
    border: 1px solid rgba(111, 31, 229, 0.14);

    box-shadow:
      0 24px 60px rgba(42, 1, 70, 0.14),
      0 8px 22px rgba(42, 1, 70, 0.07);

    max-height: calc(100vh - 90px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .aih-nav-check:checked ~ .aih-nav {
    display: flex;
  }

  .aih-nav-check:checked ~ .aih-actions .aih-mobile-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .aih-nav-check:checked ~ .aih-actions .aih-mobile-toggle span:nth-child(2) {
    opacity: 0;
  }

  .aih-nav-check:checked ~ .aih-actions .aih-mobile-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .aih-link,
  .aih-dropdown > summary {
    width: 100%;
    min-height: 48px;

    justify-content: space-between;

    padding: 0 14px;
    border-radius: 14px;

    color: #4b5870;
    background: #ffffff;
    border: 1px solid rgba(111, 31, 229, 0.12);

    font-size: 0.9rem;
    font-weight: 680;
  }

  .aih-link:hover,
  .aih-link:focus-visible,
  .aih-dropdown[open] > summary {
    color: #160038;
    background: #f7f1ff;
    border-color: rgba(111, 31, 229, 0.20);
    box-shadow: none;
    transform: none;
  }

  .aih-arrow {
    color: #6f1fe5;
  }

  .aih-dropdown {
    width: 100%;
  }

  .aih-dropdown-menu,
  .aih-webdocs .aih-dropdown-menu {
    position: static;

    width: 100%;
    display: grid;
    grid-template-columns: 1fr;

    margin-top: 8px;
    padding: 8px;
    border-radius: 16px;

    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;

    background: #ffffff;
    border: 1px solid rgba(111, 31, 229, 0.12);
  }

  .aih-dropdown:not([open]) .aih-dropdown-menu {
    display: none;
  }

  .aih-dropdown-menu a {
    padding: 12px;
    border-radius: 12px;
    background: transparent;
  }

  .aih-dropdown-menu a:hover,
  .aih-dropdown-menu a:focus-visible {
    background: #f7f1ff;
    box-shadow: inset 0 0 0 1px rgba(111, 31, 229, 0.13);
    transform: none;
  }

  .aih-dropdown-menu strong {
    color: #160038;
    font-size: 0.88rem;
    font-weight: 760;
  }

  .aih-dropdown-menu span {
    color: #667187;
    font-size: 0.77rem;
    line-height: 1.45;
  }
}

/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 640px) {
  .aih-inner {
    width: calc(100% - 18px);
    min-height: 68px;
    gap: 8px;
  }

  .aih-brand {
    min-width: 0;
    max-width: calc(100% - 104px);
  }

  .aih-logo {
    width: 38px;
    height: 38px;
  }

  .aih-brand-name {
    font-size: 1.05rem;
    font-weight: 700;
  }

  .aih-brand-name .brand-webs,
  .brand-webs {
    font-size: 23px;
  }

  .aih-brand-name .brand-docs,
  .brand-docs {
    font-size: 21px;
  }

  .aih-product-label {
    max-width: 172px;
    font-size: 0.64rem;
  }

  .aih-actions {
    gap: 7px;
  }

  .aih-mobile-toggle {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .aih-nav {
    top: calc(100% + 8px);
    max-height: calc(100vh - 84px);
    padding: 10px;
    border-radius: 18px;
  }

  .aih-link,
  .aih-dropdown > summary {
    min-height: 46px;
    font-size: 0.88rem;
  }
}

/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media (max-width: 420px) {
  .aih-brand {
    max-width: calc(100% - 98px);
  }

  .aih-logo {
    width: 36px;
    height: 36px;
  }

  .aih-brand-name {
    font-size: 0.98rem;
  }

  .aih-brand-name .brand-webs,
  .brand-webs {
    font-size: 21px;
  }

  .aih-brand-name .brand-docs,
  .brand-docs {
    font-size: 20px;
  }

  .aih-product-label {
    max-width: 146px;
  }

  .aih-nav {
    left: -2px;
    right: -2px;
  }
}

/* =========================================================
   ACCESSIBILITY / REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
  .aih-link,
  .aih-dropdown > summary,
  .aih-dropdown-menu,
  .aih-dropdown-menu a,
  .aih-action,
  .aih-mobile-toggle span {
    transition: none;
  }
}