/* ============================================================
   HELP & SUPPORT — dedicated full-page app (report an issue)
   Theme-agnostic (uses tokens); light overrides via body.light.
   ============================================================ */

.help-wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 72px;
}

.help-head { margin-bottom: 26px; }
.help-title {
  margin: 0 0 6px;
  font: 700 30px/1.15 var(--ff-sans);
  letter-spacing: -0.02em;
  color: var(--tx);
}
.help-sub {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--t3);
}

.help-card {
  background: var(--bg2);
  border: 1px solid var(--b1);
  border-radius: 16px;
  padding: 26px 26px 24px;
  box-shadow: var(--shadow-sm);
}
.help-card-head { margin-bottom: 22px; }
.help-card-title {
  font: 600 18px/1.3 var(--ff-sans);
  letter-spacing: -0.01em;
  color: var(--tx);
  margin-bottom: 4px;
}
.help-card-desc { font-size: 13.5px; line-height: 1.5; color: var(--t3); }

.help-field { margin-bottom: 20px; }
.help-label {
  display: block;
  font: 600 13px/1 var(--ff-sans);
  color: var(--tx);
  margin-bottom: 9px;
}
.help-optional { font-weight: 400; color: var(--t3); margin-left: 4px; }

.help-input,
.help-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--b2);
  border-radius: 10px;
  color: var(--tx);
  font: 400 14px/1.5 var(--ff-sans);
  padding: 12px 14px;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.help-input { height: 46px; padding: 0 14px; }
.help-textarea { resize: vertical; min-height: 150px; }
.help-input::placeholder,
.help-textarea::placeholder { color: var(--t4); }
.help-input:focus,
.help-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-line);
}

/* Attachment dropzone */
.help-drop {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 26px 18px;
  background: var(--bg);
  border: 1.5px dashed var(--b3);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.help-drop:hover { border-color: var(--accent); background: var(--bg3); }
.help-drop-ic {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--bg2); border: 1px solid var(--b1); color: var(--t3);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 3px;
}
.help-drop-ic svg { width: 20px; height: 20px; }
.help-drop-tx { font: 500 14px/1 var(--ff-sans); color: var(--tx); }
.help-drop-hint { font-size: 12px; color: var(--t4); }

/* Attachment preview */
.help-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--b1);
  border-radius: 12px;
}
.help-preview-img {
  width: 64px; height: 64px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--b1); flex-shrink: 0;
}
.help-preview-meta { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.help-preview-name {
  font-size: 13px; color: var(--t2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.help-preview-remove {
  align-self: flex-start; border: none; background: none; padding: 0; cursor: pointer;
  font: 500 13px/1 var(--ff-sans); color: var(--red, #e5484d);
}
.help-preview-remove:hover { text-decoration: underline; }

.help-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.help-actions-center { justify-content: center; }
.help-submit {
  height: 44px; padding: 0 22px; border: none; border-radius: 10px; cursor: pointer;
  background: var(--tx); color: var(--fill-ink);
  font: 600 14px/1 var(--ff-sans);
  transition: background .12s ease, transform .06s ease, opacity .12s ease;
}
.help-submit:hover { background: var(--t2); }
.help-submit:active { transform: scale(.98); }
.help-submit:disabled { opacity: .55; cursor: default; }
.help-submit-ghost {
  background: var(--bg2); color: var(--tx); border: 1px solid var(--b2);
}
.help-submit-ghost:hover { background: var(--bg3); }

/* Success state */
.help-success { text-align: center; padding: 44px 28px; }
.help-success-ic {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 16px;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.help-success-ic svg { width: 28px; height: 28px; }
.help-success-title { font: 600 20px/1.2 var(--ff-sans); color: var(--tx); margin-bottom: 8px; }
.help-success-desc { font-size: 14px; line-height: 1.6; color: var(--t3); max-width: 46ch; margin: 0 auto 22px; }

/* ── Admin: submitted-reports queue ─────────────────────── */
.help-admin { margin-top: 22px; }
.help-admin-empty { font-size: 14px; color: var(--t3); padding: 12px 0; }
.help-admin-list { display: flex; flex-direction: column; gap: 12px; }
.help-report {
  border: 1px solid var(--b1); border-radius: 12px; padding: 15px 16px; background: var(--bg);
}
.help-report.is-resolved { opacity: .68; }
.help-report-top { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.help-report-heading {
  flex: 1; min-width: 0; font: 600 14.5px/1.35 var(--ff-sans); color: var(--tx);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.help-report-badge {
  flex-shrink: 0; font: 600 11px/1 var(--ff-sans); padding: 4px 9px; border-radius: 9999px;
  text-transform: uppercase; letter-spacing: .03em;
}
.help-report-badge.open     { color: #b45309; background: rgba(245,158,11,.14); }
.help-report-badge.resolved { color: #15803d; background: rgba(22,163,74,.14); }
.help-report-meta { font-size: 12px; color: var(--t3); margin-bottom: 9px; }
.help-report-body {
  font-size: 13.5px; line-height: 1.55; color: var(--t2); white-space: pre-wrap;
  word-break: break-word; margin-bottom: 12px;
}
.help-report-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.help-report-btn {
  border: 1px solid var(--b2); background: var(--bg2); color: var(--t2); cursor: pointer;
  font: 500 12.5px/1 var(--ff-sans); padding: 7px 12px; border-radius: 8px;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.help-report-btn:hover { background: var(--bg3); color: var(--tx); border-color: var(--b3); }
.help-report-img { margin-top: 12px; }
.help-report-img img { max-width: 100%; border: 1px solid var(--b1); border-radius: 8px; display: block; }
.help-report-imgnote { font-size: 12.5px; color: var(--t3); }

.help-report-badge.answered { color: #1d4ed8; background: rgba(37,99,235,.13); }

/* Existing admin reply shown inside a report card (operator queue) */
.help-report-reply {
  margin: 4px 0 12px; padding: 12px 14px; border-radius: 10px;
  background: var(--bg3); border: 1px solid var(--b1);
}
.help-report-reply-head { font: 600 11.5px/1 var(--ff-sans); color: var(--t3); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 7px; }
.help-report-reply-body { font-size: 13px; line-height: 1.55; color: var(--t2); white-space: pre-wrap; word-break: break-word; }

/* Reply editor */
.help-reply { margin-top: 12px; }
.help-reply-input {
  width: 100%; min-height: 96px; resize: vertical;
  background: var(--bg2); border: 1px solid var(--b2); border-radius: 10px;
  color: var(--tx); font: 400 13.5px/1.5 var(--ff-sans); padding: 11px 13px;
}
.help-reply-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-line); }
.help-reply-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 9px; }
.help-report-btn.primary { background: var(--tx); color: var(--fill-ink); border-color: var(--tx); }
.help-report-btn.primary:hover { background: var(--t2); color: var(--fill-ink); border-color: var(--t2); }

/* ── My requests — the reporter's own ticket tracker ────── */
.help-mine { margin-top: 22px; }
.help-ticket-list { display: flex; flex-direction: column; gap: 12px; }
.help-ticket {
  border: 1px solid var(--b1); border-radius: 12px; padding: 15px 16px; background: var(--bg);
}
.help-ticket-top { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.help-ticket-heading {
  flex: 1; min-width: 0; font: 600 14.5px/1.35 var(--ff-sans); color: var(--tx);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.help-ticket-badge {
  flex-shrink: 0; font: 600 11px/1 var(--ff-sans); padding: 4px 9px; border-radius: 9999px;
  text-transform: uppercase; letter-spacing: .03em;
}
.help-ticket-badge.open     { color: #b45309; background: rgba(245,158,11,.14); }
.help-ticket-badge.answered { color: #1d4ed8; background: rgba(37,99,235,.13); }
.help-ticket-badge.resolved { color: #15803d; background: rgba(22,163,74,.14); }
.help-ticket-meta { font-size: 12px; color: var(--t3); margin-bottom: 9px; }
.help-ticket-body {
  font-size: 13.5px; line-height: 1.55; color: var(--t2); white-space: pre-wrap;
  word-break: break-word; margin-bottom: 12px;
}
.help-ticket-pending {
  font-size: 12.5px; color: var(--t3); font-style: italic;
  padding: 10px 12px; background: var(--bg3); border-radius: 9px;
}
.help-ticket-reply {
  background: var(--bg2);
  border: 1px solid var(--b1);
  border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 12px 14px;
}
.help-ticket-reply-head {
  display: flex; align-items: center; gap: 7px;
  font: 600 12px/1 var(--ff-sans); color: var(--tx); margin-bottom: 8px;
}
.help-ticket-reply-head svg { width: 15px; height: 15px; color: var(--accent); }
.help-ticket-reply-body { font-size: 13.5px; line-height: 1.6; color: var(--t2); white-space: pre-wrap; word-break: break-word; }

@media (max-width: 560px) {
  .help-wrap { padding: 28px 16px 56px; }
  .help-card { padding: 20px 18px; }
  .help-actions { flex-direction: column-reverse; }
  .help-submit { width: 100%; }
}
