/* Scoped to the assistant so the experience and agency workspace keep their own UI. */
#rivsight-assistant {
  --rvs-chat-ink: #302a25;
  --rvs-chat-muted: #6e6054;
  --rvs-chat-line: #e2d9ce;
  color: var(--rvs-chat-ink);
  font: 14px/1.5 Inter, Aptos, "Segoe UI", Arial, sans-serif;
  text-align: left;
  letter-spacing: normal;
}
#rivsight-assistant *, #rivsight-assistant *::before, #rivsight-assistant *::after { box-sizing: border-box; }
#rivsight-assistant [hidden] { display: none !important; }
#rivsight-assistant button, #rivsight-assistant textarea, #rivsight-assistant a {
  font: inherit; letter-spacing: normal; text-transform: none; color: inherit;
  -webkit-tap-highlight-color: transparent;
}
#rivsight-assistant button { cursor: pointer; margin: 0; }
#rivsight-assistant button:disabled { cursor: not-allowed; opacity: .48; }
#rivsight-assistant button:focus-visible, #rivsight-assistant a:focus-visible, #rivsight-assistant textarea:focus-visible {
  outline: 3px solid #775c43; outline-offset: 3px;
}
#rivsight-assistant p, #rivsight-assistant h2 { margin: 0; padding: 0; }
#rivsight-assistant svg { display: block; flex-shrink: 0; }
#rivsight-assistant .rvs-chat-launcher {
  position: fixed; right: max(20px, env(safe-area-inset-right));
  bottom: calc(20px + env(safe-area-inset-bottom) + var(--rivsight-chat-bottom-offset, 0px));
  z-index: 49; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px; padding: 0 17px; border: 1px solid #d9cdbf; border-radius: 24px;
  background: #faf8f4; color: #44362c; box-shadow: 0 5px 20px #44362c15;
  font-size: 13px; font-weight: 600; line-height: 1.3;
  transition: background-color 140ms ease, border-color 140ms ease;
}
#rivsight-assistant .rvs-chat-launcher:hover { background: #eee7dd; border-color: #bba68f; }
#rivsight-assistant .rvs-chat-dialog {
  position: fixed; inset: auto; margin: 0; padding: 0;
  top: calc(var(--rvs-chat-viewport-top, 0px) + var(--rvs-chat-viewport-height, 100dvh) - min(620px, var(--rvs-chat-viewport-height, 100dvh) - 40px) - 20px);
  right: max(20px, env(safe-area-inset-right));
  width: 390px; max-width: calc(100vw - 40px);
  height: min(620px, calc(var(--rvs-chat-viewport-height, 100dvh) - 40px));
  max-height: calc(100dvh - 24px); min-height: 0;
  border: 1px solid var(--rvs-chat-line); border-radius: 20px;
  overflow: hidden; background: #fff; color: var(--rvs-chat-ink);
  font: 14px/1.5 Inter, Aptos, "Segoe UI", Arial, sans-serif;
  text-align: left; box-shadow: 0 24px 80px #302a2528;
}
#rivsight-assistant .rvs-chat-dialog[open] { display: flex; flex-direction: column; }
#rivsight-assistant .rvs-chat-dialog::backdrop { background: #302a2530; }
#rivsight-assistant .rvs-chat-header {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex: 0 0 auto; min-height: 76px; padding: 14px 16px 14px 20px;
  background: #faf8f4; border-bottom: 1px solid var(--rvs-chat-line);
}
#rivsight-assistant .rvs-chat-title { font: 650 18px/1.25 Inter, Aptos, "Segoe UI", Arial, sans-serif; letter-spacing: -.4px; color: #302a25; }
#rivsight-assistant .rvs-chat-subtitle { display: block; margin-top: 3px; font-size: 11px; color: #775c43; }
#rivsight-assistant .rvs-chat-close {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  flex: 0 0 44px; border: 1px solid transparent; border-radius: 50%; background: transparent;
}
#rivsight-assistant .rvs-chat-close:hover { background: #eee7dd; }
#rivsight-assistant .rvs-chat-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 22px 20px 18px; scrollbar-width: thin; }
#rivsight-assistant .rvs-chat-welcome { font-size: 17px; font-weight: 600; line-height: 1.4; letter-spacing: -.25px; }
#rivsight-assistant .rvs-chat-description { margin-top: 9px; font-size: 13px; line-height: 1.65; color: var(--rvs-chat-muted); }
#rivsight-assistant .rvs-chat-suggestions { display: grid; gap: 8px; margin-top: 20px; }
#rivsight-assistant .rvs-chat-suggestion {
  min-height: 44px; padding: 10px 13px; border: 1px solid var(--rvs-chat-line); border-radius: 10px;
  background: #faf8f4; color: #44362c; text-align: left; font-size: 12px; line-height: 1.4;
}
#rivsight-assistant .rvs-chat-suggestion:hover { background: #eee7dd; border-color: #cbbba9; }
#rivsight-assistant .rvs-chat-log { display: flex; flex-direction: column; gap: 16px; }
#rivsight-assistant .rvs-chat-log:not(:empty) { margin-top: 22px; }
#rivsight-assistant .rvs-chat-message { max-width: 100%; padding: 12px 14px; border-radius: 12px; overflow-wrap: anywhere; }
#rivsight-assistant .rvs-chat-message-user { align-self: flex-end; max-width: 90%; background: #eee7dd; }
#rivsight-assistant .rvs-chat-message-assistant { align-self: stretch; background: #faf8f4; border: 1px solid #eee7dd; }
#rivsight-assistant .rvs-chat-speaker { display: block; color: #6e6054; font-size: 10px; font-weight: 600; margin-bottom: 5px; }
#rivsight-assistant .rvs-chat-message-text { font-size: 13px; line-height: 1.65; white-space: pre-wrap; }
#rivsight-assistant .rvs-chat-links { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 8px; }
#rivsight-assistant .rvs-chat-help-link { display: inline-flex; align-items: center; min-height: 44px; color: #674b32; font-size: 12px; font-weight: 600; line-height: 1.45; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
#rivsight-assistant .rvs-chat-status { color: #6e6054; font-size: 12px; line-height: 1.6; }
#rivsight-assistant .rvs-chat-status:not(:empty) { margin-top: 16px; }
#rivsight-assistant .rvs-chat-recovery { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; margin-top: 8px; }
#rivsight-assistant .rvs-chat-retry { min-height: 44px; border: 1px solid #cbbba9; background: #faf8f4; border-radius: 8px; padding: 8px 12px; font-size: 12px; }
#rivsight-assistant .rvs-chat-composer { flex: 0 0 auto; margin: 0; padding: 14px 16px 15px; border-top: 1px solid var(--rvs-chat-line); background: #fff; }
#rivsight-assistant .rvs-chat-field { display: flex; align-items: flex-end; gap: 8px; padding: 9px; border: 1px solid #d8ccbd; border-radius: 12px; background: #faf8f4; }
#rivsight-assistant .rvs-chat-input { display: block; min-width: 0; flex: 1 1 auto; width: 100%; height: 44px; min-height: 44px; max-height: 100px; resize: none; border: 0; border-radius: 3px; padding: 3px 2px; background: transparent; font-size: 14px; line-height: 1.45; box-shadow: none; }
#rivsight-assistant .rvs-chat-input::placeholder { color: #786b60; opacity: 1; }
#rivsight-assistant .rvs-chat-send { display: grid; place-items: center; flex: 0 0 44px; height: 44px; width: 44px; padding: 0; border: 0; border-radius: 9px; background: #44362c; color: #fff; }
#rivsight-assistant .rvs-chat-send:hover:not(:disabled) { background: #775c43; }
#rivsight-assistant .rvs-chat-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
#rivsight-assistant .rvs-chat-clear { min-height: 44px; padding: 6px 2px; border: 0; background: transparent; color: #6e6054; font-size: 11px; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
#rivsight-assistant .rvs-chat-limit { flex: 0 0 auto; color: #786b60; font-size: 10px; font-variant-numeric: tabular-nums; }
#rivsight-assistant .rvs-chat-privacy { font-size: 10px; line-height: 1.5; color: #6e6054; }
#rivsight-assistant .rvs-chat-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
html.rvs-chat-open { overflow: hidden; }
@media (max-width: 600px) {
  #rivsight-assistant .rvs-chat-launcher { right: max(14px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom) + var(--rivsight-chat-bottom-offset, 0px)); min-height: 48px; width: 48px; padding: 0; border-radius: 50%; }
  #rivsight-assistant .rvs-chat-launcher-label { display: none; }
  #rivsight-assistant .rvs-chat-dialog { top: calc(var(--rvs-chat-viewport-top, 0px) + var(--rvs-chat-viewport-height, 100dvh) - min(640px, var(--rvs-chat-viewport-height, 100dvh) - 24px) - 12px); right: 12px; width: calc(100vw - 24px); max-width: calc(100vw - 24px); height: min(640px, calc(var(--rvs-chat-viewport-height, 100dvh) - 24px)); border-radius: 18px; }
  #rivsight-assistant .rvs-chat-header { min-height: 68px; padding: 10px 12px 10px 17px; }
  #rivsight-assistant .rvs-chat-scroll { padding: 18px 16px; }
  #rivsight-assistant .rvs-chat-message-text { font-size: 15px; }
  #rivsight-assistant .rvs-chat-description { font-size: 14px; }
  #rivsight-assistant .rvs-chat-privacy { font-size: 11px; }
  #rivsight-assistant .rvs-chat-composer { padding: 12px 13px; }
  #rivsight-assistant .rvs-chat-input { font-size: 16px; }
}
@media (max-height: 500px) {
  #rivsight-assistant .rvs-chat-header { min-height: 58px; padding-block: 6px; }
  #rivsight-assistant .rvs-chat-composer { padding-block: 8px; }
  #rivsight-assistant .rvs-chat-scroll { padding-block: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  #rivsight-assistant *, #rivsight-assistant *::before, #rivsight-assistant *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print { #rivsight-assistant { display: none !important; } }
