/* ReserveChain chatbot chrome. Colours inherit public theme tokens (--rc-*). */
#gemreserve-chatbot-root {
  --gr-gold: var(--rc-brandgold-400, #d4af37);
  --gr-gold-bright: var(--rc-brandgold-300, #e3c766);
  --gr-gold-deep: var(--rc-brandgold-500, #c9a227);
  --gr-blue: var(--gr-gold);
  --gr-blue-deep: var(--gr-gold-deep);
  --gr-copper: var(--rc-copper-400, #d08a4c);
  --gr-on-gold: var(--rc-on-gold, #000000);
  --gr-ink: var(--rc-ink, #e7ebf0);
  --gr-muted: var(--rc-ink-faint, #77808d);
  --gr-muted-strong: var(--rc-ink-muted, #a7b0bc);
  --gr-chip: var(--rc-graphite-800, #121821);
  --gr-chip-border: var(--rc-line, #1e2833);
  --gr-input: var(--rc-graphite-850, #0e131a);
  --gr-user-bubble: var(--gr-gold);
  --gr-assistant-bubble: var(--rc-graphite-800, #121821);
  --gr-panel: var(--rc-graphite-900, #0b0f14);
  --gr-text: var(--gr-ink);
  --gr-log: var(--rc-graphite-950, #000000);
  --gr-cta: linear-gradient(
    to bottom,
    var(--rc-brandgold-300, #e3c766),
    var(--rc-brandgold-400, #d4af37) 52%,
    var(--rc-copper-500, #b87333)
  );
  --gr-cta-hover: linear-gradient(
    to bottom,
    var(--rc-brandgold-300, #e3c766),
    var(--rc-copper-400, #d08a4c)
  );
  --gr-hover-fill: color-mix(in srgb, var(--rc-brandgold-500, #c9a227) 10%, transparent);
  --gr-focus-ring: color-mix(in srgb, var(--rc-brandgold-400, #d4af37) 55%, transparent);
  --gr-desktop-margin: 22px;
  --gr-mobile-margin: 16px;
  --gr-launcher-size: 76px;
  --gr-window-width: 400px;
  --gr-window-height: 640px;
  --gr-radius: 22px;
  --gr-text-size: 15.5px;
  --gr-font: inherit;
}

#gemreserve-chatbot-root,
#gemreserve-chatbot-root * {
  box-sizing: border-box;
}

.gr-launcher,
.gr-panel {
  position: fixed;
  z-index: 9990;
  font-family: var(--gr-font), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.gr-launcher {
  bottom: calc(var(--gr-desktop-margin) + env(safe-area-inset-bottom, 0px));
  width: var(--gr-launcher-size);
  height: var(--gr-launcher-size);
  padding: 0;
  border: 2px solid var(--gr-gold);
  border-radius: 50%;
  background: var(--gr-log);
  color: var(--gr-on-gold);
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.gr-launcher:hover {
  transform: translateY(-1px);
  border-color: var(--gr-gold-bright);
  box-shadow: 0 14px 32px color-mix(in srgb, var(--gr-gold) 28%, transparent);
}

.gr-launcher:focus-visible,
.gr-close:focus-visible,
.gr-send:focus-visible,
.gr-suggestion:focus-visible,
.gr-footer a:focus-visible,
.gr-retry:focus-visible,
.gr-source:focus-visible,
.gr-conv-form__submit:focus-visible,
.gr-conv-form__ghost:focus-visible,
.gr-conv-form__link:focus-visible,
.gr-feedback__button:focus-visible {
  outline: 3px solid var(--gr-focus-ring);
  outline-offset: 3px;
}

.gr-launcher__icon {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--gr-log);
}

.gr-launcher__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.gr-launcher__label {
  display: none;
}

.gr-launcher[hidden],
.gr-panel[hidden] {
  display: none !important;
}

.gr-pos-right .gr-launcher,
.gr-pos-right .gr-panel {
  right: calc(var(--gr-desktop-margin) + env(safe-area-inset-right, 0px));
}

.gr-pos-left .gr-launcher,
.gr-pos-left .gr-panel {
  left: calc(var(--gr-desktop-margin) + env(safe-area-inset-left, 0px));
}

.gr-panel {
  bottom: calc(var(--gr-desktop-margin) + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  width: min(var(--gr-window-width), calc(100vw - 32px));
  height: min(var(--gr-window-height), calc(100dvh - 72px));
  max-height: calc(100dvh - 72px - env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  border-radius: var(--gr-radius);
  background: var(--gr-panel);
  color: var(--gr-text);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
  border: 1px solid var(--gr-chip-border);
  animation: gr-rise 0.18s ease-out;
}

@keyframes gr-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gr-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 22px 16px;
  background: var(--gr-panel);
  color: var(--gr-ink);
  border-bottom: 1px solid var(--gr-gold);
  flex: 0 0 auto;
}

.gr-header__avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: -26px;
  border: 2px solid var(--gr-gold);
  border-radius: 50%;
  background: var(--gr-log);
  overflow: hidden;
  flex: 0 0 auto;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.gr-header__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.gr-header__text {
  min-width: 0;
  flex: 1;
  padding-top: 2px;
}

.gr-header__name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.gr-header__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--gr-gold-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gr-header__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 18px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--gr-gold);
  color: var(--gr-on-gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex: 0 0 auto;
}

.gr-header__subtitle {
  margin: 3px 0 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.25;
  color: var(--gr-muted-strong);
  white-space: normal;
}

.gr-header__tools {
  display: flex;
  flex: 0 0 auto;
  align-self: flex-start;
  margin-top: 2px;
}

.gr-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--gr-chip-border);
  border-radius: 8px;
  background: var(--gr-chip);
  color: var(--gr-gold);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  font-weight: 500;
}

.gr-close:hover {
  background: var(--gr-hover-fill);
  border-color: var(--gr-gold);
  color: var(--gr-gold-bright);
}

.gr-log {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 28px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--gr-log);
  scrollbar-width: thin;
  scrollbar-color: var(--gr-gold-deep) var(--gr-log);
}

.gr-welcome {
  display: grid;
  gap: 14px;
}

.gr-welcome__text {
  margin: 0;
  color: var(--gr-ink);
  font-size: var(--gr-text-size);
  line-height: 1.55;
}

.gr-welcome__ai {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  color: var(--gr-muted);
  font-size: 13px;
  line-height: 1.45;
}

.gr-welcome__ai-icon {
  color: var(--gr-gold);
  font-size: 14px;
  line-height: 1.3;
}

.gr-msg {
  max-width: 92%;
  padding: 11px 14px;
  border-radius: 16px;
  font-family: var(--gr-font);
  font-size: var(--gr-text-size);
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.gr-msg--user {
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  background: var(--gr-user-bubble);
  color: var(--gr-on-gold);
}

.gr-msg--bot {
  align-self: flex-start;
  border: 1px solid var(--gr-chip-border);
  border-bottom-left-radius: 6px;
  background: var(--gr-assistant-bubble);
  color: var(--gr-ink);
}

.gr-msg--rtl {
  direction: rtl;
  text-align: right;
  unicode-bidi: plaintext;
}

.gr-msg--rtl a,
.gr-msg--rtl code {
  direction: ltr;
  unicode-bidi: isolate;
}

.gr-msg__time {
  display: block;
  margin-top: 6px;
  color: var(--gr-muted);
  font-size: 11px;
}

.gr-msg--user .gr-msg__time {
  color: var(--rc-graphite-700, #1a222e);
}

.gr-msg strong {
  color: var(--gr-gold-deep);
  font-weight: 600;
}

.gr-msg--user strong {
  color: var(--gr-on-gold);
}

.gr-msg a {
  color: var(--gr-copper);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.gr-msg a:hover {
  color: var(--gr-gold-bright);
}

.gr-msg--user a {
  color: var(--gr-on-gold);
}

.gr-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.gr-source {
  padding: 3px 8px;
  border: 1px solid var(--gr-chip-border);
  border-radius: 999px;
  color: var(--gr-copper);
  font-size: 11px;
  text-decoration: none;
  background: var(--gr-chip);
}

.gr-source:hover {
  border-color: var(--gr-gold);
  background: var(--gr-hover-fill);
  color: var(--gr-gold-bright);
}

.gr-feedback {
  display: flex;
  gap: 3px;
  margin-top: 8px;
}

.gr-feedback__button {
  display: grid;
  width: 26px;
  height: 24px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--gr-muted-strong);
  opacity: 0.8;
  cursor: pointer;
}

.gr-feedback__button:hover,
.gr-feedback__button.is-selected {
  border-color: var(--gr-chip-border);
  background: var(--gr-hover-fill);
  color: var(--gr-gold);
  opacity: 1;
}

.gr-suggestions {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.gr-suggestion {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gr-chip-border);
  border-radius: 10px;
  background: var(--gr-chip);
  color: var(--gr-gold-deep);
  font-size: 14.5px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.gr-suggestion:hover {
  border-color: var(--gr-gold);
  background: var(--gr-hover-fill);
  color: var(--gr-gold-bright);
}

.gr-suggestion:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.gr-form {
  padding: 0 14px 8px;
  background: var(--gr-panel);
  flex: 0 0 auto;
}

.gr-inputrow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 16px;
  border: 1px solid var(--gr-chip-border);
  border-radius: 999px;
  background: var(--gr-input);
}

.gr-input {
  flex: 1;
  min-height: 28px;
  max-height: 110px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--gr-ink);
  font-family: inherit;
  font-size: var(--gr-text-size);
  line-height: 1.45;
  resize: none;
}

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

.gr-input:focus {
  outline: none;
}

.gr-inputrow:focus-within {
  border-color: var(--gr-gold);
  box-shadow: 0 0 0 3px var(--gr-focus-ring);
}

.gr-send {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid color-mix(in srgb, var(--gr-gold-bright) 30%, transparent);
  border-radius: 50%;
  background: var(--gr-cta);
  color: var(--gr-on-gold);
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: 0 2px 12px -2px color-mix(in srgb, var(--rc-copper-500, #b87333) 50%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.gr-send:hover:not(:disabled) {
  background: var(--gr-cta-hover);
}

.gr-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.gr-send svg {
  width: 18px;
  height: 18px;
}

.gr-footer {
  margin: 8px 2px 6px;
  padding: 0 4px 4px;
  font-size: 11.5px;
  line-height: 1.5;
  text-align: center;
  color: var(--gr-muted);
}

.gr-footer a {
  color: var(--gr-copper);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gr-footer a:hover {
  color: var(--gr-gold-bright);
}

.gr-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gr-muted);
  font-size: 13px;
}

.gr-dots span {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 3px;
  border-radius: 50%;
  background: var(--gr-gold);
  animation: gr-blink 1s infinite ease-in-out;
}

.gr-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.gr-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes gr-blink {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}

.gr-error {
  display: grid;
  gap: 8px;
  justify-items: center;
  align-self: center;
  color: #c45b6c;
  font-size: 13.5px;
  text-align: center;
}

.gr-retry {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--gr-chip-border);
  border-radius: 10px;
  background: var(--gr-chip);
  color: var(--gr-gold-deep);
  cursor: pointer;
}

.gr-retry:hover {
  border-color: var(--gr-gold);
  background: var(--gr-hover-fill);
  color: var(--gr-gold-bright);
}

.gr-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.gr-preview-root {
  position: relative;
  min-height: 680px;
}

.gr-preview-root .gr-launcher,
.gr-preview-root .gr-panel {
  position: absolute;
}

.gr-conv-form {
  direction: ltr;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--gr-chip-border);
  border-radius: 14px;
  background: var(--gr-panel);
  text-align: left;
}

.gr-conv-form__title {
  margin: 0 0 4px;
  color: var(--gr-ink);
  font-size: 15px;
}

.gr-conv-form__description,
.gr-conv-form__safety,
.gr-conv-form__status {
  margin: 0 0 10px;
  color: var(--gr-muted);
  font-size: 12px;
  line-height: 1.45;
}

.gr-conv-form__safety {
  padding: 8px;
  border-radius: 8px;
  background: var(--gr-chip);
}

.gr-conv-field {
  margin-bottom: 10px;
}

.gr-conv-field[hidden],
.gr-honeypot {
  display: none !important;
}

.gr-conv-field__label {
  display: grid;
  gap: 5px;
  color: var(--gr-ink);
  font-size: 12px;
  font-weight: 600;
}

.gr-conv-field__control {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--gr-chip-border);
  border-radius: 9px;
  background: var(--gr-input);
  color: var(--gr-ink);
  font: 400 13px/1.4 var(--gr-font);
}

.gr-conv-field__control:focus {
  border-color: var(--gr-gold);
  outline: 2px solid var(--gr-focus-ring);
}

.gr-conv-field__consent,
.gr-conv-choice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 400;
}

.gr-conv-choices {
  display: grid;
  gap: 7px;
}

.gr-conv-form__progress {
  margin: 0 0 10px;
  color: var(--gr-gold);
  font-size: 12px;
}

.gr-conv-form__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.gr-conv-form__submit {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--gr-gold-bright) 30%, transparent);
  border-radius: 10px;
  background: var(--gr-cta);
  color: var(--gr-on-gold);
  font-weight: 700;
  cursor: pointer;
}

.gr-conv-form__submit:hover {
  background: var(--gr-cta-hover);
}

.gr-conv-form__ghost,
.gr-conv-form__link {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--gr-chip-border);
  border-radius: 10px;
  background: transparent;
  color: var(--gr-gold-deep);
  cursor: pointer;
}

.gr-conv-form__ghost:hover,
.gr-conv-form__link:hover {
  border-color: var(--gr-gold);
  background: var(--gr-hover-fill);
  color: var(--gr-gold-bright);
}

.gr-conv-form__link {
  border: 0;
  text-decoration: underline;
}

.gr-conv-review {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.gr-conv-review__row {
  display: grid;
  gap: 2px;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gr-chip-border);
}

.gr-conv-review__row strong {
  color: var(--gr-gold-deep);
  font-size: 12px;
}

@media (max-width: 480px) {
  .gr-panel {
    right: var(--gr-mobile-margin);
    left: var(--gr-mobile-margin);
    bottom: calc(var(--gr-mobile-margin) + env(safe-area-inset-bottom, 0px));
    width: auto;
    height: min(var(--gr-window-height), calc(100dvh - 72px - env(safe-area-inset-bottom, 0px)));
    max-height: calc(100dvh - 72px - env(safe-area-inset-bottom, 0px));
    border-radius: 18px;
  }

  .gr-launcher {
    width: 64px;
    height: 64px;
    bottom: calc(var(--gr-mobile-margin) + env(safe-area-inset-bottom, 0px));
  }

  .gr-pos-right .gr-launcher,
  .gr-pos-left .gr-launcher {
    right: var(--gr-mobile-margin);
    left: auto;
  }

  .gr-mobile-left .gr-launcher {
    right: auto;
    left: var(--gr-mobile-margin);
  }

  .gr-header__subtitle {
    font-size: 12px;
  }

  .gr-input {
    font-size: 16px;
  }

  .gr-suggestion {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gr-panel,
  .gr-launcher,
  .gr-dots span {
    animation: none;
    transition: none;
  }
}
