.project-setup {
  width: min(100%, 522px);
  margin: clamp(14px, 4.5vw, 68px) auto 28px;
}

.project-form-card {
  padding: clamp(22px, 4vw, 40px);
  box-shadow: 0 2px 8px #2039570b, 0 18px 37px #20395712;
}

.project-form-intro {
  display: grid;
  justify-items: start;
  gap: 9px;
  margin-bottom: 24px;
}

.project-form-icon {
  position: relative;
  display: block;
  width: 38px;
  height: 38px;
  margin-bottom: 3px;
  border: 1px solid #d2e1f5;
  border-radius: 11px;
  background: #e9f2ff;
  color: var(--accent-deep);
}

.project-form-icon::before,
.project-form-icon::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.project-form-icon::before {
  inset: 10px;
  border: 1.5px solid currentColor;
}

.project-form-icon::after {
  inset: 10px 14px;
  border: 1.5px solid currentColor;
}

.project-form-intro h1 {
  font-size: clamp(2rem, 4vw, 2.74rem);
  letter-spacing: -.057em;
}

.project-form-intro p {
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.55;
}

.project-form {
  gap: 13px;
}

.project-form-domain .field {
  margin-bottom: 6px;
}

.project-form-domain .input {
  width: 100%;
  min-height: 45px;
}

.project-form-domain .help {
  margin-top: 6px;
  font-size: .82rem;
}

.project-form-error:not(:empty) {
  margin-top: 7px;
  padding: 8px 10px;
  border: 1px solid #f5ccc3;
  border-radius: 8px;
  background: #fff1ee;
  color: #882f23;
  font-size: .82rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.project-form-error a {
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 650;
}

.project-form-domain .input[aria-invalid="true"] {
  border-color: #bd5343;
}

.project-example {
  justify-self: start;
  min-height: 32px;
  border: 0;
  border-radius: 7px;
  padding: 4px 7px;
  color: var(--accent-deep);
  background: #edf4ff;
  font-size: .81rem;
  font-weight: 650;
}

.project-example:hover {
  background: #e2edff;
}

.project-form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 5px;
}

.project-switcher {
  position: relative;
  flex-shrink: 1;
  min-width: 0;
}

.project-switcher[open] {
  z-index: 5;
}

.project-switcher-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  max-width: min(184px, 22vw);
  padding: 4px 10px 4px 5px;
  border: 1px solid #d0dded;
  border-radius: 10px;
  background: #ffffffeb;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.project-switcher-trigger::-webkit-details-marker {
  display: none;
}

.project-switcher-trigger:hover,
.project-switcher[open] .project-switcher-trigger {
  background: #f6faff;
  border-color: #b5cbed;
}

.project-switcher-initial {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: none;
  border-radius: 6px;
  background: #e7effc;
  color: var(--accent-deep);
  font-size: .8rem;
  font-weight: 680;
}

.project-switcher-current {
  min-width: 0;
}

.project-switcher-domain {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .8rem;
  font-weight: 660;
}

.project-switcher-current small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: .66rem;
  white-space: nowrap;
}

.project-switcher-chevron {
  width: 6px;
  height: 6px;
  flex: none;
  margin-left: 2px;
  border-right: 1.5px solid #5a6e89;
  border-bottom: 1.5px solid #5a6e89;
  transform: translateY(-2px) rotate(45deg);
}

.project-switcher[open] .project-switcher-chevron {
  transform: translateY(2px) rotate(-135deg);
}

.project-switcher-panel {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  width: min(18rem, calc(100vw - 2 * var(--gutter)));
  max-height: min(36rem, calc(100dvh - 8.5rem));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 7px;
  border: 1px solid var(--line-blue);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 9px 28px #1c375a29, 0 2px 4px #19375012;
}

.project-switcher-heading {
  padding: 7px 8px 5px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 640;
}

.project-account {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: start;
  gap: 6px;
  padding: 7px 8px 9px;
  border-bottom: 1px solid var(--line);
}

.project-account-identity { min-width: 0; overflow-wrap: anywhere; }
.project-account-identity strong { font-size: .86rem; }
.project-account-identity small { color: var(--muted); font-size: .75rem; }
.project-account-role { flex: none; }

.project-switcher-options {
  max-height: min(240px, 45vh);
  margin: 0;
  padding: 2px 0 3px;
  overflow-y: auto;
  list-style: none;
}

.project-option,
.project-switcher-new {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 8px;
  border-radius: 7px;
  font-size: .86rem;
  line-height: 1.3;
}

.project-option:hover,
.project-switcher-new:hover {
  background: #f2f6fe;
}

.project-option[aria-current="true"], .project-option[aria-current="page"] {
  background: #e8f1ff;
  color: #174d99;
}

.project-option-name {
  font-weight: 620;
  overflow-wrap: anywhere;
}

.project-option-name small {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 460;
}

.project-option-check {
  flex: none;
}

.project-switcher-new {
  justify-content: flex-start;
  margin-top: 5px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 7px 7px;
  color: var(--accent-deep);
  font-weight: 670;
}

.project-switcher-panel a:focus-visible {
  outline-offset: -2px;
}

.project-settings-menu { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 3px; }
.project-settings-card { max-width: 520px; }
.project-settings-card .project-form { display: grid; }
.project-settings-card .input { min-height: 45px; }
.project-settings-card .input[aria-invalid="true"] { border-color: #bd5343; }
.project-settings-card .project-form-error:empty { display: none; }
.project-settings-readonly { display: grid; gap: 14px; margin: 0 0 16px; }
.project-settings-readonly dt { color: var(--muted); font-size: .8rem; }
.project-settings-readonly dd { margin: 4px 0 0; font-weight: 640; overflow-wrap: anywhere; }

@media (max-width: 620px) {
  .project-setup {
    margin-block: 8px 12px;
  }

  .project-form-card {
    padding: 20px 17px 22px;
  }

  .workspace-tools:has(.project-switcher) {
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 3px;
  }

  .project-switcher-trigger {
    max-width: min(154px, 34vw);
    padding-inline: 8px;
  }

  .project-switcher-initial {
    display: none;
  }
}

@media (max-width: 365px) {
  .workspace-tools[data-chrome="workspace"]:has(.project-switcher) {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: stretch;
    justify-content: flex-end;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding-block: 3px 8px;
  }

  .project-switcher-trigger {
    max-width: min(182px, 52vw);
  }
}
