.kg-growth-dialog {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: min(410px, calc(100% - max(24px, env(safe-area-inset-left, 0px) + env(safe-area-inset-right, 0px))));
  max-width: none;
  max-height: min(780px, calc(100vh - 36px));
  max-height: min(780px, calc(100dvh - max(36px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px))));
  padding: 0;
  overflow: auto;
  border: 2px solid #f5cc77;
  border-radius: 20px;
  background: linear-gradient(153deg, #541454, #26082d 65%, #360d3b);
  box-shadow: 0 3px 0 #ad5e1b, 0 6px 0 #56250d, 0 16px 48px #17031cbb;
  color: #fff0f7;
  font: 15px/1.5 system-ui, "Microsoft YaHei", "PingFang SC", sans-serif;
  text-align: start;
  overscroll-behavior: contain;
}

.kg-growth-dialog:not([open]) { display: none; }

.kg-growth-dialog::backdrop { background: #1a0420ba; }

.kg-growth-fallback {
  z-index: 2147483000;
  box-shadow: 0 0 0 100vmax #1a0420ba;
}

.kg-growth-header {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 13px 48px;
  border-bottom: 1px solid #f0c16c60;
  background:
    repeating-conic-gradient(from 45deg at 50% 50%, #ffd8fa16 0% 25%, transparent 0% 50%) 0 0 / 24px 24px,
    linear-gradient(180deg, #8b1483, #591057);
  text-align: center;
}

.kg-growth-title {
  margin: 0;
  color: #ffe294;
  font-size: 20px;
  line-height: 1.45;
  text-shadow: 0 1px 3px #4b1435;
}

.kg-growth-dialog button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.kg-growth-dialog :focus-visible {
  outline: 2px solid #ffe294;
  outline-offset: 2px;
}

.kg-growth-dialog .kg-growth-close {
  position: absolute;
  top: 5px;
  right: 7px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #ffdc83;
  font-size: 31px;
  line-height: 1;
}

.kg-growth-body {
  display: grid;
  gap: 13px;
  padding: 18px;
}

.kg-growth-copy,
.kg-growth-status { margin: 0; }

.kg-growth-field {
  display: grid;
  gap: 6px;
  color: #ffe294;
  font-size: 13px;
}

.kg-growth-url {
  box-sizing: border-box;
  width: 100%;
  resize: none;
  padding: 10px 12px;
  overflow: auto;
  border: 1px solid #e9b466a0;
  border-radius: 9px;
  background: #210721;
  color: #fff0f7;
  font: 14px/1.4 system-ui, sans-serif;
  overflow-wrap: anywhere;
  -webkit-user-select: text;
  user-select: text;
}

.kg-growth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.kg-growth-actions > * { flex: 1 1 120px; }

.kg-growth-dialog .kg-growth-action {
  display: grid;
  box-sizing: border-box;
  min-height: 44px;
  padding: 8px 16px;
  place-items: center;
  border: 1px solid #e8bd66;
  border-radius: 999px;
  background: linear-gradient(#642367, #340b37);
  color: #ffe294;
  font-weight: 600;
  text-decoration: none;
}

.kg-growth-dialog .kg-growth-primary {
  background: linear-gradient(#aa2699, #671469 52%, #4a104a);
  box-shadow: inset 0 1px 0 #ffc3f278, 0 2px 0 #864718;
}

.kg-growth-status {
  color: #ebc9e2;
  font-size: 13px;
}

.kg-growth-status:empty { display: none; }

.kg-growth-dialog .kg-growth-subtle {
  min-height: 44px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: #ffe294;
  text-decoration: underline;
  text-underline-offset: 3px;
  justify-self: center;
}

.kg-growth-poster {
  display: block;
  width: 100%;
  border-radius: 9px;
}

.kg-growth-credential-form { display: grid; gap: 13px; }
.kg-growth-dialog .kg-growth-input { min-height: 44px; font-size: 16px; }
.kg-growth-credential-form button:disabled { opacity: .65; cursor: wait; }
