/* Portal support and feedback outlet styles (2026-10-03).
   Uses the existing design tokens only. Mobile-first, thumb-reachable, big
   targets (Fitts), clear focus (WCAG), no new dashboard. */

/* ---- always-visible floating outlet (every buyer surface) ---- */
.support-fab {
  position: fixed;
  right: 14px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  min-width: 48px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(27, 39, 51, 0.25);
}
.support-fab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--brand-accent, #DA7B46);
  color: #1B2733;
  font-weight: 800;
}

/* ---- the outlet panel (native dialog: focus trap + Esc for free) ---- */
.support-dialog {
  width: min(560px, 94vw);
  max-height: 88vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--paper);
  color: var(--ink);
}
.support-dialog::backdrop { background: rgba(27, 39, 51, 0.45); }
.support-dialog h2 { margin-top: 0; }

.support-form { margin: 0; }
.support-form fieldset {
  border: 0;
  margin: 0 0 4px;
  padding: 0;
}
.support-form legend {
  font-weight: 600;
  padding: 0;
  margin-bottom: 6px;
}
.support-kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.support-kind {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
  margin: 0;
}
.support-kind input { width: auto; min-height: 0; margin: 0; }
.support-kind:has(input:checked) {
  border-color: var(--brand-accent, #DA7B46);
  box-shadow: inset 0 0 0 1px var(--brand-accent, #DA7B46);
  font-weight: 700;
}
.support-kind input:focus-visible + span,
.support-kind:focus-within { outline: 3px solid var(--signal); outline-offset: 2px; }

.support-hint { margin: 0 0 10px; font-size: 0.82rem; }

.support-status {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 600;
}
.support-status.ok { background: #E7F3EC; color: #12502C; }
.support-status.err { background: var(--warn-bg); color: var(--warn-ink); }

/* ---- the outlet page ---- */
.support-intro { max-width: 60ch; }

.support-history-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.support-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--ink);
  color: var(--paper);
}
.support-badge-fixed, .support-badge-answered { background: var(--ok); }
.support-badge-escalated, .support-badge-linked { background: var(--signal); }
.support-history-when { font-size: 0.8rem; }
.support-history-msg { margin: 4px 0; }
.support-history-update { margin: 4px 0 0; }
.support-history-list { list-style: none; padding: 0; margin: 0; }
.support-history-item {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.support-history-item:first-child { border-top: 0; }

@media (prefers-reduced-motion: no-preference) {
  .support-dialog[open] { animation: support-pop 0.12s ease-out; }
  @keyframes support-pop { from { transform: translateY(6px); opacity: 0.6; } to { transform: none; opacity: 1; } }
}

/* ==========================================================================
   DARK MODE (2026-10-11): the support outlet follows the theme.
   ========================================================================== */
[data-theme="dark"] .support-status.ok { background: #12331F; color: #7BD79A; }
[data-theme="dark"] .support-status.err { background: #3A1B14; color: #F0957F; }
[data-theme="dark"] .support-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
