/* report-assistant.css: "Ask about this report", the three questions on the $99 Market report (the plan of 3 Oct 2026,
 * sections 2 and 10 B2; assets/js/report-assistant.js). The dashboard's panel (css/assistant.css), drawn in the report's
 * own tokens (report-view.css :root: --bg, --surface, --surface2, --line, --ink, --mint, --gold ...), so it wears whatever
 * dress the report wears. A drawer on a wide screen, a full-screen sheet at phone width (760 px and below, the report's own
 * phone line), no sideways scroll, every phone control at least 44 px, and never on paper.
 * CSP: style-src 'self'; everything here is a class. No accent stripe down the left of anything: full borders only. */

.ra-panel, .ra-open {
  --ra-mint-line: color-mix(in srgb, var(--mint) 45%, transparent);
  --ra-gold-line: color-mix(in srgb, var(--gold) 45%, transparent);
  --ra-blue: var(--blue, #7fb4e8);
  --ra-blue-soft: color-mix(in srgb, var(--ra-blue) 10%, transparent);
  --ra-blue-line: color-mix(in srgb, var(--ra-blue) 45%, transparent);
}

/* ── the button: the rail above the chapters on a wide screen, a pill at the foot of a phone's screen ── */
.ra-open { appearance: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  margin: 0 0 18px; padding: 10px 12px; border: 1px solid var(--ra-mint-line); border-radius: 10px; background: var(--mint-soft);
  color: var(--mint); font: 600 13px/1.25 var(--body); text-align: left; cursor: pointer; }
.ra-open[hidden] { display: none; }
.ra-open:hover { background: color-mix(in srgb, var(--mint) 18%, transparent); }
.ra-open:focus-visible, .ra-panel :focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ra-open-n { flex: 0 0 auto; font: 600 11.5px var(--mono); color: var(--mint); white-space: nowrap; }
/* a phone: a pill of its own at the foot of the screen (the strip at the top has no room for a fourth control) */
.ra-open.is-float { position: fixed; right: 16px; bottom: 16px; z-index: 60; width: auto; max-width: calc(100% - 32px); margin: 0;
  border-radius: 999px; min-height: 44px; padding: 10px 16px; background: var(--surface); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6); }
.ra-open.is-float:hover { background: var(--surface2); }

/* ── the panel ── */
.ra-scrim { position: fixed; inset: 0; z-index: 2147482100; background: rgba(4, 8, 7, .55); }
.ra-scrim[hidden], .ra-panel[hidden] { display: none; }
/* the body's lock is its own class (never .ra-open, the button's: the review of 3 Oct, M1) */
body.ra-locked { overflow: hidden; }
.ra-panel:focus { outline: none; }
.ra-panel { position: fixed; top: 18px; right: 18px; bottom: 18px; z-index: 2147482101; width: min(520px, calc(100% - 36px));
  display: flex; flex-direction: column; overflow: hidden; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6); font: 400 14.5px/1.55 var(--body); }
.ra-panel *, .ra-panel *::before, .ra-panel *::after { min-width: 0; box-sizing: border-box; }
.ra-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ra-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 6px; }
.ra-top h2 { margin: 0; font: 700 22px/1.1 var(--disp); color: var(--ink); letter-spacing: 0; }
.ra-x { appearance: none; flex: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: transparent;
  color: var(--ink2); font: 400 22px/1 var(--body); cursor: pointer; }
.ra-x:hover { background: var(--surface2); color: var(--ink); }
.ra-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 18px 8px; }
.ra-left { font: 600 11.5px/1.3 var(--mono); color: var(--gold); background: var(--gold-soft); border: 1px solid var(--ra-gold-line);
  border-radius: 999px; padding: 3px 10px; }
.ra-left.is-zero { color: var(--ink3); background: var(--surface2); border-color: var(--line); }
.ra-of { font: 500 11.5px var(--mono); color: var(--ink3); }

/* the conversation */
/* .rep-scrollbars: the house scroll bar (report-view.css), so the rule names the class that wears it (zip-map-views.test.js) */
.ra-thread.rep-scrollbars { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: 4px 18px 12px; display: flex; flex-direction: column; gap: 10px; }
.ra-intro { display: flex; flex-direction: column; gap: 12px; }
.ra-say { margin: 0; font-size: 14px; color: var(--ink2); }
.ra-say[hidden], .ra-sugs[hidden] { display: none; }
.ra-sugs { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.ra-sug { appearance: none; max-width: 100%; min-height: 40px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface2); color: var(--ink); font: 500 13.5px/1.3 var(--body); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.ra-sug:hover { border-color: var(--ra-mint-line); background: var(--mint-soft); }
.ra-sug:disabled { cursor: not-allowed; opacity: .55; }
.ra-msg { max-width: 100%; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.55; }
.ra-msg p { margin: 0 0 8px; }
.ra-msg p:last-child { margin-bottom: 0; }
.ra-msg.is-user { align-self: flex-end; max-width: 86%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface2); color: var(--ink); }
.ra-msg.is-bot { align-self: stretch; padding: 2px 0 4px; color: var(--ink); }
.ra-msg.is-note { align-self: stretch; padding: 9px 12px; border: 1px dashed var(--line); border-radius: 12px; color: var(--ink2); font-size: 14px; }
.ra-msg.is-bad { border: 1px solid var(--ra-gold-line); background: var(--gold-soft); color: var(--ink); }
.ra-msg.is-wait { font: 500 12.5px var(--mono); color: var(--ink3); border-style: dashed; }
.ra-rich ul, .ra-rich ol { margin: 0 0 8px; padding-left: 20px; }
.ra-rich li { margin: 2px 0; }
.ra-rich strong { font-weight: 600; color: var(--ink); }
.ra-chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 8px 0 0; padding: 0; }
.ra-chip-li { display: flex; }
.ra-chip { display: inline-block; max-width: 100%; font: 600 10.5px/1.4 var(--mono); letter-spacing: .04em; color: var(--ra-blue);
  background: var(--ra-blue-soft); border: 1px solid var(--ra-blue-line); border-radius: 6px; padding: 2px 8px; overflow-wrap: anywhere; }
a.ra-chip.is-plans { color: var(--mint); background: var(--mint-soft); border-color: var(--ra-mint-line); text-decoration: none; }
a.ra-chip.is-plans:hover { text-decoration: underline; }
.ra-uncounted { margin: 8px 0 0 !important; font: 500 12px/1.4 var(--mono); color: var(--ink3); }
/* drafts: a box with Copy (full borders only) */
.ra-draft { margin: 10px 0 2px; padding: 10px 12px; border: 1px solid var(--ra-mint-line); border-radius: 12px; background: var(--mint-soft); }
.ra-draft-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ra-draft-l { font: 600 11.5px var(--mono); letter-spacing: .04em; color: var(--mint); }
.ra-copy { appearance: none; min-height: 32px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  color: var(--ink); font: 600 12.5px var(--body); cursor: pointer; }
.ra-draft-text { white-space: pre-wrap; font-size: 14.5px; line-height: 1.5; color: var(--ink); }
.ra-copy-src { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }
.ra-thumbs { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.ra-thumbs-l { font: 500 11px var(--mono); color: var(--ink3); margin-right: 2px; }
.ra-thumb { appearance: none; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: transparent;
  font-size: 16px; line-height: 1; cursor: pointer; }
.ra-thumb:hover { background: var(--surface2); }
.ra-thumb[aria-pressed="true"] { background: var(--gold-soft); border-color: var(--gold); }

/* the lower half: why the box isn't there, or the box */
.ra-state { margin: 0 18px 10px; display: flex; flex-direction: column; gap: 8px; }
.ra-state[hidden] { display: none; }
.ra-note { margin: 0; padding: 10px 12px; border: 1px solid var(--ra-gold-line); border-radius: 12px; background: var(--gold-soft);
  color: var(--ink); font-size: 13.5px; line-height: 1.45; }
.ra-state.is-plain .ra-note { background: var(--surface2); border-color: var(--line); }
.ra-plan { padding: 12px 14px; border: 1px solid var(--ra-mint-line); border-radius: 12px; background: var(--mint-soft); color: var(--ink); font-size: 13.5px; line-height: 1.45; }
.ra-plan-h { margin: 0 0 2px; font: 700 17px/1.2 var(--disp); color: var(--ink); }
.ra-plan-t { margin: 0; }
.ra-plan-go { display: inline-flex; align-items: center; min-height: 36px; margin-top: 10px; padding: 7px 12px; border: 1px solid var(--ra-mint-line);
  border-radius: 10px; background: var(--surface); color: var(--mint); font: 600 13px var(--body); text-decoration: none; }
.ra-plan-go:hover { background: var(--surface2); }
.ra-state.is-sign { padding: 12px 14px; border: 1px solid var(--ra-blue-line); border-radius: 12px; background: var(--ra-blue-soft); }
.ra-sign-h { margin: 0; font: 700 17px/1.2 var(--disp); color: var(--ink); }
.ra-sign-t { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--ink); }
.ra-sign-form { display: flex; gap: 8px; margin-top: 2px; }
.ra-sign-note { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink2); }
.ra-sign-note[hidden] { display: none; }
.ra-form { padding: 10px 18px 4px; border-top: 1px solid var(--line); background: var(--surface); }
.ra-form[hidden] { display: none; }
.ra-form-row { display: flex; align-items: flex-end; gap: 8px; }
.ra-in { flex: 1 1 auto; width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  color: var(--ink); font: 400 14.5px/1.45 var(--body); }
.ra-in::placeholder { color: var(--ink3); opacity: 1; }
textarea.ra-in { resize: vertical; max-height: 180px; }
.ra-in:disabled { opacity: .55; cursor: not-allowed; }
.ra-send { appearance: none; flex: 0 0 auto; min-height: 42px; padding: 9px 16px; border: 1px solid var(--ra-mint-line); border-radius: 10px;
  background: var(--mint-soft); color: var(--mint); font: 600 14px var(--body); cursor: pointer; }
.ra-send:hover { background: color-mix(in srgb, var(--mint) 18%, transparent); }
.ra-send:disabled { opacity: .45; cursor: not-allowed; }
.ra-count[hidden] { display: none; }
.ra-count { margin: 4px 0 0; font: 500 11px var(--mono); color: var(--ink3); text-align: right; }
.ra-fine { margin: 0; padding: 6px 18px 14px; font-size: 11.5px; line-height: 1.4; color: var(--ink3); background: var(--surface); }

/* ── a phone: a full-screen sheet ── */
@media (max-width: 760px) {
  .ra-panel { top: 0; right: 0; bottom: 0; left: 0; width: auto; border: 0; border-radius: 0; box-shadow: none; }
  .ra-top { padding: 12px 16px 6px; }
  .ra-bar, .ra-thread, .ra-form, .ra-fine { padding-left: 16px; padding-right: 16px; }
  .ra-state { margin-left: 16px; margin-right: 16px; }
  .ra-msg.is-user { max-width: 100%; }
  .ra-x, .ra-thumb { width: 44px; height: 44px; }
  .ra-sug, .ra-in, .ra-send, .ra-plan-go, .ra-copy { min-height: 44px; }
  .ra-sign-form { flex-direction: column; }
  /* the plans chip is the panel's one link to the plans: a full tap target (the review of 3 Oct, M5) */
  a.ra-chip.is-plans { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; font-size: 12px; }
  /* room under the page's last control, so the pill at the foot of the screen never sits on one for good (S2) */
  body.ra-has-ask { padding-bottom: 76px; }
}
@media (prefers-reduced-motion: no-preference) {
  .ra-panel:not([hidden]) { animation: ra-in .18s ease-out; }
  @keyframes ra-in { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
}
/* never on paper: the report prints as it did */
@media print {
  .ra-open, .ra-scrim, .ra-panel { display: none !important; }
  body.ra-locked { overflow: visible; }
  body.ra-has-ask { padding-bottom: 0; }
}
