/* Customer research: a wide sheet with tabs (Campaigns, Customers, Conversations, WhatsApp Templates), a 5-step guide, results.
   Same quiet palette as the Analysis app. */
.an-sheet.rs { width: min(980px, 100vw); }
.rs .an-sheet-body { padding-bottom: 32px; }
.rs-tabs { display: flex; gap: 4px; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.rs-tab { position: relative; border: 0; background: none; padding: 10px 12px; font-weight: 500; color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.rs-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.rs-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; }
.rs-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rs-spacer { flex: 1; }
.rs-muted { color: var(--muted); font-size: 14px; }
.rs-h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.rs-card { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 18px; margin-bottom: 12px; }
.rs-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px;
  font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.rs-chip.is-ok { background: var(--ok-soft); color: var(--ok-ink); }
.rs-chip.is-warn { background: var(--warn-soft); color: var(--warn-ink); }
.rs-chip.is-bad { background: var(--danger-soft); color: var(--danger-ink); }
.rs-chip.is-live { background: var(--info-soft); color: var(--info-ink); }
.rs-bar { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; display: flex; margin: 10px 0 6px; }
.rs-bar span { display: block; height: 100%; }
.rs-bar .b1 { background: var(--info-ink); } .rs-bar .b2 { background: #2e90fa; } .rs-bar .b3 { background: var(--ok); }
.rs-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.rs-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }

/* empty state: the two kinds of research */
.rs-hero { text-align: center; padding: 18px 0 8px; }
.rs-hero h3 { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.02em; }
.rs-hero p { margin: 0 auto 20px; max-width: 560px; color: var(--muted); }
.rs-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; text-align: left; }
.rs-kind { all: unset; box-sizing: border-box; display: block; cursor: pointer; padding: 18px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); transition: border-color 0.15s, box-shadow 0.15s; }
.rs-kind:hover, .rs-kind:focus-visible { border-color: var(--ink); box-shadow: 0 6px 20px -12px rgba(0, 0, 0, 0.3); }
.rs-kind b { display: block; font-size: 16px; margin-bottom: 4px; }
.rs-kind span { color: var(--muted); font-size: 14px; }
.rs-kind em { display: block; margin-top: 10px; font-style: normal; font-size: 13px; color: var(--ink-2); }

/* the guide */
.rs-steps { display: flex; gap: 6px; margin: 0 0 22px; padding: 0; list-style: none; font-size: 12.5px; }
.rs-steps li { flex: 1; display: flex; flex-direction: column; gap: 7px; color: var(--faint); }
.rs-steps li::before { content: ""; height: 3px; border-radius: 2px; background: var(--line); }
.rs-steps li.is-done, .rs-steps li.is-now { color: var(--ink-2); }
.rs-steps li.is-done::before, .rs-steps li.is-now::before { background: var(--ink); }
.rs-nav { display: flex; gap: 10px; justify-content: space-between; margin-top: 22px; padding-top: 16px;
  border-top: 1px solid var(--line); }
.rs-drop { display: grid; place-items: center; gap: 8px; padding: 34px 16px; border: 2px dashed var(--line);
  border-radius: 14px; background: var(--sunken); text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.rs-drop:hover, .rs-drop.is-over { border-color: var(--ink); background: var(--surface); }
.rs-drop b { font-size: 16px; }
.rs-drop input { display: none; }
.rs-format { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 10px 0 4px; }
.rs-format th, .rs-format td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.rs-format th { color: var(--muted); font-weight: 500; }
.rs-format code { font-size: 12.5px; background: var(--line-2); padding: 1px 5px; border-radius: 4px; }
.rs-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; }
.rs-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rs-table th, .rs-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.rs-table td.wrap { white-space: normal; min-width: 220px; }
.rs-table th { background: var(--sunken); color: var(--muted); font-weight: 500; }
.rs-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 12px 0; }
.rs-stat { padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.rs-stat b { display: block; font-size: 22px; letter-spacing: -0.02em; }
.rs-stat span { font-size: 13px; color: var(--muted); }
.rs-field { display: block; margin: 12px 0; }
.rs-field > span { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; }
.rs-input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit;
  font-size: 15px; background: var(--surface); }
textarea.rs-input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.rs-input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.1); }
.rs-error { margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger-ink);
  border: 1px solid var(--danger-soft); font-size: 14px; }
.rs-note { margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: var(--line-2); color: var(--ink-2); font-size: 14px; }

/* products */
.rs-product { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.rs-product h4 { margin: 0; font-size: 15px; }
.rs-product p { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); white-space: pre-line; max-height: 4.6em; overflow: hidden; }
.rs-product p.is-open { max-height: none; }
.rs-product a { font-size: 13px; color: var(--muted); word-break: break-all; }
.rs-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.rs-pick { margin-top: 10px; }
.rs-pick button.rs-page { display: block; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface);
  border-radius: 8px; padding: 8px 10px; margin-top: 6px; cursor: pointer; font-size: 13.5px; }
.rs-pick button.rs-page:hover { border-color: var(--ink); }

/* channel and mode choices */
.rs-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.rs-choice { position: relative; display: block; padding: 16px; border: 1.5px solid var(--line); border-radius: 12px;
  cursor: pointer; background: var(--surface); }
.rs-choice input { position: absolute; opacity: 0; pointer-events: none; }
.rs-choice:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.08); }
.rs-choice:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.rs-choice b { display: block; margin-bottom: 4px; }
.rs-choice span { font-size: 13.5px; color: var(--muted); }
.rs-q { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.rs-q .rs-input { flex: 1; }
.rs-q-n { flex: none; width: 24px; height: 42px; display: grid; place-items: center; color: var(--muted); font-weight: 600; }
.rs-icon-btn { flex: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  cursor: pointer; color: var(--muted); font-size: 18px; }
.rs-icon-btn:hover { color: var(--ink); border-color: var(--ink); }
.rs-wa { max-width: 420px; padding: 14px; border-radius: 14px; background: #e7f6e7; color: #111; }
.rs-wa div { background: #fff; color: #111; border-radius: 10px 10px 10px 2px; padding: 10px 12px; font-size: 14px; line-height: 1.45;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08); }
.rs-check { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border: 1px solid var(--line);
  border-radius: 12px; margin: 14px 0; cursor: pointer; }
.rs-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); }
.rs-summary { margin: 0; padding: 0; list-style: none; }
.rs-summary li { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.rs-summary li span { width: 150px; flex: none; color: var(--muted); }

/* results */
.rs-score { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.rs-score b { font-size: 44px; letter-spacing: -0.03em; line-height: 1; }
.rs-dist { flex: 1; min-width: 220px; }
.rs-dist div { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin: 3px 0; }
.rs-dist i { display: block; height: 8px; border-radius: 4px; background: #fdb022; }
.rs-themes { display: flex; flex-wrap: wrap; gap: 6px; }
.rs-themes span { padding: 5px 10px; border-radius: 999px; background: var(--line-2); font-size: 13px; }
.rs-quote { margin: 0 0 10px; padding: 10px 14px; border-left: 3px solid var(--ink); background: var(--sunken); border-radius: 0 10px 10px 0;
  font-size: 14px; }
.rs-quote cite { display: block; margin-top: 4px; font-style: normal; font-size: 12.5px; color: var(--muted); }

/* inbox */
.rs-inbox { display: grid; grid-template-columns: 300px 1fr; min-height: 460px; border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; background: var(--surface); }
.rs-list { border-right: 1px solid var(--line); overflow-y: auto; max-height: 62vh; }
.rs-item { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 12px 14px; border-bottom: 1px solid var(--line-2);
  cursor: pointer; }
.rs-item:hover, .rs-item[aria-current="true"] { background: var(--sunken); }
.rs-item b { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.rs-item span { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-chat { display: flex; flex-direction: column; min-width: 0; }
.rs-chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.rs-chat-head small { display: block; color: var(--muted); font-size: 12.5px; }
.rs-msgs { flex: 1; overflow-y: auto; max-height: 50vh; padding: 16px; background: var(--sunken); display: flex; flex-direction: column; gap: 8px; }
.rs-msg { max-width: 78%; padding: 8px 12px; border-radius: 12px; font-size: 14px; line-height: 1.45; white-space: pre-wrap;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06); }
.rs-msg.in { align-self: flex-start; background: var(--surface); border-bottom-left-radius: 3px; }
.rs-msg.out { align-self: flex-end; background: var(--accent-soft); border-bottom-right-radius: 3px; }
.rs-msg small { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.rs-compose { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.rs-compose textarea { flex: 1; min-height: 42px; height: 42px; }
.rs-empty { padding: 40px 16px; text-align: center; color: var(--muted); }

@media (max-width: 720px) {
  .rs-inbox { grid-template-columns: 1fr; }
  .rs-inbox.is-chat .rs-list { display: none; }
  .rs-inbox:not(.is-chat) .rs-chat { display: none; }
  .rs-summary li span { width: 110px; }
  .rs-steps span { display: none; }
}
.rs .an-btn:disabled, .rs .an-btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* WhatsApp opening messages: a bubble with WhatsApp's footer line, name buttons, plain-word checks */
.rs-wa .rs-wa-foot { display: block; margin-top: 6px; padding: 0 4px; font-size: 12px; color: #667085; }
.rs-tpl { margin-bottom: 10px; }
.rs-tpl .rs-row { margin-bottom: 10px; }
.rs-tpl .rs-row b { display: inline; margin: 0; }
.rs-choice.rs-tpl .rs-wa { margin-top: 2px; }
.rs-editor { display: grid; gap: 10px; }
.rs-editor textarea { min-height: 96px; resize: vertical; font: inherit; line-height: 1.45; }
.rs-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rs-chip-btn { padding: 4px 10px; border-radius: 999px; font-size: 13px; background: var(--info-soft); color: var(--info-ink);
  border-color: var(--border); }
.rs-chip-btn::before { content: "+ "; }
.rs-code { margin: 6px 0 8px; font-size: 32px; font-weight: 700; letter-spacing: 8px; font-variant-numeric: tabular-nums; }
.rs-problem { color: var(--danger-ink); }
.rs-themes.is-problems span { background: var(--danger-soft); color: var(--danger-ink); }
.rs-report { padding: 8px 0; border-top: 1px solid var(--line); }
.rs-report summary { cursor: pointer; font-weight: 500; }
.rs-report ul { margin: 8px 0 0; padding-left: 20px; font-size: 14px; }
@media (max-width: 720px) {
  .rs-code { font-size: 26px; letter-spacing: 6px; }
  .rs-tabs { overflow-x: auto; }
  .rs-tab { white-space: nowrap; }
}

/* email campaigns: the first email as customers see it, and the interviewer's background box */
.rs-context { width: 100%; min-height: 72px; resize: vertical; font: inherit; line-height: 1.45; }
.rs-email { margin: 6px 0 14px; }
.rs-mail { max-width: 560px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.rs-mail-from { padding: 10px 14px 0; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.rs-mail-subject { padding: 2px 14px 10px; font-weight: 600; border-bottom: 1px solid var(--line); }
.rs-mail-body { padding: 12px 14px; white-space: pre-wrap; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }

/* WhatsApp messages */
.rs-msg-head { align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.rs-msg-head > div:first-child { flex: 1 1 360px; }
.rs-msg-head .rs-muted { margin: 4px 0 0; max-width: 640px; }
.rs-msg-actions { margin: 0; }
.rs-msg-filters { margin: 12px 0 14px; }
.rs-msg-list { display: flex; flex-direction: column; gap: 12px; }
.rs-empty { padding: 24px 0; text-align: center; }
.rs-tpl-name { display: flex; flex-direction: column; min-width: 0; }
.rs-tpl-meta { font-size: 12.5px; color: var(--muted); }
.rs-tpl-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; max-width: 420px; }
.rs-tpl-button { flex: 1 1 120px; padding: 7px 10px; border-radius: 10px; background: var(--surface);
  border: 1px solid var(--border); color: var(--info-ink); text-align: center; font-size: 13px; font-weight: 500; }
.rs-tpl-foot { margin: 8px 0 0; font-size: 12.5px; }
.rs-fills { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--sunken); }
.rs-fills-head { font-weight: 600; font-size: 13.5px; margin-bottom: 8px; }
.rs-fill { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; }
.rs-fill-slot { min-width: 64px; font: 600 12.5px var(--font-mono); color: var(--accent-ink); }
.rs-fill-select { width: auto; min-width: 160px; }
.rs-fill-text { flex: 1 1 180px; }
.rs-fill-text[hidden] { display: none; }
.rs-fill-ex { font-size: 12.5px; color: var(--muted); }

/* WhatsApp messages, shared by the Inbox and Customer research */
.wm { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.wm-head { display: flex; align-items: center; gap: 8px; }
.wm-head .rs-h3 { margin: 0; flex: 1; }
.wm-back { padding: 0 10px; }
.wm-lead { margin: 0; }
.wm-scroll { min-height: 0; }
.ib-read-pane > .wm .wm-scroll { flex: 1; overflow: auto; }
.wm-list { display: flex; flex-direction: column; gap: 8px; }
.wm-card { padding: 0; overflow: hidden; }
.wm-name { display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: 100%; padding: 14px 16px;
  border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.wm-name-row { display: flex; align-items: center; gap: 8px; width: 100%; }
.wm-name b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-line { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-guide { display: grid; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--sunken); }
.wm-guide p { margin: 0; }
.wm-guide-title { font-weight: 600; }
.wm-example { font-size: 14px; line-height: 1.45; padding: 10px 12px; border-radius: 10px; background: var(--surface); }
.wm-guide-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13.5px; }
.wm-guide-list li + li { margin-top: 4px; }
.wm-editor { align-items: start; }
.wm-work { display: grid; gap: 2px; min-width: 0; }
.wm-side { min-width: 0; }
.wm-side .rs-wa { max-width: 100%; }
.wm-side .rs-wa div { overflow-wrap: anywhere; }
.wm-side-label { margin: 0 0 6px; }
.wm-heads { display: flex; flex-wrap: wrap; gap: 6px; }
.wm-heads .wm-headtype { width: auto; height: 36px; min-height: 0; padding: 0 12px; border-radius: 999px; font-weight: 500; }
.wm-heads .wm-headtype.is-on { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.wm-filebox { margin-top: 8px; }
.wm-filebox[hidden] { display: none; }
.wm-vars { display: grid; gap: 8px; }
.wm-var { display: grid; gap: 4px; padding: 12px; border-radius: 12px; background: var(--sunken); }
.wm-var .rs-field { margin: 0; }
.wm-var-label { font-size: 13px; font-weight: 600; }
.wm-var-hint { margin: 0; color: var(--muted); font-size: 13px; }
.wm-var-line { margin: 0; font-size: 13.5px; }
.wm-file-input { display: block; width: 100%; font: inherit; font-size: 14px; }
.wm-file-note { margin: 4px 0 0; }
.wm-media { display: block; width: 100%; max-height: 180px; object-fit: cover; border-radius: 10px 10px 0 0; }
.wm-file { padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.wm-view { display: grid; gap: 10px; }
.wm-view-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wm-view-title .rs-h3 { margin: 0; }
.wm-view-actions { position: sticky; bottom: 0; padding: 10px 0; background: var(--bg); }
.wm-editor .rs-input, .wm-var .rs-input { width: 100%; }
.wm-detail { padding: 0 16px 16px; display: grid; gap: 8px; }
.wm-newbar { position: sticky; bottom: 0; display: flex; padding: 10px 0; background: var(--bg); }
.wm-newbar[hidden] { display: none; }
.wm-newbar .an-btn { width: auto; height: 36px; }
.wm-save { justify-content: flex-start; }
.wm-save .an-btn { flex: 0 0 auto; width: auto; height: 36px; min-height: 0; }
@media (min-width: 840px) {
  .wm-editor { grid-template-columns: minmax(0, 1fr) 280px; }
  .wm-save { grid-column: 1 / -1; }
  .wm-side { position: sticky; top: 8px; }
}
@media (max-width: 839px) {
  .wm-side { padding-bottom: 84px; }
  .wm-save { position: sticky; bottom: 0; z-index: 2; padding: 10px 0 4px; background: var(--bg); }
}
@media (max-width: 760px) {
  .wm-name { padding: 16px; }
  .wm-view-actions .an-btn { min-height: 44px; }
  .ib-wa-row .an-btn { padding: 0 10px; font-size: 13.5px; }
}
