.account-dashboard {
    width: min(100%, 74rem);
    min-width: 0;
    margin: 0 auto;
    color: var(--color-ink);
}

.account-dashboard__header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.account-dashboard__header h1,
.account-dashboard__panel h2 {
    margin: 0;
}

.account-dashboard__header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
}

.account-dashboard__panel h2 {
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    line-height: 1.2;
}

.account-dashboard__header p {
    margin: 0.45rem 0 0;
    color: var(--color-copy);
}

.account-dashboard__quick-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.8rem;
    margin-top: 1rem;
}

.account-dashboard__quick-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.25rem 0.1rem;
    color: var(--color-primary-dark);
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
}

.account-dashboard__quick-nav a:hover {
    text-decoration: underline;
}

.account-dashboard__eyebrow {
    color: var(--color-primary-dark) !important;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.account-dashboard__balance-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.account-dashboard__balance-card,
.account-dashboard__panel {
    border: var(--border-soft);
    border-radius: 0.9rem;
    background: var(--color-panel);
    box-shadow: var(--shadow-hard-sm);
}

.account-dashboard__balance-card {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
    padding: 1rem;
}

.account-dashboard__balance-card--primary {
    grid-column: span 2;
    align-content: center;
    padding: 1.2rem 1.25rem;
    background: linear-gradient(135deg, rgb(255 253 246 / 96%), rgb(255 234 244 / 92%));
}

.account-dashboard__balance-card span,
.account-dashboard__balance-card small,
.account-dashboard__history-row time,
.account-dashboard__history-value small {
    color: var(--color-copy);
    font-size: 0.82rem;
}

.account-dashboard__history-value small {
    font-variant-numeric: tabular-nums;
}

.account-dashboard__balance-card strong {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.account-dashboard__balance-card--primary strong {
    font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.account-dashboard__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(18rem, 0.8fr);
    align-items: start;
    gap: 1rem;
    min-width: 0;
}

.account-dashboard__histories,
.account-dashboard__sidebar {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.account-dashboard__panel {
    padding: clamp(1rem, 2vw, 1.35rem);
}

.account-dashboard__panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.account-dashboard__history-list {
    display: grid;
    gap: 0.2rem;
}

.account-dashboard__history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
    padding: 0.8rem 0;
    border-top: var(--border-soft);
}

.account-dashboard__history-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.account-dashboard__history-row:last-child {
    padding-bottom: 0;
}

.account-dashboard__history-row > div:first-child {
    display: grid;
    min-width: 0;
    gap: 0.2rem;
}

.account-dashboard__history-row > div:first-child strong,
.account-dashboard__history-row > div:first-child a {
    min-width: 0;
    overflow-wrap: anywhere;
}

.account-dashboard__history-row time {
    display: block;
}

.account-dashboard__history-value {
    display: grid;
    flex: 0 0 auto;
    justify-items: end;
    gap: 0.25rem;
    text-align: right;
}

.account-dashboard__amount {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.account-dashboard__status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 1.6rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    color: var(--color-ink);
    background: rgb(37 170 160 / 15%);
    font-size: 0.78rem;
    font-weight: 700;
}

.account-dashboard__status-pill--failed {
    background: rgb(208 64 64 / 14%);
}

.account-dashboard__status-pill--processing {
    background: rgb(255 210 50 / 35%);
}

.account-dashboard__empty,
.account-dashboard__status,
.account-dashboard__notice {
    color: var(--color-copy);
}

.account-dashboard__empty,
.account-dashboard__notice {
    margin: 0;
    padding: 0.9rem 1rem;
    border: 1px dashed #d8c9c6;
    border-radius: 0.7rem;
    background: rgb(255 253 246 / 72%);
}

.account-dashboard__status,
.account-dashboard__inline-error {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.7rem;
}

.account-dashboard__status {
    border: 1px solid rgb(37 170 160 / 28%);
    background: rgb(37 170 160 / 10%);
}

.account-dashboard__inline-error {
    border: 1px solid rgb(208 64 64 / 30%);
    background: rgb(208 64 64 / 8%);
}

.account-dashboard__pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-top: 1.15rem;
    color: var(--color-copy);
    font-size: 0.85rem;
}

.account-dashboard__pagination-button,
.account-dashboard__button,
.account-dashboard__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--color-primary-dark);
    border-radius: 999px;
    color: #fff;
    background: var(--color-primary-dark);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.account-dashboard__pagination-button {
    min-height: 2.75rem;
    padding-inline: 0.75rem;
    border: var(--border-ink);
    color: var(--color-ink);
    background: transparent;
    font-size: 0.82rem;
}

.account-dashboard__pagination-button:disabled,
.account-dashboard__pagination-button[aria-disabled="true"],
.account-dashboard__action:disabled,
.account-dashboard__button:disabled {
    cursor: not-allowed;
    border: var(--border-ink);
    color: var(--color-copy);
    background: transparent;
    opacity: 0.5;
}

.account-dashboard__button:hover:not(:disabled):not([aria-disabled="true"]),
.account-dashboard__action:hover:not(:disabled):not([aria-disabled="true"]),
.account-dashboard__pagination-button:hover:not(:disabled):not([aria-disabled="true"]) {
    color: #fff;
    background: var(--color-primary);
}

.account-dashboard__pagination-button:hover:not(:disabled):not([aria-disabled="true"]) {
    color: var(--color-ink);
    background: rgb(255 210 50 / 30%);
}

.account-dashboard__header .account-dashboard__button--secondary,
.account-dashboard__action--secondary {
    border: var(--border-ink);
    color: var(--color-ink);
    background: transparent;
}

.account-dashboard__header .account-dashboard__button--secondary:hover:not(:disabled):not([aria-disabled="true"]),
.account-dashboard__action--secondary:hover:not(:disabled):not([aria-disabled="true"]) {
    color: var(--color-ink);
    background: rgb(255 210 50 / 30%);
}

.account-dashboard :where(a, button):focus-visible {
    outline: 3px solid var(--color-support);
    outline-offset: 3px;
}

.account-dashboard__details {
    display: grid;
    gap: 0.75rem;
    margin: 0;
}

.account-dashboard__details div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
    padding-bottom: 0.65rem;
    border-bottom: var(--border-soft);
}

.account-dashboard__details div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.account-dashboard__details dt {
    color: var(--color-copy);
    flex: 0 0 auto;
}

.account-dashboard__details dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 700;
    text-align: right;
}

.account-dashboard__actions {
    display: grid;
    gap: 0.65rem;
}

.account-dashboard__actions form {
    display: grid;
}

.account-dashboard__action {
    width: 100%;
}

.account-dashboard__action--danger {
    border-color: var(--color-danger);
    color: var(--color-danger);
    background: transparent;
}

.account-dashboard__action--danger:hover:not(:disabled):not([aria-disabled="true"]) {
    color: #fff;
    background: var(--color-danger);
}

.account-dashboard__inline-error,
.account-dashboard__error {
    color: var(--color-danger);
}

.account-dashboard__error {
    padding: 1.5rem;
    border: 1px solid rgb(208 64 64 / 35%);
    border-radius: 0.9rem;
    background: rgb(208 64 64 / 8%);
}

.account-dashboard__detail-page {
    min-width: 0;
}

.site-main > section:first-child.account-dashboard__detail-page {
    padding: clamp(1.25rem, 3vw, 2.5rem);
}

.account-dashboard__detail-page h1 {
    margin: 0.35rem 0 1.5rem;
    font-size: clamp(1.75rem, 4vw, 2.6rem);
    line-height: 1.15;
}

.account-dashboard__detail-page .account-dashboard__details {
    margin-top: 1.25rem;
}

.account-dashboard__detail-page .account-dashboard__details dd {
    font-variant-numeric: tabular-nums;
}

.account-dashboard [id] {
    scroll-margin-top: 1.5rem;
}

.account-dashboard__pending {
    background: linear-gradient(135deg, rgb(255 253 246 / 96%), rgb(255 234 244 / 92%));
}

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

@media (max-width: 900px) {
    .account-dashboard__balance-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .account-dashboard__layout {
        grid-template-columns: 1fr;
    }

    .account-dashboard__sidebar {
        order: -1;
    }

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

    .account-dashboard__layout {
        display: grid;
    }
}

@media (max-width: 520px) {
    .account-dashboard__balance-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .account-dashboard__balance-card--primary {
        grid-column: 1 / -1;
    }

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

    .account-dashboard__history-value {
        justify-items: start;
        text-align: left;
    }

    .account-dashboard__pagination {
        gap: 0.4rem;
        font-size: 0.76rem;
    }
}

.account-main {
    min-height: calc(100svh - 12rem);
    padding-block: clamp(1.5rem, 5vh, 3.5rem) 2rem;
}

.site-header--account .site-nav {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.site-header--account .site-workspace-header__actions {
    flex-wrap: wrap;
}

.site-header--account .site-account-link,
.site-header--account .site-workspace-account-menu summary {
    min-height: 2.75rem;
    font-size: 0.875rem;
}

.site-header--account .site-workspace-account-menu summary,
.site-header--account .site-workspace-account-menu > div {
    color: var(--color-ink);
    border: var(--border-soft);
    background: var(--color-panel);
}

.site-header--account .site-workspace-account-menu > div {
    box-shadow: var(--shadow-hard-sm);
}

.site-header--account .site-workspace-account-menu .site-account-link {
    color: var(--color-ink);
}

.account-main .account-settings {
    width: min(100%, 34rem);
    margin-bottom: 0;
    padding: clamp(1.25rem, 4vw, 2.25rem);
    border-radius: 1rem;
}

.account-settings h1 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    line-height: 1.4;
    overflow-wrap: anywhere;
    text-wrap: pretty;
}

.account-settings h2 {
    margin: 1.75rem 0 0.75rem;
    padding-top: 1.25rem;
    border-top: var(--border-soft);
    font-size: 1.1rem;
}

.account-settings p {
    margin: 0.75rem 0;
    line-height: 1.7;
    color: var(--color-copy);
}

.account-settings form {
    display: grid;
    gap: 0.625rem;
    margin-top: 1.5rem;
}

.account-settings form > label {
    font-weight: 600;
}

.account-settings input + label {
    margin-top: 0.65rem;
}

.account-settings input[type="password"],
.account-settings input[type="email"] {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 3rem;
    padding: 0.6rem 0.75rem;
    border: var(--border-ink);
    border-radius: 0.6rem;
    background: #fff;
    color: var(--color-ink);
    font-size: 1rem;
}

.account-settings form > button {
    width: 100%;
    margin-top: 0.875rem;
}

.account-settings a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    color: #983f8c;
    text-decoration: underline;
    text-underline-offset: 0.2em;
    overflow-wrap: anywhere;
}

.account-settings .site-button,
.account-settings form > button,
.account-settings li button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.55rem 0.9rem;
    border: var(--border-ink);
    border-radius: 0.6rem;
    background: var(--color-panel);
    color: var(--color-ink);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.5;
    white-space: normal;
}

.account-settings .site-button,
.account-settings form > button {
    min-height: 3rem;
    color: #fff;
    border-color: #983f8c;
    background: #983f8c;
}

.account-settings .site-button {
    width: 100%;
    margin-block: 0.75rem;
}

.account-settings .site-button:hover,
.account-settings form > button:hover:not(:disabled) {
    background: #7f3275;
}

.account-settings li button:hover:not(:disabled) {
    background: var(--color-muted);
}

.account-settings button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.account-settings [role="alert"],
.account-settings [role="status"] {
    margin-bottom: 1.25rem;
    padding: 0.875rem 1rem;
    border: 1px solid #b95868;
    border-radius: 0.625rem;
    color: #8a2e40;
    background: #fff1f3;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.account-settings [role="status"] {
    border-color: #168e82;
    color: #14675f;
    background: #eff9f6;
}

.account-settings .account-back-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    margin-top: 1rem;
}

.account-footer {
    padding-block: 1.25rem;
    border-top: var(--border-soft);
    color: var(--color-copy);
    font-size: 0.875rem;
}

.account-footer nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 1.25rem;
}

.account-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.account-footer p {
    margin: 0.5rem 0 0;
    text-align: center;
}

.account-settings dl {
    display: grid;
    grid-template-columns: minmax(7rem, auto) minmax(0, 1fr);
    gap: 0.75rem 1rem;
    margin: 1rem 0;
}

.account-settings dt {
    color: var(--color-copy);
}

.account-settings dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.account-settings ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.account-settings li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 0;
}

.account-settings li strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 520px) {
    .account-settings dl {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .account-settings dt:not(:first-child) {
        margin-top: 0.75rem;
    }
}
