/* Landing "Need help?" chat. Palette follows the page; layout follows the in-app widget. */
.se-help-fab {
  position: fixed; right: 0.9rem; bottom: calc(0.9rem + env(safe-area-inset-bottom)); z-index: 45;
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; padding: 0;
  color: var(--ink);
  background: transparent; border: 0; border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line-strong); cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.se-help-fab svg { width: 26px; height: 26px; display: block; }
.se-help-fab:hover { background: var(--bg-soft); color: var(--ink); transform: translateY(-1px); }
.se-help-fab:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* The class sets display: inline-flex, which would otherwise override [hidden]. */
.se-help-fab[hidden] { display: none !important; }

.se-help { position: fixed; inset: 0; z-index: 72; display: grid; place-items: end center; }
.se-help-backdrop { position: absolute; inset: 0; background: rgba(8, 6, 5, 0.6); }
.se-help-panel {
  position: relative; display: flex; flex-direction: column;
  width: min(30rem, 100%); height: min(40rem, 90dvh);
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 22px 22px 0 0;
  padding: 0.9rem 1rem calc(0.8rem + env(safe-area-inset-bottom)); overflow: hidden;
  color: var(--ink); font-family: var(--font-sans);
}
@media (min-width: 720px) {
  .se-help { place-items: end end; padding: 1rem; }
  .se-help-backdrop { background: transparent; }
  .se-help-panel { width: 24rem; border-radius: 22px; box-shadow: var(--shadow); }
}
.se-help-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--line); }
.se-help-head div { display: flex; flex-direction: column; line-height: 1.25; }
.se-help-head strong { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 560; }
.se-help-head span { color: var(--ink-mute); font-size: 0.84rem; }
.se-help-close {
  appearance: none; background: none; border: 0; color: var(--ink-mute);
  font: inherit; font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0.2rem 0.4rem;
}
.se-help-close:hover { color: var(--ink); }

.se-help-msgs { flex: 1; min-height: 5.2rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.6rem; padding: 0.8rem 0.1rem 0.4rem; overscroll-behavior: contain; }
.se-help-row { display: flex; flex-direction: column; gap: 0.45rem; max-width: 88%; }
.se-help-row.user { align-self: flex-end; align-items: flex-end; }
.se-help-row.assistant { align-self: flex-start; align-items: flex-start; }
.se-help-bubble { margin: 0; padding: 0.6rem 0.85rem; border-radius: 16px; font-size: 0.95rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.se-help-bubble.assistant { background: var(--bg-soft); color: var(--ink); border-bottom-left-radius: 5px; }
.se-help-bubble.user { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #2a1d10; border-bottom-right-radius: 5px; }
.se-help-bubble.err { color: var(--gold-2); border: 1px solid var(--line-strong); }
.se-help-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.se-help-actions a {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; font: inherit; font-size: 0.86rem; font-weight: 560;
  color: #2a1d10; background: var(--gold); border-radius: 99px; padding: 0.45rem 0.85rem;
}
.se-help-actions a:hover { background: var(--gold-2); }

.se-help-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.4rem 0 0.6rem; }
.se-help-chip {
  font: inherit; font-size: 0.86rem; color: var(--gold-2); background: transparent;
  border: 1px solid var(--line-strong); border-radius: 99px; padding: 0.4rem 0.75rem; cursor: pointer;
}
.se-help-chip:hover:not(:disabled) { border-color: var(--gold); color: var(--ink); }
.se-help-chip:disabled { opacity: 0.5; cursor: default; }

.se-help-form { display: flex; gap: 0.5rem; align-items: center; }
.se-help-form input {
  flex: 1; min-width: 0; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--bg-soft); border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 0.65rem 0.85rem;
}
.se-help-form input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.se-help-form button[type="submit"] {
  appearance: none; border: 0; border-radius: 12px; padding: 0.65rem 0.9rem;
  font: inherit; font-weight: 560; color: #2a1d10; background: var(--gold); cursor: pointer;
}
.se-help-form button[type="submit"]:disabled { opacity: 0.5; cursor: default; }

/* Grouped FAQ above the help chat. */
.se-help-faq {
  flex: 0 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.5rem 0.1rem 0.2rem;
  border-bottom: 1px solid var(--line);
  min-height: 0;
}
.se-help-faq.is-expanded { max-height: 42%; }
.se-help-faq-label {
  margin: 0 0 0.45rem;
  color: var(--ink-mute);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.se-help-faq-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  margin-bottom: 0.32rem;
}
.se-help-faq-group.is-open { border-color: var(--line-strong); }
.se-help-faq-group-btn,
.se-help-faq-item-btn {
  appearance: none;
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  position: relative;
  padding: 0.62rem 1.85rem 0.62rem 0.75rem;
}
.se-help-faq-group-btn {
  font-family: var(--font-serif);
  font-size: 1.02rem;
  font-weight: 560;
  line-height: 1.3;
}
.se-help-faq-group-btn::after,
.se-help-faq-item-btn::after {
  content: "";
  position: absolute;
  right: 0.7rem;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--gold);
  border-bottom: 1.5px solid var(--gold);
  transform: translateY(-70%) rotate(45deg);
}
.se-help-faq-group.is-open > .se-help-faq-group-btn::after,
.se-help-faq-item.is-open > .se-help-faq-item-btn::after {
  transform: translateY(-20%) rotate(225deg);
}
.se-help-faq-group-btn:focus-visible,
.se-help-faq-item-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
  border-radius: 10px;
}
.se-help-faq-items { padding: 0 0.35rem 0.4rem; }
.se-help-faq-item { border-top: 1px solid var(--line); }
.se-help-faq-item-btn {
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.35;
  padding: 0.65rem 1.7rem 0.65rem 0.5rem;
  color: var(--gold-2);
}
.se-help-faq-answer {
  margin: 0 0.5rem 0.7rem;
  color: var(--ink-mute);
  font-size: 0.9rem;
  line-height: 1.45;
}
.se-help-faq-foot {
  margin: 0.25rem 0.15rem 0.1rem;
  color: var(--ink-mute);
  font-size: 0.84rem;
  line-height: 1.4;
}

.se-help-note-link {
  align-self: center; background: none; border: 0; color: var(--ink-mute);
  font: inherit; font-size: 0.84rem; text-decoration: underline; text-underline-offset: 0.2em;
  padding: 0.6rem 0 0.1rem; cursor: pointer;
}
.se-help-note-link:hover { color: var(--gold-2); }
.se-help-note { flex: 1; min-height: 0; overflow-y: auto; padding-top: 0.8rem; display: flex; flex-direction: column; }
.se-help-field { display: flex; flex-direction: column; gap: 0.35rem; margin: 0.7rem 0; }
.se-help-label { font-size: 0.86rem; color: var(--ink-mute); }
.se-help-label em { font-style: normal; color: var(--ink-mute); }
.se-help-input {
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--bg-soft); border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 0.65rem 0.85rem;
}
.se-help-input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
textarea.se-help-input { resize: none; }
.se-help-dim { color: var(--ink-mute); margin: 0 0 0.4rem; line-height: 1.45; }
.se-help-reply { color: var(--ink-mute); font-size: 0.9rem; margin: 0.2rem 0 0.8rem; }
.se-help-error { color: var(--danger, #c45c4a); font-size: 0.9rem; margin: 0.4rem 0; }
.se-help-done { font-family: var(--font-serif); font-size: 1.4rem; margin: 1.2rem 0 0.3rem; }
.se-help-center { text-align: center; }
.se-help-send, .se-help-back {
  appearance: none; border: 0; border-radius: 12px; padding: 0.75rem 0.9rem; margin-top: 0.4rem;
  font: inherit; font-weight: 560; cursor: pointer; width: 100%;
}
.se-help-send { color: #2a1d10; background: var(--gold); }
.se-help-send:disabled, .se-help-back:disabled { opacity: 0.5; cursor: default; }
.se-help-back { color: var(--ink); background: transparent; border: 1px solid var(--line-strong); }
