/* Mobile-first NFX app — one continuous document, anchored bottom navigation. */
:root {
    --bg: #081a17;
    --panel: #102923;
    --panel2: #17362f;
    --border: #2b4d42;
    --muted: #a2b8b0;
    --text: #f3f8f3;
    --mint: #2ce3bc;
    --cyan: #22d5d7;
    --gold: #e5c47f;
    scroll-behavior: smooth;
    scroll-padding-top: 92px
}

html {
    overflow-x: hidden
}

body {
    background: radial-gradient(ellipse at 50% 4%, #1c4239 0, transparent 32%), #081a17;
    color: var(--text);
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
    overflow-x: hidden
}

button,
select,
input {
    touch-action: manipulation
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 12px max(16px, calc((100vw - 1160px)/2));
    background: #0b211de8;
    backdrop-filter: blur(18px);
    border-bottom: 1px solid #2e5246
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
    font-size: 19px;
    font-weight: 900;
    white-space: nowrap
}

.app-brand img {
    width: 42px;
    height: 42px;
    object-fit: contain
}

.app-brand b {
    color: var(--gold)
}

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

.chain-chip {
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 6px 9px;
    font-size: 11px;
    color: var(--muted)
}

.chain-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mint);
    margin-right: 5px
}

.header-select {
    width: 110px;
    max-width: 110px;
    height: 40px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 12px;
    background: var(--panel2);
    color: var(--text)
}

.theme-toggle {
    height: 40px;
    width: 40px;
    min-width: 40px;
    border-radius: 11px;
    background: var(--panel2);
    color: var(--gold);
    border: 1px solid var(--border)
}

.app-header .btn {
    padding: 11px 12px;
    font-size: 12px;
    white-space: nowrap
}

.app-content {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 20px
}

.section {
    scroll-margin-top: 94px
}

.swap-section {
    padding-top: 28px
}

.hero {
    text-align: center;
    max-width: 740px;
    margin: 0 auto 28px
}

.hero-tag,
.overline {
    color: var(--gold);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .16em
}

.hero h1 {
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.13;
    letter-spacing: -.035em;
    margin: 12px 0
}

.hero h1 em {
    font-style: normal;
    color: var(--mint)
}

.hero p {
    font-size: 14px;
    color: var(--muted);
    max-width: 540px;
    margin: 0 auto
}

.hero-logo {
    height: 78px;
    margin-top: 15px
}

.hero-logo img {
    height: 100%;
    max-width: 240px;
    object-fit: contain
}

.swap-layout {
    display: grid;
    grid-template-columns: minmax(0, 610px) minmax(0, 280px);
    gap: 22px;
    justify-content: center;
    align-items: start
}

.panel {
    background: #102923;
    border: 1px solid #315347;
    border-radius: 26px;
    box-shadow: 0 20px 55px #0003
}

.swap-panel {
    padding: 23px
}

.panel-top {
    margin-bottom: 12px
}

.panel-top h2 {
    font-size: 24px;
    margin: 0
}

.pill {
    border-color: #a88c57;
    color: var(--gold)
}

.tabs {
    margin: 12px 0 20px;
    background: #0b211c
}

.tab.active {
    background: #27564a;
    color: #f7dca3
}

.token-box {
    padding: 15px 17px;
    background: #1a3931;
    border: 1px solid #34574a;
    border-radius: 20px;
    min-height: 132px
}

.token-box-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 12px
}

.token-box-top label {
    margin: 0;
    font-size: 12px;
    color: var(--muted)
}

.token-box-top span:last-child {
    font-size: 11px
}

.token-box-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px
}

.token-box small {
    color: var(--muted);
    font-size: 11px
}

.amount-field {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    padding: 0;
    gap: 2px
}

.amount-field input {
    font-size: clamp(23px, 4vw, 35px);
    padding: 4px 0;
    color: var(--text);
    min-width: 0
}

.amount-field .mini-btn {
    font-size: 10px;
    padding: 6px 7px
}

.token-identity {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap
}

.token-icon {
    display: grid;
    place-items: center;
    width: 33px;
    height: 33px;
    border-radius: 50%;
    background: #24b6a4;
    color: #062b26;
    font-weight: 900
}

.token-identity strong {
    font-size: 17px
}

.swap-divider {
    height: 14px;
    position: relative;
    display: grid;
    place-items: center;
    z-index: 1
}

.swap-divider span {
    height: 43px;
    width: 43px;
    border: 5px solid #102923;
    background: #183b32;
    color: var(--mint);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 24px;
    line-height: 1
}

.token-out {
    background: #203e35
}

.token-out select {
    width: min(58%, 240px);
    padding: 11px 8px;
    font-weight: 800;
    font-size: 15px;
    background: #103027;
    border: 1px solid #426252;
    border-radius: 13px;
    color: var(--text)
}

.token-out-value {
    color: var(--muted);
    font-size: 20px;
    max-width: 42%;
    overflow: hidden;
    text-overflow: ellipsis
}

.advanced {
    margin-top: 18px
}

.advanced label {
    margin-top: 12px
}

.advanced input,
.advanced select {
    background: #0c251e;
    color: var(--text)
}

.quote-card {
    background: #0b221c;
    border-color: #2e5043;
    margin-top: 18px
}

.quote-title {
    gap: 8px
}

.quote-title b {
    font-size: 13px
}

.quote-title button {
    white-space: nowrap;
    color: var(--gold)
}

.metric {
    border-color: #42604e70
}

.btn-primary {
    background: linear-gradient(100deg, #19c6b3, #46dfcb);
    color: #05251f;
    border-radius: 17px;
    font-size: 16px
}

.btn-outline {
    background: #183a30;
    color: #f3dba8;
    border-color: #977c4e
}

.mini-btn {
    background: #2a5b4b;
    color: #f1dba9
}

.swap-benefits {
    text-align: center;
    padding: 20px
}

.swap-benefits img {
    width: 100%;
    height: 185px;
    object-fit: contain
}

.swap-benefits h3 {
    font-size: 20px;
    margin: 8px 0
}

.swap-benefits p {
    color: var(--muted);
    font-size: 13px
}

.benefit-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    font-size: 13px
}

.benefit-line span:first-child {
    color: var(--gold);
    font-size: 22px
}

.section-block {
    padding-top: 70px
}

.section-heading {
    text-align: center;
    margin: 0 auto 24px;
    max-width: 580px
}

.section-heading h2 {
    font-size: clamp(26px, 4vw, 36px);
    margin: 7px 0
}

.section-heading p {
    color: var(--muted);
    font-size: 13px;
    margin: 0
}

.reward-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 18px
}

.stat {
    background: #18362d;
    border-color: #365746
}

.stat strong {
    color: var(--text)
}

.stat.gold strong {
    color: var(--gold)
}

.section-card {
    padding: 22px
}

.section-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 15px
}

.section-card-title h3 {
    margin: 0
}

.data-list {
    background: #0e251e;
    border-color: #365548
}

.referral-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px
}

.featured {
    margin-bottom: 12px
}

.account-card {
    max-width: 650px;
    margin: auto
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    background: #0a1d19f5;
    border-top: 1px solid #315244;
    backdrop-filter: blur(18px);
    box-shadow: 0 -12px 35px #0004
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 57px;
    width: min(23%, 130px);
    border-radius: 15px;
    text-decoration: none;
    color: #a6bbb1;
    font-size: 11px;
    font-weight: 700;
    transition: background .2s, color .2s
}

.nav-icon {
    font-size: 24px;
    line-height: 1.1
}

.nav-item.active {
    background: #185446;
    color: #f1d99f
}

.toast {
    bottom: calc(91px + env(safe-area-inset-bottom));
    z-index: 60
}

footer {
    margin-top: 60px;
    text-align: center;
    padding-bottom: 30px
}

[data-theme=light] {
    --bg: #eff6f0;
    --panel: #fff;
    --panel2: #edf6f0;
    --border: #d3e3d7;
    --muted: #587368;
    --text: #1b392f;
    --mint: #087e69;
    --cyan: #068d8d;
    --gold: #926525;
    color-scheme: light
}

[data-theme=light] body {
    background: radial-gradient(ellipse at 50% 4%, #d2eee1 0, transparent 30%), #eff6f0;
    color: var(--text)
}

[data-theme=light] .app-header,
[data-theme=light] .bottom-nav {
    background: #ffffffeb;
    border-color: #d2e1d7
}

[data-theme=light] .panel {
    background: #fff;
    border-color: #d4e3d7
}

[data-theme=light] .token-box {
    background: #eaf5ec;
    border-color: #d4e5d7
}

[data-theme=light] .token-out {
    background: #e1f0e6
}

[data-theme=light] .token-out select,
[data-theme=light] .advanced input,
[data-theme=light] .advanced select,
[data-theme=light] .quote-card,
[data-theme=light] .data-list {
    background: #f6faf6;
    color: #1c3b30;
    border-color: #d4e5d8
}

[data-theme=light] .swap-divider span {
    background: #e2f1e7;
    border-color: #fff
}

[data-theme=light] .amount-field input {
    color: #1c3b30
}

[data-theme=light] .tab.active {
    background: #d6ede1;
    color: #155a49
}

[data-theme=light] .tabs {
    background: #eff6f0
}

[data-theme=light] .stat {
    background: #f3f8f3;
    border-color: #d4e5d7
}

[data-theme=light] .nav-item.active {
    background: #d9f0e5;
    color: #896128
}

[data-theme=light] .app-brand {
    color: #1c392f
}

[data-theme=light] .chain-chip {
    color: #3b6154
}

[data-theme=light] .theme-toggle,
[data-theme=light] .header-select {
    background: #f2f8f3;
    color: #21493b
}

[data-theme=light] .btn-outline {
    background: #fff9eb;
    color: #845c25;
    border-color: #d3b782
}

@media(max-width:820px) {
    .swap-layout {
        grid-template-columns: minmax(0, 610px)
    }

    .referral-grid {
        grid-template-columns: 1fr
    }
}

@media(max-width:560px) {
    .app-header {
        padding: 10px 11px;
        gap: 4px
    }

    .app-brand {
        font-size: 15px;
        gap: 2px
    }

    .app-brand img {
        width: 33px;
        height: 33px
    }

    .header-actions {
        gap: 5px
    }

    .chain-chip {
        display: none
    }

    .header-select {
        width: 78px;
        max-width: 78px;
        height: 35px;
        padding: 0 3px;
        font-size: 10px
    }

    .theme-toggle {
        height: 35px;
        width: 35px;
        min-width: 35px;
        font-size: 17px
    }

    .app-header .btn {
        font-size: 10px;
        padding: 9px 8px;
        max-width: 104px;
        overflow: hidden;
        text-overflow: ellipsis
    }

    .app-content {
        padding: 0 12px
    }

    .swap-section {
        padding-top: 19px
    }

    .hero {
        margin-bottom: 18px
    }

    .hero h1 {
        font-size: clamp(31px, 8.3vw, 43px);
        margin: 8px 0
    }

    .hero p {
        font-size: 12px
    }

    .hero-tag {
        font-size: 9px
    }

    .hero-logo {
        height: 54px;
        margin-top: 10px
    }

    .hero-logo img {
        max-width: 170px
    }

    .swap-panel {
        padding: 14px;
        border-radius: 22px
    }

    .panel-top h2 {
        font-size: 21px
    }

    .pill {
        font-size: 10px;
        padding: 6px
    }

    .tabs {
        margin: 10px 0 14px
    }

    .token-box {
        padding: 12px;
        min-height: 121px
    }

    .token-box-top {
        font-size: 11px
    }

    .token-box-top span:last-child {
        font-size: 10px
    }

    .token-box-body {
        gap: 5px
    }

    .amount-field input {
        font-size: 26px
    }

    .token-identity strong {
        font-size: 14px
    }

    .token-icon {
        width: 28px;
        height: 28px
    }

    .token-out select {
        font-size: 12px;
        width: 57%
    }

    .token-out-value {
        font-size: 17px
    }

    .two-col {
        grid-template-columns: 1.4fr .6fr;
        gap: 9px
    }

    .two-col select,
    .two-col input {
        font-size: 12px;
        padding: 11px 8px
    }

    .quote-card {
        padding: 12px
    }

    .quote-title button {
        font-size: 10px
    }

    .section-block {
        padding-top: 24px
    }

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

    .reward-stats .stat:last-child {
        grid-column: 1/-1
    }

    .stat {
        padding: 13px
    }

    .stat strong {
        font-size: 21px
    }

    .section-card {
        padding: 15px
    }

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

    .nav-item {
        font-size: 10px
    }

    .nav-icon {
        font-size: 22px
    }

    .copy-field {
        flex-wrap: wrap
    }

    .copy-field input {
        min-width: 0;
        flex: 1
    }
}
/* Logo do cabecalho: troca automatica conforme data-theme no HTML. */
.app-header .app-brand {
    display: inline-flex;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
}
.app-header .app-brand img {
    display: block;
    width: clamp(112px, 17vw, 185px);
    height: 48px;
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
}
.app-header .app-brand .brand-logo-light { display: none; }
html[data-theme="light"] .app-header .app-brand .brand-logo-dark { display: none; }
html[data-theme="light"] .app-header .app-brand .brand-logo-light { display: block; }
@media (max-width: 560px) {
    .app-header .app-brand img {
        width: clamp(92px, 27vw, 132px);
        height: 38px;
    }
}
/* Desktop: mantém o card original ao lado do Swap */
.swap-benefits-mobile {
    display: none;
}

/* Celular: mostra o card depois da Carteira */
@media (max-width: 820px) {
    .swap-layout .swap-benefits {
        display: none;
    }

    .swap-benefits-mobile {
        display: block;
        margin: 24px auto;
        padding: 20px;
        max-width: 610px;
        text-align: center;
    }

    .swap-benefits-mobile img {
        display: block;
        width: 100%;
        height: 185px;
        object-fit: contain;
    }

    .swap-benefits-mobile h3 {
        font-size: 20px;
        margin: 8px 0;
    }

    .swap-benefits-mobile .benefit-line {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 0;
        border-top: 1px solid var(--border);
        font-size: 13px;
    }
}
