.gcb-banner-root {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 9999;
  pointer-events: none;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --gcb-bg: #111827;
  --gcb-surface: #1f2933;
  --gcb-text: #f9fafb;
  --gcb-muted: #9ca3af;
  --gcb-border: rgba(255, 255, 255, 0.08);
  --gcb-primary: #2563eb;
  --gcb-primary-soft: rgba(37, 99, 235, 0.15);
  --gcb-button-bg: #374151;
  --gcb-button-bg-hover: #4b5563;
}

/* Light theme override */
.gcb-banner-root.gcb-theme-light {
  --gcb-bg: #f9fafb;
  --gcb-surface: #ffffff;
  --gcb-text: #111827;
  --gcb-muted: #6b7280;
  --gcb-border: rgba(15, 23, 42, 0.1);
  --gcb-primary: #2563eb;
  --gcb-primary-soft: rgba(37, 99, 235, 0.1);
  --gcb-button-bg: #e5e7eb;
  --gcb-button-bg-hover: #d1d5db;
}

/* Auto theme: follow system preference */
@media (prefers-color-scheme: light) {
  .gcb-banner-root.gcb-theme-auto {
    --gcb-bg: #f9fafb;
    --gcb-surface: #ffffff;
    --gcb-text: #111827;
    --gcb-muted: #6b7280;
    --gcb-border: rgba(15, 23, 42, 0.1);
    --gcb-primary: #2563eb;
    --gcb-primary-soft: rgba(37, 99, 235, 0.1);
    --gcb-button-bg: #e5e7eb;
    --gcb-button-bg-hover: #d1d5db;
  }
}
@media (prefers-color-scheme: dark) {
  .gcb-banner-root.gcb-theme-auto {
    --gcb-bg: #111827;
    --gcb-surface: #1f2933;
    --gcb-text: #f9fafb;
    --gcb-muted: #9ca3af;
    --gcb-border: rgba(255, 255, 255, 0.08);
    --gcb-primary: #2563eb;
    --gcb-primary-soft: rgba(37, 99, 235, 0.15);
    --gcb-button-bg: #374151;
    --gcb-button-bg-hover: #4b5563;
  }
}

/* Banner layout */
.gcb-banner {
  pointer-events: auto;
  margin: 0 auto 1rem auto;
  max-width: 900px;
  border-radius: 0.75rem;
  background: var(--gcb-surface);
  color: var(--gcb-text);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.35);
  border: 1px solid var(--gcb-border);
  padding: 1rem 1.25rem;
}

.gcb-banner__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.gcb-banner__text {
  flex: 1 1 260px;
  min-width: 0;
}

.gcb-banner__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
}

.gcb-banner__description {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--gcb-muted);
}

.gcb-banner__actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Buttons */
.gcb-btn {
  appearance: none;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.85rem;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.gcb-btn:active {
  transform: translateY(1px);
}

.gcb-btn--primary {
  background: var(--gcb-primary);
  color: #ffffff;
  border-color: var(--gcb-primary);
}

.gcb-btn--primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.gcb-btn--secondary {
  background: var(--gcb-button-bg);
  color: var(--gcb-text);
  border-color: transparent;
}

.gcb-btn--secondary:hover {
  background: var(--gcb-button-bg-hover);
}

.gcb-btn--ghost {
  background: transparent;
  color: var(--gcb-text);
  border-color: var(--gcb-border);
}

.gcb-btn--ghost:hover {
  background: var(--gcb-primary-soft);
  border-color: var(--gcb-primary);
}

/* Modal root + overlay */
.gcb-modal-root {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  pointer-events: none;
}

.gcb-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  z-index: 2147483647;
}

.gcb-modal-overlay.is-open {
  display: flex;
}

/* Modal card */
.gcb-modal {
  position: relative;
  z-index: 2147483648;
  width: min(480px, 100% - 2rem);
  border-radius: 0.75rem;
  background: var(--gcb-surface);
  color: var(--gcb-text);
  border: 1px solid var(--gcb-border);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.5);
  padding: 1.25rem 1.5rem 1.25rem;
}

.gcb-modal__title {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  font-weight: 600;
}

.gcb-modal__description {
  margin: 0 0 1rem 0;
  font-size: 0.85rem;
  color: var(--gcb-muted);
}

.gcb-modal__options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.gcb-option {
  padding: 0.6rem 0.7rem;
  border-radius: 0.5rem;
  background: rgba(15, 23, 42, 0.12);
}

.gcb-banner-root.gcb-theme-light .gcb-option,
.gcb-banner-root.gcb-theme-auto .gcb-option {
  background: rgba(15, 23, 42, 0.04);
}

.gcb-option__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.15rem;
}

.gcb-option__title {
  font-size: 0.9rem;
  font-weight: 500;
}

.gcb-option__badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--gcb-primary-soft);
  color: var(--gcb-primary);
}

.gcb-option__description {
  margin: 0;
  font-size: 0.8rem;
  color: var(--gcb-muted);
}

.gcb-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Toggle switch */
.gcb-switch {
  position: relative;
  display: inline-flex;
  width: 38px;
  height: 20px;
  align-items: center;
}

.gcb-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.gcb-switch__slider {
  position: relative;
  display: inline-block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background-color: #4b5563;
  transition: background-color 0.15s ease;
}

.gcb-switch__slider::before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  top: 3px;
  border-radius: 999px;
  background: #ffffff;
  transition: transform 0.15s ease;
}

.gcb-switch input:checked + .gcb-switch__slider {
  background-color: var(--gcb-primary);
}

.gcb-switch input:checked + .gcb-switch__slider::before {
  transform: translateX(16px);
}

/* Iframe placeholder */
.gcb-iframe-placeholder {
  position: relative;
  display: block;
  padding: 1rem;
  margin: 0.5rem 0;
  border-radius: 0.75rem;
  border: 1px dashed var(--gcb-border);
  background: rgba(15, 23, 42, 0.06);
  text-align: center;
}

.gcb-banner-root.gcb-theme-light .gcb-iframe-placeholder,
.gcb-banner-root.gcb-theme-auto .gcb-iframe-placeholder {
  background: rgba(15, 23, 42, 0.02);
}

.gcb-iframe-placeholder .gcb-iframe-load {
  margin: 0;
}

/* Scroll lock while modal is open */
body.gcb-modal-open {
  overflow: hidden;
}

/* === GCB MODAL FINAL OVERRIDES === */

#gcb-modal-root .gcb-modal-overlay {
  background: rgba(15, 23, 42, 0.70) !important; /* darker dim */
}

#gcb-modal-root .gcb-modal {
  background-color: #1f2933 !important;         /* dark card */
  color: #f9fafb !important;                    /* light text */
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Titles / text inside the modal */
#gcb-modal-root .gcb-modal__title {
  color: #f9fafb !important;
}

#gcb-modal-root .gcb-modal__description,
#gcb-modal-root .gcb-option__description {
  color: #9ca3af !important;
}

#gcb-modal-root .gcb-option__title {
  color: #e5e7eb !important;
}

/* Make sure buttons stay on-brand in case theme touches them */
#gcb-modal-root .gcb-btn--primary {
  background-color: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
}

#gcb-modal-root .gcb-btn--secondary {
  background-color: #374151 !important;
  border-color: transparent !important;
  color: #f9fafb !important;
}

#gcb-modal-root .gcb-btn--ghost {
  background-color: transparent !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #f9fafb !important;
}