.cs-help-panel {
  --cs-help-side: max(16px, env(safe-area-inset-right));
  --cs-help-bottom: max(96px, calc(env(safe-area-inset-bottom) + 72px));
  position: fixed;
  inset: auto var(--cs-help-side) var(--cs-help-bottom) auto;
  box-sizing: border-box;
  inline-size: min(25rem, calc(100vw - var(--cs-help-side) - max(16px, env(safe-area-inset-left))));
  max-block-size: calc(100vh - var(--cs-help-bottom) - max(12px, env(safe-area-inset-top)));
  max-block-size: calc(100dvh - var(--cs-help-bottom) - max(12px, env(safe-area-inset-top)));
  margin: 0;
  padding: 0;
  border: 1px solid #ded9e7;
  border-radius: 18px;
  background: #fffdf9;
  color: var(--cs-ink, #292638);
  box-shadow: 0 12px 36px #241f2b33;
  font: 400 14px/1.45 system-ui, sans-serif;
  overflow: hidden;
}

.cs-help-panel:popover-open {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.cs-help-header,
.cs-help-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cs-help-header {
  justify-content: space-between;
  padding: 8px 12px 8px 16px;
  background: var(--cs-night, #34334f);
  color: #fff;
}

.cs-help-heading h2 {
  margin: 0;
  color: inherit;
  font: 650 16px/1.3 system-ui, sans-serif;
}

.cs-help-heading svg,
.cs-help-close svg {
  inline-size: 22px;
  block-size: 22px;
  flex: none;
}

.cs-help-close {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: 44px;
  block-size: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.cs-help-close:hover { background: #ffffff24; }
.cs-help-panel .cs-help-close:focus-visible { outline-color: #f8c9a8; }

.cs-help-conversation {
  display: grid;
  align-content: start;
  min-block-size: 0;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
}

.cs-help-panel :is(.cs-help-answer, .cs-help-question) {
  max-inline-size: 92%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px 12px 12px 4px;
  background: #f0edf4;
  color: inherit;
  font: inherit;
}

.cs-help-panel .cs-help-question {
  justify-self: end;
  border-radius: 12px 12px 4px 12px;
  background: #f9e4d5;
}

.cs-help-panel .cs-help-question:not([hidden]),
.cs-help-reply:not(:empty) { margin-block-start: 12px; }

.cs-help-topics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-block-start: 12px;
}

.cs-help-topic {
  min-block-size: 44px;
  padding: 6px 10px;
  border: 1px solid #c1b9cd;
  border-radius: 10px;
  background: #fffdf9;
  color: inherit;
  font: 600 13px/1.3 system-ui, sans-serif;
  text-align: start;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.cs-help-topic:hover { background: #f0edf4; }

.cs-help-topic[aria-pressed="true"] {
  border-color: var(--cs-night, #34334f);
  background: var(--cs-night, #34334f);
  color: #fff;
}

.cs-help-panel :is(.cs-help-action, [data-help-contact]) {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  color: inherit;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.cs-help-action { margin-block-start: 4px; }

.cs-help-footer {
  padding: 4px 16px;
  border-block-start: 1px solid #ded9e7;
}

.cs-help-panel :is(a, button):focus-visible {
  outline: 3px solid #b84732;
  outline-offset: 2px;
}

@media (max-width: 660px) {
  .cs-help-panel {
    --cs-help-side: max(8px, env(safe-area-inset-right));
    --cs-help-bottom: max(80px, calc(env(safe-area-inset-bottom) + 64px));
    inline-size: min(25rem, calc(100vw - var(--cs-help-side) - max(8px, env(safe-area-inset-left))));
  }
}

@media (prefers-reduced-motion: no-preference) {
  .cs-help-panel:popover-open { animation: cs-help-open .16s ease-out; }
  @keyframes cs-help-open {
    from { opacity: 0; translate: 0 5px; }
  }
}

@media print { .cs-help-panel:popover-open { display: none; } }
