/**
 * Help Page Styles — Gist Brand-Aligned
 *
 * What this file is:
 * - Styles for the public help page at gist.is/help.
 * - Covers header, footer, login form, support form, voice recording, attachments.
 * - Ported from extension support-message-modal.css with full-page adaptations.
 *
 * Why this file exists:
 * - The help page needs its own stylesheet (not bundled in admin.css).
 * - Keeps help-specific styles isolated from other pages.
 * - Matches the Gist brand system (brand.ts / brand.css).
 *
 * Brand alignment:
 * - Colors match brand.ts Color constants and extension brand.css tokens.
 * - Typography uses Inter (brand typeface) — same as homepage and extension.
 * - Sunrise gradient uses all 3 stops: #FF6B6B → #FFD93D → #FF8E53.
 * - Spacing follows the 4px grid from brand.css.
 *
 * Related files:
 * - packages/backend/src/ssr/help.ts (loads this stylesheet)
 * - packages/backend/src/ssr/brand.ts (brand constants — colors, fonts, wordmark)
 * - packages/backend/src/client/help.ts (renders the UI)
 * - packages/chrome-plugin/extension/ui/brand.css (extension design system)
 */

/* ============================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   Aligned with brand.ts Color + extension brand.css
   ============================================ */
:root {
  /* Text hierarchy — matches brand.ts Color.ink / inkSecondary / inkTertiary */
  --help-ink: #1C1C24;
  --help-ink-secondary: #4a4a4a;
  --help-ink-tertiary: #666666;
  --help-ink-faint: #b0b0b0;
  --help-ink-light: #F5F5F5;

  /* Surfaces — matches brand.ts Color.paper / wash */
  --help-surface: #ffffff;
  --help-wash: #FAFAFA;

  /* Borders — matches brand.ts Color.border */
  --help-border: #e8e8e8;
  --help-border-light: #f0f0f0;

  /* Brand gradient — full sunrise (3 stops) matching brand.ts Gradient */
  --help-gradient-start: #FF6B6B;
  --help-gradient-mid: #FFD93D;
  --help-gradient-end: #FF8E53;
  --help-gradient: linear-gradient(135deg, var(--help-gradient-start), var(--help-gradient-mid), var(--help-gradient-end));

  /* Feedback */
  --help-error: #dc2626;
  --help-error-wash: #fef2f2;
  --help-success: #10B981;
  --help-success-wash: rgba(16, 185, 129, 0.12);
  --help-accent: #FF6B6B;

  /* Typography — Inter, matching brand.ts Font.family */
  --help-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;

  /* Spacing — 4px grid from brand.css */
  --help-space-1: 4px;
  --help-space-2: 8px;
  --help-space-3: 12px;
  --help-space-4: 16px;
  --help-space-5: 20px;
  --help-space-6: 24px;
  --help-space-8: 32px;

  /* Shadows */
  --help-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --help-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --help-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --help-shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.08);

  /* Radii — matches brand.css scale */
  --help-radius-sm: 8px;
  --help-radius-md: 12px;
  --help-radius-lg: 16px;
  --help-radius-xl: 20px;
  --help-radius-full: 9999px;
}

/* ============================================
   BASE STYLES
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--help-font-sans);
  color: var(--help-ink);
  background: var(--help-wash);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* ============================================
   HEADER — Matches homepage fixed header
   ============================================ */
.help-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  background: rgba(250, 250, 250, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s;
}

@media (min-width: 1024px) {
  .help-header {
    padding: 24px 48px;
  }
}

.help-header__wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.08em;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--help-ink);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.help-header__wordmark:hover {
  opacity: 0.7;
}

.help-header__wordmark svg {
  width: 0.9em;
  height: 1.5em;
}

.help-header__nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.help-header__link {
  font-size: 15px;
  font-weight: 500;
  color: var(--help-ink-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.help-header__link:hover {
  color: var(--help-ink);
}

.help-header__cta {
  font-size: 15px;
  font-weight: 500;
  color: var(--help-ink-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.help-header__cta:hover {
  color: var(--help-ink);
}


/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.help-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 96px;
  padding-bottom: 48px;
}

/* ============================================
   CONTAINER
   ============================================ */
.help-container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--help-space-6);
}

/* ============================================
   FOOTER — Matches homepage/policy footer
   ============================================ */
.help-footer {
  background: var(--help-gradient);
  color: var(--help-ink);
  padding: 64px 24px;
  text-align: center;
}

@media (min-width: 1024px) {
  .help-footer {
    padding: 80px 48px;
  }
}

.help-footer__inner {
  max-width: 800px;
  margin: 0 auto;
}

.help-footer__headline {
  margin: 0 0 28px 0;
  font-family: var(--help-font-sans);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--help-ink);
}

.help-footer__cta {
  display: inline-block;
  padding: 14px 32px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  border-radius: var(--help-radius-sm);
  background: var(--help-ink);
  color: var(--help-ink-light);
  transition: opacity 0.15s ease;
}

.help-footer__cta:hover {
  opacity: 0.85;
}

.help-footer__divider {
  height: 1px;
  background: rgba(28, 28, 36, 0.2);
  margin: 32px 0 24px;
}

.help-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  font-size: 14px;
}

.help-footer__links a {
  color: var(--help-ink);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.help-footer__links a:hover {
  color: rgba(28, 28, 36, 0.7);
}

/* ============================================
   LOADING STATE
   ============================================ */
.help-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--help-space-4);
  padding: var(--help-space-8);
}

.help-loading__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--help-border);
  border-top-color: var(--help-gradient-start);
  border-radius: 50%;
  animation: help-spin 0.8s linear infinite;
}

@keyframes help-spin {
  to { transform: rotate(360deg); }
}

.help-loading__text {
  margin: 0;
  color: var(--help-ink-secondary);
  font-size: 0.9375rem;
}

/* ============================================
   PAGE LAYOUT
   ============================================ */
.help-page {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: var(--help-space-6);
  animation: help-fade-in 0.4s ease-out;
}

@keyframes help-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   HEADER (in-page)
   ============================================ */
.help-page__header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--help-space-3);
}

.help-page__header--compact {
  flex-direction: row;
  justify-content: space-between;
  text-align: left;
  padding: var(--help-space-4) 0;
  border-bottom: 1px solid var(--help-border);
  margin-bottom: var(--help-space-2);
}

.help-page__wordmark {
  display: flex;
  align-items: center;
  gap: var(--help-space-2);
  text-decoration: none;
  color: var(--help-ink);
  font-weight: 700;
  font-size: 1.25rem;
}

.help-page__wordmark svg {
  width: 28px;
  height: 44px;
}

.help-page__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--help-radius-md);
  background: var(--help-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-page__icon svg {
  width: 28px;
  height: 28px;
  color: #1C1C24;
}

.help-page__title {
  margin: 0;
  font-family: var(--help-font-sans);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.help-page__subtitle {
  margin: 0;
  color: var(--help-ink-secondary);
  font-size: 1rem;
  max-width: 320px;
}

.help-page__user {
  display: flex;
  align-items: center;
  gap: var(--help-space-3);
}

.help-page__email {
  font-size: 0.875rem;
  color: var(--help-ink-secondary);
}

.help-page__signout {
  padding: var(--help-space-2) var(--help-space-3);
  font-family: var(--help-font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--help-ink-tertiary);
  background: transparent;
  border: 1px solid var(--help-border);
  border-radius: var(--help-radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.help-page__signout:hover {
  background: var(--help-wash);
  color: var(--help-ink);
}

/* ============================================
   LOGIN FORM
   ============================================ */
.help-login {
  background: var(--help-surface);
  border-radius: var(--help-radius-xl);
  padding: var(--help-space-8);
  box-shadow: var(--help-shadow-xl);
  border: 1px solid var(--help-border-light);
}

.help-login__error {
  margin: 0 0 var(--help-space-4) 0;
  padding: var(--help-space-3) var(--help-space-4);
  background: var(--help-error-wash);
  border: 1px solid var(--help-error);
  border-radius: var(--help-radius-sm);
  font-size: 0.875rem;
  color: var(--help-error);
}

.help-login__form {
  display: flex;
  flex-direction: column;
  gap: var(--help-space-4);
}

.help-form-field {
  display: flex;
  flex-direction: column;
  gap: var(--help-space-2);
}

.help-form-field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--help-ink);
}

.help-form-field input {
  width: 100%;
  padding: var(--help-space-3) var(--help-space-4);
  font-family: var(--help-font-sans);
  font-size: 1rem;
  color: var(--help-ink);
  background: var(--help-surface);
  border: 1px solid var(--help-border);
  border-radius: var(--help-radius-md);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.help-form-field input::placeholder {
  color: var(--help-ink-faint);
}

.help-form-field input:focus {
  outline: none;
  border-color: var(--help-gradient-start);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

.help-login__divider {
  display: flex;
  align-items: center;
  gap: var(--help-space-4);
  margin: var(--help-space-5) 0;
  color: var(--help-ink-faint);
  font-size: 0.8125rem;
}

.help-login__divider::before,
.help-login__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--help-border);
}

.help-login__note {
  margin: var(--help-space-5) 0 0 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--help-ink-secondary);
}

.help-login__note a {
  color: var(--help-gradient-start);
  font-weight: 600;
  text-decoration: none;
}

.help-login__note a:hover {
  text-decoration: underline;
}

/* ============================================
   BUTTONS
   ============================================ */
.help-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--help-space-2);
  width: 100%;
  padding: var(--help-space-4);
  font-family: var(--help-font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  border-radius: var(--help-radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.help-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.help-btn--primary {
  color: #1C1C24;
  background: var(--help-gradient);
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.25);
}

.help-btn--primary:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 107, 107, 0.35);
}

.help-btn--google {
  color: var(--help-ink);
  background: var(--help-surface);
  border: 1px solid var(--help-border);
}

.help-btn--google:not(:disabled):hover {
  background: var(--help-wash);
}

.help-btn--ghost {
  color: var(--help-ink);
  background: var(--help-surface);
  border: 1px solid var(--help-border);
}

.help-btn--ghost:not(:disabled):hover {
  background: var(--help-wash);
}

.help-btn--google svg {
  flex-shrink: 0;
}

/* ============================================
   FORM CARD
   ============================================ */
.help-form-card {
  background: var(--help-surface);
  border-radius: var(--help-radius-xl);
  padding: var(--help-space-8);
  box-shadow: var(--help-shadow-xl);
  border: 1px solid var(--help-border-light);
}

.help-form-card__header {
  display: flex;
  align-items: flex-start;
  gap: var(--help-space-4);
  margin-bottom: var(--help-space-5);
}

.help-form-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--help-radius-md);
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(255, 217, 61, 0.1), rgba(255, 142, 83, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.help-form-card__icon svg {
  width: 24px;
  height: 24px;
  color: var(--help-gradient-start);
}

.help-form-card__title {
  margin: 0 0 2px 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.help-form-card__subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: var(--help-ink-tertiary);
}

/* ============================================
   FORM CONTENT
   ============================================ */
.help-form-error {
  margin: 0 0 var(--help-space-4) 0;
  padding: var(--help-space-3) var(--help-space-4);
  background: var(--help-error-wash);
  border: 1px solid var(--help-error);
  border-radius: var(--help-radius-sm);
  font-size: 0.875rem;
  color: var(--help-error);
}

.help-form-error--info {
  background: rgba(59, 130, 246, 0.1);
  border-color: #3b82f6;
  color: #1d4ed8;
}

.help-form-description {
  margin: 0 0 var(--help-space-4) 0;
  font-size: 0.9375rem;
  color: var(--help-ink-secondary);
  line-height: 1.55;
}

/* ============================================
   EXTENSION DEBUG TOGGLE
   ============================================ */
.help-debug {
  display: flex;
  flex-direction: column;
  gap: var(--help-space-3);
  padding: var(--help-space-5);
  margin-bottom: var(--help-space-4);
  border-radius: var(--help-radius-lg);
  background: var(--help-wash);
  border: 1px solid var(--help-border);
}

.help-debug__header {
  display: flex;
  flex-direction: column;
  gap: var(--help-space-2);
}

.help-debug__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--help-ink);
}

.help-debug__subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: var(--help-ink-tertiary);
  line-height: 1.5;
}

.help-debug__status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--help-space-4);
}

.help-debug__status-left {
  display: flex;
  align-items: center;
  gap: var(--help-space-2);
  flex-wrap: wrap;
}

.help-debug__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--help-ink-faint);
}

.help-debug__dot--pending {
  background: var(--help-ink-faint);
}

.help-debug__dot--ok {
  background: #10B981;
}

.help-debug__dot--active {
  background: #f97316;
}

.help-debug__dot--warn {
  background: #f59e0b;
}

.help-debug__dot--error {
  background: #ef4444;
}

.help-debug__status-text {
  font-size: 0.875rem;
  color: var(--help-ink);
  font-weight: 600;
}

.help-debug__version {
  font-size: 0.75rem;
  color: var(--help-ink-tertiary);
}

.help-debug__toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.help-toggle-input {
  appearance: none;
  width: 44px;
  height: 24px;
  background: var(--help-border);
  border-radius: 999px;
  border: none;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}

.help-toggle-input::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--help-surface);
  transition: transform 0.2s ease;
  box-shadow: var(--help-shadow-sm);
}

.help-toggle-input:checked {
  background: var(--help-gradient-start);
}

.help-toggle-input:checked::after {
  transform: translateX(20px);
}

.help-toggle-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.help-toggle-pill {
  display: none;
}

.help-debug__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--help-space-2) var(--help-space-4);
  border-radius: var(--help-radius-full);
  border: 1px solid var(--help-border);
  background: var(--help-surface);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--help-ink);
  text-decoration: none;
  transition: all 0.15s ease;
  width: fit-content;
}

.help-debug__cta:hover {
  background: var(--help-ink);
  color: var(--help-surface);
  border-color: var(--help-ink);
}

.help-debug-consent {
  display: flex;
  flex-direction: column;
  gap: var(--help-space-3);
  padding: var(--help-space-4);
  border-radius: var(--help-radius-md);
  background: var(--help-surface);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.help-debug-consent__copy {
  margin: 0;
  font-size: 0.875rem;
  color: var(--help-ink-tertiary);
}

.help-debug-consent__actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--help-space-3);
}

/* ============================================
   MESSAGE INPUT
   ============================================ */
.help-message {
  margin-bottom: var(--help-space-4);
}

.help-message textarea {
  width: 100%;
  min-height: 120px;
  padding: var(--help-space-4);
  font-family: var(--help-font-sans);
  font-size: 0.9375rem;
  color: var(--help-ink);
  background: var(--help-surface);
  border: 1px solid var(--help-border);
  border-radius: var(--help-radius-md);
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  line-height: 1.5;
}

.help-message textarea::placeholder {
  color: var(--help-ink-faint);
}

.help-message textarea:focus {
  outline: none;
  border-color: var(--help-gradient-start);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

.help-char-count {
  text-align: right;
  font-size: 0.75rem;
  color: var(--help-ink-faint);
  margin-top: var(--help-space-2);
}

/* ============================================
   VOICE NOTE
   ============================================ */
.help-attachments {
  display: flex;
  flex-direction: column;
  gap: var(--help-space-4);
  margin-bottom: var(--help-space-6);
}

.help-voice-block {
  display: flex;
  flex-direction: column;
  gap: var(--help-space-3);
}

.help-voice-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--help-space-3);
  padding: var(--help-space-6);
  background: var(--help-wash);
  border-radius: var(--help-radius-lg);
}

.help-record-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--help-gradient);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
}

.help-record-btn svg {
  width: 32px;
  height: 32px;
  color: #1C1C24;
}

.help-record-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.help-record-btn:active {
  transform: scale(0.98);
}

.help-record-hint {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--help-ink);
}

.help-record-limit {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--help-ink-tertiary);
}

/* Voice recorder (recording state) */
.help-voice-recorder {
  background: var(--help-wash);
  border-radius: var(--help-radius-lg);
  padding: var(--help-space-6);
}

.help-recorder-active {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--help-space-4);
}

.help-recording-indicator {
  display: flex;
  align-items: center;
  gap: var(--help-space-2);
}

.help-rec-dot {
  width: 12px;
  height: 12px;
  background: #ff4444;
  border-radius: 50%;
  animation: help-rec-pulse 1s ease-in-out infinite;
}

@keyframes help-rec-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.help-rec-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #ff4444;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.help-recording-timer {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--help-ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.help-waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 48px;
}

.help-wave-bar {
  width: 4px;
  height: 20px;
  background: var(--help-gradient-start);
  border-radius: 2px;
  animation: help-wave-anim 0.8s ease-in-out infinite;
}

.help-wave-bar:nth-child(1) { animation-delay: 0s; }
.help-wave-bar:nth-child(2) { animation-delay: 0.1s; }
.help-wave-bar:nth-child(3) { animation-delay: 0.2s; }
.help-wave-bar:nth-child(4) { animation-delay: 0.3s; }
.help-wave-bar:nth-child(5) { animation-delay: 0.4s; }
.help-wave-bar:nth-child(6) { animation-delay: 0.3s; }
.help-wave-bar:nth-child(7) { animation-delay: 0.2s; }
.help-wave-bar:nth-child(8) { animation-delay: 0.1s; }
.help-wave-bar:nth-child(9) { animation-delay: 0s; }

@keyframes help-wave-anim {
  0%, 100% { height: 20px; }
  50% { height: 40px; }
}

.help-stop-btn {
  display: flex;
  align-items: center;
  gap: var(--help-space-2);
  padding: var(--help-space-3) var(--help-space-5);
  background: var(--help-surface);
  border: 1px solid var(--help-border);
  border-radius: var(--help-radius-full);
  font-family: var(--help-font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--help-ink);
  cursor: pointer;
  transition: all 0.15s ease;
}

.help-stop-btn svg {
  width: 16px;
  height: 16px;
  color: #ff4444;
}

.help-stop-btn:hover {
  background: var(--help-ink);
  color: var(--help-surface);
  border-color: var(--help-ink);
}

/* Voice playback */
.help-voice-playback {
  background: var(--help-wash);
  border-radius: var(--help-radius-lg);
  padding: var(--help-space-5);
}

.help-playback-header {
  display: flex;
  align-items: center;
  gap: var(--help-space-2);
  margin-bottom: var(--help-space-4);
}

.help-playback-header svg {
  width: 18px;
  height: 18px;
  color: var(--help-ink-tertiary);
}

.help-playback-header span {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--help-ink);
  flex: 1;
}

.help-remove-voice {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--help-ink-faint);
  cursor: pointer;
  transition: all 0.15s ease;
}

.help-remove-voice svg {
  width: 16px;
  height: 16px;
}

.help-remove-voice:hover {
  background: var(--help-error-wash);
  color: var(--help-error);
}

.help-playback-controls {
  display: flex;
  align-items: center;
  gap: var(--help-space-4);
}

.help-play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--help-ink);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.help-play-btn svg {
  width: 20px;
  height: 20px;
  color: var(--help-surface);
  margin-left: 2px;
}

.help-play-btn:hover {
  transform: scale(1.05);
}

.help-playback-progress {
  flex: 1;
  min-width: 0;
}

.help-progress-bar {
  height: 6px;
  background: var(--help-border);
  border-radius: 3px;
  overflow: hidden;
}

.help-progress-fill {
  height: 100%;
  background: var(--help-gradient);
  width: 0%;
  transition: width 0.1s linear;
}

.help-progress-time {
  display: flex;
  justify-content: space-between;
  margin-top: var(--help-space-2);
  font-size: 0.75rem;
  color: var(--help-ink-tertiary);
  font-variant-numeric: tabular-nums;
}

.help-rerecord-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--help-space-2);
  padding: var(--help-space-2) var(--help-space-4);
  margin-top: var(--help-space-3);
  background: transparent;
  border: none;
  font-family: var(--help-font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--help-ink-tertiary);
  cursor: pointer;
  transition: color 0.15s ease;
}

.help-rerecord-btn svg {
  width: 16px;
  height: 16px;
}

.help-rerecord-btn:hover {
  color: var(--help-ink);
}

/* ============================================
   ATTACHMENTS
   ============================================ */
.help-attachment-block {
  display: flex;
  flex-direction: column;
  gap: var(--help-space-3);
  padding: var(--help-space-5);
  background: var(--help-wash);
  border-radius: var(--help-radius-lg);
}

.help-attachment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--help-space-3);
  flex-wrap: wrap;
}

.help-attachment-copy {
  display: flex;
  flex-direction: column;
  gap: var(--help-space-1);
  flex: 1;
  min-width: 200px;
}

.help-attachment-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--help-ink);
}

.help-attachment-note {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--help-ink-tertiary);
}

.help-attachment-button {
  padding: var(--help-space-2) var(--help-space-4);
  border-radius: var(--help-radius-full);
  border: 1px solid var(--help-border);
  background: var(--help-surface);
  font-family: var(--help-font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--help-ink);
  cursor: pointer;
  transition: all 0.15s ease;
}

.help-attachment-button:hover {
  background: var(--help-ink);
  color: var(--help-surface);
  border-color: var(--help-ink);
}

.help-attachments-input {
  display: none;
}

.help-attachments-list {
  display: flex;
  flex-direction: column;
  gap: var(--help-space-2);
}

.help-attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--help-space-3);
  padding: var(--help-space-3);
  border-radius: var(--help-radius-md);
  border: 1px solid var(--help-border);
  background: var(--help-surface);
}

.help-attachment-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.help-attachment-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--help-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.help-attachment-details {
  font-size: 0.75rem;
  color: var(--help-ink-tertiary);
}

.help-attachment-remove {
  border: none;
  background: transparent;
  font-family: var(--help-font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--help-ink-tertiary);
  cursor: pointer;
  transition: color 0.15s ease;
}

.help-attachment-remove:hover {
  color: var(--help-ink);
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */
.help-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--help-space-2);
  width: 100%;
  padding: var(--help-space-4) var(--help-space-5);
  font-family: var(--help-font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1C1C24;
  background: var(--help-gradient);
  border: none;
  border-radius: var(--help-radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.25);
}

.help-submit svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.help-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.help-submit:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 107, 107, 0.35);
}

.help-submit:not(:disabled):hover svg {
  transform: translateX(2px);
}

.help-submit--ghost {
  background: var(--help-surface);
  color: var(--help-ink);
  border: 1px solid var(--help-border);
  box-shadow: none;
}

.help-submit--ghost:not(:disabled):hover {
  background: var(--help-wash);
  transform: translateY(-1px);
  box-shadow: none;
}

/* ============================================
   SUCCESS STATE
   ============================================ */
.help-success {
  text-align: center;
  padding: var(--help-space-4) 0;
}

.help-success__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--help-space-4) auto;
  border-radius: 50%;
  background: var(--help-success-wash);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--help-success);
}

.help-success__icon svg {
  width: 28px;
  height: 28px;
}

.help-success h3 {
  margin: 0 0 var(--help-space-2) 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--help-ink);
}

.help-success p {
  margin: 0 0 var(--help-space-4) 0;
  font-size: 0.9375rem;
  color: var(--help-ink-secondary);
  line-height: 1.5;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
  .help-container {
    padding: var(--help-space-4);
  }

  .help-login,
  .help-form-card {
    padding: var(--help-space-6);
  }

  .help-page__header--compact {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--help-space-3);
  }

  .help-page__user {
    width: 100%;
    justify-content: space-between;
  }

  .help-attachment-header {
    flex-direction: column;
    align-items: stretch;
  }

  .help-attachment-button {
    width: 100%;
    text-align: center;
  }

  .help-debug-consent-btn {
    width: 100%;
  }

  .help-header__nav {
    gap: 20px;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .help-page,
  .help-loading__spinner,
  .help-record-btn,
  .help-rec-dot,
  .help-wave-bar {
    animation: none;
  }

  .help-submit,
  .help-btn,
  .help-record-btn {
    transition: none;
  }
}

/* ============================================
   HIDDEN UTILITY
   ============================================ */
[hidden] {
  display: none !important;
}
