/* Rival AI guide widget (guide.js): welcome, guided tour and chat. Brand: ink, Rival blue, cyan, Geist. */
.rg {
  --rg-ink: #070b1a;
  --rg-glass: rgba(10, 16, 36, .78);
  --rg-text: #f3f5fa;
  --rg-muted: rgba(243, 245, 250, .62);
  --rg-faint: rgba(243, 245, 250, .38);
  --rg-line: rgba(243, 245, 250, .1);
  --rg-line-2: rgba(243, 245, 250, .18);
  --rg-blue: #2b59ff;
  --rg-blue-hi: #4b73ff;
  --rg-cyan: #5ce1ff;
  --rg-ease: cubic-bezier(.16, 1, .3, 1);
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--rg-text);
  -webkit-font-smoothing: antialiased;
}
.rg *, .rg *::before, .rg *::after { box-sizing: border-box; }
.rg > * { pointer-events: auto; }
.rg button { font: inherit; color: inherit; cursor: pointer; }
.rg svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rg [hidden] { display: none !important; }
.rg :focus-visible { outline: 1px solid var(--rg-cyan); outline-offset: 3px; }

/* ---------- glass surface shared by every card ---------- */
.rg-panel, .rg-tour, .rg-welcome, .rg-nudge, .rg-launch {
  background: var(--rg-glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid var(--rg-line);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(43, 89, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .06);
}

/* ---------- the orb: Rival's AI ---------- */
.rg-orb {
  position: relative;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #eaf9ff 0, rgba(234, 249, 255, 0) 30%),
    radial-gradient(circle at 70% 78%, rgba(92, 225, 255, .9) 0, rgba(92, 225, 255, 0) 45%),
    radial-gradient(circle at 50% 50%, #5b7fff 0, #2b59ff 55%, #0c1a5c 100%);
  box-shadow: 0 0 0 1px rgba(92, 225, 255, .35), 0 0 22px -4px rgba(43, 89, 255, .9), inset 0 -4px 9px rgba(5, 10, 40, .55);
  animation: rg-breathe 4.8s ease-in-out infinite;
}
.rg-orb i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 60%, rgba(255, 255, 255, .6) 70%, transparent 80%);
  mix-blend-mode: soft-light;
  animation: rg-spin 6s linear infinite;
}
.rg-orb::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px solid rgba(92, 225, 255, .6);
  opacity: 0;
}
.rg-orb-lg { width: 40px; height: 40px; }
.rg-orb-xl { width: 64px; height: 64px; }
.rg[data-state="think"] .rg-orb i { animation-duration: 1s; }
.rg[data-state="think"] .rg-orb, .rg[data-state="speak"] .rg-orb { box-shadow: 0 0 0 1px rgba(92, 225, 255, .6), 0 0 34px -2px rgba(92, 225, 255, .8), inset 0 -4px 9px rgba(5, 10, 40, .55); }
.rg[data-state="listen"] .rg-orb::after, .rg[data-state="speak"] .rg-orb::after { animation: rg-ring 1.4s ease-out infinite; }
.rg[data-state="speak"] .rg-orb { animation: rg-talk .45s ease-in-out infinite alternate; }
@keyframes rg-breathe { 50% { transform: scale(1.06); } }
@keyframes rg-spin { to { transform: rotate(360deg); } }
@keyframes rg-ring { 0% { opacity: .9; transform: scale(.85); } 100% { opacity: 0; transform: scale(1.55); } }
@keyframes rg-talk { from { transform: scale(.97); } to { transform: scale(1.09); } }
@keyframes rg-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.rg-still .rg-orb, .rg-still .rg-orb i, .rg-still .rg-orb::after { animation: none !important; }

/* ---------- launcher + nudge ---------- */
.rg-launch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px 6px 6px;
  border-radius: 999px;
  font-size: 13.5px;
  letter-spacing: -.005em;
  transition: transform .4s var(--rg-ease), border-color .3s;
}
.rg-launch:hover { transform: translateY(-2px); border-color: var(--rg-line-2); }
.rg-open .rg-launch-t::after { content: " \00b7  close"; color: var(--rg-faint); }
.rg-touring .rg-launch { display: none; }
.rg-nudge {
  max-width: 270px;
  padding: 12px 14px;
  border-radius: 16px 16px 4px 16px;
  font-size: 13.5px;
  line-height: 1.45;
  text-align: left;
  animation: rg-in .6s var(--rg-ease) both;
}

/* ---------- welcome ---------- */
.rg-welcome {
  position: fixed;
  left: 50%;
  bottom: 28px;
  width: min(540px, calc(100vw - 32px));
  transform: translateX(-50%);
  padding: 26px 26px 22px;
  border-radius: 24px;
  text-align: center;
  animation: rg-welcome .9s var(--rg-ease) both;
}
@keyframes rg-welcome { from { opacity: 0; transform: translate(-50%, 18px) scale(.97); } }
.rg-welcome .rg-orb { margin: 0 auto 14px; }
.rg-w-t { margin: 0; font-weight: 300; font-size: 28px; line-height: 1.15; letter-spacing: -.035em; }
.rg-w-d { margin: 8px auto 18px; max-width: 400px; font-size: 14.5px; line-height: 1.55; color: var(--rg-muted); }
.rg-w-acts, .rg-tour-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* ---------- buttons inside the guide ---------- */
.rg-tbtn {
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--rg-line-2);
  border-radius: 999px;
  background: rgba(243, 245, 250, .04);
  font-size: 13.5px;
  white-space: nowrap;
  transition: background .3s, border-color .3s;
}
.rg-tbtn:hover { background: rgba(243, 245, 250, .09); }
.rg .rg-tbtn-p {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(180deg, var(--rg-blue-hi), var(--rg-blue));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 10px 30px -12px rgba(43, 89, 255, .8), 0 0 0 1px rgba(43, 89, 255, .6);
}
.rg .rg-tbtn-p:hover { background: linear-gradient(180deg, #5a80ff, #3463ff); }
.rg .rg-tbtn-g { border-color: transparent; background: transparent; color: var(--rg-muted); }
.rg .rg-tbtn-g:hover { color: var(--rg-text); background: rgba(243, 245, 250, .05); }

/* ---------- the tour card ---------- */
.rg-tour {
  position: fixed;
  left: 50%;
  bottom: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  width: min(620px, calc(100vw - 32px));
  transform: translateX(-50%);
  padding: 18px 20px 16px;
  border-radius: 22px;
  animation: rg-welcome .7s var(--rg-ease) both;
}
.rg-tour-body { flex: 1; min-width: 0; }
.rg-tour-k { margin: 2px 0 6px; font-family: "Geist Mono", ui-monospace, monospace; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--rg-cyan); }
.rg-tour-t { margin: 0 0 14px; min-height: 3em; font-size: 15.5px; line-height: 1.55; letter-spacing: -.01em; font-weight: 300; }
.rg-tour-acts { justify-content: flex-start; }
.rg-tour-bar { display: flex; gap: 5px; margin-top: 14px; }
.rg-tour-bar i { flex: 1; height: 2px; border-radius: 2px; background: var(--rg-line-2); transition: background .5s; }
.rg-tour-bar i.on { background: linear-gradient(90deg, var(--rg-blue), var(--rg-cyan)); }

/* ---------- chat panel ---------- */
.rg-panel {
  display: flex;
  flex-direction: column;
  width: 384px;
  height: min(600px, calc(100dvh - 120px));
  overflow: hidden;
  border-radius: 22px;
  animation: rg-in .5s var(--rg-ease) both;
}
.rg-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 10px 14px 16px;
  border-bottom: 1px solid var(--rg-line);
  background: radial-gradient(120% 160% at 0% 0%, rgba(43, 89, 255, .35) 0, rgba(43, 89, 255, 0) 55%);
}
.rg-title { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.rg-title strong { font-weight: 400; font-size: 15px; letter-spacing: -.01em; }
.rg-status { font-size: 12px; color: var(--rg-muted); }
.rg-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  transition: background .2s, color .2s;
}
.rg .rg-icon { color: var(--rg-muted); }
.rg .rg-icon:hover { background: rgba(243, 245, 250, .07); color: var(--rg-text); }
.rg .rg-head .rg-icon.rg-on { color: var(--rg-cyan); }
.rg-log {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(243, 245, 250, .15) transparent;
}
.rg-msg { max-width: 86%; padding: 10px 13px; border-radius: 16px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.rg-ai { align-self: flex-start; background: rgba(243, 245, 250, .06); border: 1px solid var(--rg-line); border-bottom-left-radius: 5px; }
.rg-me { align-self: flex-end; background: linear-gradient(180deg, var(--rg-blue-hi), var(--rg-blue)); color: #fff; border-bottom-right-radius: 5px; }
.rg-note { align-self: center; font-size: 12px; color: var(--rg-faint); }
.rg-note::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--rg-cyan); vertical-align: 1px; }
.rg-typing { display: inline-flex; gap: 4px; padding: 13px 14px; }
.rg-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--rg-cyan); opacity: .3; animation: rg-dot 1.1s infinite; }
.rg-typing i:nth-child(2) { animation-delay: .15s; }
.rg-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes rg-dot { 30% { opacity: 1; transform: translateY(-2px); } }
.rg-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 16px 10px; }
.rg-chips:empty { display: none; }
.rg-chip {
  padding: 7px 12px;
  border: 1px solid rgba(92, 225, 255, .25);
  border-radius: 999px;
  background: rgba(43, 89, 255, .12);
  font-size: 13px;
  line-height: 1.2;
  transition: background .2s, border-color .2s;
}
.rg-chip:hover { background: rgba(43, 89, 255, .24); border-color: rgba(92, 225, 255, .45); }
.rg-form {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 12px;
  padding: 5px 5px 5px 14px;
  border: 1px solid var(--rg-line-2);
  border-radius: 999px;
  background: rgba(243, 245, 250, .04);
}
.rg-form:focus-within { border-color: rgba(92, 225, 255, .5); box-shadow: 0 0 0 3px rgba(43, 89, 255, .25); }
.rg-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--rg-text); }
.rg-input::placeholder { color: var(--rg-faint); }
.rg .rg-mic.rg-on { color: #fff; background: var(--rg-blue); }
.rg .rg-send {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(180deg, var(--rg-blue-hi), var(--rg-blue));
}
.rg .rg-send:hover { background: linear-gradient(180deg, #5a80ff, #3463ff); }
.rg-foot { margin: 0; padding: 8px 16px 12px; font-size: 11px; line-height: 1.35; color: var(--rg-faint); text-align: center; }

/* ---------- phones ---------- */
@media (max-width: 560px) {
  .rg { right: 16px; bottom: 16px; left: 16px; }
  .rg-panel { width: 100%; height: min(78dvh, 640px); }
  .rg-welcome { bottom: 16px; padding: 22px 18px 18px; }
  .rg-w-t { font-size: 24px; }
  .rg-tour { bottom: 16px; padding: 16px; gap: 12px; }
  .rg-tour .rg-orb-lg { width: 30px; height: 30px; }
  .rg-tour-t { font-size: 14.5px; }
  .rg-tbtn { height: 36px; padding: 0 13px; font-size: 13px; }
  .rg-nudge { max-width: 78vw; }
}
@media print { .rg { display: none; } }
