:root {
  --pf-bg: #f6f3fb;
  --pf-ink: #34225a;
  --pf-muted: #7b68be;
  --pf-panel: #ffffff;
  --pf-panel-soft: #f7f4ff;
  --pf-line: #e7e0f7;
  --pf-violet: #8858ff;
  --pf-violet-deep: #6a40e6;
  --pf-violet-soft: rgba(136, 88, 255, 0.12);
  --pf-green: #1e9b6e;
  --pf-green-soft: #e7f7f1;
  --pf-amber: #986411;
  --pf-amber-soft: #fff4dc;
  --pf-red: #d94b67;
  --pf-red-soft: rgba(217, 75, 103, 0.12);
  --pf-shadow: 0 18px 38px rgba(52, 34, 90, 0.12);
  --pf-shadow-subtle: 0 0.7rem 2rem rgba(136, 88, 255, 0.09), 0 0.2rem 0.7rem rgba(30, 30, 60, 0.03);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body.profile-body {
  min-height: 100vh;
  margin: 0;
  background: var(--pf-bg);
  color: var(--pf-ink);
  font-family: "Inter", Arial, sans-serif;
}
button, input { font: inherit; }

.profile-top-logo {
  position: absolute;
  top: 1.4rem;
  left: 2rem;
  z-index: 205;
}
.profile-top-logo img {
  width: auto;
  height: 60px;
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(136, 88, 255, 0.22);
}
.profile-shell {
  display: flex;
  width: min(1160px, 100%);
  margin: 96px auto 80px;
  padding: 0 24px 96px;
  flex-direction: column;
  gap: 32px;
}
.profile-global-header {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 24px 32px;
  border-radius: 32px;
  background: var(--pf-panel);
  box-shadow: var(--pf-shadow);
}
.profile-header-left {
  display: flex;
  min-width: 220px;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
}
.profile-product-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--pf-violet);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.profile-header-note {
  max-width: 390px;
  margin: 0;
  color: var(--pf-muted);
  font-size: 14px;
  line-height: 1.5;
}
.profile-header-status {
  color: rgba(136, 88, 255, 0.85);
  font-size: 13px;
  font-weight: 600;
}
.profile-header-center {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
}
.profile-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px;
  border-radius: 999px;
  background: var(--pf-violet-soft);
}
.profile-toolbar-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--pf-panel);
  box-shadow: 0 1px 6px rgba(136, 88, 255, 0.1);
  color: var(--pf-muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.profile-toolbar-button:hover,
.profile-toolbar-button:focus-visible {
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(136, 88, 255, 0.18);
}
.profile-toolbar-button--primary {
  background: linear-gradient(135deg, var(--pf-violet) 0%, var(--pf-violet-deep) 96%);
  box-shadow: 0 12px 28px rgba(136, 88, 255, 0.24);
  color: #ffffff;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
  align-items: start;
}
.profile-main, .profile-side { display: grid; gap: 24px; }
.profile-danger { border: 1px solid rgba(217, 75, 103, 0.2); }
.profile-danger__warning { color: #8b3046 !important; }
.profile-button--danger {
  border: 1px solid #bd3652;
  background: #bd3652;
  color: #fff;
}
.profile-button--danger:hover,
.profile-button--danger:focus-visible { background: #9f2943; }
.profile-button--danger:disabled { cursor: not-allowed; opacity: .48; }
.profile-card {
  padding: 28px 30px;
  border: 0;
  border-radius: 2rem;
  background: var(--pf-panel);
  box-shadow: var(--pf-shadow-subtle);
}
.profile-card--presence,
#account-details { scroll-margin-top: 96px; }
.profile-card__heading, .profile-card__title {
  display: flex;
  align-items: center;
  gap: 14px;
}
.profile-card__heading { margin-bottom: 22px; }
.profile-card__heading--split { justify-content: space-between; gap: 24px; }
.profile-card__heading h2, .profile-card--compact h2 {
  margin: 4px 0 0;
  color: var(--pf-ink);
  font-size: 23px;
  font-weight: 700;
  line-height: 1.22;
}
.profile-eyebrow {
  margin: 0;
  color: var(--pf-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.profile-icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: none;
  place-items: center;
  border-radius: 14px;
  background: var(--pf-violet-soft);
  color: var(--pf-violet);
  font-size: 20px;
}
.identity-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 18px;
  background: var(--pf-panel-soft);
}
.identity-avatar {
  display: grid;
  width: 64px;
  height: 64px;
  flex: none;
  overflow: hidden;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--pf-violet), var(--pf-violet-deep));
  box-shadow: 0 10px 24px rgba(136, 88, 255, 0.2);
  color: white;
  font-size: 16px;
  font-weight: 700;
}
.identity-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.identity-summary__details { min-width: 0; flex: 1; }
.identity-summary__details strong, .identity-summary__details span { display: block; }
.identity-summary__details span {
  margin-top: 4px;
  color: var(--pf-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.identity-photo-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}
.identity-photo-actions .profile-button { min-height: 40px; padding: 0 14px; font-size: 12px; cursor: pointer; }
.identity-photo-actions .profile-button[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.identity-photo-actions .profile-text-button { color: var(--pf-muted); }
.profile-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.profile-file-input:focus-visible + .profile-text-button,
.profile-button:has(+ .profile-file-input:focus-visible) {
  outline: 3px solid rgba(136, 88, 255, 0.24);
  outline-offset: 2px;
}
.profile-note--photo { margin: -6px 0 18px 80px; }
.profile-name-form { display: grid; gap: 16px; }
.profile-name-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.profile-name-fields label {
  display: grid;
  gap: 8px;
  color: var(--pf-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.profile-name-fields input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--pf-line);
  border-radius: 14px;
  outline: none;
  background: #fcfbff;
  color: var(--pf-ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.profile-name-fields input:focus {
  border-color: var(--pf-violet);
  box-shadow: 0 0 0 3px rgba(136, 88, 255, 0.18);
}
.profile-facts--email { grid-template-columns: 1fr; }
.profile-actions--identity { margin-top: 0; }
.profile-actions--identity small { color: var(--pf-muted); font-size: 11px; line-height: 1.45; }
.profile-actions--identity small.is-success { color: var(--pf-green); }
.profile-actions--identity small.is-error { color: var(--pf-red); }
.profile-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0;
}
.profile-facts--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.profile-facts > div {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--pf-line);
  border-radius: 16px;
  background: #fcfbff;
}
.profile-facts dt {
  color: var(--pf-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.profile-facts dd {
  margin: 7px 0 0;
  color: var(--pf-ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.profile-note, .profile-copy {
  color: var(--pf-muted);
  font-size: 12px;
  line-height: 1.6;
}

.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}
.profile-modal__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(27, 17, 48, .64);
  cursor: default;
}
.profile-modal__dialog {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 30px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(22, 13, 40, .3);
}
.profile-modal__dialog h2 { margin: 7px 40px 12px 0; font-size: 25px; line-height: 1.25; }
.profile-modal__dialog > p:not(.profile-eyebrow) { color: var(--pf-muted); line-height: 1.6; }
.profile-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--pf-panel-soft);
  color: var(--pf-ink);
  font-size: 25px;
  cursor: pointer;
}
.profile-modal__danger-icon { display: grid; width: 48px; height: 48px; place-items: center; margin-bottom: 16px; border-radius: 15px; background: var(--pf-red-soft); color: var(--pf-red); font-size: 22px; }
.profile-modal__billing-warning { display: grid; gap: 7px; margin: 20px 0; padding: 16px; border-radius: 15px; background: var(--pf-amber-soft); color: #6e4908; font-size: 13px; }
.profile-modal__billing-warning a { color: #6e4908; font-weight: 700; }
.profile-delete-check { display: flex; align-items: flex-start; gap: 10px; color: var(--pf-ink); font-size: 13px; line-height: 1.5; }
.profile-delete-check input { width: 18px; height: 18px; flex: none; margin-top: 2px; accent-color: var(--pf-red); }
.profile-delete-confirm { display: grid; gap: 8px; margin-top: 18px; color: var(--pf-muted); font-size: 12px; }
.profile-delete-confirm input { min-height: 48px; padding: 0 14px; border: 1px solid var(--pf-line); border-radius: 13px; outline: none; }
.profile-delete-confirm input:focus { border-color: var(--pf-red); box-shadow: 0 0 0 3px var(--pf-red-soft); }
.profile-delete-status { min-height: 22px; margin: 12px 0 0; color: var(--pf-muted); font-size: 12px; }
.profile-delete-status.is-error { color: var(--pf-red); }
.profile-modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
body.has-profile-modal { overflow: hidden; }
.profile-note { margin: 14px 0 0; }
.profile-copy { margin: -4px 0 20px; }
.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--pf-violet-soft);
  color: var(--pf-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.profile-badge::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}
.profile-badge[data-state="active"],
.profile-badge[data-state="configured"],
.profile-badge[data-state="available"] { background: var(--pf-green-soft); color: var(--pf-green); }
.profile-badge[data-state="inactive"],
.profile-badge[data-state="unavailable"],
.profile-badge[data-state="invalid"] { background: var(--pf-red-soft); color: var(--pf-red); }
.profile-badge[data-state="not-configured"],
.profile-badge[data-state="checking"] { background: var(--pf-violet-soft); color: var(--pf-muted); }

.prefix-field {
  display: grid;
  gap: 8px;
  color: var(--pf-ink);
  font-size: 12px;
  font-weight: 700;
}
.prefix-control {
  display: flex;
  min-height: 52px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--pf-line);
  border-radius: 16px;
  background: white;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.prefix-control:focus-within {
  border-color: var(--pf-violet);
  box-shadow: 0 0 0 3px rgba(136, 88, 255, 0.18);
}
.prefix-protocol, .prefix-suffix {
  color: var(--pf-muted);
  font-size: 13px;
  white-space: nowrap;
}
.prefix-protocol { padding-left: 15px; }
.prefix-suffix { padding-right: 15px; }
.prefix-control input {
  width: 100%;
  min-width: 80px;
  height: 50px;
  padding: 0 3px;
  border: 0;
  outline: 0;
  color: var(--pf-violet-deep);
  font-weight: 700;
}
.prefix-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 8px;
  color: var(--pf-muted);
}
.prefix-meta small:last-child { text-align: right; }
.prefix-meta .is-success { color: var(--pf-green); }
.prefix-meta .is-error { color: var(--pf-red); }
.creator-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 15px 16px;
  border-radius: 18px;
  background: var(--pf-panel-soft);
}
.creator-preview > span {
  display: grid;
  width: 40px;
  height: 40px;
  flex: none;
  place-items: center;
  border-radius: 12px;
  background: white;
  box-shadow: 0 1px 6px rgba(136, 88, 255, 0.1);
  color: var(--pf-violet);
}
.creator-preview small, .creator-preview a { display: block; }
.creator-preview small {
  color: var(--pf-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.creator-preview a {
  margin-top: 4px;
  color: var(--pf-violet-deep);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.creator-preview a[aria-disabled="true"] { color: var(--pf-muted); text-decoration: none; }
.profile-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.profile-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: white;
  box-shadow: 0 1px 6px rgba(136, 88, 255, 0.12);
  color: var(--pf-muted);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.profile-button:hover:not(:disabled), .profile-button:focus-visible {
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(136, 88, 255, 0.18);
}
.profile-button:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.profile-button--primary {
  background: linear-gradient(135deg, var(--pf-violet), var(--pf-violet-deep));
  box-shadow: 0 12px 28px rgba(136, 88, 255, 0.24);
  color: white;
}
.profile-button--quiet { background: var(--pf-panel-soft); }
.profile-text-button {
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--pf-red);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.profile-callout {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--pf-amber-soft);
  color: var(--pf-amber);
}
.profile-callout p { margin: 0; }
.profile-callout strong, .profile-callout span { display: block; }
.profile-callout span { margin-top: 4px; color: #755b35; font-size: 11px; line-height: 1.5; }
.external-billing-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border-radius: 18px;
  background: var(--pf-green-soft);
  color: var(--pf-green);
}
.external-billing-note > i { font-size: 21px; }
.external-billing-note strong { font-size: 12px; }
.external-billing-note p { margin: 4px 0 0; color: #456b5e; font-size: 11px; line-height: 1.45; }
.external-billing-note a { color: var(--pf-green); font-size: 11px; font-weight: 700; white-space: nowrap; }

.profile-card--compact { padding: 24px; border-radius: 24px; }
.profile-card--compact > p:not(.profile-eyebrow) {
  margin: 10px 0 18px;
  color: var(--pf-muted);
  font-size: 12px;
  line-height: 1.6;
}
.side-actions { display: grid; gap: 10px; }
.side-actions .profile-button { width: 100%; justify-content: flex-start; }
.profile-shortcuts { display: grid; margin-top: 14px; }
.profile-shortcuts a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--pf-line);
  color: var(--pf-ink);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.profile-shortcuts a:hover, .profile-shortcuts a:focus-visible { color: var(--pf-violet); }
.profile-shortcuts a span { display: flex; align-items: center; gap: 9px; }
.profile-shortcuts a span i { color: var(--pf-violet); }
.profile-shortcuts > a > i { color: #a89bc8; font-size: 10px; }
.profile-help-actions { display: grid; gap: 14px; }
.profile-help-actions .profile-button { width: 100%; justify-content: flex-start; }
.profile-help-email { color: var(--pf-violet); font-size: 12px; font-weight: 700; }
.profile-state {
  display: flex;
  min-height: 112px;
  align-items: center;
  gap: 14px;
  padding: 24px 28px;
  border-radius: 24px;
  background: white;
  box-shadow: var(--pf-shadow-subtle);
}
.profile-state strong, .profile-state small { display: block; }
.profile-state small { margin-top: 5px; color: var(--pf-muted); }
.profile-state--error { color: var(--pf-red); }
.profile-state--error button { margin-left: auto; }
.profile-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--pf-violet-soft);
  border-top-color: var(--pf-violet);
  border-radius: 50%;
  animation: profile-spin 0.75s linear infinite;
}
@keyframes profile-spin { to { transform: rotate(360deg); } }
.profile-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 13000;
  max-width: 370px;
  padding: 14px 17px;
  border-radius: 14px;
  background: var(--pf-ink);
  box-shadow: var(--pf-shadow);
  color: white;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.profile-toast.is-visible { opacity: 1; transform: none; }

@media (max-width: 920px) {
  .profile-global-header { flex-direction: column; align-items: stretch; gap: 18px; }
  .profile-header-center { justify-content: flex-start; }
  .profile-layout { grid-template-columns: 1fr; }
  .profile-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-help { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .profile-top-logo { top: 1rem; left: 1.2rem; }
  .profile-top-logo img { height: 48px; }
}
@media (max-width: 700px) {
  .profile-shell { margin: 100px auto 60px; padding: 0 16px 72px; gap: 24px; }
  .profile-global-header { padding: 16px; border-radius: 18px; }
  .profile-toolbar {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 10px;
    border-radius: 18px;
  }
  .profile-toolbar-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    flex: 0 0 auto;
    padding: 0;
    border-radius: 14px;
  }
  .profile-toolbar-button span { display: none; }
  .profile-toolbar-button i { font-size: 18px; }
  .profile-card { padding: 22px 20px; border-radius: 20px; }
  .profile-card__heading--split { align-items: flex-start; }
  .profile-facts, .profile-facts--three, .profile-name-fields, .profile-side { grid-template-columns: 1fr; }
  .identity-summary { align-items: flex-start; flex-wrap: wrap; }
  .identity-photo-actions { width: 100%; justify-content: flex-start; padding-left: 78px; }
  .profile-note--photo { margin-left: 0; }
  .external-billing-note { grid-template-columns: auto 1fr; }
  .external-billing-note a { grid-column: 2; }
  .prefix-control { display: grid; grid-template-columns: auto minmax(80px, 1fr); }
  .prefix-suffix { grid-column: 1 / -1; margin-top: -11px; padding: 0 14px 10px 64px; }
  .prefix-meta { display: grid; }
  .prefix-meta small:last-child { text-align: left; }
  .profile-actions { display: grid; }
  .profile-actions > * { width: 100%; }
  .profile-toast { right: 12px; bottom: 12px; left: 12px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .profile-toolbar-button, .profile-button, .profile-name-fields input, .profile-spinner, .profile-toast { animation: none; transition: none; }
}
