/* Ryviu Q&A storefront widgets. Colours come from CSS variables set from the widget settings. */
.rqa, .rfaq { box-sizing: border-box; font: inherit; line-height: 1.5; max-width: 1200px; margin: 32px auto; padding: 0 16px; }
.rqa *, .rfaq * { box-sizing: border-box; }
.rqa { color: var(--rqa-text, #1a1a1a); }
.rqa svg, .rfaq svg { width: 16px; height: 16px; flex: none; }

/* header + tools */
.rqa-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.rqa-title, .rfaq-title { margin: 0; font-size: 22px; font-weight: 700; color: inherit; }
.rqa-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--rqa-accent, #5d865a); background: var(--rqa-accent, #5d865a); color: #fff; border-radius: 6px; padding: 9px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.rqa-btn:disabled { opacity: .6; cursor: default; }
.rqa-btn-outline { background: transparent; color: var(--rqa-accent, #5d865a); }
.rqa-tools { display: flex; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.rqa-search, .rfaq-search { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--rqa-border, #e5e7eb); border-radius: 6px; padding: 0 12px; background: #fff; color: #888; }
.rqa-search input, .rfaq-search input { flex: 1; border: 0; outline: 0; padding: 10px 0; font: inherit; color: #1a1a1a; background: transparent; min-width: 0; }
.rqa-sort { border: 1px solid var(--rqa-border, #e5e7eb); border-radius: 6px; padding: 9px 12px; font: inherit; background: #fff; color: inherit; }

/* questions */
.rqa-question { border-bottom: 1px solid var(--rqa-border, #e5e7eb); padding: 18px 0; }
.rqa-q { display: flex; gap: 12px; }
.rqa-q-mark { flex: none; width: 28px; height: 28px; border-radius: 6px; background: var(--rqa-accent, #5d865a); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.rqa-q-body { flex: 1; min-width: 0; }
.rqa-q-text { font-weight: 600; font-size: 16px; word-wrap: break-word; }
.rqa-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 13px; opacity: .8; margin-top: 2px; }
.rqa-author { font-weight: 600; }
.rqa-date::before, .rqa-count::before { content: "·"; margin-right: 10px; }
.rqa-answers { margin: 10px 0 0 40px; display: grid; gap: 10px; }
.rqa-answer { background: var(--rqa-bg, #fff); border: 1px solid var(--rqa-border, #e5e7eb); border-radius: 8px; padding: 12px 14px; }
.rqa-answer .rqa-meta { opacity: 1; margin: 0 0 6px; }
.rqa-avatar { width: 24px; height: 24px; border-radius: 50%; background: #eef0f2; color: #555; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.rqa-owner .rqa-avatar { background: var(--rqa-accent, #5d865a); color: #fff; }
.rqa-avatar svg { width: 14px; height: 14px; }
.rqa-badge { font-size: 11px; font-weight: 700; color: var(--rqa-accent, #5d865a); border: 1px solid currentColor; border-radius: 999px; padding: 0 8px; }
.rqa-text { white-space: pre-line; word-wrap: break-word; }
.rqa-none { font-size: 14px; opacity: .6; }
.rqa-q-actions { display: flex; align-items: center; gap: 16px; margin: 10px 0 0 40px; flex-wrap: wrap; }
.rqa-votes { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; opacity: .85; margin-top: 6px; }
.rqa-q-actions .rqa-votes { margin-top: 0; }
.rqa-vote { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 2px 4px; font: inherit; color: inherit; cursor: pointer; border-radius: 4px; }
.rqa-vote svg { width: 14px; height: 14px; }
.rqa-vote b { font-weight: 500; }
.rqa-vote.on { color: var(--rqa-accent, #5d865a); }
.rqa-link { border: 0; background: none; padding: 0; font: inherit; font-size: 14px; font-weight: 600; color: var(--rqa-accent, #5d865a); cursor: pointer; text-decoration: underline; }
.rqa-empty { padding: 28px 0; text-align: center; opacity: .7; }
.rqa-more { text-align: center; margin-top: 18px; }

/* forms */
/* Ask / answer forms open in a modal over the page */
.rqa-modal {
  --rqa-accent: #5d865a; --rqa-text: #1a1a1a; --rqa-border: #e5e7eb; --rqa-bg: #fff;
  position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(0, 0, 0, .55); color: var(--rqa-text); font-size: 14px; line-height: 1.5;
  opacity: 0; transition: opacity .2s ease;
}
.rqa-modal.rqa-open { opacity: 1; }
.rqa-modal *, .rqa-modal *::before, .rqa-modal *::after { box-sizing: border-box; }
.rqa-modal button { font: inherit; cursor: pointer; }
.rqa-modal-box {
  position: relative; width: min(560px, 100%); max-height: 100%; overflow-x: hidden; overflow-y: auto; border-radius: 12px;
  background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); transform: translateY(12px) scale(.98); transition: transform .2s ease;
}
.rqa-modal.rqa-open .rqa-modal-box { transform: none; }
.rqa-modal-close {
  position: absolute; top: 12px; right: 12px; display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .06); color: var(--rqa-text);
}
.rqa-modal-close svg { display: block; width: 18px; height: 18px; }
html.rqa-no-scroll { overflow: hidden; }
.rqa-form { margin: 0; padding: 32px 32px 28px; background: #fff; text-align: left; }
.rqa-form-title { margin: 0 36px 6px; padding: 0; font-size: 22px; font-weight: 700; line-height: 1.3; text-align: center; color: var(--rqa-text); }
.rqa-form-desc { margin: 0 0 22px; font-size: 14px; text-align: center; color: #6b7280; }
.rqa-form-context { margin: 12px 0 22px; padding: 12px 14px; border-left: 3px solid var(--rqa-accent); border-radius: 0 8px 8px 0; background: #f6f7f8; font-size: 14px; font-weight: 600; white-space: pre-line; word-wrap: break-word; }
.rqa-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; font-size: 14px; }
.rqa-label { font-size: 13px; font-weight: 600; color: var(--rqa-text); }
.rqa-label i { font-style: normal; color: #d92d20; }
.rqa-field input, .rqa-field textarea {
  width: 100%; margin: 0; padding: 11px 13px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; color: #1a1a1a;
  font: inherit; font-size: 14px; line-height: 1.4; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); transition: border-color .15s, box-shadow .15s;
}
.rqa-field textarea { min-height: 104px; resize: vertical; }
.rqa-field input::placeholder, .rqa-field textarea::placeholder { color: #98a2b3; }
.rqa-field input:focus, .rqa-field textarea:focus { outline: none; border-color: var(--rqa-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rqa-accent) 22%, transparent); }
.rqa-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.rqa-help { margin: -6px 0 16px; font-size: 12px; color: #6b7280; }
.rqa-hp { position: absolute !important; left: 0 !important; top: 0 !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.rqa-form-error { margin: 0 0 12px; padding: 9px 12px; border-radius: 8px; background: #fef3f2; color: #b42318; font-size: 13px; }
.rqa-form-error:empty { display: none; }
.rqa-form-actions { display: flex; gap: 10px; margin-top: 6px; }
.rqa-form-actions .rqa-btn { flex: 1; }
.rqa-modal .rqa-btn { min-height: 44px; padding: 10px 22px; border-radius: 8px; font-size: 15px; }
.rqa-modal .rqa-btn:hover { opacity: .9; }
.rqa-modal .rqa-btn:disabled { opacity: .55; cursor: default; }
.rqa-login { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 44px 32px 36px; }
.rqa-login .rqa-form-title { margin: 0; }
.rqa-thanks { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 52px 32px 44px; text-align: center; }
.rqa-thanks p { margin: 0; font-size: 17px; font-weight: 600; color: var(--rqa-text); }
.rqa-done-icon { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: var(--rqa-accent, #5d865a); color: #fff; font-size: 28px; }
@media (max-width: 600px) {
  .rqa-answers, .rqa-q-actions { margin-left: 0; }
  .rqa-modal { align-items: flex-end; padding: 0; }
  .rqa-modal-box { width: 100%; max-height: 92%; border-radius: 16px 16px 0 0; }
  .rqa-form { padding: 26px 18px 20px; }
  .rqa-row { grid-template-columns: 1fr; }
}

/* FAQ */
.rfaq { color: var(--rfaq-q, #1a1a1a); }
.rfaq-title { margin-bottom: 16px; text-align: center; }
.rfaq-search { margin: 0 auto 20px; max-width: 520px; border-color: var(--rfaq-border, #e1e3e5); }
.rfaq-cat { font-size: 17px; font-weight: 700; margin: 24px 0 10px; color: var(--rfaq-q, #1a1a1a); }
.rfaq-item { border: 1px solid var(--rfaq-border, #e1e3e5); background: var(--rfaq-bg, #f6f6f7); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.rfaq-item summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; font-weight: 600; color: var(--rfaq-q, #1a1a1a); }
.rfaq-item summary::-webkit-details-marker { display: none; }
.rfaq-icon { display: inline-flex; color: var(--rfaq-accent, #6d7175); transition: transform .2s; }
.rfaq-item[open] .rfaq-icon-chevron { transform: rotate(180deg); }
.rfaq-item[open] .rfaq-icon-plus { transform: rotate(45deg); }
.rfaq-a { padding: 0 16px 16px; color: var(--rfaq-a, #4a4a4a); white-space: pre-line; word-wrap: break-word; }
.rfaq-tabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 16px; }
.rfaq-tab { border: 1px solid var(--rfaq-border, #e1e3e5); background: #fff; color: var(--rfaq-q, #1a1a1a); border-radius: 999px; padding: 6px 16px; font: inherit; cursor: pointer; }
.rfaq-tab.on { background: var(--rfaq-accent, #6d7175); border-color: var(--rfaq-accent, #6d7175); color: #fff; }
.rfaq-empty { text-align: center; opacity: .7; padding: 20px 0; }

/* Pro-only widget on the Free plan: shown to the merchant in the theme editor only. */
.rqa-locked {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
  margin: 16px 0;
  padding: 28px 24px;
  border: 1px dashed #d4a017;
  border-radius: 8px;
  background: #fffbeb;
  color: #5c4400;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

/* Question count block: hidden by the block itself, shown once the app embed (this stylesheet) is on. */
body .ryviu-qa-count { display: flex !important; }
