.rubi {
  --blue: #0058be;
  --blue-dark: #004897;
  --ink: #142a48;
  --muted: #52657c;
  --line: #dbe6f3;
  --gutter: clamp(12px, 2.15vw, 28px);
  --bottom: calc(var(--gutter) + max(env(safe-area-inset-bottom, 0px), var(--rubi-obstruction, 0px)));
  --launcher: 54px;
  position: fixed;
  inset: auto var(--gutter) var(--bottom);
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
  z-index: 10990;
  font-family: Geist, Inter, system-ui, sans-serif;
  color: var(--ink);
}
.rubi [hidden] { display: none !important; }
.rubi-launch, .rubi-panel { pointer-events: auto; }
body:has(.rubi) #fpm-cw:not(.open) { display: none; }
body:has(#fpm-cw.open) .rubi,
body:has(#fpm-dock:not([hidden])) .rubi,
body.fp-tools-open .rubi { visibility: hidden; }
.rubi button, .rubi input, .rubi textarea { font: inherit; }
.rubi button { cursor: pointer; }
.rubi :is(button, input, textarea, a):focus-visible { outline: 2px solid #247cf1; outline-offset: 3px; }
.rubi-launch {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--launcher);
  padding: 5px 6px 5px 16px;
  border: 1px solid #176dcc;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 15px !important;
  font-weight: 750 !important;
  box-shadow: 0 8px 24px #0758b43d, inset 0 1px 0 #ffffff29;
  transition: background .18s ease, transform .18s ease;
}
.rubi-launch:hover { background: var(--blue-dark); transform: translateY(-2px); }
.rubi-orb {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border: 1px solid #b5ddff;
  border-radius: 50%;
  color: #fff;
  font-size: 21px;
  text-shadow: 0 2px 7px #1866d1;
  background: radial-gradient(circle at 74% 19%, #d6f4ff, transparent 46%),
    linear-gradient(-140deg, #7cd3ff, #3093ef 48%, #1654ba);
  box-shadow: inset 0 0 6px #e0faff80, 0 0 9px #98d9ffa1;
}
.rubi-panel {
  position: absolute;
  inset: auto auto calc(var(--launcher) + 12px) 0;
  width: min(416px, 100%);
  height: min(580px, calc(100dvh - var(--bottom) - var(--launcher) - 28px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #cdddef;
  border-radius: 21px;
  background: #fff;
  box-shadow: 0 20px 58px #12335c35;
  animation: rubi-enter .18s ease-out both;
}
.rubi[data-compact] .rubi-launch[aria-expanded="true"] { visibility: hidden; }
.rubi[data-compact] .rubi-panel {
  bottom: 0;
  height: calc(100dvh - var(--bottom) - var(--gutter));
}
.rubi[data-compact] .rubi-header { padding: 5px 10px; }
.rubi[data-compact] .rubi-composer { padding-top: 6px; padding-bottom: 6px; }
.rubi-header {
  flex: none;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(-113deg, #e5f2ff, #f7faff 70%);
}
.rubi-heading { flex: 1; min-width: 0; }
.rubi-heading h2 { margin: 0; color: var(--ink); font-size: 20px; font-weight: 780; line-height: 1.17; }
.rubi-heading p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.rubi-close { width: 42px; height: 42px; flex: none; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); font-size: 24px !important; line-height: 1; }
.rubi-close:hover { background: #e6f2ff; }
.rubi-chat { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.rubi-feed { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 11px; padding: 16px; background: #f6f9fd; }
.rubi-message {
  align-self: flex-start;
  flex: none;
  max-width: 94%;
  border: 1px solid var(--line);
  border-radius: 15px 5px 15px 15px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.52;
  overflow-wrap: anywhere;
}
.rubi-message.is-user { align-self: flex-end; border-color: #bfd9f8; border-radius: 5px 15px 15px 15px; background: #e6f2ff; }
.rubi-message p { margin: 0; }
.rubi-message.is-typing { display: flex; align-items: center; gap: 4px; height: 38px; }
.rubi-message.is-typing i { width: 6px; height: 6px; border-radius: 50%; background: #2976c9; animation: rubi-dot 1.05s infinite ease-in-out; }
.rubi-message.is-typing i:nth-of-type(2) { animation-delay: .14s; }
.rubi-message.is-typing i:nth-of-type(3) { animation-delay: .28s; }
.rubi-links { display: flex; flex-direction: column; gap: 7px; padding: 0; margin: 9px 0 0; list-style: none; }
.rubi-links a { display: inline-block; color: var(--blue-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.rubi-shortcuts { display: flex; flex-wrap: wrap; gap: 7px; flex: none; }
.rubi-shortcuts button, .rubi-message button {
  border: 1px solid #bed6f2;
  border-radius: 12px;
  padding: 7px 10px;
  background: #fff;
  color: var(--blue-dark);
  font-size: 12.5px;
  font-weight: 650;
  text-align: right;
}
.rubi-message button { display: block; margin-top: 9px; }
.rubi-shortcuts button:hover, .rubi-message button:hover { background: #e6f2ff; }
.rubi-shortcuts button:disabled { opacity: .65; cursor: wait; }
.rubi-composer { flex: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 10px 14px 8px; border-top: 1px solid var(--line); background: #fff; }
.rubi-form { display: flex; gap: 8px; margin: 0; }
.rubi-form input, .rubi-report-form :is(input, textarea) { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #c9d9eb; border-radius: 11px; padding: 8px 11px; color: var(--ink); background: #fff; font-size: 16px; }
.rubi-form input::placeholder, .rubi-report-form textarea::placeholder { color: var(--muted); opacity: 1; }
.rubi-form button, .rubi-report-send { flex: none; min-width: 44px; min-height: 44px; border: 1px solid var(--blue); border-radius: 11px; background: var(--blue); color: #fff; font-weight: 760; }
.rubi-form button { width: 44px; font-size: 23px; }
.rubi :is(.rubi-form button, .rubi-report-send):hover { background: var(--blue-dark); }
.rubi :is(.rubi-form button, .rubi-report-send):disabled { opacity: .6; cursor: wait; }
.rubi-composer > button { justify-self: start; }
.rubi-text-button { display: inline-flex; gap: 5px; align-items: center; min-height: 34px; border: none; padding: 4px 3px; background: transparent; color: var(--blue-dark); font-size: 12.5px !important; font-weight: 640 !important; }
.rubi-text-button:hover { text-decoration: underline; }
.rubi-report { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 12px 16px 16px; }
.rubi-report h3 { margin: 5px 0 6px; font-size: 18px; font-weight: 720; }
.rubi-report p { margin: 0 0 11px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.rubi-report-form { display: grid; gap: 9px; margin: 0; }
.rubi-contact-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rubi-report-form label { display: grid; gap: 4px; min-width: 0; margin: 0; font-size: 13px; font-weight: 650; }
.rubi-report-form input, .rubi-report-form textarea { font-weight: 400; }
.rubi-report-form textarea { min-height: 76px; resize: vertical; }
.rubi-report-send { padding: 8px 12px; }
.rubi-report .rubi-report-status { margin: 0; color: #9b2626; }
.rubi-trap, .rubi-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
@keyframes rubi-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rubi-dot { 0%, 60%, 100% { opacity: .5; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@media (max-width: 560px) {
  .rubi { --launcher: 50px; }
  .rubi-launch .rubi-orb { width: 36px; height: 36px; }
  .rubi-panel { height: min(554px, calc(100dvh - var(--bottom) - var(--launcher) - 22px)); }
}
@media (max-width: 370px) {
  .rubi-contact-fields { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .rubi *, .rubi *::before, .rubi *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
}
