/* ════════════════════════════════════════════════════════════════
   Research 2.0 (#page-research) — js/research.js
   Theme tokens only (--surface, --border, --charcoal, --muted, --green),
   so light and dark share one set of rules.
   ════════════════════════════════════════════════════════════════ */
.rx-wrap { --rx-soft: color-mix(in srgb, var(--charcoal) 5%, transparent); --rx-ok: #1f7a46; --rx-warn: #9a5b00; --rx-bad: #b83a2e; --rx-info: #2f5fb3;
  max-width: min(var(--orv-page-maxw, 1440px), 1400px); margin: 0 auto; padding: var(--orv-page-top, 28px) 24px 120px; color: var(--charcoal); display: flex; flex-direction: column; gap: 20px; box-sizing: border-box; width: 100%; }
body.dark-mode .rx-wrap { --rx-ok: #5fd68f; --rx-warn: #f0b04a; --rx-bad: #ff7b6b; --rx-info: #8fb4ff; }
.rx-wrap *, .rx-wrap *::before, .rx-wrap *::after { box-sizing: border-box; }
.rx-wrap :focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
@media (min-width: 1025px) { .rx-head, .rx-topbar { padding-right: 56px; } }
@media (max-width: 1024px) { .rx-wrap { padding-top: 64px; } }

/* Type */
.rx-head { display: flex; flex-direction: column; gap: 6px; }
.rx-title { margin: 0; font-size: 28px; line-height: 1.2; font-weight: 750; letter-spacing: -.02em; color: var(--charcoal); text-wrap: balance; }
.rx-title-sm { font-size: 22px; }
.rx-title:focus { outline: none; }
.rx-sub { margin: 0; max-width: 62ch; font-size: 15px; line-height: 1.5; color: var(--muted); }
.rx-h2 { margin: 0 0 12px; font-size: 18px; font-weight: 700; letter-spacing: -.01em; color: var(--charcoal); scroll-margin-top: 90px; }
.rx-h2:focus { outline: none; }
.rx-h3 { margin: 16px 0 8px; font-size: 14px; font-weight: 700; color: var(--charcoal); }
.rx-eyebrow { margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rx-lbl { display: block; font-size: 13px; font-weight: 700; color: var(--charcoal); margin-bottom: 8px; }
.rx-lbl-sm { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.rx-muted { color: var(--muted); }
.rx-hint { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.rx-note { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.rx-ref { display: inline-block; margin-left: 4px; font-size: 12px; opacity: .8; font-variant-numeric: tabular-nums; }
.rx-err { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; color: var(--rx-bad); background: color-mix(in srgb, var(--rx-bad) 9%, transparent); }
.rx-warn { margin: 6px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.45; background: color-mix(in srgb, var(--rx-warn) 10%, transparent); color: var(--charcoal); }
.rx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Controls */
.rx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-size: 13.5px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.rx-btn:disabled { opacity: .55; cursor: default; }
.rx-btn-primary { background: var(--green); color: #0a0a0a; }
.rx-btn-primary:hover:not(:disabled) { filter: brightness(.96); }
.rx-btn-ghost { background: var(--surface); color: var(--charcoal); border-color: var(--border); }
.rx-btn-ghost:hover:not(:disabled) { background: var(--rx-soft); }
.rx-btn-lg { min-height: 46px; padding: 0 22px; font-size: 15px; }
.rx-link { background: none; border: 0; padding: 2px 0; font: inherit; font-size: 13px; font-weight: 650; color: var(--charcoal); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; cursor: pointer; }
.rx-link:hover { text-decoration-color: currentColor; }
.rx-danger { color: var(--rx-bad); }
.rx-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.rx-row-between { justify-content: space-between; }
.rx-input { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--charcoal); font: inherit; font-size: 15px; line-height: 1.45; }
.rx-input:focus { outline: none; border-color: var(--charcoal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 30%, transparent); }
.rx-q { resize: vertical; min-height: 84px; }
.rx-check { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; cursor: pointer; margin-top: 8px; }
.rx-check input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--charcoal); flex-shrink: 0; }
.rx-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 10px; border-radius: 999px; background: var(--rx-soft); font-size: 12.5px; font-weight: 600; color: var(--charcoal); overflow-wrap: anywhere; }
.rx-chip-x button { border: 0; background: none; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; padding: 0 0 0 2px; }
.rx-chip-x button:hover { color: var(--charcoal); }
.rx-chip-g { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.rx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rx-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* Home */
.rx-home { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 20px; align-items: start; }
/* Wide screens: the four types side by side; business context next to the extra websites. */
@media (min-width: 1280px) {
  .rx-home .rx-types { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rx-home .rx-ctx { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; align-items: start; }
  .rx-home .rx-ctx .rx-sites { margin-top: 0; }
}
/* Readable line length for report prose on wide screens. */
.rx-body p, .rx-body li { max-width: 78ch; }
.rx-fs { border: 0; margin: 0; padding: 0; min-width: 0; }
.rx-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rx-type { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: border-color .14s, background .14s; }
.rx-type:hover { background: var(--rx-soft); }
.rx-type input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.rx-type.is-on { border-color: var(--charcoal); box-shadow: inset 0 0 0 1px var(--charcoal); }
.rx-type:has(input:focus-visible) { outline: 2px solid var(--green); outline-offset: 2px; }
.rx-type-t { font-size: 14px; font-weight: 700; }
.rx-type-d { font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.rx-youget { margin-top: 8px; }
.rx-ctx { padding-top: 14px; border-top: 1px solid var(--border); }
.rx-ctx-line { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13.5px; }
.rx-sites { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.rx-sites .rx-lbl { margin-bottom: 0; font-weight: 600; color: var(--muted); }
.rx-sites > .rx-link { align-self: flex-start; }
.rx-url-row { display: flex; gap: 8px; }
.rx-url-row .rx-input { font-size: 14px; padding: 9px 11px; }
.rx-start { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; padding-top: 16px; border-top: 1px solid var(--border); }
.rx-cost { display: flex; flex-direction: column; gap: 3px; max-width: 52ch; }
.rx-cost b { font-size: 13px; letter-spacing: .05em; text-transform: uppercase; }
.rx-cost span { font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.rx-banner { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: 14px; }
.rx-banner span:nth-child(2) { flex: 1 1 240px; }
.rx-pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); animation: rxPulse 1.6s ease-out infinite; }
@keyframes rxPulse { to { box-shadow: 0 0 0 10px transparent; } }

.rx-lib { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; min-width: 0; }
.rx-lib .rx-h2 { font-size: 15px; }
.rx-continue { display: block; width: 100%; text-align: left; margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--rx-soft); color: var(--charcoal); font: inherit; font-size: 13.5px; font-weight: 650; cursor: pointer; overflow-wrap: anywhere; }
.rx-lib-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rx-lib-item { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--border); }
.rx-lib-item:first-child { border-top: 0; }
.rx-lib-main { display: flex; flex-direction: column; gap: 2px; text-align: left; background: none; border: 0; padding: 4px 6px; margin: 0 -6px; border-radius: 8px; color: var(--charcoal); font: inherit; cursor: pointer; }
.rx-lib-main:hover:not(:disabled) { background: var(--rx-soft); }
.rx-lib-main:disabled { cursor: default; }
.rx-lib-t { font-size: 14px; font-weight: 650; line-height: 1.35; color: var(--charcoal); overflow-wrap: anywhere; }
.rx-lib-m { font-size: 12.5px; color: var(--muted); }
.rx-lib-e { font-size: 12px; color: var(--muted); }
.rx-lib-acts { display: flex; gap: 14px; }
.rx-lib-item.is-edit .rx-input { font-size: 14px; padding: 8px 10px; }
.rx-st { align-self: flex-start; margin-top: 3px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650; }
.rx-st.is-run { background: color-mix(in srgb, var(--green) 22%, transparent); color: var(--charcoal); }
.rx-st.is-fail { background: color-mix(in srgb, var(--rx-bad) 12%, transparent); color: var(--rx-bad); }

/* Progress */
.rx-progress { max-width: 640px; margin: 0 auto; width: 100%; }
.rx-q-recap { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.rx-steps { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rx-step { display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 12px; padding: 9px 0; color: var(--muted); font-size: 14.5px; }
.rx-step-dot { grid-row: span 2; width: 14px; height: 14px; margin-top: 3px; border-radius: 50%; border: 2px solid var(--border); }
.rx-step.is-done { color: var(--charcoal); }
.rx-step.is-done .rx-step-dot { background: var(--charcoal); border-color: var(--charcoal); }
.rx-step.is-on { color: var(--charcoal); font-weight: 650; }
.rx-step.is-on .rx-step-dot { border-color: var(--green); background: var(--green); animation: rxPulse 1.6s ease-out infinite; }
.rx-step-d { grid-column: 2; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.rx-elapsed { font-variant-numeric: tabular-nums; }

/* Report */
.rx-topbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.rx-back { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 13.5px; font-weight: 650; color: var(--muted); cursor: pointer; }
.rx-back:hover { color: var(--charcoal); }
.rx-rhead { display: flex; flex-direction: column; gap: 6px; max-width: 820px; }
.rx-rename { max-width: 640px; }
.rx-rename .rx-input { flex: 1 1 260px; }
.rx-meta { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.rx-report { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
.rx-toc { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.rx-toc .rx-lbl-sm { margin-bottom: 6px; }
.rx-toc a { padding: 5px 10px; margin-left: -10px; border-radius: 8px; font-size: 13px; line-height: 1.35; color: var(--muted); text-decoration: none; }
.rx-toc a:hover { color: var(--charcoal); background: var(--rx-soft); }
.rx-body { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.rx-sec { min-width: 0; }
.rx-sec + .rx-sec { padding-top: 26px; border-top: 1px solid var(--border); }
.rx-lead { margin: 0 0 6px; font-size: 16px; line-height: 1.6; max-width: 70ch; }
.rx-kc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: kc; }
.rx-kc-i { position: relative; display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 14px 16px 14px 48px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); counter-increment: kc; }
.rx-kc-i::before { content: counter(kc); position: absolute; left: 16px; top: 14px; width: 22px; height: 22px; border-radius: 50%; background: var(--charcoal); color: var(--surface); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.rx-kc-b { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rx-kc-t { margin: 0; font-size: 15px; font-weight: 650; line-height: 1.45; }
.rx-kc-b p.rx-muted { margin: 0; font-size: 13.5px; line-height: 1.45; }

.rx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.rx-icard { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.rx-icard-opp { border-left: 3px solid var(--green); }
.rx-icard-h { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; justify-content: space-between; }
.rx-icard h3 { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.rx-icard p { margin: 0; font-size: 13.5px; line-height: 1.5; }
.rx-icard-f { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.rx-site { font-size: 12.5px; color: var(--muted); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; overflow-wrap: anywhere; }
.rx-dl { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.rx-f { display: grid; grid-template-columns: minmax(96px, 34%) minmax(0, 1fr); gap: 10px; font-size: 13px; line-height: 1.45; }
.rx-f dt { color: var(--muted); }
.rx-f dd { margin: 0; overflow-wrap: anywhere; }
.rx-msg { font-weight: 600; }
.rx-ab { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; }
.rx-ab span:not(.rx-vs) { padding: 3px 9px; border-radius: 8px; background: var(--rx-soft); }
.rx-vs { color: var(--muted); font-size: 12px; }
.rx-support { display: flex; flex-direction: column; gap: 4px; padding-top: 6px; border-top: 1px dashed var(--border); }

.rx-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rx-item { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--border); }
.rx-item:first-child { border-top: 0; padding-top: 2px; }
.rx-item-b { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rx-item-b p { margin: 0; font-size: 14px; line-height: 1.5; }
.rx-bul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; line-height: 1.5; }

/* Evidence */
.rx-evline { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12px; margin-top: 2px; }
.rx-ev { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; color: var(--muted); }
.rx-ev i { font-style: normal; }
.rx-ev-source_checked { color: var(--rx-ok); }
.rx-ev-source_cited { color: var(--rx-info); }
.rx-ev-src a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 2px; }
.rx-ev-src a:hover { color: var(--charcoal); }
.rx-quote { flex-basis: 100%; }
.rx-quote summary { display: inline-block; list-style: none; cursor: pointer; color: var(--muted); font-weight: 600; }
.rx-quote summary::-webkit-details-marker { display: none; }
.rx-quote summary::before { content: '▸'; display: inline-block; margin-right: 5px; transition: transform .15s; }
.rx-quote[open] summary::before { transform: rotate(90deg); }
.rx-quote summary:hover { color: var(--charcoal); }
.rx-quote blockquote { margin: 6px 0 2px; padding: 8px 12px; border-left: 3px solid var(--rx-ok); background: var(--rx-soft); border-radius: 0 8px 8px 0; font-size: 13px; line-height: 1.5; color: var(--charcoal); }
.rx-quote cite { display: block; margin-top: 4px; font-style: normal; font-size: 12px; }
.rx-quote cite a { color: var(--muted); }

.rx-add { flex-shrink: 0; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--charcoal); font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.rx-add:hover:not(:disabled) { border-color: var(--charcoal); }
.rx-add.is-on { background: var(--charcoal); color: var(--surface); border-color: var(--charcoal); }
.rx-add:disabled { opacity: .45; cursor: default; }

.rx-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.rx-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 620px; }
.rx-table th, .rx-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-top: 1px solid var(--border); line-height: 1.45; }
.rx-table thead th { border-top: 0; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--rx-soft); }
.rx-table tbody th { font-weight: 700; white-space: nowrap; }

.rx-src { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.rx-src-i { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 13px; overflow-wrap: anywhere; }
.rx-src-i:first-child { border-top: 0; }
.rx-src-t { font-weight: 650; color: var(--charcoal); }
.rx-src-m { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12px; }
.rx-tag { padding: 1px 8px; border-radius: 999px; background: var(--rx-soft); color: var(--muted); font-weight: 650; }
.rx-tag.is-read { background: color-mix(in srgb, var(--rx-ok) 13%, transparent); color: var(--rx-ok); }
.rx-refs { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; font-size: 13px; }
.rx-refs a { color: var(--charcoal); }

/* Selection tray */
.rx-tray { position: sticky; bottom: 12px; z-index: 30; display: flex; justify-content: center; pointer-events: none; }
.rx-tray-in { pointer-events: auto; width: min(760px, 100%); padding: 12px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 14px 40px rgba(0, 0, 0, .16); display: flex; flex-direction: column; gap: 8px; }
.rx-tray-top, .rx-tray-bottom { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.rx-tray-top b { font-size: 13.5px; }
.rx-tray .rx-chips { max-height: 92px; overflow-y: auto; }
.rx-tray-bottom .rx-hint { margin: 0; flex: 1 1 240px; }

@media (max-width: 960px) {
  .rx-home { grid-template-columns: minmax(0, 1fr); }
  .rx-report { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .rx-toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; padding: 0; }
  .rx-toc .rx-lbl-sm { flex-basis: 100%; margin: 0; }
  .rx-toc a { margin: 0; border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; }
}
@media (max-width: 640px) {
  .rx-wrap { padding-left: 16px; padding-right: 16px; gap: 16px; }
  .rx-title { font-size: 24px; }
  .rx-card { padding: 18px 16px; }
  .rx-types { grid-template-columns: minmax(0, 1fr); }
  .rx-start .rx-btn-lg { width: 100%; }
  .rx-grid { grid-template-columns: minmax(0, 1fr); }
  .rx-kc-i, .rx-item { flex-direction: column; }
  .rx-f { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .rx-url-row { flex-direction: column; }
  .rx-tray { bottom: 8px; }
  .rx-tray-bottom .rx-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .rx-pulse, .rx-step.is-on .rx-step-dot { animation: none; }
  .rx-type { transition: none; }
}
/* Same left edge as Control Center, Launch and Campaigns on desktop. */
@media (min-width: 1025px) { .rx-wrap { padding-left: 40px; padding-right: 40px; } }

/* ── Research workspace (refined Home) ──────────────────────────────
   One composer in three numbered steps (direction → question → context),
   with recent research and the evidence legend beside it. */
.rx-ws { grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); }
.rx-composer { gap: 22px; padding: 24px 26px; }
.rx-stepl { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rx-stepl .rx-lbl { margin: 0; }
.rx-stepn { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border); font: 600 11.5px/1 'Geist Mono', ui-monospace, monospace; color: var(--muted); font-variant-numeric: tabular-nums; }
.rx-composer .rx-types { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rx-home .rx-composer .rx-types { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.rx-dir { padding: 12px 12px 12px; gap: 4px; transition: border-color .16s, background .16s, transform .16s; }
.rx-dir:hover { transform: translateY(-1px); }
.rx-dir-ic { width: 30px; height: 30px; display: grid; place-items: center; margin-bottom: 4px; border-radius: 9px; background: var(--rx-soft); color: var(--muted); transition: color .16s, background .16s; }
.rx-dir-ic svg { width: 18px; height: 18px; }
.rx-dir .rx-type-t { font-size: 13.5px; }
.rx-dir .rx-type-d { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rx-dir.is-on { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); background: color-mix(in srgb, var(--green) 7%, var(--surface)); }
.rx-dir.is-on .rx-dir-ic { color: #0a0a0a; background: var(--green); }
body.dark-mode .rx-dir.is-on .rx-type-t { color: #fff; }
.rx-ask .rx-q { min-height: 92px; font-size: 15px; line-height: 1.5; }
.rx-starters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.rx-starters .rx-lbl-sm { margin-right: 2px; }
.rx-starter { all: unset; box-sizing: border-box; max-width: 100%; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border); font-size: 12.5px; line-height: 1.35; color: var(--charcoal); cursor: pointer; transition: border-color .15s, background .15s; }
.rx-starter:hover { background: var(--rx-soft); border-color: color-mix(in srgb, var(--charcoal) 25%, transparent); }
.rx-starter:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.rx-composer .rx-ctx { padding-top: 18px; border-top: 1px solid var(--border); }
.rx-composer .rx-start { padding-top: 16px; border-top: 1px solid var(--border); }
.rx-aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; position: sticky; top: 20px; }
.rx-aside .rx-card { padding: 18px 18px; gap: 10px; }
.rx-aside .rx-h2 { font-size: 15px; margin: 0; }
.rx-recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rx-recent-i { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; transition: background .15s; }
.rx-recent-i:hover:not(:disabled) { background: var(--rx-soft); }
.rx-recent-i:disabled { cursor: default; opacity: .75; }
.rx-recent-i:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.rx-recent-ic { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--border); color: var(--muted); }
.rx-recent-ic svg { width: 15px; height: 15px; }
.rx-recent-b { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.rx-recent-b .rx-lib-t { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rx-recent-b .rx-lib-m { font-size: 12px; }
.rx-recent-all { align-self: flex-start; }
/* Recent research stays inside its card: items may shrink, a long title wraps to two lines. */
.rx-recent-list, .rx-recent-list > li, .rx-recent-i { min-width: 0; max-width: 100%; }
.rx-recent-b .rx-lib-t { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.rx-legend { margin: 4px 0 0; display: grid; gap: 10px; }
.rx-legend dt { margin: 0 0 2px; font-size: 12.5px; }
.rx-legend dd { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
/* Views enter softly; nothing moves for reduced motion. */
#rsRoot[data-view] > * { animation: rx-in .28s cubic-bezier(.22, .61, .36, 1) both; }
@keyframes rx-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (max-width: 1100px) {
  .rx-ws { grid-template-columns: minmax(0, 1fr); }
  .rx-aside { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .rx-aside { grid-template-columns: minmax(0, 1fr); }
  .rx-composer { padding: 18px 16px; }
  .rx-composer .rx-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  #rsRoot[data-view] > * { animation: none; }
  .rx-dir, .rx-dir:hover { transition: none; transform: none; }
}

/* ── Research start: three areas + Saved research (2026-11-25 refinement) ──
   Two columns, two rows; every card in a row the same height, actions at the bottom. */
.rx-areas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.rx-area { gap: 12px; }
.rx-area-top { display: flex; align-items: center; gap: 12px; }
.rx-area-top .rx-h2 { margin: 0; }
.rx-area-ic { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; flex: none; color: var(--og-deep, #2E7D32); background: color-mix(in srgb, var(--og-mid, #7CCB45) 16%, transparent); border: 1px solid color-mix(in srgb, var(--og-mid, #7CCB45) 35%, transparent); }
body.dark-mode .rx-area-ic { color: var(--og-fresh, #C9F27A); }
.rx-area-ic svg { width: 19px; height: 19px; }
.rx-area-d { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; max-width: 60ch; }
.rx-area-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; font-size: 13.5px; color: var(--c2, var(--charcoal)); }
.rx-area-list li { display: flex; gap: 9px; align-items: baseline; }
.rx-area-list li::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; transform: translateY(-1px); background: var(--og-mid, #7CCB45); }
.rx-area-acts { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.rx-area--saved .rx-recent-list { margin: 0; }
.rx-area-empty { flex: 1 1 auto; display: grid; align-content: center; padding: 14px 16px; border: 1px dashed var(--border); border-radius: 12px; background: var(--og-card-soft, transparent); }
.rx-area-empty p { margin: 0; }
.rx-back { all: unset; cursor: pointer; align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.rx-back:hover, .rx-back:focus-visible { color: var(--charcoal); text-decoration: underline; text-underline-offset: 3px; }
.rx-tool { gap: 10px; }
@media (max-width: 900px) { .rx-areas { grid-template-columns: minmax(0, 1fr); } }
/* Area view: the form and the side column end level (the last side card takes the rest). */
@media (min-width: 1001px) {
  .rx-home.rx-ws { align-items: stretch; }
  .rx-ws > .rx-aside { position: static; }
  .rx-ws > .rx-aside > .rx-card:last-child { flex: 1 1 auto; }
}
.rx-home .rx-composer .rx-types:has(> .rx-dir:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rx-ask > .rx-youget { margin: -2px 0 2px; }
.rx-how--fold { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.rx-how--fold > summary { cursor: pointer; list-style: none; display: flex; font-size: 13px; font-weight: 600; color: var(--muted); align-items: center; justify-content: space-between; gap: 10px; margin: 0; }
.rx-how--fold > summary::-webkit-details-marker { display: none; }
.rx-how--fold > summary::after { content: ''; width: 8px; height: 8px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg); opacity: .6; flex: none; }
.rx-how--fold[open] > summary::after { transform: rotate(-135deg); }
/* The form's start row sits at the bottom of its card when the side column is taller. */
.rx-ws .rx-composer > .rx-start { margin-top: auto; }
.rx-other { display: grid; gap: 8px; }
.rx-other-i { all: unset; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--og-card-soft, transparent); font-size: 14px; color: var(--charcoal); }
.rx-other-i:hover, .rx-other-i:focus-visible { border-color: color-mix(in srgb, var(--og-mid, #7CCB45) 55%, transparent); }
.rx-other-i .rx-area-ic { width: 32px; height: 32px; border-radius: 9px; }
