:root {
  --es-surface: #ffffff;
  --es-surface-subtle: #f4f4f5;
  --es-text: #343a40;
  --es-muted: #71717a;
  --es-line: #e4e4e7;
  --es-line-strong: #d4d4d8;
  --es-accent: #343a40;
  --es-shadow: 0 18px 54px rgba(52, 58, 64, 0.2);
}

html.dark {
  --es-surface: #27272a;
  --es-surface-subtle: #3f3f46;
  --es-text: #f4f4f5;
  --es-muted: #a1a1aa;
  --es-line: #52525b;
  --es-line-strong: #71717a;
  --es-accent: #f4f4f5;
  --es-shadow: 0 18px 54px rgba(0, 0, 0, 0.42);
}

html.es-modal-open {
  overflow: hidden;
}

.es-native-qr-content {
  color: var(--es-text);
}

.es-native-qr-controls {
  box-sizing: border-box;
  width: 100%;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--es-line);
  font: inherit;
}

.es-native-qr-content.is-es-full .es-native-qr-controls {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.es-native-qr-content.is-es-full > .es-native-qr-original {
  display: none !important;
}

.es-field + .es-field {
  margin-top: 16px;
}

.es-label {
  display: block;
  margin-bottom: 8px;
  color: var(--es-text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.es-segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  box-sizing: border-box;
  width: 100%;
  padding: 3px;
  border: 1px solid var(--es-line);
  border-radius: 4px;
  background: var(--es-surface-subtle);
}

.es-segmented button,
.es-client,
.es-copy-button {
  box-sizing: border-box;
  min-height: 36px;
  border: 1px solid var(--es-line-strong);
  border-radius: 3px;
  background: var(--es-surface);
  color: var(--es-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
}

.es-segmented button {
  border-color: transparent;
  background: transparent;
}

.es-segmented button.is-active,
.es-client.is-active {
  border-color: var(--es-accent);
  background: var(--es-accent);
  color: var(--es-surface);
}

.es-segmented button:disabled {
  color: var(--es-muted);
  cursor: not-allowed;
  opacity: 0.45;
}

.es-segmented button:focus-visible,
.es-client:focus-visible,
.es-copy-button:focus-visible,
.es-close:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 2px;
}

.es-clients {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.es-client:hover,
.es-copy-button:hover {
  border-color: var(--es-text);
}

.es-native-full-panel {
  display: grid;
  justify-items: center;
  padding-top: 22px;
}

.es-native-full-qr {
  display: grid;
  width: 140px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  background: #ffffff;
}

.es-native-full-qr img {
  display: block;
  width: 140px;
  height: 140px;
}

.es-native-full-panel p {
  margin: 14px 0 0;
  color: var(--es-muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.es-qr-loading,
.es-loading,
.es-error {
  color: var(--es-muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

#enhanced-subscription-root {
  display: none;
  position: fixed;
  z-index: 10000;
  inset: 0;
  color: var(--es-text);
  font-family: inherit;
}

#enhanced-subscription-root.is-open {
  display: block;
}

.es-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
}

.es-copy-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  transform: translate(-50%, -50%);
  border: 1px solid var(--es-line);
  border-radius: 6px;
  background: var(--es-surface);
  box-shadow: var(--es-shadow);
}

.es-copy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--es-line);
}

.es-copy-header h2 {
  margin: 0;
  color: var(--es-text);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: 0;
}

.es-close {
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--es-muted);
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.es-close:hover {
  background: var(--es-surface-subtle);
  color: var(--es-text);
}

.es-copy-body {
  padding: 18px 20px 20px;
}

.es-copy-button {
  width: 100%;
  min-height: 42px;
  margin-top: 20px;
  padding: 0 14px;
  border-color: var(--es-accent);
  background: var(--es-accent);
  color: var(--es-surface);
  font-size: 13px;
}

.es-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  padding: 9px 14px;
  transform: translate(-50%, 18px);
  border-radius: 4px;
  background: var(--es-text);
  color: var(--es-surface);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.es-toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (max-width: 640px) {
  .es-copy-modal {
    width: min(360px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
  }

  .es-copy-header,
  .es-copy-body {
    padding-right: 16px;
    padding-left: 16px;
  }
}
