/* Chatbot UI styles extracted from index.html */
:root {
  --assistant-launcher-right: 24px;
  --assistant-launcher-bottom: 30px;
  --assistant-launcher-height: 44px;
  --assistant-arrow-gap: 12px;
  --composer-height: 112px;
}

body.chatbot-open {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}
html.chatbot-open {
  overflow: hidden;
  overscroll-behavior: none;
}
body.chatbot-open #cursor-ring,
body.chatbot-open #cursor-dot { opacity: 0 !important; }

body.rg-chat-route-active {
  background: var(--paper);
}

body.rg-chat-route-active > *:not(#rg-chatbot-shell) {
  display: none !important;
}

/* Hide portfolio "scroll to top" button when mobile chat drawer/route is active. */
body.rg-chat-route-active #scroll-top,
#rg-chatbot-shell.mobile-layout.drawer-open ~ #scroll-top {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#rg-chatbot-launcher {
  position: fixed;
  right: var(--assistant-launcher-right);
  bottom: var(--assistant-launcher-bottom);
  z-index: 10020;
  border: 1px solid rgba(13,13,13,0.15);
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 12px 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  box-shadow: 0 12px 32px rgba(13,13,13,0.2), 0 0 0 0 rgba(184,145,42,0.22);
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease;
  animation: rgLauncherFloat 4.6s ease-in-out infinite, rgLauncherAura 3.2s ease-in-out infinite;
  isolation: isolate;
  overflow: visible;
}

.rg-chatbot-launcher-boy {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 12px);
  transform: translateX(-50%);
  width: 220px;
  pointer-events: none;
  z-index: 2;
}

.rg-chatbot-launcher-boy img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 5px 9px rgba(0, 0, 0, 0.32));
}

#rg-chatbot-launcher::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(184,145,42,0.2);
  box-shadow: 0 0 14px rgba(184,145,42,0.2), 0 0 28px rgba(184,145,42,0.16);
  opacity: 0.62;
  z-index: -1;
  pointer-events: none;
  animation: rgLauncherGlow 3s ease-in-out infinite;
}

#rg-chatbot-launcher::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 999px;
  border: 1px solid rgba(212,170,69,0.36);
  opacity: 0.46;
  pointer-events: none;
  z-index: -1;
}

#rg-chatbot-launcher:hover {
  transform: translateY(-2px) scale(1.01);
  background: #191919;
  animation-play-state: paused;
}

#rg-chatbot-launcher:hover::before {
  animation-play-state: paused;
  opacity: 0.8;
}

#rg-chatbot-launcher:hover .rg-chatbot-launcher-dot {
  animation-play-state: paused;
}

@keyframes rgLauncherFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes rgLauncherAura {
  0%, 100% {
    box-shadow: 0 12px 32px rgba(13,13,13,0.2), 0 0 0 0 rgba(184,145,42,0.20), 0 0 24px rgba(184,145,42,0.08);
  }
  50% {
    box-shadow: 0 16px 36px rgba(13,13,13,0.24), 0 0 0 9px rgba(184,145,42,0.07), 0 0 34px rgba(184,145,42,0.18);
  }
}

@keyframes rgLauncherGlow {
  0%, 100% {
    opacity: 0.5;
    transform: scale(0.99);
    box-shadow: 0 0 12px rgba(184,145,42,0.18), 0 0 22px rgba(184,145,42,0.12);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(184,145,42,0.24), 0 0 36px rgba(184,145,42,0.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  #rg-chatbot-launcher,
  #rg-chatbot-launcher::before,
  .rg-chatbot-launcher-dot {
    animation: none;
  }
}

.rg-chatbot-launcher-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  font-family: 'DM Mono', monospace;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 6px rgba(184,145,42,0.14);
  animation: rgLauncherDotPulse 2.4s ease-in-out infinite;
}

.rg-chatbot-launcher-dot::before {
  content: 'AI';
}

@keyframes rgLauncherDotPulse {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(184,145,42,0.12);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(184,145,42,0.22);
  }
}

#rg-chatbot-shell {
  position: fixed;
  inset: 0;
  z-index: 130000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  overscroll-behavior: contain;
}

#rg-chatbot-shell.open {
  opacity: 1;
  pointer-events: auto;
}

.rg-chatbot-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6,6,8,0.6);
  backdrop-filter: blur(4px);
}

.rg-chatbot-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(96vw, 1680px);
  height: min(92dvh, 980px);
  transform: translate(-50%, -50%);
  background: var(--paper);
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.22);
  padding: 0 !important;
  margin: 0;
}

.rg-chatbot-layout {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(300px, 34%) 1fr;
}

.rg-chatbot-profile {
  background: var(--ink);
  color: #fff;
  padding: 40px 34px 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  overflow: hidden;
  min-height: 0;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.rg-chatbot-profile::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.5;
  pointer-events: none;
}

.rg-chatbot-profile-inner {
  position: relative;
  z-index: 1;
}

.rg-chatbot-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
}

.rg-chatbot-kicker::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--gold);
}

.rg-chatbot-name {
  font-family: 'Playfair Display', serif;
  font-size: clamp(36px, 4.2vw, 56px);
  line-height: 0.95;
  font-weight: 900;
  margin-bottom: 14px;
  letter-spacing: -1px;
}

.rg-chatbot-tagline {
  border-left: 2px solid var(--gold);
  padding-left: 12px;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  line-height: 1.65;
  margin-bottom: 20px;
}

.rg-chatbot-facts {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.rg-chatbot-fact {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.84);
  font-size: 13px;
  line-height: 1.35;
}

.rg-chatbot-fact-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

.rg-chatbot-prompts-title {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 10px;
}

.rg-chatbot-profile-prompts {
  display: grid;
  gap: 9px;
}

.rg-chatbot-profile-prompt {
  text-align: left;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.74);
  font-size: 12px;
  line-height: 1.45;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.rg-chatbot-profile-prompt:hover {
  color: var(--gold);
  transform: translateX(4px);
}

.rg-chatbot-chat {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  background: var(--paper);
  overflow: hidden;
}

.rg-chatbot-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(245,240,232,0.97);
  backdrop-filter: blur(8px);
  min-height: 76px;
}

.rg-chatbot-route-header {
  display: none;
}

.rg-chatbot-route-back {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.1);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rg-chatbot-route-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.rg-chatbot-top-title {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 2.1px;
  text-transform: uppercase;
  color: var(--muted);
}

.rg-chatbot-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rg-chatbot-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--slate);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.rg-chatbot-icon-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.rg-chatbot-icon-glyph {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rg-chatbot-icon-glyph svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rg-chatbot-mobile-expanded,
.rg-chatbot-mobile-prompts-expanded {
  display: none;
}

.rg-chatbot-mobile-header { display: none; }

.rg-chatbot-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 22px 24px;
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.rg-chat-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: min(94%, 860px);
}

.rg-chat-msg.user {
  justify-self: end;
  flex-direction: row-reverse;
}

.rg-chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.6px;
}

.rg-chat-msg.bot .rg-chat-msg-avatar {
  background: var(--gold);
  color: var(--ink);
}

.rg-chat-msg.user .rg-chat-msg-avatar {
  background: var(--ink);
  color: #fff;
}

.rg-chat-msg-bubble {
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.62;
  white-space: pre-wrap;
  word-break: break-word;
}

.rg-chat-msg.bot .rg-chat-msg-bubble {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  border-top-left-radius: 5px;
  color: var(--slate);
}

.rg-chat-msg.user .rg-chat-msg-bubble {
  background: var(--ink);
  color: #fff;
  border-top-right-radius: 5px;
}

.rg-chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
}

.rg-chat-typing-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(184,145,42,0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: rgChatSpin 1s linear infinite;
}

@keyframes rgChatSpin {
  to { transform: rotate(360deg); }
}

.rg-chatbot-input-wrap {
  position: sticky;
  bottom: 0;
  z-index: 3;
  flex-shrink: 0;
  padding: 18px 24px 20px;
  background: linear-gradient(to top, rgba(245,240,232,1), rgba(245,240,232,0.95), rgba(245,240,232,0.6));
  border-top: 1px solid var(--border);
}

.rg-chatbot-mobile-prompts {
  display: none;
}

.rg-chatbot-desktop-prompts {
  display: grid;
  gap: 12px;
  width: min(94%, 860px);
  margin: 10px 0 0;
}

#rg-chatbot-shell.chat-started .rg-chatbot-desktop-prompts {
  display: none;
}

.rg-chatbot-desktop-prompt-card {
  width: auto;
  text-align: left;
  border-radius: 14px;
  font-size: 15px;
  padding: 14px 16px;
}

.rg-chatbot-mobile-prompt-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.rg-chatbot-mobile-prompt-row::-webkit-scrollbar {
  display: none;
}

.rg-chatbot-mobile-prompt-pill {
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--slate);
  padding: 8px 12px;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}

.rg-chatbot-mobile-prompts-expanded {
  gap: 8px;
}

.rg-chatbot-mobile-prompt-card {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.45;
  padding: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.rg-chatbot-desktop-prompts .rg-chatbot-desktop-prompt-card {
  border-radius: 14px;
  font-size: 15px;
  padding: 14px 16px;
}

.rg-chatbot-mobile-prompt-pill:hover,
.rg-chatbot-mobile-prompt-card:hover,
.rg-chatbot-desktop-prompt-card:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.rg-chatbot-mobile-prompt-card:active,
.rg-chatbot-desktop-prompt-card:active {
  background: var(--gold-pale);
}

.rg-chatbot-prompt-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gold);
}

.rg-chatbot-prompt-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rg-chatbot-prompt-label {
  display: inline-block;
}

.rg-chatbot-form {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 8px 6px 14px;
  box-shadow: var(--shadow-sm);
  max-width: 1040px;
  margin: 0 auto;
}

.rg-chatbot-input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  color: var(--slate);
  font-size: 13px;
  line-height: 1.45;
  outline: none;
}

.rg-chatbot-input::placeholder { color: var(--muted); }

.rg-chatbot-send {
  width: 34px;
  height: 34px;
  aspect-ratio: 1 / 1;
  flex: 0 0 auto;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(13,13,13,0.38);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.rg-chatbot-send:hover { background: var(--ink); color: #fff; }

.rg-chatbot-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rg-chatbot-footnote {
  text-align: center;
  margin-top: 10px;
  font-family: 'DM Mono', monospace;
  font-size: 8px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}

.rg-chatbot-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.rg-chatbot-mobile-drawer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(84dvh, 760px);
  transform: translateY(calc(100% + 40px));
  transition: transform 0.28s cubic-bezier(0.22,1,0.36,1);
  background: var(--ink);
  color: #fff;
  border-radius: 24px 24px 0 0;
  padding: 12px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -14px 36px rgba(0,0,0,0.35);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  pointer-events: none;
  visibility: hidden;
}

/* Remove mobile "info" swipe-up sheet entirely. */
#rg-chatbot-open-drawer,
.rg-chatbot-drawer-overlay,
.rg-chatbot-mobile-drawer {
  display: none !important;
}

#rg-chatbot-shell.drawer-open .rg-chatbot-drawer-overlay {
  opacity: 1;
  pointer-events: auto;
}

#rg-chatbot-shell.drawer-open .rg-chatbot-mobile-drawer {
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}

.rg-chatbot-drawer-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

.rg-chatbot-drawer-name {
  font-size: clamp(28px, 8.4vw, 42px);
  white-space: nowrap;
  margin-bottom: 12px;
}

.rg-chatbot-drawer-prompts {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.rg-chatbot-drawer-prompt {
  text-align: left;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.84);
  padding: 12px;
  font-size: 12px;
  line-height: 1.45;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 1024px) {
  .rg-chatbot-launcher-boy {
    display: none;
  }

  #rg-chatbot-shell.mobile-layout .rg-chatbot-backdrop {
    display: none;
  }

  #rg-chatbot-shell.route-mode {
    opacity: 1;
    pointer-events: auto;
  }

  #rg-chatbot-shell.route-mode .rg-chatbot-route-header {
    display: none;
  }

  #rg-chatbot-shell.mobile-layout .rg-chatbot-panel {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: none;
    min-width: 0;
    height: var(--rg-chatbot-vh, 100dvh);
    margin: 0;
    border-radius: 0;
    transform: none;
    border: 0;
  }

  :root {
    --assistant-launcher-right: 16px;
    --assistant-launcher-bottom: calc(16px + env(safe-area-inset-bottom));
    --assistant-launcher-height: 40px;
    --assistant-arrow-gap: 10px;
  }

  #rg-chatbot-launcher {
    padding: 11px 14px;
    font-size: 9px;
  }

  .rg-chatbot-panel {
    inset: 0;
    width: 100%;
    height: 100dvh;
    height: var(--rg-chatbot-vh, 100dvh);
    transform: none;
    top: 0;
    left: 0;
    border-radius: 0;
  }

  .rg-chatbot-layout {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
  }

  .rg-chatbot-profile,
  .rg-chatbot-topbar {
    display: none;
  }

  .rg-chatbot-chat {
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .rg-chatbot-mobile-expanded {
    display: block;
    background: var(--ink);
    color: #fff;
    position: relative;
    z-index: 1;
    border-radius: 0 0 40px 40px;
    box-shadow: 0 10px 24px rgba(13, 13, 13, 0.2);
    overflow: hidden;
    flex-shrink: 0;
    margin-bottom: 10px;
    visibility: visible;
    max-height: 360px;
    opacity: 1;
    transform: translateY(0);
    transform-origin: top center;
    transition: max-height 0.24s ease, opacity 0.18s ease, transform 0.24s ease, margin-bottom 0.24s ease;
  }

  #rg-chatbot-shell.chat-started .rg-chatbot-mobile-expanded,
  #rg-chatbot-shell.composer-active .rg-chatbot-mobile-expanded {
    max-height: 0;
    opacity: 0;
    transform: translateY(-8px);
    margin-bottom: 0;
    pointer-events: none;
    box-shadow: none;
    border-radius: 0;
    visibility: hidden;
  }

  .rg-chatbot-mobile-expanded-noise {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  }

  .rg-chatbot-mobile-expanded-inner {
    position: relative;
    z-index: 1;
    padding: 40px 24px 32px;
  }

  .rg-chatbot-mobile-expanded-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.08);
    color: #fff;
    cursor: pointer;
  }

  .rg-chatbot-mobile-expanded-kicker {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    letter-spacing: 3.5px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
  }

  .rg-chatbot-mobile-expanded-kicker::before {
    content: '';
    width: 16px;
    height: 1px;
    background: var(--gold);
  }

  .rg-chatbot-mobile-expanded-name {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
  }

  .rg-chatbot-mobile-expanded-copy {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 90%;
  }

  .rg-chatbot-mobile-expanded-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .rg-chatbot-mobile-tag {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    line-height: 1;
  }

  .rg-chatbot-mobile-tag-gold {
    color: var(--gold);
    border-color: rgba(184,145,42,0.32);
  }

  .rg-chatbot-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 16px;
    background: var(--ink);
    color: #fff;
    box-shadow: none;
    position: sticky;
    top: 0;
    z-index: 2;
    flex-shrink: 0;
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.22s ease, opacity 0.16s ease, transform 0.22s ease, padding 0.22s ease, box-shadow 0.22s ease;
  }

  #rg-chatbot-shell.chat-started .rg-chatbot-mobile-header,
  #rg-chatbot-shell.composer-active .rg-chatbot-mobile-header {
    max-height: 84px;
    opacity: 1;
    transform: translateY(0);
    padding: calc(16px + env(safe-area-inset-top)) 16px 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
    pointer-events: auto;
  }

  .rg-chatbot-mobile-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }

  .rg-chatbot-mobile-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--ink);
    font-family: 'Playfair Display', serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
  }

  .rg-chatbot-mobile-name {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    line-height: 1;
    font-weight: 700;
  }

  .rg-chatbot-mobile-role {
    margin-top: 2px;
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
  }

  .rg-chatbot-icon-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--gold);
  }

  .rg-chatbot-icon-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    color: var(--gold);
  }

  .rg-chatbot-messages {
    flex: 1 1 auto;
    padding: 16px;
    gap: 24px;
    display: grid;
    align-content: start;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: calc(var(--composer-height, 112px) + env(safe-area-inset-bottom));
    transition: padding-bottom 0.2s ease, padding-top 0.2s ease;
  }

  #rg-chatbot-shell:not(.chat-started) .rg-chatbot-messages {
    align-content: start;
    padding-top: 20px;
  }

  .rg-chat-msg {
    max-width: 92%;
    gap: 10px;
  }

  .rg-chat-msg-avatar {
    width: 28px;
    height: 28px;
    font-size: 10px;
  }

  .rg-chat-msg-bubble {
    padding: 14px;
    font-size: 13px;
    line-height: 1.62;
    max-width: 100%;
  }

  #rg-chatbot-shell.mobile-layout .rg-chatbot-input-wrap {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    flex-shrink: 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    background: transparent;
    border-top: 0;
    min-width: 0;
    transition: padding 0.2s ease;
  }

  #rg-chatbot-shell.composer-active .rg-chatbot-input-wrap,
  #rg-chatbot-shell.keyboard-open .rg-chatbot-input-wrap {
    padding-top: 10px;
  }

  #rg-chatbot-shell:not(.open) .rg-chatbot-input-wrap {
    display: none;
  }

  .rg-chatbot-mobile-prompts {
    display: none !important;
  }

  .rg-chatbot-desktop-prompts {
    display: none;
  }

  .rg-chatbot-mobile-prompts-expanded {
    display: grid;
    margin-bottom: 16px;
    overflow: hidden;
    max-height: 260px;
    opacity: 1;
    transform: translateY(0);
    transition: max-height 0.22s ease, opacity 0.16s ease, transform 0.22s ease, margin-bottom 0.22s ease;
  }

  #rg-chatbot-shell.chat-started .rg-chatbot-mobile-prompts {
    display: none !important;
  }

  #rg-chatbot-shell.chat-started .rg-chatbot-mobile-prompts-expanded {
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);
    margin-bottom: 0;
    pointer-events: none;
  }

  #rg-chatbot-shell.composer-active .rg-chatbot-mobile-prompts,
  #rg-chatbot-shell.composer-active .rg-chatbot-mobile-prompts-expanded {
    display: none !important;
  }

  #rg-chatbot-shell.chat-started .rg-chatbot-mobile-prompt-row {
    margin: 0 -16px;
    padding: 0 16px 8px;
  }

  .rg-chatbot-input {
    font-size: 13px;
    min-width: 0;
  }

  .rg-chatbot-form {
    gap: 8px;
    padding: 6px 8px 6px 12px;
  }

  .rg-chatbot-send {
    width: 40px;
    height: 40px;
  }

  .rg-chatbot-drawer-overlay {
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
  }

  .rg-chatbot-mobile-drawer {
    height: min(85dvh, 760px);
    border-radius: 24px 24px 0 0;
    padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
  }

  .rg-chatbot-drawer-close {
    top: 20px;
    right: 20px;
    border: none;
    background: rgba(255,255,255,0.1);
  }

  #rg-chatbot-shell.keyboard-open .rg-chatbot-mobile-prompts,
  #rg-chatbot-shell.keyboard-open .rg-chatbot-mobile-prompts-expanded,
  #rg-chatbot-shell.keyboard-open .rg-chatbot-footnote {
    display: none;
  }

  /* Safety guard: force-hide intro card while keyboard is visible to avoid ghost layers/shadows. */
  #rg-chatbot-shell.keyboard-open .rg-chatbot-mobile-expanded,
  #rg-chatbot-shell.composer-active .rg-chatbot-mobile-expanded {
    display: none !important;
  }

  #rg-chatbot-shell.composer-active .rg-chatbot-drawer-overlay {
    opacity: 0 !important;
    pointer-events: none !important;
  }

  #rg-chatbot-shell.composer-active .rg-chatbot-mobile-drawer {
    transform: translateY(100%) !important;
    pointer-events: none !important;
  }
}

@media (max-width: 420px) {
  .rg-chatbot-form {
    padding: 5px 6px 5px 11px;
    gap: 8px;
  }

  .rg-chatbot-mobile-expanded-inner {
    padding: 36px 20px 28px;
  }
}

@media (max-width: 390px) {
  .rg-chatbot-mobile-expanded {
    border-radius: 0 0 34px 34px;
    margin-bottom: 8px;
  }

  .rg-chatbot-mobile-expanded-inner {
    padding: 30px 16px 20px;
  }

  .rg-chatbot-mobile-expanded-close {
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
  }

  .rg-chatbot-mobile-expanded-kicker {
    font-size: 8px;
    letter-spacing: 3px;
    margin-bottom: 14px;
    gap: 8px;
  }

  .rg-chatbot-mobile-expanded-kicker::before {
    width: 12px;
  }

  .rg-chatbot-mobile-expanded-name {
    font-size: clamp(30px, 9vw, 34px);
    margin-bottom: 10px;
    line-height: 1.05;
    letter-spacing: -0.25px;
    white-space: nowrap;
  }

  .rg-chatbot-mobile-expanded-copy {
    font-size: 12px;
    line-height: 1.45;
    margin-bottom: 14px;
    max-width: 100%;
  }

  .rg-chatbot-mobile-expanded-tags {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .rg-chatbot-mobile-expanded-tags::-webkit-scrollbar {
    display: none;
  }

  .rg-chatbot-mobile-tag {
    padding: 5px 10px;
    font-size: 9px;
    white-space: nowrap;
  }

  .rg-chatbot-messages {
    padding: 12px 14px 14px;
    gap: 16px;
  }

  #rg-chatbot-shell:not(.chat-started) .rg-chatbot-messages {
    padding-top: 14px;
  }
}

@media (max-width: 520px) {
  #rg-chatbot-launcher {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
  }

  #rg-chatbot-launcher .rg-chatbot-launcher-label {
    display: none;
  }

  .rg-chatbot-mobile-prompt-pill {
    padding: 7px 10px;
    font-size: 10.5px;
  }

  .rg-chatbot-footnote {
    font-size: 7px;
    letter-spacing: 1.25px;
  }
}

#rg-chatbot-shell,
#rg-chatbot-shell * {
  cursor: auto !important;
}

#rg-chatbot-shell button,
#rg-chatbot-shell [role="button"] {
  cursor: pointer !important;
}

#rg-chatbot-shell input {
  cursor: text !important;
}

/* Prevent mobile browsers (especially iOS Safari) from zooming on input focus. */
@media (hover: none) and (pointer: coarse) {
  #rg-chatbot-shell input,
  #rg-chatbot-shell textarea,
  #rg-chatbot-shell select {
    font-size: 16px !important;
  }

  .rg-chatbot-input {
    font-size: 16px !important;
    line-height: 1.4;
  }
}
