/* Ascend account — premium dark auth + dashboard.
 *
 * Standalone: every class templates/account.php emits is styled here, so the page does
 * not depend on the account rules still living in shop.css (those target the previous
 * markup). The shared primitives that shop.css also ships — .acend-btn, .acend-form,
 * .acend-badge, .acend-notice, .acend-pager — are re-declared below scoped to
 * `.acend-account--v2`, which loads after shop.css and therefore wins.
 *
 * Layout order:
 *   1. tokens
 *   2. shared primitives (notice, forms, buttons, badges, pager, empty states)
 *   3. signed-out auth shell + OAuth
 *   4. modal (verify / two-step) + code input
 *   5. dashboard shell (header, tabs, panels)
 *   6. panels: overview, licenses, orders, downloads, security
 *   7. responsive + reduced motion
 */

/* ================================================================== 1. tokens */

.acend-account--v2 {
  /* New palette. */
  --acend2-bg: #0b0b12;
  --acend2-card: #15151f;
  --acend2-card-hi: #1a1a26;
  --acend2-sunk: rgba(0, 0, 0, 0.28);
  --acend2-line: rgba(255, 255, 255, 0.08);
  --acend2-line-hi: rgba(255, 255, 255, 0.16);
  --acend2-text: #f3f1f8;
  --acend2-muted: #9b95ad;
  --acend2-faint: #6b6578;
  --acend2-accent: #8b5cf6;
  --acend2-accent-hi: #7c3aed;
  --acend2-accent-soft: rgba(139, 92, 246, 0.14);
  --acend2-ok: #4ade80;
  --acend2-warn: #facc15;
  --acend2-bad: #f87171;
  --acend2-r: 16px;
  --acend2-r-sm: 12px;
  --acend2-r-xs: 10px;
  --acend2-gap: 1.15rem;
  --acend2-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --acend2-lift: 0 14px 34px rgba(0, 0, 0, 0.38);
  --acend2-glow: 0 0 0 1px rgba(139, 92, 246, 0.35), 0 16px 38px rgba(139, 92, 246, 0.16);

  /* Keep the primitives inherited from shop.css on the same palette. */
  --acend-accent: #8b5cf6;
  --acend-accent-soft: rgba(139, 92, 246, 0.14);
  --acend-text: #f3f1f8;
  --acend-muted: #9b95ad;
  --acend-surface: rgba(255, 255, 255, 0.035);
  --acend-surface-strong: rgba(255, 255, 255, 0.06);
  --acend-border: rgba(255, 255, 255, 0.08);
  --acend-radius: 16px;

  display: flex;
  flex-direction: column;
  gap: var(--acend2-gap);
  width: 100%;
  color: var(--acend2-text);
}

.acend-account--v2 .acend-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.acend-account--v2 .acend-account__bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.acend-account--v2 .acend-account__bar .acend-langbar { margin: 0; }

/* ==================================================== 2. shared primitives */

/* --- notices --- */

.acend-account--v2 .acend-notice {
  margin: 0;
  padding: 0.9rem 1.15rem;
  border: 1px solid var(--acend2-line);
  border-radius: var(--acend2-r-sm);
  background: var(--acend2-card);
  color: var(--acend2-text);
  font-size: 0.93rem;
  line-height: 1.55;
}

.acend-account--v2 .acend-notice--ok {
  border-color: rgba(74, 222, 128, 0.38);
  background: rgba(74, 222, 128, 0.09);
}

.acend-account--v2 .acend-notice--error {
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(248, 113, 113, 0.09);
}

/* --- forms --- */

.acend-account--v2 .acend-form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  margin: 0;
}

.acend-account--v2 .acend-form__row {
  display: grid;
  gap: 0.95rem;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.acend-account--v2 .acend-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.acend-account--v2 .acend-form__field > span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--acend2-muted);
}

.acend-account--v2 .acend-form__field input,
.acend-account--v2 .acend-form__field textarea,
.acend-account--v2 .acend-form__field select {
  width: 100%;
  padding: 0.82rem 0.95rem;
  background: var(--acend2-sunk);
  border: 1px solid var(--acend2-line);
  border-radius: var(--acend2-r-xs);
  color: var(--acend2-text);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.18s var(--acend2-ease), background 0.18s var(--acend2-ease),
    box-shadow 0.18s var(--acend2-ease);
}

.acend-account--v2 .acend-form__field textarea { resize: vertical; }

.acend-account--v2 .acend-form__field input::placeholder,
.acend-account--v2 .acend-form__field textarea::placeholder {
  color: var(--acend2-faint);
  opacity: 1;
}

.acend-account--v2 .acend-form__field input:hover,
.acend-account--v2 .acend-form__field textarea:hover {
  border-color: var(--acend2-line-hi);
}

.acend-account--v2 .acend-form__field input:focus,
.acend-account--v2 .acend-form__field textarea:focus {
  outline: none;
  border-color: var(--acend2-accent);
  background: rgba(0, 0, 0, 0.36);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.22);
}

.acend-account--v2 .acend-form__field input:focus-visible,
.acend-account--v2 .acend-form__field textarea:focus-visible {
  outline: 2px solid var(--acend2-accent);
  outline-offset: 2px;
}

.acend-account--v2 .acend-form__check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--acend2-muted);
  cursor: pointer;
}

.acend-account--v2 .acend-form__check input { accent-color: var(--acend2-accent); }

/* --- buttons --- */

.acend-account--v2 .acend-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.82rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--acend2-r-xs);
  font: 600 0.95rem/1 inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s var(--acend2-ease), background 0.18s var(--acend2-ease),
    border-color 0.18s var(--acend2-ease), box-shadow 0.18s var(--acend2-ease);
}

.acend-account--v2 .acend-btn.acend-btn--primary {
  background: var(--acend2-accent);
  color: #fff;
}

.acend-account--v2 .acend-btn.acend-btn--primary:hover {
  background: #9668f8;
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(139, 92, 246, 0.32);
}

.acend-account--v2 .acend-btn.acend-btn--ghost {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--acend2-line);
  color: var(--acend2-text);
}

.acend-account--v2 .acend-btn.acend-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.075);
  border-color: var(--acend2-line-hi);
  transform: translateY(-1px);
}

.acend-account--v2 .acend-btn:active { transform: translateY(0); }

.acend-account--v2 .acend-btn--block { width: 100%; }

.acend-account--v2 .acend-btn:focus-visible {
  outline: 2px solid var(--acend2-accent);
  outline-offset: 2px;
}

.acend-account--v2 .acend-linkbtn {
  padding: 0;
  background: none;
  border: 0;
  color: var(--acend2-muted);
  font: inherit;
  font-size: 0.88rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.18s var(--acend2-ease), opacity 0.18s var(--acend2-ease);
}

.acend-account--v2 .acend-linkbtn:hover { color: var(--acend2-text); }

.acend-account--v2 .acend-linkbtn:focus-visible {
  outline: 2px solid var(--acend2-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.acend-account--v2 .acend-linkbtn.is-cooling {
  opacity: 0.55;
  cursor: default;
  text-decoration: none;
}

/* --- badges --- */

.acend-account--v2 .acend-badge {
  display: inline-block;
  padding: 0.24rem 0.65rem;
  border: 1px solid var(--acend2-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--acend2-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.5;
  text-transform: uppercase;
  white-space: nowrap;
}

.acend-account--v2 .acend-badge--active,
.acend-account--v2 .acend-badge--paid,
.acend-account--v2 .acend-badge--fulfilled {
  background: rgba(74, 222, 128, 0.13);
  border-color: rgba(74, 222, 128, 0.38);
  color: var(--acend2-ok);
}

.acend-account--v2 .acend-badge--pending {
  background: rgba(250, 204, 21, 0.12);
  border-color: rgba(250, 204, 21, 0.38);
  color: var(--acend2-warn);
}

.acend-account--v2 .acend-badge--failed,
.acend-account--v2 .acend-badge--cancelled,
.acend-account--v2 .acend-badge--revoked,
.acend-account--v2 .acend-badge--suspended,
.acend-account--v2 .acend-badge--expired {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--acend2-bad);
}

/* --- empty states --- */

.acend-blank {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  padding: 2.2rem 1.4rem;
  border: 1px dashed var(--acend2-line-hi);
  border-radius: var(--acend2-r);
  background: rgba(0, 0, 0, 0.14);
  text-align: center;
}

.acend-blank__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--acend2-text);
}

.acend-blank__text {
  margin: 0;
  max-width: 34rem;
  color: var(--acend2-muted);
  font-size: 0.93rem;
  line-height: 1.6;
}

.acend-blank .acend-btn { margin-top: 0.3rem; }

/* --- pager (markup unchanged from the previous template) --- */

.acend-account--v2 .acend-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--acend2-line);
}

.acend-account--v2 .acend-pager__pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.acend-account--v2 .acend-pager__step,
.acend-account--v2 .acend-pager__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.3rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--acend2-line);
  border-radius: var(--acend2-r-xs);
  color: var(--acend2-text);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  opacity: 0.72;
  transition: opacity 0.18s var(--acend2-ease), background 0.18s var(--acend2-ease),
    border-color 0.18s var(--acend2-ease);
}

.acend-account--v2 .acend-pager__step:hover,
.acend-account--v2 .acend-pager__page:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--acend2-line-hi);
}

.acend-account--v2 .acend-pager__page.is-active {
  background: var(--acend2-accent);
  border-color: var(--acend2-accent);
  color: #fff;
  opacity: 1;
}

.acend-account--v2 .acend-pager__step.is-disabled {
  opacity: 0.3;
  cursor: default;
}

.acend-account--v2 .acend-pager__gap {
  padding: 0 0.15rem;
  color: var(--acend2-muted);
}

/* ================================================== 3. signed-out auth shell */

.acend-auth2 {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0.5rem 0 1.5rem;
}

.acend-auth2__inner {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  width: 100%;
  max-width: 27rem;
}

.acend-auth2--wide .acend-auth2__inner { max-width: 31rem; }

/* Behind the verify / two-step modal the card stays visible but recedes. */
.acend-auth2.is-behind-modal .acend-auth2__inner {
  filter: saturate(0.6) blur(1px);
  opacity: 0.42;
  pointer-events: none;
  user-select: none;
}

.acend-auth2__head { text-align: center; }

.acend-account--v2 .acend-auth2__title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.18;
  color: var(--acend2-text);
}

.acend-auth2__lead {
  margin: 0.55rem 0 0;
  color: var(--acend2-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Segmented switch: plain `?view=` links, so it works without JavaScript. */
.acend-auth2__seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.25rem;
  padding: 0.28rem;
  background: var(--acend2-sunk);
  border: 1px solid var(--acend2-line);
  border-radius: 999px;
}

.acend-account--v2 .acend-auth2__seg-item {
  padding: 0.58rem 0.5rem;
  border-radius: 999px;
  color: var(--acend2-text);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.18s var(--acend2-ease), background 0.18s var(--acend2-ease),
    box-shadow 0.18s var(--acend2-ease);
}

.acend-account--v2 .acend-auth2__seg-item:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.06);
}

.acend-account--v2 .acend-auth2__seg-item.is-active {
  background: var(--acend2-accent);
  color: #fff;
  opacity: 1;
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.3);
}

.acend-account--v2 .acend-auth2__seg-item:focus-visible {
  outline: 2px solid var(--acend2-accent);
  outline-offset: 2px;
  opacity: 1;
}

.acend-auth2__card {
  padding: 1.6rem;
  background: var(--acend2-card);
  border: 1px solid var(--acend2-line);
  border-radius: var(--acend2-r);
  box-shadow: var(--acend2-lift);
  transition: border-color 0.25s var(--acend2-ease), box-shadow 0.25s var(--acend2-ease),
    transform 0.25s var(--acend2-ease);
}

.acend-auth2__card:hover,
.acend-auth2__card:focus-within {
  border-color: rgba(139, 92, 246, 0.28);
  box-shadow: var(--acend2-lift), 0 0 40px rgba(139, 92, 246, 0.09);
}

.acend-auth2__cardlead {
  margin: 0 0 1.1rem;
  color: var(--acend2-muted);
  font-size: 0.93rem;
  line-height: 1.6;
}

.acend-auth2__pwrow { grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); }

.acend-auth2__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: 1.1rem;
}

.acend-account--v2 .acend-auth2__link {
  color: var(--acend2-muted);
  font-size: 0.86rem;
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 0.18s var(--acend2-ease);
}

.acend-account--v2 .acend-auth2__link:hover {
  color: var(--acend2-text);
  text-decoration: underline;
}

.acend-account--v2 .acend-auth2__link:focus-visible {
  outline: 2px solid var(--acend2-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.acend-auth2__note {
  margin: 1rem 0 0;
  color: var(--acend2-muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.acend-auth2__foot {
  margin: 0;
  color: var(--acend2-muted);
  font-size: 0.84rem;
  line-height: 1.55;
  text-align: center;
}

/* Captcha inherits shop.css; only the frame needs the new palette. */
.acend-account--v2 .acend-captcha {
  --acend-border: rgba(255, 255, 255, 0.1);
  --acend-surface: rgba(255, 255, 255, 0.04);
  margin: 0.25rem 0 0;
}

/* --- OAuth --- */

.acend-auth2__divider {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 1.35rem 0 1rem;
  color: var(--acend2-faint);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.acend-auth2__divider::before,
.acend-auth2__divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--acend2-line);
}

.acend-oauth {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}

.acend-account--v2 .acend-oauth__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.78rem 1rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--acend2-line);
  border-radius: var(--acend2-r-xs);
  color: var(--acend2-text);
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.18s var(--acend2-ease), background 0.18s var(--acend2-ease),
    border-color 0.18s var(--acend2-ease), box-shadow 0.18s var(--acend2-ease);
}

.acend-account--v2 .acend-oauth__btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--acend2-line-hi);
}

.acend-account--v2 .acend-oauth__btn--discord:hover {
  border-color: rgba(88, 101, 242, 0.55);
  box-shadow: 0 10px 24px rgba(88, 101, 242, 0.22);
  color: #c7cdff;
}

.acend-account--v2 .acend-oauth__btn--google:hover {
  border-color: rgba(234, 67, 53, 0.45);
  box-shadow: 0 10px 24px rgba(66, 133, 244, 0.18);
}

.acend-account--v2 .acend-oauth__btn:focus-visible {
  outline: 2px solid var(--acend2-accent);
  outline-offset: 2px;
}

.acend-oauth__icon {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.acend-oauth__label { white-space: nowrap; }

/* ================================================== 4. modal + code input */

.acend-modal {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  color: var(--acend2-text);
  animation: acend-modal-in 0.2s var(--acend2-ease) both;
}

@keyframes acend-modal-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.acend-modal__backdrop {
  position: absolute;
  inset: 0;
  display: block;
  background: rgba(8, 8, 13, 0.76);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}

.acend-modal__panel {
  position: relative;
  width: 100%;
  max-width: 25rem;
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
  padding: 2rem 1.75rem 1.6rem;
  background: var(--acend2-card);
  border: 1px solid var(--acend2-line-hi);
  border-radius: var(--acend2-r);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(139, 92, 246, 0.12);
  text-align: center;
  animation: acend-modal-rise 0.24s var(--acend2-ease) both;
}

@keyframes acend-modal-rise {
  from { transform: translateY(14px) scale(0.985); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.acend-account--v2 .acend-modal__close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: var(--acend2-muted);
  font-size: 1.35rem;
  line-height: 1;
  text-decoration: none;
  transition: background 0.18s var(--acend2-ease), color 0.18s var(--acend2-ease);
}

.acend-account--v2 .acend-modal__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--acend2-text);
}

.acend-account--v2 .acend-modal__close:focus-visible {
  outline: 2px solid var(--acend2-accent);
  outline-offset: 2px;
}

.acend-account--v2 .acend-modal__title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.acend-modal__lead {
  margin: 0.6rem 0 1.4rem;
  color: var(--acend2-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.acend-modal__form { text-align: left; }

.acend-modal__codefield { gap: 0; }

.acend-account--v2 .acend-code {
  width: 100%;
  padding: 0.85rem 0.5rem;
  background: var(--acend2-sunk);
  border: 1px solid var(--acend2-line);
  border-radius: var(--acend2-r-sm);
  color: var(--acend2-text);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.42em;
  line-height: 1.2;
  text-align: center;
  text-indent: 0.42em;
}

.acend-account--v2 .acend-code::placeholder {
  color: rgba(155, 149, 173, 0.42);
  letter-spacing: 0.42em;
}

.acend-account--v2 .acend-code:focus {
  outline: none;
  border-color: var(--acend2-accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.24);
}

.acend-account--v2 .acend-code--inline {
  font-size: 1.15rem;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  padding: 0.72rem 0.5rem;
}

.acend-modal__resend {
  display: flex;
  justify-content: center;
  margin-top: 1.05rem;
}

.acend-modal__foot {
  margin: 0.9rem 0 0;
  font-size: 0.82rem;
}

.acend-account--v2 .acend-modal__foot a {
  color: var(--acend2-faint);
  text-decoration: none;
}

.acend-account--v2 .acend-modal__foot a:hover {
  color: var(--acend2-muted);
  text-decoration: underline;
}

/* ==================================================== 5. dashboard shell */

.acend-dash2 {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  width: 100%;
  min-width: 0;
}

.acend-dash2__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.5rem;
  background: linear-gradient(140deg, var(--acend2-card-hi), var(--acend2-card));
  border: 1px solid var(--acend2-line);
  border-radius: var(--acend2-r);
  transition: border-color 0.25s var(--acend2-ease), box-shadow 0.25s var(--acend2-ease);
}

.acend-dash2__header:hover {
  border-color: rgba(139, 92, 246, 0.24);
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.08);
}

.acend-dash2__identity {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.acend-dash2__avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(140deg, var(--acend2-accent), #6d3ae0);
  box-shadow: 0 0 0 1px var(--acend2-line), 0 8px 22px rgba(139, 92, 246, 0.24);
}

.acend-dash2__avatar img,
.acend-dash2__avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.acend-dash2__avatar--letter {
  color: #fff;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
}

.acend-dash2__ident-text { min-width: 0; }

.acend-dash2__name {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.acend-dash2__mail {
  margin: 0.15rem 0 0;
  color: var(--acend2-muted);
  font-size: 0.87rem;
  overflow-wrap: anywhere;
}

.acend-dash2__since {
  margin: 0.3rem 0 0;
  color: var(--acend2-faint);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.acend-dash2__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* --- tab bar --- */

.acend-dash2__tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.3rem;
  background: var(--acend2-sunk);
  border: 1px solid var(--acend2-line);
  border-radius: 999px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.acend-dash2__tabs::-webkit-scrollbar { display: none; }

.acend-account--v2 .acend-dash2__tab {
  flex: 1 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.05rem;
  border-radius: 999px;
  color: var(--acend2-text);
  font-size: 0.89rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.18s var(--acend2-ease), background 0.18s var(--acend2-ease),
    box-shadow 0.18s var(--acend2-ease);
}

.acend-account--v2 .acend-dash2__tab:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.06);
}

.acend-account--v2 .acend-dash2__tab.is-active {
  background: var(--acend2-accent);
  color: #fff;
  opacity: 1;
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.3);
}

.acend-account--v2 .acend-dash2__tab:focus-visible {
  outline: 2px solid var(--acend2-accent);
  outline-offset: 2px;
  opacity: 1;
}

.acend-dash2__tab-count {
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.5;
}

.acend-account--v2 .acend-dash2__tab.is-active .acend-dash2__tab-count {
  background: rgba(0, 0, 0, 0.25);
}

/* --- panels --- */

.acend-dash2__panels { min-width: 0; }

.acend-dash2__panel {
  display: none;
  flex-direction: column;
  gap: var(--acend2-gap);
  min-width: 0;
  scroll-margin-top: 6rem;
}

.acend-dash2__panel.is-active { display: flex; }

.acend-dash2__panel:focus { outline: none; }

.acend-dash2__panel:focus-visible {
  outline: 2px solid var(--acend2-accent);
  outline-offset: 6px;
  border-radius: var(--acend2-r);
}

.acend-account--v2 .acend-dash2__panel-title {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

/* With JavaScript the tab bar already names the panel, so the heading only stays for
 * assistive technology. */
.acend-dash2:not(.is-nojs) .acend-dash2__panel-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.acend-dash2__panel-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--acend2-muted);
  font-size: 0.85rem;
}

.acend-account--v2 .acend-dash2__panel-foot a {
  color: var(--acend2-muted);
  text-underline-offset: 3px;
}

.acend-account--v2 .acend-dash2__panel-foot a:hover { color: var(--acend2-text); }

/* No-JS fallback: the tab bar cannot switch anything, so every panel is shown stacked
 * with its own visible heading. account.js removes `is-nojs` before first paint. */
.acend-dash2.is-nojs .acend-dash2__tabs { display: none; }

.acend-dash2.is-nojs .acend-dash2__panel {
  display: flex;
  padding-top: 1.4rem;
  margin-top: 0.3rem;
  border-top: 1px solid var(--acend2-line);
}

.acend-dash2.is-nojs .acend-dash2__panel:first-child {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}

/* =========================================================== 6a. overview */

.acend-tiles {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.acend-tile {
  padding: 1.25rem 1rem;
  background: var(--acend2-card);
  border: 1px solid var(--acend2-line);
  border-radius: var(--acend2-r);
  text-align: center;
  transition: transform 0.22s var(--acend2-ease), border-color 0.22s var(--acend2-ease),
    box-shadow 0.22s var(--acend2-ease);
}

.acend-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), 0 0 34px rgba(139, 92, 246, 0.1);
}

.acend-tile__value {
  display: block;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.acend-tile__label {
  display: block;
  margin-top: 0.35rem;
  color: var(--acend2-muted);
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.acend-latest {
  padding: 1.35rem 1.4rem;
  background: var(--acend2-card);
  border: 1px solid var(--acend2-line);
  border-radius: var(--acend2-r);
  transition: border-color 0.22s var(--acend2-ease), box-shadow 0.22s var(--acend2-ease);
}

.acend-latest:hover {
  border-color: rgba(139, 92, 246, 0.28);
  box-shadow: 0 0 34px rgba(139, 92, 246, 0.08);
}

.acend-latest__label {
  margin: 0 0 0.85rem;
  color: var(--acend2-faint);
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.acend-latest__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.acend-latest__main {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  flex: 1 1 14rem;
  min-width: 0;
}

.acend-account--v2 .acend-latest__ref {
  color: var(--acend2-text);
  font-size: 0.98rem;
  font-weight: 750;
  text-decoration: none;
  transition: color 0.18s var(--acend2-ease);
}

.acend-account--v2 .acend-latest__ref:hover { color: var(--acend2-accent); }

.acend-latest__items {
  color: var(--acend2-muted);
  font-size: 0.87rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.acend-latest__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

.acend-latest__amount {
  font-size: 0.98rem;
  font-weight: 700;
  white-space: nowrap;
}

.acend-quick {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.acend-account--v2 .acend-quick__link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.1rem 1.2rem;
  background: var(--acend2-card);
  border: 1px solid var(--acend2-line);
  border-radius: var(--acend2-r);
  color: var(--acend2-text);
  text-decoration: none;
  transition: transform 0.22s var(--acend2-ease), border-color 0.22s var(--acend2-ease),
    box-shadow 0.22s var(--acend2-ease), background 0.22s var(--acend2-ease);
}

.acend-account--v2 .acend-quick__link:hover {
  transform: translateY(-2px);
  background: var(--acend2-card-hi);
  border-color: rgba(139, 92, 246, 0.34);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), 0 0 30px rgba(139, 92, 246, 0.1);
}

.acend-account--v2 .acend-quick__link:focus-visible {
  outline: 2px solid var(--acend2-accent);
  outline-offset: 2px;
}

.acend-quick__title {
  font-size: 0.98rem;
  font-weight: 700;
}

.acend-quick__sub {
  color: var(--acend2-muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

/* =========================================================== 6b. licenses */

.acend-licgroups {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.acend-licgroup {
  padding: 1.25rem 1.35rem;
  background: var(--acend2-card);
  border: 1px solid var(--acend2-line);
  border-radius: var(--acend2-r);
  transition: border-color 0.22s var(--acend2-ease), box-shadow 0.22s var(--acend2-ease);
}

.acend-licgroup:hover {
  border-color: rgba(139, 92, 246, 0.28);
  box-shadow: 0 0 36px rgba(139, 92, 246, 0.08);
}

.acend-licgroup__head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.95rem;
}

.acend-account--v2 .acend-licgroup__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.acend-licgroup__chip {
  flex: 0 0 auto;
  padding: 0.1rem 0.6rem;
  background: var(--acend2-accent-soft);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 999px;
  color: var(--acend2-text);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.6;
}

.acend-licgroup__list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.acend-licrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  background: var(--acend2-sunk);
  border: 1px solid var(--acend2-line);
  border-left: 3px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--acend2-r-sm);
  transition: background 0.2s var(--acend2-ease), border-color 0.2s var(--acend2-ease),
    transform 0.2s var(--acend2-ease);
}

.acend-licrow:hover {
  transform: translateX(2px);
  background: rgba(0, 0, 0, 0.36);
  border-color: var(--acend2-line-hi);
}

.acend-licrow.is-active { border-left-color: var(--acend2-accent); }

.acend-licrow.is-active:hover { border-left-color: var(--acend2-accent); }

.acend-account--v2 .acend-licrow__key {
  padding: 0.35rem 0.65rem;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid var(--acend2-line);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
}

.acend-licrow__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  color: var(--acend2-muted);
  font-size: 0.81rem;
}

.acend-licrow__order { color: var(--acend2-faint); }

/* ============================================================= 6c. orders */

.acend-orderlist {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.acend-orderrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1rem 1.15rem;
  background: var(--acend2-card);
  border: 1px solid var(--acend2-line);
  border-radius: var(--acend2-r-sm);
  transition: background 0.2s var(--acend2-ease), border-color 0.2s var(--acend2-ease),
    transform 0.2s var(--acend2-ease), box-shadow 0.2s var(--acend2-ease);
}

.acend-orderrow:hover {
  transform: translateY(-1px);
  background: var(--acend2-card-hi);
  border-color: rgba(139, 92, 246, 0.28);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
}

.acend-orderrow__main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1 1 14rem;
  min-width: 0;
}

.acend-account--v2 .acend-orderrow__ref {
  color: var(--acend2-text);
  font-size: 0.95rem;
  font-weight: 750;
  text-decoration: none;
  transition: color 0.18s var(--acend2-ease);
}

.acend-account--v2 .acend-orderrow__ref:hover { color: var(--acend2-accent); }

.acend-orderrow__items {
  color: var(--acend2-muted);
  font-size: 0.87rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.acend-orderrow__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

.acend-orderrow__amount {
  font-size: 0.97rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ========================================================== 6d. downloads */

.acend-dlgrid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.acend-dlcard {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: space-between;
  padding: 1.25rem 1.35rem;
  background: var(--acend2-card);
  border: 1px solid var(--acend2-line);
  border-radius: var(--acend2-r);
  transition: transform 0.22s var(--acend2-ease), border-color 0.22s var(--acend2-ease),
    box-shadow 0.22s var(--acend2-ease);
}

.acend-dlcard:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 92, 246, 0.32);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), 0 0 30px rgba(139, 92, 246, 0.1);
}

.acend-dlcard__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.acend-dlcard__label {
  font-size: 1rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.acend-dlcard__sub {
  color: var(--acend2-muted);
  font-size: 0.85rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.acend-dlcard__action { align-self: flex-start; }

/* =========================================================== 6e. security */

.acend-sec {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.acend-sec__card {
  padding: 1.35rem 1.45rem;
  background: var(--acend2-card);
  border: 1px solid var(--acend2-line);
  border-radius: var(--acend2-r);
  transition: border-color 0.22s var(--acend2-ease), box-shadow 0.22s var(--acend2-ease);
}

.acend-sec__card:hover,
.acend-sec__card:focus-within {
  border-color: rgba(139, 92, 246, 0.26);
  box-shadow: 0 0 34px rgba(139, 92, 246, 0.08);
}

.acend-sec__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.acend-account--v2 .acend-sec__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.acend-sec__desc {
  margin: 0.5rem 0 0;
  color: var(--acend2-muted);
  font-size: 0.89rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.acend-sec__body { margin-top: 1.1rem; }

.acend-sec__note {
  margin: 0.9rem 0 0;
  padding: 0.9rem 1.05rem;
  border: 1px dashed var(--acend2-line-hi);
  border-radius: var(--acend2-r-sm);
  color: var(--acend2-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.acend-pill {
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--acend2-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--acend2-muted);
  font-size: 0.71rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.6;
  text-transform: uppercase;
  white-space: nowrap;
}

.acend-pill.is-on {
  background: rgba(74, 222, 128, 0.13);
  border-color: rgba(74, 222, 128, 0.38);
  color: var(--acend2-ok);
}

.acend-pill.is-off {
  background: rgba(155, 149, 173, 0.1);
  border-color: var(--acend2-line-hi);
  color: var(--acend2-muted);
}

.acend-sec__restart {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--acend2-line);
}

.acend-sec__restart > summary {
  color: var(--acend2-muted);
  font-size: 0.86rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  list-style: none;
}

.acend-sec__restart > summary::-webkit-details-marker { display: none; }

.acend-sec__restart > summary:hover { color: var(--acend2-text); }

.acend-sec__restart > summary:focus-visible {
  outline: 2px solid var(--acend2-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.acend-linkrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  background: var(--acend2-sunk);
  border: 1px solid var(--acend2-line);
  border-radius: var(--acend2-r-sm);
  transition: background 0.2s var(--acend2-ease), border-color 0.2s var(--acend2-ease);
}

.acend-linkrow + .acend-linkrow { margin-top: 0.6rem; }

.acend-linkrow:hover {
  background: rgba(0, 0, 0, 0.36);
  border-color: var(--acend2-line-hi);
}

.acend-linkrow__ident {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.acend-linkrow__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--acend2-line);
}

.acend-linkrow__icon .acend-oauth__icon {
  width: 1.05rem;
  height: 1.05rem;
}

.acend-linkrow__icon--discord { color: #8b95f8; }

.acend-linkrow__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.acend-linkrow__name {
  font-size: 0.94rem;
  font-weight: 700;
}

.acend-linkrow__sub {
  color: var(--acend2-muted);
  font-size: 0.83rem;
  overflow-wrap: anywhere;
}

.acend-linkrow__action { flex: 0 0 auto; }

.acend-linkrow__action form { margin: 0; }

.acend-account--v2 .acend-linkrow__action .acend-btn {
  padding: 0.55rem 1.05rem;
  font-size: 0.86rem;
}

/* ========================================================= 7. responsive */

@media (max-width: 900px) {
  .acend-dash2__header { padding: 1.15rem 1.2rem; }
  .acend-account--v2 .acend-dash2__tab { flex: 0 0 auto; }
}

@media (max-width: 700px) {
  .acend-tiles { gap: 0.5rem; }
  .acend-tile { padding: 0.95rem 0.5rem; }
  .acend-tile__value { font-size: 1.4rem; }
  .acend-tile__label { font-size: 0.63rem; letter-spacing: 0.05em; }

  .acend-dash2__actions { width: 100%; }
  .acend-account--v2 .acend-dash2__actions .acend-btn { width: 100%; }
}

@media (max-width: 560px) {
  .acend-auth2 { padding: 0 0 1rem; }
  .acend-auth2__card { padding: 1.2rem; }
  .acend-account--v2 .acend-auth2__title { font-size: 1.5rem; }

  .acend-auth2__seg {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    border-radius: var(--acend2-r);
  }

  .acend-account--v2 .acend-auth2__seg-item { border-radius: var(--acend2-r-sm); }

  .acend-auth2__links { flex-direction: column; align-items: flex-start; }

  /* Full-screen modal on a phone. */
  .acend-modal { padding: 0; }

  .acend-modal__panel {
    max-width: none;
    min-height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
    padding: 3.2rem 1.35rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .acend-licrow,
  .acend-orderrow,
  .acend-linkrow {
    flex-direction: column;
    align-items: stretch;
  }

  .acend-licrow__meta,
  .acend-orderrow__meta { justify-content: flex-start; }

  .acend-linkrow__action .acend-btn,
  .acend-dlcard__action { width: 100%; }

  .acend-dash2__identity { gap: 0.8rem; }
  .acend-dash2__avatar { width: 3rem; height: 3rem; }

  .acend-sec__card,
  .acend-licgroup,
  .acend-latest,
  .acend-dlcard { padding: 1.1rem; }
}

/* ==================================================== 8. reduced motion */

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

  .acend-tile:hover,
  .acend-orderrow:hover,
  .acend-dlcard:hover,
  .acend-licrow:hover,
  .acend-account--v2 .acend-quick__link:hover,
  .acend-account--v2 .acend-btn:hover,
  .acend-account--v2 .acend-oauth__btn:hover {
    transform: none;
  }
}
