/* Ree portal experience. Load after site.css. */
.ree-assistant { --ree-visible-height: 100dvh; --ree-viewport-bottom: 0px; }
.ree-chat { width: min(460px, calc(100vw - 32px)); height: min(760px, calc(var(--ree-visible-height) - 36px)); display: flex; flex-direction: column; position: fixed; right: 20px; bottom: calc(18px + var(--ree-viewport-bottom)); overflow: hidden; }
.ree-chat > * { flex-shrink: 0; }
.ree-chat [hidden] { display: none !important; }
.ree-chat button, .ree-chat summary, .ree-chat .ree-topic-list button, .ree-launcher { min-height: 44px; touch-action: manipulation; }
.ree-chat button:disabled { cursor: default; opacity: .5; }
.ree-chat button:focus-visible, .ree-chat textarea:focus-visible, .ree-chat input:focus-visible, .ree-chat summary:focus-visible, .ree-chat a:focus-visible { outline: 3px solid #22a879; outline-offset: 3px; }
.ree-chat-head { padding: 12px 14px; }
.ree-chat-reset, .ree-chat-close { width: 44px; height: 44px; flex-basis: 44px; }
.ree-context-badge { margin: 0; padding: 7px 14px; background: #e6f5ed; color: #07553c; font-size: .78rem; font-weight: 750; overflow-wrap: anywhere; }
.ree-tools { border-bottom: 1px solid #dce8e2; background: #fff; }
.ree-tools summary { display: flex; align-items: center; gap: 8px; padding: 8px 15px; color: #165a43; font-size: .85rem; font-weight: 750; cursor: pointer; }
.ree-tools summary::before { content: '+'; font-size: 1.2rem; width: 16px; }
.ree-tools[open] summary::before { content: '−'; }
.ree-tools summary::-webkit-details-marker { display: none; }
.ree-tools-body { padding: 0 14px 14px; max-height: min(350px, 43dvh); overflow: auto; overscroll-behavior: contain; }
.ree-tools-body > label:not(.ree-profile-choice) { display: block; color: #334b41; font-size: .8rem; font-weight: 700; }
.ree-tools input[type="search"] { width: 100%; min-width: 0; min-height: 44px; font: inherit; font-size: 16px; border: 1px solid #b3cfc0; border-radius: 10px; padding: 8px 11px; margin: 4px 0 10px; }
.ree-topic-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ree-topic-list button, .ree-tool-actions button, .ree-handoff-draft button { border: 1px solid #bfd7ca; border-radius: 10px; background: #f0f8f4; color: #07553c; padding: 8px 10px; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.ree-profile-choice { display: flex; align-items: center; gap: 9px; min-height: 44px; font-size: .82rem; font-weight: 700; line-height: 1.4; cursor: pointer; }
.ree-profile-choice input[type="checkbox"] { width: 21px; height: 21px; margin: 0; flex: 0 0 21px; accent-color: #0d6b4f; }
.ree-profile-help, .ree-tools-note, .ree-topic-empty { font-size: .75rem; line-height: 1.5; color: #53665c; margin: 3px 0 11px; }
.ree-tool-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 8px; }
.ree-tools-note { margin: 9px 0 0; }
.ree-chat-messages { min-height: 75px; flex: 1 1 auto; scroll-behavior: auto; overflow-x: hidden; }
.ree-message { max-width: 95%; animation: none; }
.ree-message-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ree-provenance { margin: 9px 0 0; font-size: .71rem; line-height: 1.45; color: #4f6358; border-top: 1px solid #e4ece8; padding-top: 7px; }
.ree-message-meta { margin: 7px 0 0; font-size: .66rem; line-height: 1.3; color: #5b7164; }
.ree-message.user .ree-message-meta { color: #e4fff2; }
.ree-answer-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.ree-answer-actions button { border: 1px solid #c2d7cc; border-radius: 8px; background: #fff; color: #175940; font: inherit; font-size: .7rem; font-weight: 700; padding: 6px 9px; cursor: pointer; }
.ree-answer-actions button[aria-pressed="true"] { border-color: #0b6446; background: #e3f4eb; color: #044c32; }
.ree-quick-replies { gap: 6px; padding: 7px 12px; flex-wrap: nowrap; }
.ree-quick-replies button { min-height: 44px; font-size: .76rem; }
.ree-chat-form { display: grid; grid-template-columns: minmax(0, 1fr) 48px; align-items: end; padding: 8px 12px 6px; gap: 5px 8px; }
.ree-chat-form textarea { margin: 0; min-width: 0; width: 100%; min-height: 56px; max-height: 160px; padding: 8px 11px; resize: vertical; border: 1px solid #accabb; border-radius: 12px; background: #fff; color: #071a14; font: inherit; font-size: 16px; line-height: 1.4; }
.ree-chat-send { align-self: stretch; height: auto; min-height: 48px; margin-bottom: 0; }
.ree-compose-meta { grid-column: 1 / -1; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 3px 9px; color: #53695c; font-size: .64rem; line-height: 1.5; }
.ree-count-warning { color: #884410; font-weight: 800; }
.ree-ui-status { margin: 0; background: #fff; color: #07553c; padding: 3px 14px 6px; font-size: .74rem; line-height: 1.4; }
.ree-ui-status:empty { padding: 0; }
.ree-chat-privacy { padding: 3px 12px 9px; font-size: .68rem; }
.ree-chat-privacy a { text-decoration: underline; text-underline-offset: 2px; color: #165a43; }
.ree-copy-fallback, .ree-handoff-draft textarea { display: block; width: 100%; min-height: 90px; margin: 8px 0; border: 1px solid #a2c5b0; border-radius: 8px; padding: 8px; color: #0a2d1d; background: #fff; font: inherit; font-size: 16px; resize: vertical; }
.ree-handoff-draft { padding-top: 12px; margin-top: 12px; border-top: 1px solid #d5e6dc; font-size: .8rem; }
.ree-handoff-draft p { font-size: .76rem; color: #53665c; }
.ree-handoff-draft a { display: inline-flex; align-items: center; min-height: 44px; margin-top: 5px; color: #07553c; text-decoration: underline; }
.ree-chat-open .mobile-cta { visibility: hidden; pointer-events: none; }
@media (max-width: 767px) {
  .ree-chat { left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right)); width: auto; bottom: calc(8px + env(safe-area-inset-bottom) + var(--ree-viewport-bottom)); height: min(780px, calc(var(--ree-visible-height) - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom))); border-radius: 19px; }
  .ree-chat-head { padding: 9px 11px; gap: 9px; }
  .ree-chat-head .ree-avatar-wrap img { width: 40px; height: 40px; border-radius: 12px; }
  .ree-chat-head-copy span { font-size: .7rem; }
  .ree-chat-messages { padding: 12px; }
  .ree-message { font-size: .9rem; }
  .ree-chat-form { padding-bottom: 5px; }
  .ree-assistant { right: max(10px, env(safe-area-inset-right)); bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media (max-height: 520px) {
  .ree-chat { overflow-y: auto; }
  .ree-chat-messages { min-height: 90px; }
  .ree-chat-head { padding-top: 5px; padding-bottom: 5px; }
  .ree-quick-replies { padding-top: 4px; padding-bottom: 4px; }
  .ree-chat-privacy { padding-bottom: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .ree-chat, .ree-launcher, .ree-message, .ree-quick-replies button { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
