.contextual-help-slot {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin-right: 8px;
  height: 40px;
  line-height: 0;
  vertical-align: middle;
}

.contextual-help-button {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.contextual-help-button:hover {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.32);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.14);
  transform: translateY(-1px);
}

.contextual-help-button:focus-visible,
.contextual-help-close:focus-visible,
.contextual-help-action:focus-visible,
.contextual-help-search-input:focus-visible,
.contextual-help-item:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.26);
  outline-offset: 2px;
}

.contextual-help-button.is-fixed {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  z-index: 50;
}

.contextual-help-panel {
  box-sizing: border-box;
  width: min(420px, calc(100vw - 32px));
  max-height: min(76vh, 620px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 18px;
  background: rgba(250, 248, 255, 0.88);
  color: #131b2e;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.18), 0 4px 14px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.98);
  transition: opacity 200ms ease, transform 200ms ease, visibility 0s linear 200ms;
  visibility: hidden;
}

.contextual-help-panel.is-navbar,
.contextual-help-panel.is-slot,
.contextual-help-panel.is-fixed {
  position: fixed;
  z-index: 50;
}

.contextual-help-panel.is-navbar {
  top: 70px;
  right: 16px;
}

.contextual-help-panel.is-fixed {
  top: calc(60px + env(safe-area-inset-top, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
}

.contextual-help-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition: opacity 200ms ease, transform 200ms ease, visibility 0s linear 0s;
  visibility: visible;
}

.contextual-help-sheet-handle {
  display: none;
}

.contextual-help-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.contextual-help-header-copy {
  min-width: 0;
}

.contextual-help-kicker {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.contextual-help-title {
  margin: 0;
  color: #0f172a;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.18;
}

.contextual-help-intro {
  margin: 8px 0 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.5;
}

.contextual-help-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: #e9edff;
  color: #434655;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.contextual-help-close:hover {
  background: #dbeafe;
  color: #0f172a;
  transform: translateY(-1px);
}

.contextual-help-search {
  position: relative;
  display: block;
  margin-top: 18px;
}

.contextual-help-search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #737686;
  pointer-events: none;
}

.contextual-help-search-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(195, 198, 215, 0.68);
  border-radius: 14px;
  background: rgba(242, 243, 255, 0.86);
  color: #131b2e;
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  padding: 12px 14px 12px 46px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 4px 12px rgba(15, 23, 42, 0.04);
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.contextual-help-search-input::placeholder {
  color: #737686;
}

.contextual-help-search-input:focus {
  border-color: rgba(37, 99, 235, 0.52);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.contextual-help-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.contextual-help-action {
  min-width: 0;
  min-height: 118px;
  border: 1px solid rgba(195, 198, 215, 0.62);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  color: #131b2e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 8px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.contextual-help-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.contextual-help-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.contextual-help-action-label {
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.contextual-help-action-tour {
  border-color: rgba(37, 99, 235, 0.26);
  background: rgba(219, 225, 255, 0.7);
}

.contextual-help-action-tour .contextual-help-action-icon {
  color: #004ac6;
}

.contextual-help-action-manual .contextual-help-action-icon {
  color: #475569;
}

.contextual-help-action-support .contextual-help-action-icon {
  color: #2563eb;
}

.contextual-help-section {
  margin-top: 22px;
}

.contextual-help-section-title {
  margin: 0 0 12px;
  color: #737686;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: uppercase;
}

.contextual-help-list {
  display: grid;
  gap: 10px;
}

.contextual-help-item {
  width: 100%;
  min-height: 72px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  color: inherit;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.contextual-help-item:hover,
.contextual-help-item.is-active {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

.contextual-help-item-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #e9edff;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.contextual-help-item-copy {
  min-width: 0;
}

.contextual-help-item-title {
  display: block;
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}

.contextual-help-item-body {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.contextual-help-item-arrow {
  color: #737686;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 160ms ease, transform 160ms ease;
}

.contextual-help-item:hover .contextual-help-item-arrow,
.contextual-help-item.is-active .contextual-help-item-arrow {
  color: #2563eb;
  transform: translateX(2px);
}

.contextual-help-empty {
  border: 1px dashed rgba(148, 163, 184, 0.5);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
  padding: 14px;
  text-align: center;
}

.contextual-help-target {
  position: relative;
  z-index: 38;
  outline: 3px solid rgba(37, 99, 235, 0.48) !important;
  outline-offset: 3px;
  border-radius: 10px;
  box-shadow: 0 0 0 7px rgba(37, 99, 235, 0.1) !important;
}

.contextual-help-tooltip {
  box-sizing: border-box;
  position: fixed;
  z-index: 39;
  width: min(320px, calc(100vw - 24px));
  max-height: min(52vh, 340px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.2);
  padding: 14px;
  color: #131b2e;
}

.contextual-help-tooltip-title {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}

.contextual-help-tooltip-body {
  margin: 6px 0 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
}

html.contextual-help-x-lock,
body.contextual-help-x-lock {
  overflow-x: hidden !important;
}

@media (max-width: 640px) {
  .contextual-help-button {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .contextual-help-panel,
  .contextual-help-panel.is-navbar,
  .contextual-help-panel.is-slot,
  .contextual-help-panel.is-fixed {
    position: fixed;
    top: auto;
    right: calc(12px + env(safe-area-inset-right, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: calc(12px + env(safe-area-inset-left, 0px));
    width: auto;
    max-height: min(82dvh, 720px);
    border-radius: 28px 28px 18px 18px;
    padding: 12px 16px 18px;
    transform: translateY(110%);
  }

  .contextual-help-panel.is-open {
    transform: translateY(0);
  }

  .contextual-help-sheet-handle {
    display: block;
    width: 52px;
    height: 5px;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: rgba(195, 198, 215, 0.82);
  }

  .contextual-help-title {
    font-size: 22px;
    line-height: 1.22;
  }

  .contextual-help-intro {
    font-size: 13px;
  }

  .contextual-help-close {
    width: 36px;
    height: 36px;
  }

  .contextual-help-actions {
    gap: 10px;
  }

  .contextual-help-action {
    min-height: 106px;
    border-radius: 15px;
    padding: 10px 6px;
  }

  .contextual-help-action-icon {
    width: 44px;
    height: 44px;
  }

  .contextual-help-item {
    grid-template-columns: 40px minmax(0, 1fr) 18px;
    min-height: 68px;
    padding: 11px 12px;
  }

  .contextual-help-item-icon {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 420px) {
  .contextual-help-panel,
  .contextual-help-panel.is-navbar,
  .contextual-help-panel.is-slot,
  .contextual-help-panel.is-fixed {
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    left: 10px;
    padding-inline: 14px;
  }

  .contextual-help-actions {
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
  }

  .contextual-help-action-label {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contextual-help-button,
  .contextual-help-panel,
  .contextual-help-close,
  .contextual-help-action,
  .contextual-help-item,
  .contextual-help-item-arrow {
    transition: none;
  }
}
