/* Rivet, the chat assistant. Colours come from the site tokens in style.css,
   so the panel follows the light/dark toggle with no rules of its own. */

.rv-launcher {
  position: fixed; z-index: 900;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px 6px 6px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font: 600 14px/1 inherit; cursor: pointer;
  box-shadow: 0 6px 24px rgb(4 18 31 / .22);
  transition: transform .15s ease, box-shadow .15s ease;
}
.rv-launcher:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgb(4 18 31 / .28); }
.rv-launcher:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.rv-open .rv-launcher { display: none; }

.rv-avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-wash); flex: none; }
.rv-avatar svg { width: 30px; height: 30px; }
.rv-avatar-sm { width: 34px; height: 34px; }
.rv-avatar-sm svg { width: 26px; height: 26px; }
.rv-ear, .rv-head { fill: var(--accent); }
.rv-visor { fill: var(--ink); }
.rv-eye { fill: #8ff0ff; }
/* The saucer. Mid-tone metal reads on both themes. */
.rv-dome { fill: var(--surface); fill-opacity: .55; stroke: var(--accent); stroke-width: 1.2; }
.rv-hull { fill: #9fb3c8; }
.rv-hull-top { fill: #fff; opacity: .4; }
.rv-under { fill: #34465e; }
.rv-light { fill: #8ff0ff; }
.rv-beam { fill: #8ff0ff; opacity: 0; transition: opacity .2s ease; }
.rv-launcher .rv-avatar svg { animation: rv-hover 3.2s ease-in-out infinite alternate; }
.rv-launcher:hover .rv-beam, .rv-launcher:focus-visible .rv-beam { opacity: .45; }
.rv-launcher:hover .rv-light, .rv-launcher:focus-visible .rv-light { animation: rv-blink .8s steps(2, jump-none) infinite; }
.rv-launcher .rv-light:nth-of-type(4) { animation-delay: .2s; }
.rv-launcher .rv-light:nth-of-type(5) { animation-delay: .4s; }
.rv-launcher .rv-light:nth-of-type(6) { animation-delay: .6s; }
@keyframes rv-hover { from { transform: translateY(-1.2px); } to { transform: translateY(1.6px); } }
@keyframes rv-blink { from { opacity: 1; } to { opacity: .25; } }
/* Opening the chat beams the panel down from the launcher's corner. */
.rv-panel:not([hidden]) { animation: rv-beam-in .3s cubic-bezier(.2,.8,.2,1); transform-origin: 100% 100%; }
@keyframes rv-beam-in { from { opacity: 0; transform: translateY(14px) scale(.94); box-shadow: 0 0 40px rgb(143 240 255 / .5); } to { opacity: 1; transform: none; } }

.rv-panel {
  position: fixed; z-index: 1000;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: min(390px, calc(100vw - 32px)); height: min(600px, calc(100dvh - 32px));
  display: flex; flex-direction: column;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 18px; overflow: hidden;
  box-shadow: 0 18px 60px rgb(4 18 31 / .35);
  font-size: 15px; line-height: 1.45;
}
.rv-panel[hidden] { display: none; }

.rv-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 14px; border-bottom: 1px solid var(--line); }
.rv-who { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; }
.rv-who strong { display: block; font-size: 15px; }
.rv-sub { display: block; font-size: 12px; color: var(--ink-3); }
.rv-icon-btn { border: 0; background: transparent; color: var(--ink-2); cursor: pointer; border-radius: 8px; padding: 6px 8px; font: 500 13px/1 inherit; }
.rv-icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.rv-icon-btn:focus-visible, .rv-chip:focus-visible, .rv-send:focus-visible, .rv-cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rv-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; display: block; }

.rv-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.rv-turn { display: flex; flex-direction: column; gap: 8px; }
.rv-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.rv-assistant { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.rv-user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }

.rv-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.rv-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: rv-dot 1s infinite ease-in-out; }
.rv-typing i:nth-child(2) { animation-delay: .15s; }
.rv-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes rv-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.rv-starters { display: flex; flex-wrap: wrap; gap: 6px; }
.rv-chip { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 7px 12px; font: 500 13px/1.2 inherit; cursor: pointer; }
.rv-chip:hover { border-color: var(--accent); color: var(--accent); }

.rv-safety { align-self: stretch; border: 1px solid #d99a1e; background: rgb(217 154 30 / .12); border-radius: 12px; padding: 10px 12px; }
.rv-safety strong { display: block; font-size: 13px; letter-spacing: .02em; color: var(--amber); } /* the amber text token: 4.5:1 on the wash in both themes */
.rv-safety p { margin: 4px 0 0; }

.rv-card { align-self: stretch; border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.rv-card-title { margin: 0; font-weight: 700; }
.rv-tiers { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rv-tiers li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.rv-tier-name { color: var(--ink-2); }
.rv-tier-price { font-weight: 600; font-variant-numeric: tabular-nums; }
.rv-card-meta { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.rv-card-caveat { margin: 0; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: rgb(217 154 30 / .12); }
.rv-contact { margin: 0; font-weight: 600; user-select: all; }
.rv-cta { justify-self: start; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; font-size: 14px; padding: 9px 14px; border-radius: 10px; }
.rv-cta:hover { background: var(--accent-bright); }

.rv-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.rv-input { flex: 1; min-width: 0; resize: none; border: 1px solid var(--line-strong); border-radius: 12px; padding: 9px 12px; background: var(--surface); color: var(--ink); font: 15px/1.4 inherit; max-height: 120px; }
.rv-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.rv-send { flex: none; width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); cursor: pointer; display: grid; place-items: center; }
.rv-send:disabled { opacity: .5; cursor: default; }
.rv-send svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rv-foot { margin: 0; padding: 0 14px 10px; font-size: 11.5px; color: var(--ink-3); }
.rv-foot a { color: inherit; }

/* Phones: the launcher shrinks to the face, and the panel takes the screen. */
@media (max-width: 699px) {
  .rv-launcher { padding: 5px; }
  .rv-launcher-label { display: none; }
  .rv-avatar { width: 44px; height: 44px; }
  .rv-panel { inset: 0; width: auto; height: auto; border-radius: 0; border: 0;
    padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .rv-input { font-size: 16px; } /* below 16px, iOS zooms the page on focus */
  .rv-open { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .rv-launcher { transition: none; }
  .rv-typing i { animation: none; opacity: .6; }
  .rv-launcher .rv-avatar svg, .rv-launcher .rv-light, .rv-panel:not([hidden]) { animation: none; }
}
html[data-motion="paused"] .rv-launcher .rv-avatar svg { animation: none; }
@media print { .rv-launcher, .rv-panel { display: none !important; } }
