html.dww-auth-pending body {
  overflow: hidden;
}

html.dww-auth-pending body > :not(#dwwAuthRoot) {
  visibility: hidden !important;
}

#dwwAuthRoot {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.dww-auth-screen {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  grid-template-columns: minmax(300px, .9fr) minmax(400px, 1.1fr);
  background: #eef4f2;
  color: #102d29;
}

.dww-auth-brand {
  padding: clamp(34px, 6vw, 86px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 80% 20%, rgba(119, 217, 125, .2), transparent 36%),
    linear-gradient(145deg, #063d37, #08766a);
  color: white;
}

.dww-auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.dww-auth-logo > span {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: white;
  color: #08766a;
  font-size: 16px;
  font-weight: 900;
}

.dww-auth-logo strong,
.dww-auth-logo small {
  display: block;
}

.dww-auth-logo strong {
  font-size: 18px;
}

.dww-auth-logo small {
  margin-top: 2px;
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
}

.dww-auth-copy {
  max-width: 520px;
}

.dww-auth-copy p {
  margin: 0 0 10px;
  color: #dff66b;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.dww-auth-copy h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1;
  letter-spacing: -.05em;
}

.dww-auth-copy span {
  max-width: 470px;
  margin-top: 20px;
  display: block;
  color: rgba(255, 255, 255, .75);
  font-size: 15px;
  line-height: 1.6;
}

.dww-auth-security {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, .65);
  font-size: 10px;
}

.dww-auth-security svg {
  width: 17px;
  height: 17px;
  stroke: #dff66b;
  stroke-width: 2;
}

.dww-auth-panel {
  padding: 34px;
  display: grid;
  place-items: center;
  overflow: auto;
}

.dww-auth-card {
  width: min(440px, 100%);
}

.dww-auth-loading,
.dww-auth-error,
.dww-auth-blocked {
  padding: 28px;
  border-radius: 18px;
  background: white;
  box-shadow: 0 18px 55px rgba(12, 56, 49, .12);
  text-align: center;
}

.dww-auth-spinner {
  width: 32px;
  height: 32px;
  margin: 0 auto 16px;
  border: 3px solid #dce9e6;
  border-top-color: #08766a;
  border-radius: 50%;
  animation: dww-auth-spin .8s linear infinite;
}

@keyframes dww-auth-spin {
  to { transform: rotate(360deg); }
}

.dww-auth-error strong,
.dww-auth-blocked strong {
  display: block;
  font-size: 19px;
}

.dww-auth-error p,
.dww-auth-blocked p {
  margin: 9px 0 18px;
  color: #657d78;
  font-size: 12px;
}

.dww-auth-retry,
.dww-auth-signout {
  min-height: 40px;
  padding: 9px 14px;
  border: 0;
  border-radius: 8px;
  background: #08766a;
  color: white;
  font: 800 12px/1 system-ui, sans-serif;
  cursor: pointer;
}

.dww-auth-bar {
  position: fixed;
  top: 8px;
  right: 14px;
  z-index: 9989;
  min-height: 48px;
  padding: 6px 8px 6px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(9, 89, 79, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 28px rgba(5, 49, 43, .13);
  backdrop-filter: blur(10px);
}

.dww-auth-user-copy {
  max-width: 170px;
  text-align: right;
}

.dww-auth-user-copy strong,
.dww-auth-user-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dww-auth-user-copy strong {
  color: #173f39;
  font-size: 11px;
}

.dww-auth-user-copy small {
  margin-top: 1px;
  color: #6c817d;
  font-size: 9px;
}

.dww-auth-admin-link {
  padding: 7px 9px;
  border-radius: 7px;
  background: #e9f4f1;
  color: #086b60;
  font-size: 10px;
  font-weight: 850;
  text-decoration: none;
}

.dww-role-preview-control {
  min-height: 31px;
  padding: 3px 4px 3px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #ead591;
  border-radius: 8px;
  background: #fff9e7;
  color: #725713;
  font-size: 9px;
  font-weight: 850;
}

.dww-role-preview-control select {
  max-width: 148px;
  min-height: 23px;
  padding: 2px 24px 2px 7px;
  border: 0;
  border-radius: 6px;
  outline: 0;
  background: #fff;
  color: #4f421e;
  font: 750 10px/1 system-ui, sans-serif;
  cursor: pointer;
}

.dww-role-preview-control select:focus-visible {
  box-shadow: 0 0 0 2px #d9bc59;
}

.dww-auth-profile-link {
  min-height: 31px;
  padding: 4px 7px 4px 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  border-radius: 8px;
  background: #f1f6f5;
  color: #47645e;
  font-size: 9px;
  font-weight: 850;
  text-decoration: none;
}

.dww-auth-profile-link img,
.dww-auth-profile-link svg {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #e3eeeb;
  image-rendering: pixelated;
}

.dww-auth-profile-link svg {
  padding: 4px;
  stroke: #08766a;
  stroke-width: 1.7;
}

.dww-auth-role {
  padding: 5px 7px;
  border-radius: 99px;
  background: #f2f5f4;
  color: #647873;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.dww-auth-role.admin {
  background: #fff0c5;
  color: #7a5800;
}

.dww-auth-role.owner {
  background: linear-gradient(135deg, #173c37, #08766a);
  color: #dff66b;
  box-shadow: inset 0 0 0 1px rgba(223, 246, 107, .25);
}

.dww-auth-role.preview {
  background: #2c1d54;
  color: #f1e9ff;
  box-shadow: inset 0 0 0 1px rgba(198, 174, 255, .4);
}

.dww-role-preview-banner {
  position: fixed;
  top: 67px;
  right: 14px;
  z-index: 9988;
  width: min(560px, calc(100vw - 28px));
  min-height: 58px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(92, 63, 158, .24);
  border-radius: 13px;
  background: rgba(44, 29, 84, .97);
  color: #fff;
  box-shadow: 0 12px 34px rgba(26, 14, 56, .22);
  backdrop-filter: blur(10px);
}

.dww-role-preview-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #c6aeff;
  color: #2c1d54;
  font-size: 14px;
}

.dww-role-preview-banner strong,
.dww-role-preview-banner small {
  display: block;
}

.dww-role-preview-banner strong {
  font-size: 11px;
}

.dww-role-preview-banner small {
  margin-top: 2px;
  color: #d8ccef;
  font-size: 9px;
  line-height: 1.35;
}

.dww-role-preview-banner button {
  min-height: 31px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 8px;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font: 800 9px/1 system-ui, sans-serif;
  cursor: pointer;
}

.dww-role-preview-banner button:hover {
  background: rgba(255, 255, 255, .18);
}

[data-required-permission].dww-permission-denied {
  cursor: not-allowed !important;
  filter: grayscale(.35);
  opacity: .52 !important;
}

@media (max-width: 820px) {
  .dww-auth-screen {
    display: block;
    overflow: auto;
  }

  .dww-auth-brand {
    min-height: 260px;
    padding: 28px;
    gap: 44px;
  }

  .dww-auth-copy h1 {
    font-size: 38px;
  }

  .dww-auth-security {
    display: none;
  }

  .dww-auth-panel {
    padding: 24px 14px 36px;
  }

  .dww-auth-bar {
    left: 8px;
    right: 8px;
    justify-content: flex-end;
  }

  .dww-auth-user-copy {
    display: none;
  }

  .dww-auth-profile-link span {
    display: none;
  }

  .dww-auth-profile-link {
    padding-right: 4px;
  }

  .dww-role-preview-control > span {
    display: none;
  }

  .dww-role-preview-control {
    padding-left: 4px;
  }

  .dww-role-preview-control select {
    max-width: 116px;
  }

  .dww-role-preview-banner {
    top: 66px;
    left: 8px;
    right: 8px;
    width: auto;
    grid-template-columns: auto 1fr;
  }

  .dww-role-preview-banner button {
    grid-column: 1 / -1;
  }
}
