:root {
  --arv-ai-teal: #087f83;
  --arv-ai-teal-dark: #05676b;
  --arv-ai-coral: #ff625f;
  --arv-ai-ink: #14202b;
  --arv-ai-muted: #66727d;
  --arv-ai-line: #e3e8ec;
  --arv-ai-surface: #ffffff;
}

body.arv-ai-open { overflow: hidden; }

.arv-ai-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147482000;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 9px 18px 9px 9px;
  border: 0;
  border-radius: 30px;
  color: #fff;
  background: linear-gradient(135deg, var(--arv-ai-teal), #11a6aa);
  box-shadow: 0 12px 35px rgba(3, 87, 91, .32);
  font: 700 15px/1.2 Ubuntu, Arial, sans-serif;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.arv-ai-launcher:hover,
.arv-ai-launcher:focus {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 15px 38px rgba(3, 87, 91, .4);
  outline: 0;
}

.arv-ai-launcher__orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--arv-ai-teal-dark);
  background: #fff;
  font-size: 13px;
  font-weight: 900;
}

.arv-ai-launcher__orb::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid rgba(255,255,255,.45);
  border-radius: inherit;
  animation: arv-ai-pulse 2.1s ease-out infinite;
}

.arv-ai-launcher.is-listening .arv-ai-launcher__orb {
  color: #fff;
  background: var(--arv-ai-coral);
}

@keyframes arv-ai-pulse {
  0% { transform: scale(.82); opacity: .85; }
  75%, 100% { transform: scale(1.28); opacity: 0; }
}

.arv-ai-nudge {
  position: fixed;
  right: 22px;
  bottom: 88px;
  z-index: 2147481999;
  width: min(320px, calc(100vw - 32px));
  padding: 15px 42px 15px 16px;
  border: 1px solid var(--arv-ai-line);
  border-radius: 16px;
  color: var(--arv-ai-ink);
  background: #fff;
  box-shadow: 0 12px 34px rgba(21, 37, 48, .18);
  font: 500 14px/1.45 Ubuntu, Arial, sans-serif;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: .25s ease;
}

.arv-ai-nudge.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.arv-ai-nudge strong { display: block; margin-bottom: 3px; color: var(--arv-ai-teal-dark); }
.arv-ai-nudge button { position: absolute; top: 9px; right: 9px; width: 28px; height: 28px; border: 0; background: transparent; color: #7e8992; font-size: 20px; cursor: pointer; }

.arv-ai-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147482001;
  background: rgba(12, 25, 35, .46);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease;
}
.arv-ai-backdrop.is-open { opacity: 1; visibility: visible; }

.arv-ai-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 2147482002;
  display: flex;
  flex-direction: column;
  width: min(430px, 100vw);
  height: 100dvh;
  color: var(--arv-ai-ink);
  background: #f7f9fa;
  box-shadow: -18px 0 55px rgba(10, 24, 34, .24);
  transform: translateX(105%);
  transition: transform .25s ease;
  font-family: Ubuntu, Arial, sans-serif;
}
.arv-ai-panel.is-open { transform: translateX(0); }

.arv-ai-panel__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 17px;
  color: #fff;
  background: linear-gradient(135deg, var(--arv-ai-teal-dark), var(--arv-ai-teal));
}
.arv-ai-logo { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 14px; color: var(--arv-ai-teal-dark); background: #fff; font-weight: 900; }
.arv-ai-title { min-width: 0; flex: 1; }
.arv-ai-title strong { display: block; font-size: 17px; }
.arv-ai-status { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: rgba(255,255,255,.82); font-size: 12px; }
.arv-ai-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #83e594; box-shadow: 0 0 0 3px rgba(131,229,148,.18); }
.arv-ai-status.is-busy::before { background: #ffd76a; animation: arv-ai-blink 1s infinite; }
.arv-ai-status.is-error::before { background: #ff8c89; }
@keyframes arv-ai-blink { 50% { opacity: .35; } }

.arv-ai-icon-button { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; color: #fff; background: rgba(255,255,255,.12); cursor: pointer; font-size: 20px; }
.arv-ai-icon-button:hover, .arv-ai-icon-button:focus { background: rgba(255,255,255,.23); outline: 0; }

.arv-ai-messages { flex: 1; overflow-y: auto; padding: 18px 15px 12px; overscroll-behavior: contain; }
.arv-ai-message { display: flex; gap: 9px; margin-bottom: 13px; animation: arv-ai-enter .2s ease; }
.arv-ai-message--user { justify-content: flex-end; }
.arv-ai-bubble { max-width: 84%; padding: 11px 13px; border: 1px solid var(--arv-ai-line); border-radius: 16px 16px 16px 4px; background: #fff; box-shadow: 0 3px 12px rgba(20,32,43,.06); font-size: 14px; line-height: 1.48; white-space: pre-wrap; word-break: break-word; }
.arv-ai-message--user .arv-ai-bubble { border-color: var(--arv-ai-teal); border-radius: 16px 16px 4px 16px; color: #fff; background: var(--arv-ai-teal); }
@keyframes arv-ai-enter { from { opacity: 0; transform: translateY(4px); } }

.arv-ai-quick { display: flex; gap: 7px; overflow-x: auto; padding: 0 15px 11px; scrollbar-width: none; }
.arv-ai-quick::-webkit-scrollbar { display: none; }
.arv-ai-chip { flex: 0 0 auto; padding: 8px 11px; border: 1px solid #cfdadd; border-radius: 18px; color: var(--arv-ai-teal-dark); background: #fff; font-size: 12px; font-weight: 700; cursor: pointer; }

.arv-ai-compose { padding: 11px 12px calc(11px + env(safe-area-inset-bottom)); border-top: 1px solid var(--arv-ai-line); background: #fff; }
.arv-ai-compose__row { display: flex; align-items: flex-end; gap: 8px; }
.arv-ai-input { min-width: 0; flex: 1; max-height: 112px; resize: none; border: 1px solid #ccd6dc; border-radius: 20px; padding: 11px 14px; color: var(--arv-ai-ink); background: #fff; font: 14px/1.4 Ubuntu, Arial, sans-serif; outline: 0; }
.arv-ai-input:focus { border-color: var(--arv-ai-teal); box-shadow: 0 0 0 3px rgba(8,127,131,.11); }
.arv-ai-action { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border: 0; border-radius: 50%; color: #fff; background: var(--arv-ai-teal); cursor: pointer; font-size: 19px; }
.arv-ai-action--mic { background: var(--arv-ai-coral); }
.arv-ai-action--mic.is-listening { animation: arv-ai-mic 1s ease-in-out infinite; }
@keyframes arv-ai-mic { 50% { transform: scale(1.08); box-shadow: 0 0 0 9px rgba(255,98,95,.15); } }
.arv-ai-note { margin: 8px 3px 0; color: #89939b; font-size: 10px; text-align: center; }

@media (max-width: 767px) {
  .arv-ai-launcher { right: 14px; bottom: calc(72px + env(safe-area-inset-bottom)); min-height: 52px; padding: 7px 14px 7px 7px; }
  .arv-ai-launcher__orb { width: 38px; height: 38px; }
  .arv-ai-nudge { right: 12px; bottom: calc(132px + env(safe-area-inset-bottom)); }
  .arv-ai-panel { width: 100%; }
  .arv-ai-panel__head { padding-top: calc(14px + env(safe-area-inset-top)); }
  .arv-ai-bubble { max-width: 90%; }
}

@media (max-width: 420px) {
  .arv-ai-launcher { right: 8px; bottom: calc(66px + env(safe-area-inset-bottom)); min-height: 44px; gap: 7px; padding: 5px 10px 5px 5px; font-size: 13px; white-space: nowrap; }
  .arv-ai-launcher__orb { width: 32px; height: 32px; font-size: 12px; }
  .arv-ai-nudge { right: 8px; bottom: calc(116px + env(safe-area-inset-bottom)); width: calc(100% - 16px); }
}

@media (prefers-reduced-motion: reduce) {
  .arv-ai-launcher, .arv-ai-panel, .arv-ai-backdrop, .arv-ai-nudge { transition: none; }
  .arv-ai-launcher__orb::after, .arv-ai-action--mic.is-listening { animation: none; }
}
