.profile-page {
  min-height: 100vh;
  overflow-x: hidden;
  color: #0d1a2d;
  background: #faf9f7;
}

.profile-page a,
.profile-page button,
.profile-page input {
  font-family: var(--font-ui);
}

.profile-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.96);
}

.profile-page .brand-caption,
.profile-page .brand-scope {
  display: none;
}

.profile-search {
  max-width: 610px;
}

.profile-toolbar-link,
.profile-new-project {
  text-decoration: none;
}

.profile-refresh i {
  font-size: 17px;
}

.profile-page .account-popover {
  width: 238px;
}

.profile-page .account-popover > a,
.profile-page .account-popover > button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 0;
  color: #566172;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.profile-page .account-popover > a:hover,
.profile-page .account-popover > a.is-current {
  color: #0d1a2d;
  background: #f5f6f7;
}

.profile-page .account-popover > button:hover {
  color: #a43138;
  background: #fff7f7;
}

.profile-main {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 47px clamp(24px, 4.45vw, 64px) 64px;
}

.profile-page-heading {
  display: grid;
  justify-items: start;
  gap: 12px;
  margin: 0 0 28px;
}

.profile-page-heading h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 29px;
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.045em;
}

.profile-page-heading > span,
.profile-section-heading > span {
  width: 36px;
  height: 3px;
  border-radius: 99px;
  background: #e5002b;
}

.profile-surface {
  border: 1px solid #dedfe1;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 22px rgba(7, 17, 31, 0.025);
}

.profile-hub-card {
  padding: 24px;
}

.profile-hub-state {
  margin: 18px 0 8px;
  color: #0d1a2d;
  font-size: 14px;
  font-weight: 760;
}

.profile-hub-state::before {
  width: 8px;
  height: 8px;
  display: inline-block;
  margin-right: 8px;
  border-radius: 50%;
  background: #c1c6ce;
  content: "";
}

.profile-hub-state[data-state="active"]::before {
  background: #24a148;
}

.profile-hub-help {
  margin: 0;
  color: #6c7788;
  font-size: 12px;
  line-height: 1.55;
}

.profile-hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.profile-hub-actions a {
  text-decoration: none;
}

.profile-hub-dialog {
  width: min(92vw, 480px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  color: #0d1a2d;
  box-shadow: 0 24px 70px rgba(7, 17, 31, 0.24);
}

.profile-hub-dialog::backdrop {
  background: rgba(7, 17, 31, 0.56);
}

.profile-hub-dialog-body {
  display: grid;
  gap: 18px;
  padding: 28px;
}

.profile-hub-dialog-body h2,
.profile-hub-dialog-body p {
  margin: 0;
}

.profile-hub-dialog-body > p {
  color: #657084;
  font-size: 13px;
  line-height: 1.55;
}

.profile-hub-dialog-status {
  min-height: 20px;
  color: #a43138 !important;
}

.profile-identity-card {
  min-height: 186px;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  gap: 36px;
  padding: 28px 37px 28px 31px;
}

.profile-photo {
  position: relative;
  width: 120px;
  height: 120px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(150deg, #8469ff, #3d55d7);
  box-shadow: 0 9px 24px rgba(61, 85, 215, 0.16);
  font-size: 35px;
  font-weight: 500;
}

.profile-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1;
  display: block;
  border-radius: 50%;
  object-fit: cover;
}

.profile-identity-copy {
  min-width: 0;
}

.profile-identity-copy h2 {
  overflow: hidden;
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 760;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-identity-copy p {
  overflow: hidden;
  margin: 0 0 14px;
  color: #778293;
  font-size: 13px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-role-badge {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 0 10px;
  border-radius: 6px;
  color: #e5002b;
  background: #fff0f2;
  font-size: 11px;
  font-weight: 700;
}

.profile-identity-actions {
  min-width: 172px;
  display: grid;
  justify-items: stretch;
  gap: 14px;
}

.profile-secondary-action,
.profile-primary-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.profile-secondary-action {
  border: 1px solid #d8dce2;
  color: #253044;
  background: #fff;
}

.profile-secondary-action:hover {
  border-color: #aeb5c0;
  background: #fafafa;
}

.profile-primary-action {
  border: 1px solid #07111f;
  color: #fff;
  background: #07111f;
  box-shadow: 0 8px 18px rgba(7, 17, 31, 0.13);
}

.profile-primary-action:hover {
  background: #142238;
}

.profile-secondary-action:active,
.profile-primary-action:active {
  transform: translateY(1px);
}

.profile-secondary-action:disabled,
.profile-primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.profile-active-status {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border-radius: 6px;
  color: #159957;
  background: #eaf8f0;
  font-size: 11px;
  font-weight: 700;
}

.profile-active-status i,
.profile-provider-status i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #20aa67;
}

.profile-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.44fr) minmax(360px, 1fr);
  gap: 22px;
  margin-top: 22px;
}

.profile-contact-card {
  min-height: 423px;
  padding: 30px 31px 36px;
}

.profile-side-column {
  display: grid;
  align-content: start;
  gap: 22px;
}

.profile-security-card {
  min-height: 195px;
  padding: 30px;
}

.profile-workspace-card {
  min-height: 205px;
  padding: 30px;
}

.profile-side-column .profile-section-heading {
  margin-bottom: 17px;
}

.profile-section-heading {
  display: grid;
  justify-items: start;
  gap: 13px;
  margin-bottom: 25px;
}

.profile-section-heading h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 760;
  line-height: 1.2;
}

.profile-form {
  position: relative;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px 38px;
}

.profile-field {
  min-width: 0;
  display: grid;
  gap: 10px;
  color: #263247;
  font-size: 11px;
  font-weight: 650;
}

.profile-field-wide {
  grid-column: 1 / -1;
}

.profile-field input {
  width: 100%;
  min-height: 56px;
  padding: 0 15px;
  border: 1px solid #d5dae1;
  border-radius: 8px;
  outline: 0;
  color: #263247;
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.profile-field input:hover {
  border-color: #b8bec8;
}

.profile-field input:focus {
  border-color: #667085;
  box-shadow: 0 0 0 3px rgba(36, 107, 254, 0.1);
}

.profile-field input[aria-invalid="true"] {
  border-color: #cf3e49;
  box-shadow: 0 0 0 3px rgba(229, 0, 43, 0.08);
}

.profile-field-error {
  min-height: 0;
  margin-top: -5px;
  color: #b4232f;
  font-size: 9px;
  font-weight: 600;
}

.profile-field-error:empty {
  display: none;
}

.profile-form-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 41px;
}

.profile-form-actions .profile-primary-action {
  min-width: 297px;
  min-height: 56px;
}

.profile-cancel-action {
  min-width: 172px;
  min-height: 56px;
  color: #667085;
}

.profile-form-status {
  position: absolute;
  left: 0;
  bottom: -28px;
  min-height: 18px;
  margin: 0;
  color: #159957;
  font-size: 10px;
  font-weight: 650;
}

.profile-form-status.is-error {
  color: #b4232f;
}

.profile-provider-row {
  min-height: 80px;
  display: grid;
  grid-template-columns: 43px max-content minmax(95px, 1fr) max-content;
  align-items: center;
  gap: 15px;
  padding: 14px 16px;
  border: 1px solid #d8dce2;
  border-radius: 8px;
  background: #fff;
}

.profile-provider-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 1px solid #e0e3e8;
  border-radius: 8px;
  color: #4285f4;
  background: #fff;
  font-size: 23px;
}

.profile-provider-row > strong {
  font-size: 12px;
  font-weight: 700;
}

.profile-provider-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #159957;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.profile-provider-status i {
  width: 7px;
  height: 7px;
}

.profile-manage-action {
  min-width: 106px;
  min-height: 42px;
  padding-inline: 15px;
}

.profile-workspace-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) max-content;
  align-items: center;
  gap: 18px;
  color: inherit;
  text-decoration: none;
}

.profile-workspace-row > img {
  width: 48px;
  height: 48px;
  border: 1px solid #e0e3e8;
  border-radius: 8px;
  box-shadow: 0 5px 13px rgba(7, 17, 31, 0.08);
}

.profile-workspace-row > span {
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 8px;
}

.profile-workspace-row strong {
  overflow: hidden;
  width: 100%;
  font-size: 11px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-workspace-row small {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border-radius: 6px;
  color: #e5002b;
  background: #fff0f2;
  font-size: 10px;
  font-weight: 700;
}

.profile-workspace-row > i {
  color: #8892a0;
  font-size: 20px;
  transition: transform 0.16s ease;
}

.profile-workspace-row:hover > i {
  transform: translateX(2px);
}

.profile-workspace-card > p {
  margin: 8px 0 0;
  color: #778293;
  font-size: 10px;
}

.profile-toast-region {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.profile-toast {
  max-width: 340px;
  padding: 13px 16px;
  border: 1px solid #d9dde3;
  border-radius: 10px;
  color: #263247;
  background: #fff;
  box-shadow: 0 14px 36px rgba(7, 17, 31, 0.14);
  font-size: 10px;
  font-weight: 650;
  animation: profile-toast-in 0.18s ease both;
}

.profile-toast.is-error {
  color: #a43138;
  border-color: #f1c4c8;
  background: #fff8f8;
}

@keyframes profile-toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (min-width: 981px) {
  .profile-main {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .profile-page-heading {
    gap: 8px;
    margin-bottom: 12px;
  }

  .profile-identity-card {
    min-height: 130px;
    gap: 30px;
    padding: 16px 30px;
  }

  .profile-photo {
    width: 96px;
    height: 96px;
    font-size: 30px;
  }

  .profile-identity-copy h2 {
    margin-bottom: 6px;
  }

  .profile-identity-copy p {
    margin-bottom: 10px;
  }

  .profile-identity-actions {
    gap: 10px;
  }

  .profile-content-grid {
    gap: 18px;
    margin-top: 14px;
  }

  .profile-side-column {
    gap: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-page *,
  .profile-page *::before,
  .profile-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 1180px) {
  .profile-page .save-state {
    display: none;
  }

  .profile-content-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.9fr);
  }

  .profile-provider-row {
    grid-template-columns: 43px 1fr max-content;
  }

  .profile-provider-status {
    grid-column: 2;
    grid-row: 2;
  }

  .profile-manage-action {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}

@media (max-width: 980px) {
  .profile-page .profile-toolbar-link {
    display: none;
  }

  .profile-main {
    padding-inline: 24px;
  }

  .profile-content-grid {
    grid-template-columns: 1fr;
  }

  .profile-side-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .profile-page .topbar {
    min-height: 60px;
    height: auto;
    display: flex;
    align-items: center;
    padding: 10px 14px;
  }

  .profile-page .profile-search {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
  }

  .profile-page .profile-refresh,
  .profile-page .profile-new-project {
    display: none;
  }

  .profile-main {
    padding: 24px 14px 48px;
  }

  .profile-page-heading {
    margin-bottom: 22px;
  }

  .profile-identity-card {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 18px;
    padding: 24px 20px;
  }

  .profile-photo {
    width: 82px;
    height: 82px;
    font-size: 25px;
  }

  .profile-identity-copy h2 {
    font-size: 18px;
  }

  .profile-identity-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .profile-content-grid,
  .profile-side-column {
    grid-template-columns: 1fr;
  }

  .profile-contact-card,
  .profile-security-card,
  .profile-workspace-card {
    min-height: 0;
    padding: 24px 20px;
  }

  .profile-form-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .profile-field-wide {
    grid-column: auto;
  }

  .profile-form-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 30px;
  }

  .profile-form-actions .profile-primary-action,
  .profile-cancel-action {
    width: 100%;
    min-width: 0;
    min-height: 50px;
  }
}

@media (max-width: 460px) {
  .profile-page .brand-name {
    font-size: 20px;
  }

  .profile-page .top-actions {
    min-width: 0;
  }

  .profile-identity-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .profile-identity-copy {
    width: 100%;
  }

  .profile-identity-actions {
    grid-template-columns: 1fr;
  }

  .profile-provider-row {
    grid-template-columns: 43px minmax(0, 1fr);
  }

  .profile-provider-status {
    grid-column: 2;
  }

  .profile-manage-action {
    grid-column: 1 / -1;
    grid-row: auto;
    width: 100%;
  }

  .profile-workspace-row {
    gap: 12px;
  }
}
