.im-help-ribbon,
.im-help-ribbon * {
  box-sizing: border-box;
}

.im-help-ribbon {
  /* Self-contained theme tokens. Edit these without touching global theme CSS. */
  --im-help-blue: #2563eb;
  --im-help-blue-dark: #1d4ed8;
  --im-help-blue-deep: #1d4ed8;
  --im-help-blue-soft: #f0f4ff;
  --im-help-button-bg: var(--im-help-blue);
  --im-help-button-bg-hover: var(--im-help-blue-dark);

  /* Desktop size controls. Increase/decrease these to resize the desktop ribbon. */
  --im-help-desktop-height: 3.35rem;
  /* Matches the site's page-shell pattern (width: min(100% - 2rem, 82rem); margin: 0 auto;)
     so the ribbon content recenters like page divs instead of drifting to the edges as the viewport widens. */
  --im-help-desktop-content-max-width: 82rem;
  --im-help-desktop-x-padding: max(1rem, calc((100% - var(--im-help-desktop-content-max-width)) / 2));
  --im-help-desktop-y-padding: 0.48rem;
  --im-help-desktop-button-height: 2.2rem;
  --im-help-desktop-button-font: 0.76rem;
  --im-help-desktop-title-font: clamp(0.92rem, 1.45vw, 1.08rem);
  --im-help-desktop-copy-font: clamp(0.78rem, 1vw, 0.9rem);

  /* Mobile size controls. Increase/decrease these to resize the mobile ribbon. */
  --im-help-mobile-height: 3.9rem;
  --im-help-mobile-button-height: 2.35rem;
  --im-help-mobile-button-font: 0.74rem;
  --im-help-mobile-title-font: 0.92rem;
  --im-help-mobile-copy-font: 0.74rem;

  /* Independent font stack; does not rely on homepage.css or brand-system.css. */
  --im-help-font-primary: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --im-help-font-secondary: var(--im-help-font-primary);
}

body:has(.im-help-ribbon.is-visible:not(.is-hidden)) {
  padding-bottom: var(--im-help-desktop-height);
}

body:has(.im-help-ribbon) .lp-mobile-sticky {
  display: none;
}

/*
  To disable this global help ribbon on mobile only, uncomment this block.

  @media (max-width: 759px) {
    body:has(.im-help-ribbon.is-visible:not(.is-hidden)) {
      padding-bottom: 0;
    }

    .im-help-ribbon {
      display: none;
    }
  }
*/

.im-help-ribbon {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100001;
  display: none;
  font-family: var(--im-help-font-primary);
  color: #111827;
}

.im-help-ribbon.is-visible {
  display: block;
}

.im-help-ribbon.is-hidden {
  display: none;
}

.im-help-ribbon-bar {
  display: flex;
  min-height: var(--im-help-desktop-height);
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: var(--im-help-desktop-y-padding) var(--im-help-desktop-x-padding);
  border-top: 1px solid rgba(29, 78, 216, 0.18);
  background: linear-gradient(90deg, #ffffff 0%, var(--im-help-blue-soft) 100%);
  box-shadow: 0 -12px 30px rgba(15, 23, 42, 0.14);
}

.im-help-ribbon-copy {
  min-width: 0;
}

.im-help-ribbon-copy strong {
  color: var(--im-help-blue);
  font-family: var(--im-help-font-primary);
  font-size: var(--im-help-desktop-title-font);
  font-weight: 900;
  line-height: 1.15;
}

.im-help-ribbon-copy span {
  margin-left: 0.28rem;
  color: #334155;
  font-family: var(--im-help-font-primary);
  font-size: var(--im-help-desktop-copy-font);
  font-weight: 600;
  line-height: 1.3;
}

.im-help-ribbon-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.6rem;
}

.im-help-ribbon-call,
.im-help-ribbon-toggle {
  display: inline-flex;
  min-height: var(--im-help-desktop-button-height);
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  border: 0;
  background: var(--im-help-button-bg);
  color: #ffffff;
  font-family: var(--im-help-font-primary);
  font-size: var(--im-help-desktop-button-font);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 20px 25px -5px rgba(240, 234, 234, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

.im-help-ribbon-call {
  display: none;
  padding: 0.48rem 0.82rem;
}

.im-help-ribbon-toggle {
  gap: 0.52rem;
  padding: 0.5rem 0.88rem;
  cursor: pointer;
}

.im-help-ribbon-call:hover,
.im-help-ribbon-toggle:hover {
  transform: translateY(-2px);
  background: var(--im-help-button-bg-hover);
  box-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.3), 0 8px 10px -6px rgba(59, 130, 246, 0.3);
  color: #ffffff;
}

.im-help-ribbon-toggle svg {
  width: 0.86rem;
  height: 0.86rem;
}

.im-help-ribbon-panel {
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  display: none;
  max-height: min(76vh, 36rem);
  overflow: auto;
  padding: 1.55rem clamp(1rem, 6vw, 12rem) 1.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  background:
    radial-gradient(circle at 12% 0%, rgba(96, 165, 250, 0.2), transparent 30%),
    linear-gradient(135deg, #14347d 0%, #1d46a5 48%, #1d4ed8 100%);
  box-shadow: 0 -18px 44px rgba(15, 23, 42, 0.24);
}

.im-help-ribbon.is-open .im-help-ribbon-panel {
  display: block;
}

.im-help-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.im-help-panel-head span {
  display: block;
  margin-bottom: 0.28rem;
  color: #dbeafe;
  font-family: var(--im-help-font-primary);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.im-help-panel-head h2 {
  margin: 0;
  color: #ffffff;
  font-family: var(--im-help-font-secondary);
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.im-help-panel-head p {
  margin: 0.4rem 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--im-help-font-primary);
  font-size: 0.9rem;
  line-height: 1.45;
}

.im-help-panel-close {
  flex: 0 0 auto;
  appearance: none;
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  font-family: var(--im-help-font-primary);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  padding: 0;
  box-shadow: none;
}

.im-help-ribbon .im-help-panel-close:hover,
.im-help-ribbon .im-help-panel-close:focus {
  background: transparent;
  color: #ffffff;
  box-shadow: none;
}

.im-help-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 0.78rem 0.9rem;
  font-family: var(--im-help-font-primary);
}

.im-help-form label {
  display: grid;
  min-width: 0;
  gap: 0.33rem;
}

.im-help-form span {
  color: #ffffff;
  font-family: var(--im-help-font-primary);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.2;
}

.im-help-form input,
.im-help-form select,
.im-help-form textarea {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0.65rem;
  outline: none;
  background: #ffffff;
  color: #24364b;
  font-family: var(--im-help-font-primary);
  font-size: 0.9rem;
  line-height: 1.35;
  padding: 0.82rem 0.95rem;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.im-help-form textarea {
  min-height: 7.8rem;
  resize: vertical;
}

.im-help-form-frame {
  position: absolute;
  width: 0;
  height: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.im-help-form input::placeholder,
.im-help-form textarea::placeholder {
  color: #9ca3af;
}

.im-help-form-full {
  grid-column: 1 / span 2;
}

.im-help-submit {
  align-self: end;
  justify-self: end;
  min-width: 8rem;
  min-height: 2.9rem;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  background: #ffffff;
  color: var(--im-help-blue-deep);
  cursor: pointer;
  font-family: var(--im-help-font-primary);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
  padding: 0.78rem 1.35rem;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.im-help-submit:hover {
  background: #f0f4ff;
  color: var(--im-help-blue-dark);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.24);
  transform: translateY(-1px);
}

.im-help-submit:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.im-help-submit:disabled {
  cursor: wait;
  opacity: 0.78;
  transform: none;
}

.im-help-form-status {
  grid-column: 1 / span 2;
  min-height: 1.25rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--im-help-font-primary);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

.im-help-form-status[data-state="success"] {
  color: #dcfce7;
}

.im-help-form-status[data-state="error"] {
  color: #fee2e2;
}

@media (min-width: 760px) {
  .im-help-ribbon-call {
    display: inline-flex;
  }

  .im-help-form {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .im-help-form label:nth-of-type(1),
  .im-help-form label:nth-of-type(2) {
    grid-column: span 3;
  }

  .im-help-form label:nth-of-type(3),
  .im-help-form label:nth-of-type(4),
  .im-help-form label:nth-of-type(5) {
    grid-column: span 2;
  }

  .im-help-form-full {
    grid-column: 1 / span 4;
  }

  .im-help-submit {
    grid-column: 5 / 7;
    justify-self: end;
  }

  .im-help-form-status {
    grid-column: 1 / span 4;
  }
}

@media (max-width: 759px) {
  body:has(.im-help-ribbon.is-visible:not(.is-hidden)) {
    padding-bottom: var(--im-help-mobile-height);
  }

  .im-help-ribbon-bar {
    min-height: var(--im-help-mobile-height);
    padding: 0.58rem 0.75rem;
  }

  .im-help-ribbon-copy strong,
  .im-help-ribbon-copy span {
    display: block;
    margin-left: 0;
  }

  .im-help-ribbon-copy strong {
    font-size: var(--im-help-mobile-title-font);
  }

  .im-help-ribbon-copy span {
    font-size: var(--im-help-mobile-copy-font);
  }

  .im-help-ribbon-toggle {
    min-height: var(--im-help-mobile-button-height);
    padding: 0.58rem 0.75rem;
    font-size: var(--im-help-mobile-button-font);
  }

  .im-help-ribbon-panel {
    max-height: 82vh;
    padding: 1.1rem 0.78rem 1.2rem;
  }

  .im-help-panel-head {
    margin-bottom: 0.88rem;
  }

  .im-help-panel-head h2 {
    font-size: 1.18rem;
  }

  .im-help-panel-head p {
    font-size: 0.82rem;
  }

  .im-help-form {
    grid-template-columns: 1fr;
  }

  .im-help-form-full,
  .im-help-submit,
  .im-help-form-status {
    grid-column: auto;
  }

  .im-help-form textarea {
    min-height: 6.5rem;
  }

  .im-help-submit {
    width: 100%;
    justify-self: stretch;
  }

}
