:root {
    color-scheme: dark;
    --bg: #071017;
    --panel: #121b27;
    --line: #2a3b50;
    --text: #eef5ff;
    --muted: #91a0b5;
    --blue: #66e3b4;
    --red: #ff7e86
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at 10% 0, #153d45 0, transparent 40%), var(--bg);
    color: var(--text);
    font: 15px/1.5 Inter, Segoe UI, sans-serif
}

.back-home {
    position: fixed;
    z-index: 2;
    top: 24px;
    left: 28px;
    color: var(--muted);
    text-decoration: none
}

.back-home:hover, .security-note a {
    color: var(--blue)
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 72px 24px 24px
}

.login-card {
    width: min(450px, 100%);
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(145deg, #141f2d, #0d1621);
    box-shadow: 0 24px 70px #0007
}

.account-card {
    width: min(560px, 100%)
}

.eyebrow {
    margin: 0;
    color: var(--blue);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .16em
}

.login-card h1 {
    margin: 8px 0 6px;
    font-size: 30px
}

.subtitle, .security-note {
    color: var(--muted)
}

.subtitle {
    margin: 0 0 24px
}

.security-note {
    margin: 18px 0 0;
    font-size: 12px
}

label {
    display: block;
    margin: 14px 0;
    font-weight: 700
}

input {
    display: block;
    width: 100%;
    margin-top: 7px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #0b141f;
    color: var(--text);
    font: inherit;
    outline: none
}

input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px #66e3b422
}

button {
    width: 100%;
    margin-top: 8px;
    padding: 13px;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(90deg, #3bc995, #66e3b4);
    color: #07101d;
    font: 800 15px Inter, Segoe UI, sans-serif;
    cursor: pointer
}

button:disabled {
    opacity: .55;
    cursor: wait
}

.secondary-button {
    border: 1px solid var(--line);
    background: #0b141f;
    color: var(--text)
}

.error {
    min-height: 22px;
    color: var(--red);
    font-size: 13px
}

.success {
    color: var(--blue);
    font-size: 13px
}

.consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500
}

.consent input {
    flex: 0 0 18px;
    width: 18px;
    margin: 1px 0;
    accent-color: var(--blue)
}

.access-box {
    padding: 18px;
    border: 1px solid #285a50;
    border-radius: 13px;
    background: #102720
}

.access-box span, .access-box strong, .access-box small {
    display: block
}

.access-box span, .access-box small {
    color: var(--muted)
}

.access-box strong {
    margin: 3px 0;
    font-size: 23px;
    color: var(--blue)
}

.account-data {
    display: grid;
    gap: 1px;
    margin: 15px 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: var(--line)
}

.account-data > div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 12px;
    background: #0b141f
}

.account-data span {
    color: var(--muted)
}

.pending-note {
    padding: 13px;
    border-left: 3px solid #ffb35c;
    background: #241d13;
    color: #d8c7aa;
    font-size: 12px
}

.exchange-box {
    margin: 20px 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #0b141f
}

.exchange-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px
}

.exchange-title h2 {
    margin: 3px 0;
    font-size: 20px
}

.connection-badge {
    padding: 6px 9px;
    border-radius: 999px;
    background: #2b1a1f;
    color: #ff9ba1;
    font-size: 12px;
    font-weight: 800
}

.connection-badge.ok {
    background: #102720;
    color: var(--blue)
}

.danger-button {
    border: 1px solid #71333a;
    background: #2b181c;
    color: #ff9ba1
}

.account-shell {
    padding-top: 85px;
    padding-bottom: 50px
}

.hidden {
    display: none !important
}

@media (max-width: 520px) {
    .back-home {
        top: 14px;
        left: 16px
    }

    .login-card {
        padding: 22px
    }

    .exchange-title {
        align-items: flex-start;
        flex-direction: column
    }
}

/* Account dashboard */
.account-page {
    background: radial-gradient(circle at 8% 0, #172b45 0, transparent 34%), #091019;
    color: #eef5ff
}

.account-page .topbar button {
    width: auto;
    margin: 0;
    padding: 6px 10px;
    border: 0;
    background: #26364b;
    color: #eef5ff
}

.account-page .badge {
    color: #ffbd59;
    border-color: #8c6727
}

.account-page .badge.ok {
    color: #28d7a0;
    border-color: #277960
}

.account-main {
    width: min(1280px, calc(100% - 32px));
    min-height: calc(100vh - 150px);
    margin: 30px auto 45px
}

.account-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px
}

.account-hero h1 {
    margin: 6px 0 3px;
    font-size: clamp(28px, 4vw, 40px)
}

.account-hero .subtitle {
    margin: 0
}

.account-health {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 13px;
    border: 1px solid #2a3b50;
    border-radius: 999px;
    background: #121b27;
    color: #91a0b5;
    font-size: 12px
}

.account-health span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #91a0b5;
    box-shadow: 0 0 0 4px #91a0b51a
}

.account-health.ok {
    color: #76e5be;
    border-color: #277960
}

.account-health.ok span {
    background: #28d7a0;
    box-shadow: 0 0 0 4px #28d7a01a
}

.account-health.warn {
    color: #ffcd82;
    border-color: #755724
}

.account-health.warn span {
    background: #ffbd59;
    box-shadow: 0 0 0 4px #ffbd591a
}

.account-dashboard {
    display: grid;
    grid-template-columns:minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 18px
}

.account-panel {
    min-width: 0;
    padding: 22px;
    border: 1px solid #263447;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(19, 29, 42, .98), rgba(14, 22, 32, .98));
    box-shadow: 0 16px 45px #0003
}

.account-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 17px
}

.account-section-head h2 {
    margin: 4px 0 0;
    font-size: 21px
}

.account-page .access-box {
    margin-bottom: 13px;
    padding: 17px;
    background: linear-gradient(135deg, #102720, #101d25)
}

.info-grid {
    display: grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap: 8px
}

.info-grid > div, .account-identity-row > div {
    min-width: 0;
    padding: 12px;
    border: 1px solid #263447;
    border-radius: 10px;
    background: #0b141f
}

.info-grid span, .info-grid b, .account-identity-row span, .account-identity-row b {
    display: block
}

.info-grid span, .account-identity-row span {
    color: #91a0b5;
    font-size: 11px
}

.info-grid b, .account-identity-row b {
    overflow: hidden;
    margin-top: 4px;
    color: #dce9f9;
    font-size: 13px;
    text-overflow: ellipsis
}

.account-identity-row {
    display: grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px
}

.panel-note, .section-description {
    color: #91a0b5;
    font-size: 12px
}

.panel-note {
    margin: 13px 0 0;
    padding-top: 12px;
    border-top: 1px solid #263447
}

.exchange-panel form {
    margin-top: 5px
}

.credential-grid {
    display: grid;
    grid-template-columns:1fr 1fr;
    gap: 12px
}

.credential-grid label {
    margin: 0
}

.account-page input {
    background: #0b141f;
    border-color: #2a3b50
}

.permission-line {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 9px;
    padding: 11px 12px;
    border: 1px solid #263447;
    border-radius: 10px;
    background: #0b141f;
    font-size: 12px
}

.permission-line span {
    color: #91a0b5
}

.permission-line b {
    text-align: right
}

.security-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 14px;
    margin: 11px 0;
    color: #76e5be;
    font-size: 11px
}

.account-page .compact-action {
    width: auto;
    margin-top: 8px;
    padding: 9px 13px;
    font-size: 12px
}

.account-message {
    min-height: 20px;
    margin: 10px 0 0;
    color: #91a0b5;
    font-size: 12px
}

.account-message.error {
    color: #ff7e86
}

.account-message.success {
    color: #66e3b4
}

.balance-panel {
    grid-column: 1/-1
}

.section-description {
    margin: -8px 0 16px
}

.empty-state {
    padding: 28px;
    border: 1px dashed #2a3b50;
    border-radius: 12px;
    color: #91a0b5;
    text-align: center
}

.balance-overview {
    display: grid;
    grid-template-columns:1.5fr repeat(4, 1fr);
    gap: 9px
}

.balance-overview > div {
    min-width: 0;
    padding: 13px;
    border: 1px solid #263447;
    border-radius: 11px;
    background: #0b141f
}

.balance-overview span, .balance-overview b, .balance-overview strong, .balance-overview small {
    display: block
}

.balance-overview span, .balance-overview small {
    color: #91a0b5;
    font-size: 10px
}

.balance-overview b {
    margin-top: 7px;
    font-size: 14px
}

.balance-overview .primary-balance {
    border-color: #277960;
    background: linear-gradient(135deg, #102720, #0e1e23)
}

.balance-overview strong {
    margin: 5px 0 2px;
    color: #66e3b4;
    font-size: 23px
}

.asset-table-wrap {
    max-height: 360px;
    margin-top: 12px;
    overflow: auto;
    border: 1px solid #263447;
    border-radius: 11px
}

.asset-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px
}

.asset-table th, .asset-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #263447;
    text-align: right
}

.asset-table th:first-child, .asset-table td:first-child {
    text-align: left
}

.asset-table th {
    position: sticky;
    z-index: 1;
    top: 0;
    background: #121b27;
    color: #91a0b5
}

.account-footer {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 20px;
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto 28px;
    color: #718299;
    font-size: 11px
}

.account-footer a {
    color: #66e3b4;
    text-decoration: none
}

@media (max-width: 900px) {
    .account-dashboard {
        grid-template-columns:1fr
    }

    .balance-panel {
        grid-column: auto
    }

    .balance-overview {
        grid-template-columns:repeat(2, minmax(0, 1fr))
    }

    .balance-overview .primary-balance {
        grid-column: 1/-1
    }
}

@media (max-width: 620px) {
    .account-main {
        width: min(100% - 20px, 1280px);
        margin-top: 20px
    }

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

    .account-panel {
        padding: 16px
    }

    .credential-grid, .info-grid, .account-identity-row, .balance-overview {
        grid-template-columns:1fr
    }

    .balance-overview .primary-balance {
        grid-column: auto
    }

    .account-page .topbar-context, .account-page #headerUsername {
        display: none
    }

    .asset-table th, .asset-table td {
        padding: 9px 7px
    }
}
