/* ── DESIGN SYSTEM PROVENTOSPRO (DARK MODE PREMIUM) ── */
:root {
    --bg: #09090B; 
    --surface: #18181B; 
    --border: #27272A; 
    --text-main: #FAFAFA; 
    --text-sub: #A1A1AA; 
    --text-dim: #52525B; 
    --primary: #FAFAFA; 
    --success: #34D399; 
    --danger: #F87171; 
    --accent: #E2F29F; 
    --gradient-brand: linear-gradient(135deg, #E2F29F 0%, #F5FBB1 100%);
    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 -10px 40px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body { 
    background-color: var(--bg); 
    color: var(--text-main); 
    font-family: var(--font-sans); 
    -webkit-font-smoothing: antialiased; 
    height: 100vh; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    position: relative;
}

body::before {
    content: ''; position: fixed; top: -10%; right: -10%; width: 60vw; height: 60vh;
    background: radial-gradient(circle, rgba(226, 242, 159, 0.08) 0%, transparent 60%);
    z-index: -1; pointer-events: none;
}

.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.up { color: var(--success); } .down { color: var(--danger); }

.tela-principal { padding: 24px; padding-bottom: 120px; animation: fadeIn 0.3s ease-out; height: 100%; overflow-y: auto; width: 100%; max-width: 640px; margin: 0 auto; }
.scroll-view { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; position: relative; }

.ptr-indicator {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 8px);
    left: 50%;
    transform: translate(-50%, calc(-100% + var(--ptr-pull, 0px)));
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(24, 24, 27, 0.94);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-sub);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s ease, transform 0.12s ease, color 0.12s ease, border-color 0.12s ease;
    will-change: transform, opacity;
}
.ptr-indicator.show { opacity: 1; }
.ptr-indicator.ready { color: var(--accent); border-color: rgba(226, 242, 159, 0.45); }
.ptr-indicator.refreshing { color: var(--success); border-color: rgba(52, 211, 153, 0.45); }
/* Barra de rolagem customizada para PC */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ── COMPONENTES GERAIS ── */
.overlay-screen { position: fixed; inset: 0; background: var(--bg); z-index: 2000; display: none; flex-direction: column; overflow-y: auto; max-width: 640px; margin: 0 auto; }

.card { background: var(--surface); border-radius: 24px; border: 1px solid var(--border); padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow-sm); }
.card-title { font-size: 13px; font-weight: 700; color: var(--text-main); margin-bottom: 16px; display: block; }

.top-header { padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; background: rgba(9,9,11,0.86); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 50; max-width: 640px; margin: 0 auto; width: 100%; }

.table-area { width: 100%; overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; margin-bottom:24px; box-shadow: var(--shadow-sm); }
.data-grid { width: 100%; min-width: 700px; border-collapse: collapse; }
.data-grid th { font-size: 10px; font-weight: 800; color: var(--text-sub); text-transform: uppercase; padding: 16px; border-bottom: 1px solid var(--border); text-align: right; background: rgba(255,255,255,0.02); }
.data-grid td { padding: 16px; border-bottom: 1px solid var(--border); font-size: 14px; text-align: right; font-weight: 600; cursor: pointer; color: var(--text-main); }
.data-grid tr:last-child td { border-bottom: none; }
.portfolio-empty-cell {
    padding: 28px 18px !important;
    text-align: center !important;
    cursor: default !important;
}
.portfolio-empty-state {
    max-width: 520px;
    margin: 0 auto;
    background: linear-gradient(145deg, rgba(255,255,255,0.045), rgba(226,242,159,0.035));
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 28px;
}
.portfolio-empty-state.compact {
    max-width: 420px;
    padding: 22px;
    background: rgba(255,255,255,0.025);
}
.portfolio-empty-kicker {
    display: inline-block;
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}
.portfolio-empty-state strong {
    display: block;
    color: var(--text-main);
    font-size: 16px;
    margin-bottom: 8px;
}
.portfolio-empty-state p {
    color: var(--text-sub);
    font-size: 13px;
    line-height: 1.65;
    max-width: 420px;
    margin: 0 auto;
}
.portfolio-empty-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}
.portfolio-empty-primary,
.portfolio-empty-secondary {
    border-radius: 999px;
    padding: 12px 18px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}
.portfolio-empty-primary {
    background: var(--gradient-brand);
    color: #000;
    border: none;
}
.portfolio-empty-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
}

/* Meus Ativos: melhorar legibilidade da tabela */
#tab-ativos .data-grid th {
    font-size: 10px;
    padding: 18px 14px;
}
#tab-ativos .data-grid td {
    font-size: 15px;
    padding: 14px 14px;
}
#tab-ativos .data-grid td .num {
    font-size: 15px;
}

.tab-bar { display: flex; padding: 0 24px; background: transparent; gap: 24px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; margin: -10px -24px 24px -24px; position: sticky; top: 0; z-index: 40; backdrop-filter: blur(12px); }
.tab { padding: 16px 0; border: none; background: none; font-size: 12px; font-weight: 600; color: var(--text-sub); cursor: pointer; position: relative; white-space: nowrap; transition: color 0.2s; }
.tab.active { color: var(--text-main); font-weight: 800; }
.section-kicker {
    font-size: 10px;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}
.ativos-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}
.ativos-hero h3 {
    font-size: 22px;
    line-height: 1.1;
    margin: 0 0 6px;
}
.ativos-hero p {
    color: var(--text-sub);
    font-size: 13px;
    line-height: 1.55;
    max-width: 520px;
}
.ativos-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.ativos-action-primary,
.ativos-action-secondary {
    border-radius: 999px;
    padding: 11px 16px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}
.ativos-action-primary {
    background: var(--gradient-brand);
    color: #000;
    border: none;
}
.ativos-action-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    color: var(--accent);
    border: 1px solid var(--border);
}
.ativos-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.ativos-summary-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.045), rgba(226,242,159,0.025));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    min-width: 0;
}
.ativos-summary-card span {
    display: block;
    color: var(--text-sub);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}
.ativos-summary-card strong {
    display: block;
    color: var(--text-main);
    font-size: 15px;
    font-family: var(--font-mono);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ativos-filter-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: 22px;
}
.ativos-filter-bar::-webkit-scrollbar { display: none; }
.ativos-filter {
    flex-shrink: 0;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-sub);
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}
.ativos-filter.active {
    background: var(--text-main);
    color: var(--bg);
    border-color: var(--text-main);
}
.ativos-mobile-list {
    display: none;
    gap: 12px;
    margin-bottom: 24px;
}
.ativo-mobile-card {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-main);
    border-radius: 20px;
    padding: 16px;
    text-align: left;
    cursor: pointer;
}
.ativo-mobile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.ativo-mobile-title {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}
.ativo-mobile-title img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--border);
    object-fit: contain;
}
.ativo-mobile-title span {
    font-size: 15px;
    font-weight: 900;
}
.ativo-mobile-title small {
    color: var(--text-sub);
    font-size: 10px;
    font-weight: 800;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 7px;
}
.ativo-mobile-value {
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
}
.ativo-mobile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.ativo-mobile-grid div {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 9px;
}
.ativo-mobile-grid span {
    display: block;
    color: var(--text-sub);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 5px;
}
.ativo-mobile-grid strong {
    font-size: 12px;
}
.modal-insight-card {
    background:
        radial-gradient(circle at top right, rgba(226,242,159,0.12), transparent 32%),
        rgba(255,255,255,0.035);
    border: 1px solid rgba(226,242,159,0.16);
    border-radius: 20px;
    padding: 18px;
    margin: 8px 0 24px;
}
.modal-insight-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.modal-insight-head span {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 900;
    letter-spacing: -0.01em;
}
.modal-insight-head strong {
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}
.modal-insight-head strong.good {
    color: #052e1a;
    background: var(--success);
}
.modal-insight-head strong.neutral {
    color: #1f1b05;
    background: var(--accent);
}
.modal-insight-head strong.watch {
    color: #3b0707;
    background: var(--danger);
}
.modal-insight-card p {
    color: var(--text-sub);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 14px;
}
.modal-insight-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}
.modal-insight-pills span {
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.22);
    color: var(--text-main);
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 11px;
    font-weight: 800;
}
.tab.active::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--text-main); }
.tab-bar.hidden-tabs { height: 0; margin: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; overflow: hidden; }

.mobile-switch { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 5px; }
.quick-period-btn { border: none; background: transparent; color: var(--text-sub); border-radius: 10px; padding: 10px 8px; font-size: 11px; font-weight: 700; cursor: pointer; transition: all 0.2s ease; }
.quick-period-btn.active { background: #000; color: var(--text-main); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05); }

.content-sec { display: none; animation: fadeIn 0.3s ease; }
.content-sec.active { display: block; }

.premium-input { background: #000; border: 1px solid var(--border); padding: 16px 20px; border-radius: 16px; font-size: 15px; outline: none; width: 100%; color: var(--text-main); font-weight: 500; transition: 0.2s; }
.premium-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(226, 242, 159, 0.1); }
.premium-input::placeholder { color: var(--text-dim); }

.btn-main { background: var(--gradient-brand); color: #000; border: none; padding: 18px; border-radius: 100px; font-weight: 800; font-size: 14px; width: 100%; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 16px rgba(226, 242, 159, 0.2); text-align: center; }
.btn-main:active { transform: scale(0.98); }
.btn-main-dark { background: var(--surface); color: var(--text-main); border: 1px solid var(--border); box-shadow: none; }

.btn-float { position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%); background: var(--text-main); color: var(--bg); border: none; padding: 16px 32px; border-radius: 100px; font-weight: 800; font-size: 12px; text-transform: uppercase; box-shadow: var(--shadow-md); z-index: 100; cursor: pointer; letter-spacing: 0.05em; display: flex; align-items: center; gap: 8px;}

.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(12px); z-index: 3000; align-items: flex-end; justify-content: center; }
.overlay.open { display: flex; }
.modal { background: var(--bg); width: 100%; max-width: 640px; height: 90vh; border-radius: 32px 32px 0 0; overflow-y: auto; display: flex; flex-direction: column; border-top: 1px solid var(--border); }
#m-meses-bar {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scrollbar-width: none;
}
#m-meses-bar::-webkit-scrollbar { display: none; }
#m-meses-bar > div {
    min-width: 40px;
    flex: 0 0 40px !important;
}
#agenda-carteira-list .agenda-table-scroll,
#pub-agenda-content .agenda-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
#agenda-carteira-list .agenda-table-grid,
#pub-agenda-content .agenda-table-grid {
    min-width: 680px;
}
#agenda-carteira-list .agenda-no-wrap,
#pub-agenda-content .agenda-no-wrap {
    white-space: nowrap;
}
#auth-modal { align-items: center; padding: 14px; }
#auth-modal .auth-mobile-modal {
    width: min(92vw, 390px);
    max-width: 390px;
    border-radius: 28px;
    border: 1px solid var(--border);
    border-top: 1px solid var(--border);
    height: auto;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes skeletonPulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.9; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.spin { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }

.search-input-wrapper { position: relative; display: flex; align-items: center; width: 100%; margin-bottom: 24px; }
.search-icon-svg { position: absolute; left: 20px; width: 18px; height: 18px; stroke: var(--text-sub); fill: none; }
.search-input { width: 100%; background: var(--surface); border: 1px solid var(--border); padding: 16px 20px 16px 48px; border-radius: 100px; font-size: 15px; font-weight: 500; color: var(--text-main); outline: none; transition: 0.2s; cursor: pointer; }
.search-input:focus { border-color: var(--text-dim); }
.asset-deep-link-btn { padding: 12px 16px; border-radius: 14px; font-size: 12px; font-weight: 800; }
.asset-deep-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.asset-deep-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.asset-deep-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px; }
.asset-deep-kpi-label { font-size: 10px; font-weight: 800; color: var(--text-sub); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.asset-deep-kpi-value { font-size: 15px; font-weight: 800; color: var(--text-main); }
.asset-deep-table { width: 100%; border-collapse: collapse; }
.asset-deep-table th { text-align: left; font-size: 10px; font-weight: 800; color: var(--text-sub); text-transform: uppercase; padding: 10px 0; border-bottom: 1px solid var(--border); }
.asset-deep-table td { font-size: 12px; color: var(--text-main); padding: 12px 0; border-bottom: 1px solid var(--border); }
.asset-deep-table tr:last-child td { border-bottom: none; }
.asset-proventos-scroll {
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 10px;
    background: rgba(255,255,255,0.01);
}
.asset-chart-tooltip {
    position: fixed;
    z-index: 99999;
    display: none;
    pointer-events: none;
    max-width: 240px;
    background: rgba(9, 11, 14, 0.96);
    border: 1px solid rgba(255,255,255,0.14);
    color: #F5F7FA;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    box-shadow: 0 10px 24px rgba(0,0,0,0.34);
}
.chart-tip-target { cursor: pointer; }
.asset-hero-card { padding: 0; overflow: hidden; }
.asset-hero-top {
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
    background:
      radial-gradient(120% 90% at 0% 0%, rgba(226,242,159,0.12) 0%, rgba(226,242,159,0) 52%),
      linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
}
.asset-hero-row { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.asset-hero-head { display: flex; gap: 14px; align-items: center; min-width: 0; }
.asset-hero-logo {
    width: 62px;
    height: 62px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    object-fit: contain;
    flex-shrink: 0;
}
.asset-hero-id { min-width: 0; }
.asset-hero-ticker { font-size: 44px; font-weight: 900; line-height: 1; }
.asset-hero-name { font-size: 13px; color: var(--text-sub); margin-top: 6px; line-height: 1.4; max-width: 860px; }
.asset-hero-tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.asset-hero-tag {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-main);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    padding: 7px 12px;
    border-radius: 999px;
}
.asset-hero-tag-accent {
    color: var(--accent);
    background: rgba(226,242,159,0.08);
    border-color: rgba(226,242,159,0.2);
}
.asset-hero-links { display: flex; gap: 8px; flex-wrap: wrap; }
.asset-hero-link {
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.01);
}
.asset-hero-link-primary { color: #0E1116; background: var(--accent); border-color: rgba(226,242,159,0.35); }
.asset-hero-kpi-wrap { padding: 18px 18px 20px; }
.asset-hero-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.asset-hero-kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.asset-hero-kpi-label {
    font-size: 11px;
    font-weight: 900;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
}
.asset-hero-kpi-value { font-size: 30px; font-weight: 900; padding: 14px 10px; text-align: center; }
.asset-anchor-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 16px;
    position: sticky;
    top: 8px;
    z-index: 8;
    padding: 10px 0;
    backdrop-filter: blur(8px);
}
.asset-anchor-pill {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
}
.asset-anchor-pill:hover { border-color: var(--text-dim); }
.asset-premium-panel {
    background:
      radial-gradient(140% 100% at 0% 0%, rgba(226,242,159,0.11) 0%, rgba(226,242,159,0) 44%),
      linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border: 1px solid rgba(226,242,159,0.2);
    box-shadow: 0 12px 30px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.03);
}
.asset-premium-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.asset-premium-chart-card {
    background: rgba(8,10,14,0.72);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 12px;
}
.asset-premium-chart-title {
    font-size: 12px;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: .02em;
}
.asset-premium-chart-sub {
    font-size: 11px;
    color: var(--text-sub);
    margin-top: 4px;
    margin-bottom: 8px;
}
body[data-asset-standalone="1"] { overflow-y: auto; display: block; min-height: 100vh; }
body[data-asset-standalone="1"] .top-header { max-width: none; width: 100%; padding: 20px 32px; border-bottom: 1px solid var(--border); }
body[data-asset-standalone="1"] #screen-asset-deep { width: 100%; max-width: none; min-height: 100vh; }
body[data-asset-standalone="1"] #asset-deep-content { width: min(1460px, 96vw); max-width: none; margin: 0 auto; padding: 24px 0 56px; }
body[data-asset-standalone="1"] .card { border-radius: 20px; }
body[data-asset-standalone="1"] .asset-deep-grid-3 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body[data-asset-standalone="1"] .asset-deep-grid-2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body[data-asset-standalone="1"] .asset-hero-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
body[data-asset-standalone="1"] .asset-premium-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 1024px) {
    .asset-hero-row { flex-direction: column; align-items: stretch; }
    .asset-hero-tags { justify-content: flex-start; }
    .asset-hero-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    body[data-asset-standalone="1"] .asset-premium-grid { grid-template-columns: 1fr; }
}

.toast { display:none; position:fixed; top:24px; left:50%; transform:translateX(-50%); background:var(--text-main); color:var(--bg); padding:14px 28px; border-radius:100px; font-size:13px; font-weight:700; z-index:9999; box-shadow:var(--shadow-md); opacity:0; transition:opacity 0.3s; }
.toast.show { display:block; opacity:1; }

/* ── TELA DE LOGIN ── */
#screen-login { background: var(--bg); }
.auth-bottom-card { background: var(--bg); padding: 32px 24px; display: flex; flex-direction: column; flex: 1; }
.social-btn { flex: 1; background: var(--surface); border: 1px solid var(--border); padding: 16px; border-radius: 100px; font-weight: 600; font-size: 14px; color: var(--text-main); display: flex; align-items: center; justify-content: center; gap: 12px; cursor: pointer; transition: 0.2s; }
.pw-wrapper { position: relative; display: flex; align-items: center; }
.pw-toggle { position: absolute; right: 16px; background: none; border: none; cursor: pointer; padding: 4px; display: flex; align-items: center; justify-content: center; color: var(--text-dim); }

/* Entrada de autenticação com ilustração fixa */
#auth-entry-screen {
    position: fixed;
    inset: 0;
    z-index: 3100;
    max-width: none;
    margin: 0;
    background: #020304;
}
.auth-entry-shell {
    width: 100%;
    max-width: 420px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 24px 22px max(30px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.auth-entry-back {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    background: #111217;
    color: var(--text-sub);
    border-radius: 999px;
    padding: 8px 12px;
    margin-bottom: 16px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.auth-entry-back:hover { color: var(--text-main); border-color: var(--text-dim); }
.auth-entry-illust {
    position: relative;
    height: 300px;
    margin-bottom: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-entry-illust::before {
    content: '';
    width: 232px;
    height: 232px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, rgba(18, 26, 16, 0.95) 0%, rgba(5, 11, 9, 0.92) 100%);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.02), inset 0 0 50px rgba(0,0,0,0.45);
    position: absolute;
}
.wallet-wrap {
    position: relative;
    width: 188px;
    height: 156px;
    z-index: 1;
}
.wallet-money {
    position: absolute;
    width: 72px;
    height: 56px;
    border-radius: 8px;
    background: linear-gradient(145deg, #0a9f79 0%, #45d3b0 100%);
    box-shadow: 0 8px 12px rgba(0,0,0,0.18);
}
.wallet-money-back {
    left: 46px;
    top: 24px;
    transform: rotate(-9deg);
    opacity: 0.88;
}
.wallet-money-front {
    left: 96px;
    top: 36px;
    transform: rotate(4deg);
}
.wallet-body {
    position: absolute;
    left: 24px;
    bottom: 24px;
    width: 146px;
    height: 88px;
    border-radius: 24px 24px 18px 18px;
    background: linear-gradient(180deg, #2f3137 0%, #24262b 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 14px 22px rgba(0,0,0,0.36);
}
.wallet-stitch {
    position: absolute;
    left: 10px;
    right: 10px;
    top: 24px;
    height: 28px;
    border-top: 3px solid rgba(207, 214, 231, 0.62);
    border-radius: 0 0 80px 80px;
}
.wallet-dot {
    position: absolute;
    left: 50%;
    top: 33px;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #c9d46e 0%, #a5b24f 72%, #83913e 100%);
    box-shadow: 0 0 0 2px rgba(64,70,37,0.45);
}
.auth-entry-title {
    font-size: 56px;
    line-height: 1.04;
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}
.auth-entry-title span {
    display: block;
    color: var(--accent);
}
.auth-entry-sub {
    font-size: 14px;
    line-height: 1.4;
    color: #8f9096;
    margin-bottom: 30px;
    max-width: 92%;
}
.auth-entry-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.auth-entry-btn-primary {
    height: 56px;
    border-radius: 100px;
    background: linear-gradient(180deg, #1e3009 0%, #151f09 100%);
    color: #f4f6e9;
    box-shadow: 0 12px 24px rgba(64, 100, 14, 0.22), inset 0 1px 0 rgba(255,255,255,0.07);
}
.auth-entry-btn-secondary {
    height: 56px;
    border-radius: 100px;
    background: #2b2d32;
    color: #f4f5f8;
    border: 1px solid #36383e;
    box-shadow: none;
}

.auth-motion-scene {
    position: relative;
    height: 136px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.07);
    background:
        linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%),
        radial-gradient(circle at 18% 18%, rgba(226,242,159,0.11) 0%, transparent 42%);
    overflow: hidden;
    margin-bottom: 16px;
    padding: 14px;
}
.auth-scene-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.auth-scene-chip {
    font-size: 11px;
    font-weight: 800;
    color: #0b0b0d;
    background: var(--accent);
    border-radius: 999px;
    padding: 4px 10px;
}
.auth-scene-pulse {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #34D399;
    box-shadow: 0 0 0 0 rgba(52,211,153,0.48);
    animation: authPulse 1.8s ease-out infinite;
}
.auth-scene-graph {
    position: relative;
    height: 44px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    overflow: hidden;
    margin-bottom: 12px;
}
.auth-scene-line {
    position: absolute;
    left: -10%;
    width: 120%;
    height: 100%;
    border-radius: 999px;
    border: 2px solid transparent;
}
.auth-scene-line-a {
    top: 12px;
    border-top-color: rgba(226,242,159,0.92);
    animation: authWaveA 3.2s ease-in-out infinite;
}
.auth-scene-line-b {
    top: 18px;
    border-top-color: rgba(96,165,250,0.86);
    animation: authWaveB 2.9s ease-in-out infinite;
}
.auth-scene-bars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    align-items: end;
    height: 42px;
}
.auth-bar {
    border-radius: 10px 10px 6px 6px;
    background: linear-gradient(180deg, rgba(226,242,159,0.95) 0%, rgba(226,242,159,0.25) 100%);
    animation: authBars 2.4s ease-in-out infinite;
}
.auth-bar-1 { height: 20px; animation-delay: -0.3s; }
.auth-bar-2 { height: 30px; animation-delay: -1.0s; }
.auth-bar-3 { height: 24px; animation-delay: -0.6s; }
.auth-bar-4 { height: 34px; animation-delay: -1.4s; }

.auth-mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 14px;
}
.auth-mode-btn {
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 700;
    padding: 9px 8px;
    cursor: pointer;
    transition: 0.2s ease;
}
.auth-mode-btn.active {
    background: #000;
    color: var(--text-main);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

@keyframes authWaveA {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
@keyframes authWaveB {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}
@keyframes authBars {
    0%, 100% { transform: scaleY(0.82); opacity: 0.86; }
    50% { transform: scaleY(1.08); opacity: 1; }
}
@keyframes authPulse {
    0% { box-shadow: 0 0 0 0 rgba(52,211,153,0.5); opacity: 1; }
    100% { box-shadow: 0 0 0 10px rgba(52,211,153,0); opacity: 0.75; }
}

.balance-card { background: var(--surface); border-radius: 28px; padding: 32px 24px; text-align: left; margin-bottom: 24px; border: 1px solid var(--border); position: relative; overflow: hidden; }
.balance-card::after { content: ''; position: absolute; top: 0; right: 0; width: 150px; height: 150px; background: radial-gradient(circle, rgba(226, 242, 159, 0.1) 0%, transparent 70%); border-radius: 50%; pointer-events: none; }
.balance-card.compact { padding: 22px 20px; border-radius: 18px; }
.balance-card.compact::after { width: 100px; height: 100px; background: radial-gradient(circle, rgba(96,165,250,0.1) 0%, transparent 70%); }

@media (max-width: 420px) {
    #m-meses-bar > div {
        min-width: 36px;
        flex-basis: 36px !important;
    }
    .auth-entry-shell {
        padding-left: 18px;
        padding-right: 18px;
    }
    .auth-entry-illust {
        height: 270px;
    }
    .auth-entry-title {
        font-size: 50px;
    }
    .auth-entry-sub {
        font-size: 13px;
    }
}

@media (max-width: 640px) {
    .tela-principal { padding-bottom: 170px; }
    #bottom-nav-public,
    #bottom-nav-app {
        width: calc(100% - 12px) !important;
        border-radius: 18px 18px 0 0 !important;
        padding: 8px 0 calc(10px + env(safe-area-inset-bottom)) !important;
    }
    #bottom-nav-public button,
    #bottom-nav-app button {
        padding: 6px 12px !important;
    }
    #bottom-nav-public span,
    #bottom-nav-app span {
        font-size: 9px !important;
    }
    .ativos-hero { flex-direction: column; }
    .ativos-actions { width: 100%; justify-content: stretch; }
    .ativos-action-primary,
    .ativos-action-secondary { flex: 1; justify-content: center; }
    .ativos-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ativos-summary-card:last-child { grid-column: 1 / -1; }
    #tab-ativos > h3,
    #tab-ativos .table-area { display: none; }
    .ativos-mobile-list { display: grid; }
    .asset-deep-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .asset-hero-ticker { font-size: 34px; }
    .asset-hero-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .asset-anchor-nav { top: 0; padding-top: 6px; }
    body[data-asset-standalone="1"] .top-header { padding: 16px 20px; }
    body[data-asset-standalone="1"] #asset-deep-content { width: 100%; padding: 16px 16px 40px; }
    body[data-asset-standalone="1"] .asset-deep-grid-3,
    body[data-asset-standalone="1"] .asset-deep-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body[data-asset-standalone="1"] .asset-hero-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* Public mode hard lock: hide portfolio-only controls in asset modal */
body[data-public-mode='1'] #m-edit-card,
body[data-public-mode='1'] #pm-sim-card,
#asset-modal.public-readonly #m-edit-card,
#asset-modal.public-readonly #pm-sim-card { display: none !important; }

