/* Canonical My Fixonic account-hub layout and theme treatment. */
.app-account-header {
    align-items: center;
    gap: 14px;
    padding: 20px 22px;
    border: 1px solid var(--fx-line);
    border-radius: 18px;
    background: var(--fx-panel);
    box-shadow: none;
}

.app-account-identity {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.app-account-identity > span {
    color: var(--fx-blue);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.app-account-identity h1 {
    margin: 0;
    color: var(--fx-text);
    line-height: 1.15;
}

.app-account-identity p {
    margin: 0;
    max-width: 100%;
    color: var(--fx-muted);
    overflow-wrap: anywhere;
}

.app-account-signout {
    min-width: 132px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    padding: 0 18px;
    color: var(--fx-text) !important;
    border: 1px solid var(--fx-line-strong);
    border-radius: 12px;
    background: var(--fx-panel-2);
    font-size: .94rem;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none !important;
}

.app-account-signout > i {
    flex: 0 0 auto;
    width: 1em;
    text-align: center;
    font-size: .92em;
}

.app-account-signout > span {
    display: block;
    min-width: max-content;
}

.app-account-signout:hover,
.app-account-signout:focus-visible {
    color: var(--fx-blue) !important;
    border-color: var(--fx-blue);
    background: color-mix(in srgb, var(--fx-blue) 8%, var(--fx-panel));
}

.app-account-metrics,
.app-account-links > a,
.app-account-theme-control,
.app-account-activity-list > a,
.app-account-order-grid > a {
    color: var(--fx-text);
    border-color: var(--fx-line);
}

.app-account-metrics {
    background: var(--fx-panel);
}

.app-account-metrics a {
    color: var(--fx-text);
    background: transparent;
}

.app-account-metrics strong,
.app-account-links > a strong,
.app-account-theme-control strong,
.app-account-activity-list strong,
.app-account-order-grid strong {
    color: var(--fx-text);
}

.app-account-metrics span,
.app-account-links > a small,
.app-account-theme-control small,
.app-account-activity-list small,
.app-account-order-grid small {
    color: var(--fx-muted);
}

.app-account-links > a,
.app-account-theme-control,
.app-account-activity-list > a,
.app-account-order-grid > a {
    background: var(--fx-panel);
}

.app-account-links > a,
.app-account-theme-control {
    grid-template-columns: 42px minmax(0, 1fr) 18px !important;
    gap: 14px !important;
    padding: 14px 14px !important;
}

.app-account-link-icon {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    box-sizing: border-box;
    border-radius: 12px;
    color: var(--fx-blue);
    background: var(--fx-panel-2);
    font-size: 1rem;
    line-height: 1;
}

.app-account-link-icon > i {
    width: 1.1em;
    text-align: center;
    line-height: 1;
}

.app-account-links > a > .app-account-chevron,
.app-account-theme-control > .app-account-chevron {
    justify-self: end;
    width: 18px;
    color: var(--fx-muted);
    font-size: .9rem;
    text-align: center;
}

/* Order-state chips must remain legible in both themes. */
.app-account-order-grid .status-pill,
.app-account-activity-list .status-pill {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 5px 9px;
    color: var(--fx-text-soft) !important;
    border: 1px solid var(--fx-line-strong);
    border-radius: 999px;
    background: var(--fx-panel-2) !important;
    font-size: .68rem;
    font-weight: 800;
    line-height: 1.15;
    white-space: normal;
}

.app-account-order-grid .status-pending_payment {
    color: #704700 !important;
    border-color: #e9c268;
    background: #fff0bf !important;
}

.app-account-order-grid .status-expired {
    color: #4f5967 !important;
    border-color: #d2d7df;
    background: #eef1f5 !important;
}

html[data-theme="dark"] .app-account-header {
    color: var(--fx-text);
    border-color: var(--fx-line-strong);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--fx-blue) 9%, transparent), transparent 58%),
        var(--fx-panel) !important;
}

html[data-theme="dark"] .app-account-header :is(h1, strong),
html[data-theme="dark"] .app-account-metrics :is(strong, a),
html[data-theme="dark"] .app-account-links > a strong,
html[data-theme="dark"] .app-account-theme-control strong,
html[data-theme="dark"] .app-account-activity-list strong,
html[data-theme="dark"] .app-account-order-grid strong {
    color: var(--fx-text) !important;
}

html[data-theme="dark"] .app-account-header :is(p, small),
html[data-theme="dark"] .app-account-metrics span,
html[data-theme="dark"] .app-account-links > a small,
html[data-theme="dark"] .app-account-theme-control small,
html[data-theme="dark"] .app-account-activity-list small,
html[data-theme="dark"] .app-account-order-grid small {
    color: var(--fx-muted) !important;
}

html[data-theme="dark"] .app-account-identity > span {
    color: var(--fx-cyan) !important;
}

html[data-theme="dark"] :is(
    .app-account-metrics,
    .app-account-links > a,
    .app-account-theme-control,
    .app-account-activity-list > a,
    .app-account-order-grid > a
) {
    border-color: var(--fx-line) !important;
    background: var(--fx-panel) !important;
}

html[data-theme="dark"] .app-account-link-icon {
    color: var(--fx-cyan) !important;
    background: var(--fx-panel-2) !important;
}

html[data-theme="dark"] .app-account-signout {
    color: var(--fx-text) !important;
    border-color: var(--fx-line-strong);
    background: var(--fx-panel-2);
}

html[data-theme="dark"] .app-account-signout:hover,
html[data-theme="dark"] .app-account-signout:focus-visible {
    color: var(--fx-cyan) !important;
    border-color: var(--fx-cyan);
    background: color-mix(in srgb, var(--fx-cyan) 8%, var(--fx-panel));
}

html[data-theme="dark"] .app-account-order-grid .status-pill,
html[data-theme="dark"] .app-account-activity-list .status-pill {
    color: var(--fx-text) !important;
    border-color: var(--fx-line-strong) !important;
    background: var(--fx-panel-2) !important;
}

html[data-theme="dark"] .app-account-order-grid .status-pending_payment {
    color: #ffd57f !important;
    border-color: rgba(255, 213, 127, .38) !important;
    background: rgba(255, 193, 70, .12) !important;
}

html[data-theme="dark"] .app-account-order-grid .status-expired {
    color: var(--fx-text-soft) !important;
    border-color: var(--fx-line-strong) !important;
    background: var(--fx-panel-3) !important;
}

@media (min-width: 901px) {
    .app-account-header {
        width: fit-content;
        max-width: 100%;
        grid-template-columns: auto minmax(280px, 460px) auto;
        justify-content: start;
    }

    .app-account-signout {
        margin-left: 4px;
        justify-self: start;
    }
}

@media (max-width: 900px) {
    .app-account-header {
        width: 100%;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 12px 14px;
        padding: 18px;
    }

    .app-account-signout {
        grid-column: 2;
        justify-self: start;
        margin: 4px 0 0;
    }
}

@media (max-width: 760px) {
    .app-account-links > a,
    .app-account-theme-control {
        grid-template-columns: 40px minmax(0, 1fr) 16px !important;
        gap: 12px !important;
        padding: 13px 10px !important;
    }

    .app-account-link-icon {
        width: 40px;
        height: 40px;
        border-radius: 11px;
    }
}

@media (max-width: 420px) {
    .app-account-header {
        padding: 16px;
    }

    .app-account-signout {
        min-width: 128px;
        min-height: 40px;
        padding-inline: 15px;
    }
}
