.account-body {
  min-height: 100vh;
  background: #07101d;
}

.account-body::before {
  opacity: 0.45;
}

.account-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: rgb(5 12 24 / 90%);
  backdrop-filter: blur(18px);
}

.account-header-inner {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.account-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.account-email {
  max-width: 300px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-loading {
  display: grid;
  min-height: calc(100vh - 68px);
  place-items: center;
  align-content: center;
  gap: 18px;
}

.account-loading p {
  font-size: 0.8rem;
}

.account-loader {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: account-spin 800ms linear infinite;
}

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

.account-auth-state {
  min-height: calc(100vh - 68px);
  padding: 70px 20px;
  background:
    radial-gradient(circle at 50% 15%, rgb(24 230 161 / 10%), transparent 38%),
    var(--bg);
}

.account-auth-card {
  width: min(100%, 570px);
  margin: 0 auto;
  padding: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.account-auth-card > .brand {
  margin-bottom: 55px;
}

.account-auth-card h1 {
  margin-bottom: 20px;
  font-size: clamp(2.2rem, 7vw, 3.45rem);
}

.account-auth-card > p {
  font-size: 0.9rem;
}

.account-auth-form {
  margin-top: 30px;
}

.account-auth-form label {
  display: block;
  margin-bottom: 8px;
  color: #d2dbe7;
  font-size: 0.75rem;
  font-weight: 750;
}

.account-auth-form input {
  width: 100%;
  min-height: 54px;
  margin-bottom: 12px;
  padding: 0 15px;
  border: 1px solid #2b3e59;
  border-radius: 7px;
  background: #07111f;
  color: var(--text);
}

.account-auth-form .button {
  width: 100%;
}

.account-dashboard {
  min-height: calc(100vh - 68px);
}

.account-layout {
  display: grid;
  grid-template-columns: 215px minmax(0, 1fr);
  gap: 48px;
}

.account-sidebar {
  position: sticky;
  top: 68px;
  display: flex;
  height: calc(100vh - 68px);
  padding: 38px 22px 30px 0;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
}

.sidebar-label {
  margin: 0 0 15px 13px;
  color: #53647c;
  font-size: 0.6rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.account-sidebar nav {
  display: grid;
  gap: 5px;
}

.account-sidebar nav a {
  display: flex;
  padding: 10px 12px;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #78889e;
  font-size: 0.73rem;
  font-weight: 700;
}

.account-sidebar nav a span {
  width: 19px;
  color: #55677f;
  text-align: center;
}

.account-sidebar nav a:hover,
.account-sidebar nav a.active {
  border-color: rgb(24 230 161 / 14%);
  background: rgb(24 230 161 / 7%);
  color: var(--text);
}

.account-sidebar nav a.active span {
  color: var(--green);
}

.sidebar-help {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #091524;
}

.sidebar-help p {
  margin-bottom: 6px;
  color: #cbd5e1;
  font-size: 0.7rem;
  font-weight: 750;
}

.sidebar-help a {
  color: var(--green);
  font-size: 0.65rem;
}

.account-content {
  min-width: 0;
  padding: 56px 0 60px;
}

.account-welcome {
  display: flex;
  margin-bottom: 35px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.account-welcome h1 {
  margin-bottom: 10px;
  font-size: clamp(2.25rem, 5vw, 4rem);
}

.account-welcome p:last-child {
  margin-bottom: 0;
  font-size: 0.82rem;
}

.service-pill {
  display: flex;
  margin-bottom: 8px;
  padding: 7px 11px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: #8b9ab0;
  font-size: 0.63rem;
  white-space: nowrap;
}

.service-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
}

.account-metrics {
  display: grid;
  margin-bottom: 18px;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 14px;
}

.account-metric {
  min-height: 175px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(145deg, var(--surface-2), var(--surface));
}

.account-metric--credit {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  border-color: rgb(24 230 161 / 30%);
  background:
    radial-gradient(circle at 20% 0%, rgb(24 230 161 / 12%), transparent 55%),
    var(--surface);
}

.account-metric p {
  margin-bottom: 12px;
  color: #77879d;
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.account-metric strong {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
  font-size: 3rem;
  letter-spacing: -0.06em;
  line-height: 1;
}

.account-metric span,
.account-metric a {
  color: #718199;
  font-size: 0.65rem;
}

.account-metric a {
  color: var(--green);
}

.account-metric .metric-text {
  margin: 22px 0 12px;
  color: var(--text);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.account-metric .metric-text--muted {
  color: #8392a7;
}

.checkout-result {
  margin-top: 18px;
  padding: 14px 17px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0b1726;
  color: #b9c5d4;
  font-size: 0.76rem;
  line-height: 1.55;
}

.checkout-result--success {
  border-color: rgb(15 226 166 / 38%);
  background: rgb(15 226 166 / 8%);
  color: #7ff5d2;
}

.checkout-result--pending {
  border-color: rgb(245 184 74 / 38%);
  background: rgb(245 184 74 / 8%);
  color: #f4ce86;
}

.checkout-result--error {
  border-color: rgb(255 101 119 / 38%);
  background: rgb(255 101 119 / 8%);
  color: #ff9dab;
}

.checkout-result--neutral {
  color: #aebccd;
}

.order-status {
  display: inline-flex;
  padding: 5px 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0b1726;
  color: #9dacbf;
  font-size: 0.58rem;
  font-weight: 750;
  white-space: nowrap;
}

.order-status--credits-awarded,
.order-status--payment-confirmed {
  border-color: rgb(15 226 166 / 30%);
  color: var(--green);
}

.order-status--pending,
.order-status--paid {
  border-color: rgb(245 184 74 / 30%);
  color: #f4ce86;
}

.order-status--partially-refunded,
.order-status--refunded,
.order-status--cancelled,
.order-status--expired {
  color: #aab7c8;
}

.order-status--failed {
  border-color: rgb(255 101 119 / 30%);
  color: var(--danger);
}

.account-panel,
.account-section {
  margin-top: 18px;
}

.account-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.account-panel-heading {
  display: flex;
  padding: 25px 27px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 25px;
}

.account-panel-heading .eyebrow {
  margin-bottom: 8px;
}

.account-panel-heading h2 {
  margin: 0;
  font-size: 1.55rem;
}

.account-panel-heading > span,
.account-panel-heading > p {
  margin: 0;
  color: #65758c;
  font-size: 0.63rem;
}

.activity-table-wrap {
  border-top: 1px solid var(--line);
  overflow-x: auto;
}

.activity-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.activity-table th {
  padding: 13px 22px;
  background: #091422;
  color: #5d6e85;
  font-size: 0.57rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.activity-table td {
  padding: 17px 22px;
  border-top: 1px solid var(--line);
  color: #8e9db1;
  font-size: 0.72rem;
}

.activity-table tbody tr:first-child td {
  border-top: 0;
}

.activity-table td:first-child {
  color: #c9d2de;
  font-weight: 650;
}

.activity-amount {
  font-weight: 850;
}

.activity-amount.positive {
  color: var(--green);
}

.activity-amount.negative {
  color: var(--danger);
}

.activity-type {
  display: block;
  margin-top: 3px;
  color: #5e6f86;
  font-size: 0.58rem;
  font-weight: 500;
  text-transform: capitalize;
}

.account-empty {
  display: grid;
  min-height: 230px;
  padding: 35px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.account-empty > span {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
}

.account-empty h3 {
  margin-bottom: 7px;
}

.account-empty p {
  margin: 0;
  font-size: 0.72rem;
}

.account-section {
  padding-top: 35px;
}

.account-section > .account-panel-heading {
  padding-right: 0;
  padding-left: 0;
}

.account-package-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.account-package {
  position: relative;
  display: flex;
  min-height: 285px;
  padding: 23px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(145deg, var(--surface-2), var(--surface));
}

.account-package.popular {
  border-color: rgb(24 230 161 / 45%);
  box-shadow: 0 0 40px rgb(24 230 161 / 7%);
}

.account-package-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  color: var(--green);
  font-size: 0.52rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.account-package h3 {
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.account-package-credit {
  margin: 18px 0 2px;
  color: var(--text);
  font-size: 1.7rem;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.account-package-price {
  color: var(--green);
  font-size: 1.2rem;
  font-weight: 800;
}

.account-package p {
  font-size: 0.68rem;
}

.account-package button {
  width: 100%;
  margin-top: auto;
}

.account-small-note {
  margin-top: 13px;
  font-size: 0.62rem;
  text-align: center;
}

.connection-panel {
  display: grid;
  margin-top: 60px;
  padding: 34px;
  grid-template-columns: 1.4fr 0.6fr;
  align-items: center;
  gap: 50px;
  border-color: rgb(81 168 255 / 25%);
  background:
    radial-gradient(circle at 0% 50%, rgb(81 168 255 / 9%), transparent 45%),
    var(--surface);
}

.connection-panel h2 {
  margin-bottom: 13px;
  font-size: 2rem;
}

.connection-panel p {
  font-size: 0.78rem;
}

.connection-action {
  display: grid;
  justify-items: stretch;
  gap: 12px;
  text-align: center;
}

.connection-status {
  justify-self: center;
  padding: 5px 9px;
  border: 1px solid rgb(81 168 255 / 25%);
  border-radius: 99px;
  color: var(--blue);
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.connection-action button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.connection-action a {
  color: #74849a;
  font-size: 0.62rem;
}

.account-footer-note {
  display: flex;
  margin-top: 32px;
  padding-top: 22px;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
}

.account-footer-note p {
  margin: 0;
  font-size: 0.65rem;
}

.account-footer-note strong {
  color: #aeb9c8;
}

.account-footer-note div {
  display: flex;
  gap: 18px;
}

.account-footer-note a {
  color: #718198;
  font-size: 0.65rem;
}

@media (max-width: 1020px) {
  .account-layout {
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 28px;
  }

  .account-sidebar {
    padding-right: 15px;
  }

  .account-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .account-metric--credit {
    grid-column: 1 / -1;
  }

  .account-package-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .account-email {
    display: none;
  }

  .account-layout {
    display: block;
  }

  .account-sidebar {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    padding: 16px 0;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-label,
  .sidebar-help {
    display: none;
  }

  .account-sidebar nav {
    display: flex;
    min-width: max-content;
  }

  .account-sidebar nav a {
    padding: 8px 10px;
  }

  .account-content {
    padding-top: 38px;
  }

  .account-welcome {
    align-items: flex-start;
    flex-direction: column;
  }

  .service-pill {
    margin-top: -10px;
  }

  .connection-panel {
    grid-template-columns: 1fr;
    gap: 25px;
  }
}

@media (max-width: 560px) {
  .account-header-inner {
    min-height: 62px;
  }

  .account-header-actions .button {
    min-height: 35px;
  }

  .account-auth-state {
    padding: 35px 14px;
  }

  .account-auth-card {
    padding: 30px 22px;
  }

  .account-auth-card > .brand {
    margin-bottom: 42px;
  }

  .account-metrics {
    grid-template-columns: 1fr;
  }

  .account-metric--credit {
    grid-column: auto;
    align-items: flex-start;
    flex-direction: column;
  }

  .account-package-grid {
    grid-template-columns: 1fr;
  }

  .account-panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .activity-table th,
  .activity-table td {
    padding-right: 14px;
    padding-left: 14px;
  }

  .activity-table th:nth-child(2),
  .activity-table td:nth-child(2) {
    display: none;
  }

  .connection-panel {
    padding: 26px 22px;
  }

  .account-footer-note {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .account-loader {
    animation: none;
    border-top-color: var(--line);
  }
}
/* The hidden attribute must always win over component display rules. */
.account-body [hidden] {
  display: none !important;
}

/* Keep primary-button text readable inside metric cards. */
.account-metric a.button--primary {
  color: #02140e;
}

.activity-audit-target {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #84a5a4;
  font-size: 0.58rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
