/* ── Settings Components (rendered inside profile content) ─────────── */

/* Setting row (toggle / info) */
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--bg2);
  border: 1px solid var(--border2); border-radius: 9px;
  margin-bottom: 8px;
}
.setting-row:last-child { margin-bottom: 0 }
.setting-row-body { flex: 1; margin-right: 16px }
.setting-row-title { font-size: 13px; color: var(--cream) }
.setting-row-sub { font-size: 11px; color: var(--muted); margin-top: 1px }

/* Toggle switch */
.setting-toggle {
  width: 38px; height: 20px; border-radius: 10px;
  background: var(--border2); cursor: pointer;
  position: relative; transition: background 0.2s;
  flex-shrink: 0;
}
.setting-toggle::after {
  content: ''; position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--muted); transition: all 0.2s;
}
.setting-toggle.on { background: var(--rose) }
.setting-toggle.on::after {
  left: 20px; background: #fff;
}

/* Select dropdown */
.setting-select {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 7px; padding: 6px 10px;
  font-family: var(--ff-body); font-size: 12px;
  color: var(--cream); outline: none; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a6d72' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  padding-right: 26px; flex-shrink: 0;
}
.setting-select option { background: var(--bg2); color: var(--cream) }

/* Volume slider */
.setting-slider-wrap {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.setting-slider {
  -webkit-appearance: none; appearance: none;
  width: 120px; height: 4px; border-radius: 2px;
  background: var(--border2); outline: none;
  cursor: pointer;
}
.setting-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--rose); border: none;
  cursor: pointer; transition: transform 0.15s;
  margin-top: -5px;
}
.setting-slider::-webkit-slider-thumb:hover { transform: scale(1.2) }
.setting-slider::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
}
.setting-slider-val {
  font-size: 11px; color: var(--muted);
  width: 32px; text-align: right; flex-shrink: 0;
}

/* Setting row right side (for toggle + preview combos) */
.setting-row-right {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}

/* Preview button */
.setting-preview-btn {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--bg2); border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.15s; flex-shrink: 0;
}
.setting-preview-btn svg { width: 12px; height: 12px; color: var(--muted) }
.setting-preview-btn:hover {
  border-color: var(--rose-30);
  background: var(--rose-bg);
}
.setting-preview-btn:hover svg { color: var(--rose) }

/* Color picker trigger */
.color-trigger {
  width: 36px; height: 28px; border-radius: 7px;
  border: 1px solid var(--border2); cursor: pointer;
  flex-shrink: 0; transition: border-color 0.15s; position: relative;
}
.color-trigger:hover { border-color: var(--cream-15) }
.color-trigger.open { border-color: var(--rose-40) }

/* Color picker dropdown */
.color-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; width: 232px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  animation: colorDropIn 0.15s ease-out;
}
@keyframes colorDropIn { from { opacity: 0; transform: translateY(-4px) } to { opacity: 1; transform: translateY(0) } }

.color-dropdown-label {
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted2); margin-bottom: 8px;
}
.color-swatches {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
  margin-bottom: 12px;
}
.color-swatch {
  width: 24px; height: 24px; border-radius: 6px;
  cursor: pointer; border: 2px solid transparent;
  transition: all 0.15s; position: relative;
}
.color-swatch:hover { transform: scale(1.15) }
.color-swatch.active { border-color: var(--cream) }
.color-swatch.active::after {
  content: ''; position: absolute; inset: 3px; border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Hex input row */
.color-hex-row {
  display: flex; align-items: center; gap: 8px;
}
.color-hex-input {
  flex: 1; background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 7px; padding: 6px 8px; font-family: var(--ff-body);
  font-size: 12px; color: var(--cream); outline: none;
  letter-spacing: 0.04em;
}
.color-hex-input:focus { border-color: var(--rose-30) }
.color-hex-preview {
  width: 28px; height: 28px; border-radius: 7px;
  border: 1px solid var(--border2); flex-shrink: 0;
}

/* Bubble preview strip */
.color-bubble-preview {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--border2);
}
.color-bubble-preview-row {
  display: flex; align-items: flex-end; gap: 8px;
}
.color-preview-av {
  width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 500;
}
.color-preview-bubble {
  padding: 6px 10px; border-radius: 10px; border-bottom-left-radius: 3px;
  font-size: 11px; color: var(--cream); max-width: 160px;
}

/* Reset link */
.setting-reset-link {
  font-size: 11px; color: var(--muted2); cursor: pointer;
  margin-top: 4px; display: inline-block; transition: color 0.15s;
}
.setting-reset-link:hover { color: var(--rose) }

/* About section */
.about-info {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--bg2);
  border: 1px solid var(--border2); border-radius: 9px;
  margin-bottom: 8px;
}
.about-info-label { font-size: 12px; color: var(--muted); flex: 1 }
.about-info-val { font-size: 13px; color: var(--cream) }

/* What's New -- one card per category */
.wn-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 9px;
  margin-bottom: 10px;
  overflow: hidden;
}
.wn-card-header {
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border2);
  font-family: var(--ff-body);
}
.wn-card-feature .wn-card-header {
  color: var(--rose);
  background: rgba(194,105,122,0.06);
}
.wn-card-improvement .wn-card-header {
  color: var(--blue);
  background: rgba(96,165,250,0.05);
}
.wn-card-fix .wn-card-header {
  color: var(--amber);
  background: rgba(251,191,36,0.05);
}
.wn-card-body {
  padding: 4px 16px 8px;
}
.wn-item {
  font-size: 12.5px; color: var(--cream);
  line-height: 1.5; padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.wn-item:last-child { border-bottom: none }
.wn-item-rich { padding: 10px 0 }
.wn-item-title {
  font-size: 13px; font-weight: 600; color: var(--cream);
  margin-bottom: 6px;
}
.wn-item-bullets {
  margin: 0; padding: 0 0 0 18px;
  list-style: disc;
}
.wn-item-bullets li {
  font-size: 12px; color: var(--muted);
  line-height: 1.55; padding: 2px 0;
}

/* Export data button */
.btn-outline {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--cream);
  padding: 9px 18px;
  border-radius: 8px;
  font-family: var(--ff-body);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-outline:hover {
  border-color: var(--rose-30);
  background: var(--rose-bg);
  color: var(--rose);
}
.btn-outline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Language selector */
.lang-selector {
  display: flex; gap: 4px;
}
.lang-opt {
  padding: 6px 14px; border-radius: 7px;
  background: var(--bg2); color: var(--muted);
  border: 1px solid var(--border2);
  font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.lang-opt:hover { border-color: var(--rose); color: var(--cream) }
.lang-opt.active {
  background: var(--rose-bg); color: var(--rose);
  border-color: var(--rose);
}

/* ── Help & Support ─────────────────────────────────────────────── */

/* Sub-topic pill tabs */
.help-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px;
}
.help-tab {
  padding: 7px 16px; border-radius: 20px;
  background: var(--bg2); color: var(--muted);
  border: 1px solid var(--border2);
  font-family: var(--ff-body); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
}
.help-tab:hover { border-color: var(--rose); color: var(--cream) }
.help-tab.active {
  background: var(--rose-bg); color: var(--rose);
  border-color: var(--rose);
}

/* Contact cards grid */
.help-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-bottom: 16px;
}
.help-card {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 10px; padding: 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.help-card-title {
  font-size: 14px; font-weight: 600; color: var(--cream);
}
.help-card-desc {
  font-size: 11px; color: var(--muted); line-height: 1.4;
  flex: 1;
}
.help-card-email {
  font-size: 12px; text-decoration: none; transition: color 0.15s;
  word-break: break-all;
}
.help-card-badge {
  font-size: 10px; color: var(--muted2); margin-top: 2px;
}

/* Card color variants */
.help-card-green .help-card-title { color: #4ade80 }
.help-card-green .help-card-email { color: #4ade80 }
.help-card-green .help-card-email:hover { color: #86efac }
.help-card-blue .help-card-title { color: #60a5fa }
.help-card-blue .help-card-email { color: #60a5fa }
.help-card-blue .help-card-email:hover { color: #93bbfd }
.help-card-rose .help-card-title { color: var(--rose) }
.help-card-rose .help-card-email { color: var(--rose) }
.help-card-rose .help-card-email:hover { color: var(--rose-light, #e8a0b0) }

.help-response-note {
  font-size: 11px; color: var(--muted2);
  margin-bottom: 20px; padding: 0 2px;
}

/* FAQ accordion */
.help-faq-list {
  display: flex; flex-direction: column; gap: 6px;
}
.help-faq-item {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 9px; overflow: hidden;
}
.help-faq-q {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; cursor: pointer; gap: 12px;
  font-size: 13px; color: var(--cream); transition: color 0.15s;
}
.help-faq-q:hover { color: var(--rose) }
.help-faq-q svg {
  width: 14px; height: 14px; flex-shrink: 0;
  color: var(--muted); transition: transform 0.2s;
}
.help-faq-item.open .help-faq-q svg { transform: rotate(180deg) }
.help-faq-a {
  max-height: 0; overflow: hidden;
  transition: max-height 0.25s ease, padding 0.25s ease;
  font-size: 12px; color: var(--muted); line-height: 1.6;
  padding: 0 16px;
}
.help-faq-item.open .help-faq-a {
  max-height: 300px; padding: 0 16px 14px;
}
.help-faq-a a { color: var(--rose); text-decoration: none }
.help-faq-a a:hover { text-decoration: underline }

/* Legal links footer */
.help-legal-row {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  margin-top: 28px; padding-top: 16px;
  border-top: 1px solid var(--border2);
}
.help-legal-link {
  font-size: 11px; color: var(--muted2);
  text-decoration: none; transition: color 0.15s;
}
.help-legal-link:hover { color: var(--rose) }

/* ── Support Tickets ───────────────────────────────────────────── */

.ticket-list-wrap, .ticket-detail-wrap {
  display: flex; flex-direction: column; gap: 8px;
}
.ticket-list-loading, .ticket-detail-loading {
  font-size: 13px; color: var(--muted); padding: 20px 0; text-align: center;
}
.ticket-empty {
  font-size: 13px; color: var(--muted); padding: 32px 0; text-align: center;
}

/* Card */
.ticket-card {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 9px; padding: 14px 16px; cursor: pointer;
  transition: border-color 0.15s;
}
.ticket-card:hover { border-color: var(--rose-30) }
.ticket-card-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.ticket-card-id {
  font-size: 12px; font-weight: 600; color: var(--cream);
}
.ticket-card-summary {
  font-size: 13px; color: var(--cream); margin-bottom: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ticket-card-meta {
  display: flex; gap: 12px; font-size: 11px; color: var(--muted);
}

/* Status badges */
.ticket-status {
  font-size: 10px; font-weight: 600; padding: 2px 8px;
  border-radius: 99px; text-transform: uppercase; letter-spacing: 0.04em;
}
.ticket-status-open { background: rgba(239, 68, 68, 0.15); color: #ef4444 }
.ticket-status-in_progress { background: rgba(234, 179, 8, 0.15); color: #eab308 }
.ticket-status-resolved { background: rgba(34, 197, 94, 0.15); color: #22c55e }
.ticket-status-closed { background: rgba(120, 113, 108, 0.15); color: var(--muted) }

/* Detail view */
.ticket-back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: none; color: var(--muted); font-size: 12px;
  cursor: pointer; padding: 4px 0; margin-bottom: 8px;
  font-family: var(--ff-body); transition: color 0.15s;
}
.ticket-back-btn:hover { color: var(--rose) }
.ticket-back-btn svg { width: 14px; height: 14px }

.ticket-detail-header { margin-bottom: 12px }
.ticket-detail-title {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.ticket-detail-summary {
  font-size: 13px; color: var(--cream); margin-top: 6px;
}

/* Conversation */
.ticket-conversation {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 400px; overflow-y: auto; padding: 4px 0;
  margin-bottom: 12px;
}
.ticket-conversation::-webkit-scrollbar { width: 3px }
.ticket-conversation::-webkit-scrollbar-thumb { background: var(--muted2); border-radius: 2px }

.ticket-msg { max-width: 85% }
.ticket-msg-user { align-self: flex-end }
.ticket-msg-admin, .ticket-msg-bot, .ticket-msg-assistant { align-self: flex-start }

.ticket-msg-meta {
  display: flex; gap: 8px; font-size: 10px; color: var(--muted2); margin-bottom: 2px;
}
.ticket-msg-role { font-weight: 600 }

.ticket-msg-text {
  padding: 8px 12px; border-radius: 10px; font-size: 13px;
  line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.ticket-msg-user .ticket-msg-text {
  background: rgba(194, 105, 122, 0.15); color: var(--cream);
  border-bottom-right-radius: 3px;
}
.ticket-msg-admin .ticket-msg-text {
  background: rgba(34, 197, 94, 0.12); color: var(--cream);
  border-bottom-left-radius: 3px;
}
.ticket-msg-bot .ticket-msg-text,
.ticket-msg-assistant .ticket-msg-text {
  background: var(--bg2); color: var(--muted);
  border-bottom-left-radius: 3px;
}

/* Reply input */
.ticket-reply-wrap {
  display: flex; flex-direction: column; gap: 8px;
}
.ticket-reply-input {
  width: 100%; min-height: 64px; max-height: 120px; resize: vertical;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 9px; padding: 10px 14px;
  font-family: var(--ff-body); font-size: 13px; color: var(--cream);
  outline: none; transition: border-color 0.15s;
  box-sizing: border-box;
}
.ticket-reply-input::placeholder { color: var(--muted2) }
.ticket-reply-input:focus { border-color: var(--rose-30) }
.ticket-reply-btn {
  align-self: flex-end; padding: 8px 20px; border-radius: 8px;
  background: var(--rose); color: #fff; border: none;
  font-family: var(--ff-body); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: opacity 0.15s;
}
.ticket-reply-btn:hover { opacity: 0.85 }
.ticket-reply-btn:disabled { opacity: 0.5; cursor: not-allowed }

.ticket-closed-notice {
  font-size: 12px; color: var(--muted); text-align: center;
  padding: 12px; background: var(--bg2); border-radius: 8px;
  border: 1px solid var(--border2);
}

/* Responsive: stack cards on narrow screens */
@media (max-width: 700px) {
  .help-cards { grid-template-columns: 1fr; }
}

/* Alias input */
.setting-alias-wrap {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.setting-alias-input {
  width: 160px; padding: 6px 10px; font-size: 13px;
  border-radius: 7px; border: 1px solid var(--border2);
  background: var(--bg2); color: var(--cream);
}
.setting-alias-input::placeholder { color: var(--muted); opacity: 0.6 }
.setting-alias-save {
  padding: 5px 12px; font-size: 12px; border-radius: 6px;
  background: var(--rose); color: #fff; border: none; cursor: pointer;
  transition: opacity 0.15s;
}
.setting-alias-save:hover { opacity: 0.85 }
.setting-alias-save:disabled { opacity: 0.5; cursor: not-allowed }

/* ── Username field ─────────────────────────────────────────────── */

.setting-username-edit {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.setting-username-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.18);
  font-size: 12px;
  color: #f59e0b;
  line-height: 1.4;
}
.setting-username-warning svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.setting-username-field {
  display: flex;
  align-items: center;
  border: 1px solid var(--border2);
  border-radius: 8px;
  background: var(--bg2);
  overflow: hidden;
}

.setting-username-at {
  padding: 8px 0 8px 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  user-select: none;
}

.setting-username-input {
  flex: 1;
  padding: 8px 12px 8px 4px;
  font-size: 14px;
  background: transparent;
  border: none;
  color: var(--cream);
  outline: none;
}

.setting-username-input::placeholder { color: var(--muted); opacity: 0.5; }

.setting-username-status {
  font-size: 12px;
  min-height: 16px;
}

.setting-username-status.checking { color: var(--muted); }
.setting-username-status.available { color: var(--green, #4caf50); }
.setting-username-status.error { color: var(--rose, #e94560); }

.setting-username-save {
  align-self: flex-start;
  padding: 7px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: var(--rose);
  color: #fff;
  transition: opacity 0.15s;
}

.setting-username-save:hover { opacity: 0.85; }
.setting-username-save:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Discord Reward Banner ──────────────────────────────────────── */

.discord-reward-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: var(--bg2);
  border: 1px solid rgba(88, 101, 242, 0.25);
  overflow: hidden;
}

.discord-reward-banner-glow {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(88, 101, 242, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.discord-reward-banner-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(88, 101, 242, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.discord-reward-banner-body {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.discord-reward-banner-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--cream);
  margin-bottom: 8px;
}

.discord-reward-banner-rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.discord-reward-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
}

.drb-tokens {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.drb-frame {
  background: rgba(88, 101, 242, 0.1);
  color: #7289da;
  border: 1px solid rgba(88, 101, 242, 0.2);
}

.drb-banner {
  background: rgba(88, 101, 242, 0.1);
  color: #7289da;
  border: 1px solid rgba(88, 101, 242, 0.2);
}
