.google-connection-warning {
  position: fixed;
  inset: 0;
  width: min(640px, calc(100vw - 24px));
  max-height: min(90dvh, 900px);
  margin: auto;
  padding: 0;
  overflow: auto;
  color: var(--ui-color-text, var(--app-shell-text, #172033));
  background: var(--ui-modal-bg, var(--app-shell-surface, #fff));
  border: 1px solid var(--ui-color-border, #8993a2);
  border-radius: var(--ui-modal-radius, 16px);
  box-shadow: var(--ui-modal-shadow, 0 18px 48px rgba(0, 0, 0, .34));
  scrollbar-width: thin;
  scrollbar-color: var(--ui-color-border, #8993a2) transparent;
}

.google-connection-warning::-webkit-scrollbar {
  width: 10px;
}

.google-connection-warning::-webkit-scrollbar-track {
  background: transparent;
}

.google-connection-warning::-webkit-scrollbar-thumb {
  background: var(--ui-color-border, #8993a2);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.google-connection-warning::-webkit-scrollbar-thumb:hover {
  background: var(--ui-color-text-muted, #64748b);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.google-connection-warning::backdrop {
  background: var(--ui-overlay-bg, rgba(2, 6, 23, .68));
}

.google-connection-warning form {
  display: grid;
  margin: 0;
  /* Second layer: the dark app-shell surface is slightly translucent, the page must not show through. */
  background: var(--ui-modal-bg, var(--app-shell-surface, #fff));
}

.google-connection-warning :is(h2, h3, p, ol) {
  margin: 0;
}

.google-connection-warning-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(16px, 4vw, 24px) clamp(16px, 4vw, 28px) 0;
}

.google-connection-warning h2 {
  min-width: 0;
  font-size: 1.25rem;
  line-height: 1.3;
}

/* The title only receives programmatic focus to start reading; no ring on a non-control. */
.google-connection-warning h2:focus {
  outline: none;
}

.google-connection-warning-close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.google-connection-warning-close:hover {
  background: var(--ui-color-surface-hover, transparent);
}

.google-connection-warning-close:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.google-connection-warning-body {
  display: grid;
  gap: 14px;
  padding: 16px clamp(16px, 4vw, 28px) 20px;
  line-height: 1.5;
}

.google-connection-warning-steps-title {
  margin-block-start: 4px;
  font-size: 1rem;
  line-height: 1.4;
}

.google-connection-warning-steps {
  display: grid;
  gap: 8px;
  padding-inline-start: 1.5rem;
}

.google-connection-warning-steps li {
  padding-inline-start: 4px;
}

.google-connection-warning-note {
  color: var(--ui-color-text-muted, inherit);
  font-size: .9rem;
}

.google-connection-warning-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  justify-content: center;
  gap: 10px;
  padding: 14px clamp(16px, 4vw, 28px) clamp(16px, 4vw, 24px);
  background: var(--ui-modal-bg, var(--app-shell-surface, #fff));
  border-top: 1px solid var(--ui-color-border, #8993a2);
}

.google-connection-warning-actions button {
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid var(--ui-color-border, #8993a2);
  border-radius: 9px;
  background: var(--ui-modal-bg, var(--app-shell-surface, #fff));
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.google-connection-warning-actions button:hover {
  filter: brightness(.95);
}

.google-connection-warning-actions button:focus-visible {
  outline: 2px solid var(--primary-color, #267653);
  outline-offset: 2px;
}

.google-connection-warning-actions button[value="continue"] {
  border-color: var(--primary-color, #267653);
  background: var(--primary-color, #267653);
  color: var(--on-primary-color);
}

@media (max-width: 420px) {
  .google-connection-warning-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (forced-colors: active) {
  .google-connection-warning,
  .google-connection-warning-actions,
  .google-connection-warning-actions button {
    border-color: CanvasText;
  }
}
