/* ===== Tema (baseado no protótipo Helix/Aave: claro com topo escuro) ===== */
:root {
    --ink: #161a26;        /* topo escuro / texto principal */
    --ink-2: #1f2433;      /* superfícies escuras */
    --ink-line: #2f3545;
    --bg: #ececed;         /* fundo da página */
    --card: #ffffff;
    --text: #161a26;
    --muted: #8b93a7;
    --muted-2: #4a5160;
    --line: #e3e5ea;
    --line-soft: #f0f1f4;
    --teal: #3ad6b8;
    --teal-2: #2b8fc4;
    --ok: #3ccf8e;
    --warn: #f3a52e;
    --danger: #e23b3b;
}

* { box-sizing: border-box; }

html {
    /* WebViews de apps de carteira (MetaMask/Rabby) aplicam "font boosting" no Android,
       inflando textos pequenos. Complementa a altura fixa da barra de menu inferior. */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: 'Manrope', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    background: var(--bg);
    color: var(--text);
}

h1, h2, h3 { font-family: 'Space Grotesk', 'Manrope', sans-serif; }

/* ===== Login / Connect ===== */
.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--ink);
}
.login-card {
    width: 100%;
    max-width: 450px;
    background: var(--card);
    border-radius: 18px;
    padding: 1.1rem;
    box-shadow: 0 24px 70px rgba(0,0,0,.35);
}
.login-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-family: 'Space Grotesk';
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 1.4rem;
}
.login-brand .brand-mark { width: 38px; height: 38px; }
.login-voltar {
    display: inline-flex; align-items: center; gap: .4rem;
    color: var(--muted-2); font-size: .85rem; font-weight: 700;
    text-decoration: none; 
}
.login-voltar:hover { color: var(--teal-2); }
.login-text { color: var(--muted-2); font-size: .95rem; line-height: 1.5; }
.login-rede { color: var(--muted); font-size: .8rem; margin-top: 1.6rem; text-align: center; }
.login-info { color: var(--muted-2); font-size: .8rem; line-height: 1.5; margin-top: .9rem; text-align: center; }
.login-info a { color: var(--teal-2); font-weight: 700; text-decoration: none; }
.login-info a:hover { text-decoration: underline; }

@media (max-width: 560px) {
    .login-shell { padding: 0.6rem; }
    .login-card { padding: 1rem; }
}

/* ===== Aviso "aplicação em teste" ===== */
.aviso-teste {
    display: flex; align-items: flex-start; gap: 10px;
    background: #fff7e9; border: 1px solid #f3d6a0; color: #7a5311;
    border-radius: 12px; padding: 12px 14px; margin: 1.1rem 0;
    font-size: .9rem; line-height: 1.45; font-weight: 500;
}
.aviso-teste .bi { color: var(--warn); font-size: 1.15rem; line-height: 1.4; flex: none; }
.aviso-teste strong { color: #7a5311; }

.dash-main .aviso-teste { margin-bottom: -5px; }

/* ===== Card "como funciona" ===== */
.info-app-body { padding: 0 26px 22px; color: var(--muted-2); font-size: .92rem; line-height: 1.55; }
.info-app-body p { margin: 0 0 12px; }
.info-app-body ol { margin: 0 0 12px; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 7px; }
.info-app-body strong { color: var(--ink); }
.info-app-body a { color: var(--teal-2); font-weight: 700; text-decoration: none; }
.info-app-body a:hover { text-decoration: underline; }
.info-app-nota { color: var(--muted); font-size: .85rem; }
.info-app-contratos { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.info-app-contratos-titulo { display: block; color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 9px; }
.info-app-links { display: flex; flex-wrap: wrap; gap: 8px; }
.info-app-links a {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--line); border-radius: 8px; padding: 6px 11px;
    color: var(--muted-2); font-size: .82rem; font-weight: 700; text-decoration: none;
}
.info-app-links a::before { content: "↗"; color: var(--teal-2); font-weight: 700; }
.info-app-links a:hover { border-color: var(--teal-2); color: var(--ink); }

/* ===== Ícone de ajuda + tooltip (clique) ===== */
.ajuda { position: relative; display: inline-flex; vertical-align: middle; }
.ajuda-btn {
    background: transparent; border: none; cursor: pointer;
    color: var(--muted); padding: 0 0 0 5px; font-size: 14px; line-height: 1;
    display: inline-flex; align-items: center; vertical-align: middle;
}
.ajuda-btn:hover { color: var(--teal-2); }
.ajuda-overlay { position: fixed; inset: 0; z-index: 25; background: transparent; }
.ajuda-tip {
    position: absolute; top: calc(100% + 8px); left: 0; z-index: 30;
    width: 250px; max-width: 70vw;
    background: var(--ink); color: #fff;
    border-radius: 10px; padding: 11px 13px;
    font-size: .8rem; font-weight: 500; line-height: 1.5; letter-spacing: normal;
    box-shadow: 0 10px 28px rgba(20,26,40,.28);
}
.ajuda-tip strong { color: #fff; }
.ajuda-tip::before {
    content: ""; position: absolute; bottom: 100%; left: 12px;
    border: 6px solid transparent; border-bottom-color: var(--ink);
}
.ajuda-tip-dir { left: auto; right: 0; }
.ajuda-tip-dir::before { left: auto; right: 12px; }

/* No celular o tooltip abre centralizado na tela (overlay escurecido, sem a setinha). */
@media (max-width: 560px) {
    .ajuda-overlay { background: rgba(0, 0, 0, .45); }
    .ajuda-tip, .ajuda-tip-dir {
        position: fixed; top: 50%; left: 50%; right: auto;
        transform: translate(-50%, -50%);
        width: min(340px, 88vw); max-width: 88vw;
        font-size: .9rem; padding: 16px 18px;
    }
    .ajuda-tip::before { display: none; }
}
.btn-connect {
    width: 100%;
    padding: .95rem;
    border: none;
    border-radius: 12px;
    background: var(--ink);
    color: #fff;
    font-family: 'Manrope';
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-top: 1.4rem;
}
.btn-connect:disabled { opacity: .6; cursor: default; }
.btn-connect-outline {
    width: 100%;
    padding: .95rem;
    border: 1px solid #d9dbe2;
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font-family: 'Manrope';
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-top: .7rem;
}
.btn-connect-outline:hover { border-color: var(--ink); }
.btn-connect-outline:disabled { opacity: .6; cursor: default; }

.wallet-ico { width: 22px; height: 22px; flex: none; border-radius: 6px; }

/* ===== Marca (logotipo: moeda ₿ em ladrilho teal) ===== */
.brand-mark { width: 38px; height: 38px; flex: none; }

/* ===== Top nav (escuro) ===== */
.topnav { background: var(--ink); color: #fff; }
.topnav-inner {
    max-width: 1320px; margin: 0 auto;
    padding: 0 32px; height: 68px;
    display: flex; align-items: center; gap: 28px;
}
.brand {
    display: flex; align-items: center; gap: 10px;
    font-family: 'Space Grotesk'; font-weight: 700; font-size: 20px;
    letter-spacing: -.5px; color: #fff; text-decoration: none;
}
.topnav-spacer { flex: 1; }
.topnav-actions { display: flex; align-items: center; gap: 10px; }

/* Menu principal (Painel / Simulações / Alertas / Assinatura) */
.nav-menu { display: flex; align-items: center; gap: 4px; }
.nav-item {
    display: inline-flex; align-items: center; gap: 8px;
    color: rgba(255,255,255,.78); text-decoration: none;
    font-weight: 700; font-size: 13.5px;
    padding: 8px 13px; border-radius: 9px;
    transition: background .15s, color .15s;
}
.nav-item i { font-size: 15px; opacity: .9; }
.nav-item:hover { color: #fff; background: var(--ink-2); }
.nav-item.active { color: #fff; background: var(--ink-2); }
.wallet-chip {
    display: flex; align-items: center; gap: 9px;
    background: var(--ink-2); color: #fff;
    border: 1px solid var(--ink-line); border-radius: 9px;
    padding: 8px 14px; font-weight: 700; font-size: 13.5px;
}
.wallet-dot {
    width: 18px; height: 18px; border-radius: 50%;
    background: linear-gradient(135deg, #5be0c0, #3a7bd5);
   /* flex: 0 0 auto;*/
}
/* Botão de copiar o endereço da carteira */
.wallet-copy {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; margin-right: -4px;
    background: transparent; border: none; border-radius: 6px;
    color: #b8bdcc; font-size: 14px; cursor: pointer;
    transition: background .15s, color .15s;
}
.wallet-copy:hover { color: #fff; background: rgba(255,255,255,.08); }
.wallet-copy.copiado { color: #5be0c0; }
.wallet-copy.copiado i { animation: copy-pop .35s ease; }
@keyframes copy-pop {
    0% { transform: scale(.4); opacity: 0; }
    60% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}
/*.wallet-addr { min-width: 0; }*/
.btn-icon-dark {
    width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
    background: var(--ink-2); color: #b8bdcc; border: 1px solid var(--ink-line);
    border-radius: 9px; cursor: pointer; font-size: 16px;
}
.btn-icon-dark:hover { color: #fff; }

/* ===== Market header (escuro) ===== */
.market { background: var(--ink); color: #fff; padding-bottom: 80px; }
.market-inner { max-width: 1320px; margin: 0 auto; padding: 36px 32px 0; }
.market-top { display: flex; flex-direction: column; }
.market-head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.market-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.market-title img { width: 42px; height: 42px; border-radius: 50%; box-shadow: 0 4px 14px rgba(124,58,237,.45); }
.market-title h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.6px; }
.badge-v3 {
    background: linear-gradient(135deg, var(--teal), var(--teal-2));
    color: #06121a; font-weight: 800; font-size: 11px;
    padding: 3px 8px; border-radius: 6px; letter-spacing: .3px;
}
/* Botão de atualizar (recarrega a posição on-chain sem recarregar a página). */
.market-refresh {
    flex: none; width: 42px; height: 42px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
    color: #fff; font-size: 20px; cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}
.market-refresh:hover:not(:disabled) { background: rgba(255,255,255,.16); }
.market-refresh:disabled { cursor: default; opacity: .8; }
.market-refresh.girando i { display: inline-block; animation: spin .8s linear infinite; }

.market-stats { display: flex; align-items: flex-end; gap: 44px; margin-top: 26px; flex-wrap: wrap; }
.mstat-label { color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.mstat-value { font-size: 22px; font-weight: 800; }
.mstat-value .unit { color: var(--muted); font-weight: 600; }
.mstat-value.warn { color: var(--warn); }
.mstat-value.ok { color: var(--ok); }
.mstat-value.danger { color: var(--danger); }

/* Sub-navegação (FX) exibida sobre a faixa escura, abaixo do logo. */
.market-subnav { margin-top: 24px; }
.market-subnav .pills { margin: 0 !important; padding: 0; }
.market-subnav .pill {
    display: inline-flex; align-items: center; gap: 9px; text-decoration: none;
    color: rgba(255,255,255,.82); border-color: rgba(255,255,255,.22);
    background: rgba(255,255,255,.04);
}
.market-subnav .pill:hover { background: rgba(255,255,255,.12); color: #fff; }
.market-subnav .pill.active { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.35); color: #fff; }

/* ===== Body grid ===== */
.dash-main {
    max-width: 1320px; margin: -56px auto 0;
    padding: 0 32px 64px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start;
}
.dash-col { display: flex; flex-direction: column; gap: 24px; }

/* ===== Cards ===== */
.card {
    background: var(--card); border-radius: 16px;
    box-shadow: 0 1px 3px rgba(20,26,40,.06), 0 8px 24px rgba(20,26,40,.05);
}
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px; gap: 12px; }
.card-head.tight { padding-bottom: 16px; }
.card-title { margin: 0; font-size: 20px; font-weight: 700; }
.card-toggle {
    background: transparent; border: none; color: var(--muted);
    font-family: 'Manrope'; font-weight: 700; font-size: 13px; cursor: pointer;
}
.card-toggle:hover { color: var(--ink); }

.pills { display: flex; gap: 8px; padding: 0 26px 18px; flex-wrap: wrap; }
.pill {
    border: 1px solid var(--line); border-radius: 8px; padding: 6px 11px;
    font-size: 13px; color: var(--muted-2); font-weight: 600;
}
.pill strong { color: var(--ink); }

.empty { color: var(--muted); font-size: 14px; font-weight: 500; padding: 0 26px 22px; }

/* ===== Tabela de ativos ===== */
.tbl-head {
    display: grid; padding: 0 26px 10px;
    font-size: 12.5px; color: var(--muted); font-weight: 700;
    border-bottom: 1px solid var(--line-soft);
    white-space: nowrap;   /* cabeçalhos como "APY variável" não quebram em duas linhas */
}
.tbl-row { display: grid; align-items: center; padding: 16px 26px; }
.tbl-row:hover { background: #fafafb; }
.cols-supply { grid-template-columns: 1.4fr 1fr 0.7fr 2fr; }
.cols-borrow { grid-template-columns: 1.5fr 1.3fr 1fr 1.4fr; }
.cols-fx-saldo { grid-template-columns: 1.4fr 1fr; }
/* Saldo alinhado à direita, na mesma coluna vertical do "Total" (margem 26 + padding 16 da overview). */
.cols-fx-saldo .cell-bal { text-align: right; padding-right: 16px; }
.tbl-head.cols-fx-saldo span:last-child { text-align: right; padding-right: 16px; }

.asset-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.asset-cell img { width: 32px; height: 32px; flex: none; }
.asset-sym { font-weight: 700; font-size: 15px; }
.cell-main { font-weight: 700; font-size: 14px; }
.cell-sub { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.cell-apy { font-weight: 600; font-size: 14px; white-space: nowrap; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: nowrap; }

/* ===== Botões ===== */
.btn {
    font-family: 'Manrope'; font-weight: 700; font-size: 13px;
    border-radius: 8px; padding: 9px 16px; cursor: pointer; border: 1px solid transparent;
    white-space: nowrap;
}
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #2a3040; }
.btn-outline { background: #fff; color: var(--ink); border-color: #d9dbe2; }
.btn-outline:hover { border-color: var(--ink); }

/* Botões de ação das linhas (Depositar/Emprestar/Sacar/Pagar) com tamanho uniforme */
.row-actions .btn { min-width: 118px; padding: 9px 22px; }

/* ===== Modal de operação ===== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(15,18,28,.55);
    display: flex; align-items: center; justify-content: center;
    z-index: 100; padding: 24px;
}
.modal {
    background: #fff; width: 422px; max-width: 100%;
    max-height: 92vh; overflow-y: auto;
    border-radius: 16px; padding: 26px;
    box-shadow: 0 24px 70px rgba(0,0,0,.4);
}
.modal-swap { max-height: 96vh; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.modal-title { margin: 0; font-size: 22px; font-weight: 700; }
.modal-x { background: transparent; border: none; font-size: 20px; color: var(--ink); cursor: pointer; line-height: 1; padding: 0; }
.modal-sub { color: var(--muted-2); font-size: 13.5px; font-weight: 500; line-height: 1.5; margin: -6px 0 18px; }

.field-label { font-size: 13.5px; color: #6b7280; font-weight: 600; margin-bottom: 8px; }
.amount-box { border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px; margin-bottom: 20px; }
.amount-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.amount-input {
    font-size: 27px; font-weight: 700; color: var(--ink);
    border: none; outline: none; background: transparent;
    width: 60%; min-width: 0; font-family: 'Manrope';
}
.amount-token { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; flex: none; }
.amount-token img { width: 24px; height: 24px; }
.amount-sub { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; color: #6b7280; font-size: 13px; font-weight: 600; gap: 8px; }
.amount-max { color: var(--ink); cursor: pointer; margin-left: 4px; }
.amount-readonly { display: flex; align-items: center; }

/* ===== Swap ===== */
.swap-token-select {
    background: transparent; border: none; padding: 0;
    font-family: 'Manrope'; font-weight: 700; font-size: 16px;
    color: var(--ink); cursor: pointer;
}
.swap-arrow { text-align: center; color: var(--muted); font-size: 20px; cursor: pointer; user-select: none; margin: 6px 0 2px; }
.ov-ico { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
.row-actions .btn.btn-sm { min-width: auto; padding: 9px 14px; }

.slippage-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.slippage-opt {
    background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
    padding: 7px 12px; font-family: 'Manrope'; font-weight: 700; font-size: 13px;
    color: var(--muted-2); cursor: pointer;
}
.slippage-opt.ativo { background: var(--ink); color: #fff; border-color: var(--ink); }
.slippage-custom {
    display: inline-flex; align-items: center; gap: 2px;
    border: 1px solid var(--line); border-radius: 8px; padding: 0 10px;
    color: var(--muted-2); font-weight: 700; font-size: 13px;
}
.slippage-custom input {
    width: 54px; border: none; background: transparent; padding: 7px 0;
    font-family: 'Manrope'; font-weight: 700; font-size: 13px; color: var(--ink); outline: none;
}
.slippage-aviso {
    font-size: 12.5px; font-weight: 600; padding: 9px 11px;
    border-radius: 8px; margin: -8px 0 16px;
}
.slippage-aviso.alerta { background: rgba(243,165,46,.14); color: #b97608; }
.slippage-aviso.perigo { background: rgba(226,59,59,.12); color: var(--danger); }

.overview { border: 1px solid var(--line); border-radius: 11px; padding: 2px 16px; margin-bottom: 18px; }
.overview-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 0; }
.overview-row + .overview-row { border-top: 1px solid var(--line-soft); }
.overview-label { color: var(--muted-2); font-weight: 600; font-size: 14px; }
.overview-val { text-align: right; font-weight: 800; font-size: 14px; }
.overview-hint { color: var(--muted); font-size: 11.5px; font-weight: 600; margin-top: 2px; }
.hf-arrow { color: var(--ink); margin: 0 2px; }
.hf-ok { color: var(--ok); }
.hf-warn { color: var(--warn); }
.hf-danger { color: var(--danger); }

.btn-primary {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: .5rem;
    background: var(--ink); color: #fff; border: none; border-radius: 11px;
    padding: 15px; font-family: 'Manrope'; font-weight: 700; font-size: 15px; cursor: pointer;
}
.btn-primary:disabled { background: #eceef1; color: #aab0bd; cursor: default; }

/* ===== Página de assinatura ===== */
/* Corpo do formulário (fora do modal): alinha ao recuo do card e limita a largura no desktop. */
.assinatura-form { padding: 6px 26px 26px; max-width: 560px; }

/* Combo de duração (meses): estilo próprio, com seta customizada e fonte contida. */
.select-meses {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    font-family: 'Manrope'; font-size: 14.5px; font-weight: 700; color: var(--ink);
    background: #fff url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E") no-repeat right 12px center / 13px;
    border: 1px solid var(--line); border-radius: 9px;
    padding: 10px 38px 10px 14px; 
    min-width: 150px;
    cursor: pointer; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.select-meses:hover:not(:disabled) { border-color: #b8bdc9; }
.select-meses:focus { border-color: var(--teal-2); box-shadow: 0 0 0 3px rgba(43,143,196,.14); }
.select-meses:disabled { opacity: .6; cursor: default; }

/* Select padrão (aparência custom com seta), largura flexível — para selects que não listam meses. */
.select-padrao {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-family: 'Manrope';
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ink);
    background: #fff url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E") no-repeat right 12px center / 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 10px 38px 10px 14px;
    width: 100%;
    min-width: 0;
    cursor: pointer;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.select-padrao:hover:not(:disabled) { border-color: #b8bdc9; }
.select-padrao:focus { border-color: var(--teal-2); box-shadow: 0 0 0 3px rgba(43,143,196,.14); }
.select-padrao:disabled { opacity: .6; cursor: default; }

/* Campo numérico/texto padrão (sem a seta de select); divide o espaço da linha e nunca estoura. */
.campo-numero {
    font-family: 'Manrope';
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 10px 14px;
    flex: 1 1 90px;
    min-width: 0;
    width: 100%;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.campo-numero:hover:not(:disabled) { border-color: #b8bdc9; }
.campo-numero:focus { border-color: var(--teal-2); box-shadow: 0 0 0 3px rgba(43,143,196,.14); }
.campo-numero:disabled { opacity: .6; cursor: default; }
/* Remove as setinhas nativas do input number para manter o visual limpo. */
.campo-numero::-webkit-outer-spin-button,
.campo-numero::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.campo-numero[type=number] { -moz-appearance: textfield; }
.assinatura-intro {
    display: flex; align-items: flex-start; gap: 12px;
    border: 1px solid var(--line); border-radius: 11px;
    padding: 14px 16px; margin-bottom: 18px;
    color: var(--muted-2); font-size: 13.5px; line-height: 1.55; font-weight: 500;
}
.assinatura-intro i { color: var(--teal-2); font-size: 20px; line-height: 1.2; flex: none; }
.assinatura-intro strong { display: block; color: var(--ink); margin-bottom: 2px; }
.assinatura-msgs { padding: 0 26px 22px; max-width: 560px; }

/* Botão de cancelar renovação — ação secundária/destrutiva, alinhada ao corpo do card */
.cancelar-box { padding: 18px 26px 2px; }
.btn-cancelar {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: .5rem;
    background: #fff; color: var(--danger);
    border: 1px solid rgba(226,59,59,.38); border-radius: 11px;
    padding: 13px; font-family: 'Manrope'; font-weight: 700; font-size: 14px; cursor: pointer;
    transition: background .15s, border-color .15s;
}
.btn-cancelar:hover:not(:disabled) { background: rgba(226,59,59,.06); border-color: var(--danger); }
.btn-cancelar:disabled { opacity: .55; cursor: default; }
.btn-cancelar i { font-size: 16px; }
.btn-cancelar .spinner { border-color: rgba(226,59,59,.25); border-top-color: var(--danger); }
.cancelar-nota { color: var(--muted); font-size: 12.5px; font-weight: 500; line-height: 1.5; margin: 10px 2px 12px; text-align: left; }

.modal-msg { margin-top: 14px; padding: .7rem .9rem; border-radius: 10px; font-size: .9rem; font-weight: 600; }
.modal-msg.ok { background: rgba(60,207,142,.14); color: #1f9d6b; }
.modal-msg.erro { background: rgba(226,59,59,.12); color: var(--danger); }
.modal-hash { margin-top: .6rem; font-size: .75rem; color: var(--muted); word-break: break-all; }

/* ===== Conexão por QR ===== */
.modal-qr { width: 360px; text-align: center; }
.qr-area { min-height: 288px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.qr-box {
    width: 256px; height: 256px; padding: 10px;
    background: #fff; border: 1px solid var(--line); border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
}
.qr-box svg { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.qr-status { display: flex; align-items: center; justify-content: center; gap: .55rem; color: var(--muted-2); font-size: 13.5px; font-weight: 600; }
.qr-status .spinner { border-color: rgba(22,26,38,.2); border-top-color: var(--ink); }

/* ===== Genéricos ===== */
.loading { display: flex; align-items: center; gap: .6rem; color: var(--muted-2); padding: 1.4rem; font-weight: 600; }
.spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.45);
    border-top-color: currentColor;
    border-radius: 50%; display: inline-block;
    flex: none;
    animation: spin .7s linear infinite;
}
/* .btn-connect fica em fundo escuro (mantém branco). Já .btn-primary, enquanto processa, fica
   disabled com fundo CLARO — por isso o spinner precisa ser escuro para aparecer. */
.btn-connect .spinner { border-color: rgba(255,255,255,.4); border-top-color: #fff; }
.btn-primary .spinner { border-color: rgba(22,26,38,.25); border-top-color: var(--ink); }
.btn-connect-outline .spinner { border-color: rgba(22,26,38,.25); border-top-color: var(--ink); }
.loading .spinner { border-color: rgba(22,26,38,.2); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }
.erro-boundary { text-align: center; padding: 2rem; color: var(--danger); }

/* ===== Pull-to-refresh (mobile) ===== */
.ptr-indicator {
    position: fixed; top: -44px; left: 50%; z-index: 200;
    width: 36px; height: 36px; margin-left: -18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.18);
    transform: translateY(0); pointer-events: none;
}
.ptr-indicator .ptr-spinner {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid rgba(22,26,38,.2); border-top-color: var(--ink);
    display: inline-block;
}
.ptr-indicator.pronto .ptr-spinner { border-top-color: var(--teal); }
.ptr-indicator.carregando .ptr-spinner { animation: spin .7s linear infinite; }

/* ===== Responsivo ===== */
@media (max-width: 1050px) {
    .dash-main { grid-template-columns: 1fr; margin-top: -40px; padding: 0 16px 48px; }
    .topnav-inner, .market-inner { padding-left: 16px; padding-right: 16px; }
    .market { padding-bottom: 64px; }
    .market-stats { gap: 18px 30px; }
    .market-title h1 { font-size: 25px; }
}
@media (max-width: 560px) {
    /* Carteira e botão de desconectar quebram para uma segunda linha, abaixo do logo. */
    .topnav-inner { gap: 12px; height: auto; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
    .topnav-actions { width: 100%; justify-content: flex-end; }
    .wallet-chip {  min-width: 0; word-break: break-all; }
    .dash-main { padding-left: 10px; padding-right: 10px; }
    .topnav-inner, .market-inner { padding-left: 10px; padding-right: 10px; }
    .market-inner { padding-top: 26px; }
    .mstat-value { font-size: 19px; }
    .tbl-head { display: none; }
    .tbl-row { grid-template-columns: 1fr auto !important; row-gap: 6px; padding: 16px; }
    .tbl-row .asset-cell { grid-row: 1; }
    .tbl-row .row-actions { grid-row: 1; grid-column: 2; }
    .tbl-row .cell-bal, .tbl-row .cell-apy { grid-column: 1 / -1; grid-row: auto; }
    /* Carteira FX: sem ações/APY, o saldo fica ao lado do ativo, alinhado à direita. */
    .tbl-row.cols-fx-saldo .cell-bal { grid-column: 2; grid-row: 1; text-align: right; padding-right: 0; }
    .modal-overlay { padding: 12px 0 0; align-items: flex-start; }
    .modal { width: 100%; border-radius: 18px; max-height: 92vh; }
    .modal-swap { max-height: 96vh; }
}

/* Quando o menu não cabe ao lado do logo, vai para uma barra fixa no rodapé (estilo app). */
@media (max-width: 1025px) {
    .nav-menu {
        position: fixed; bottom: 0; left: 0; right: 0;
        z-index: 90;
        display: flex; justify-content: space-around; align-items: center; gap: 0;
        background: var(--ink); border-top: 1px solid var(--ink-line);
        box-shadow: 0 -6px 20px rgba(0,0,0,.3);
        /* Altura explícita: 46px no navegador comum (env() = 0). Nas WebViews dos apps de
           carteira (Android edge-to-edge), env(safe-area-inset-bottom) reporta a barra de
           gestos do sistema (24-48px) — o min() limita o acréscimo a 10px, e os itens ficam
           CENTRALIZADOS na altura total (align-items: center), sem vazio embaixo. */
        height: calc(65px + min(env(safe-area-inset-bottom, 0px), 10px));
        padding: 0 4px;
    }
    .nav-item {
        flex: 1; flex-direction: column; gap: 1px;
        justify-content: center; text-align: center;
        padding: 3px 4px; font-size: 10.5px; border-radius: 8px;
        /* Altura fechada em px: a barra não cresce mesmo se a WebView inflar textos. */
        line-height: 13px; height: 60px;
    }
    .nav-item i { font-size: 17px; line-height: 18px; opacity: 1; }
    /* Espaço para o conteúdo não ficar escondido atrás da barra inferior. */
    .dash-main { padding-bottom: 64px; }
}
