/* Financial UI readability pass layered over the established visual system. */
:root {
    --bg: #04101f;
    --surface: #091a30;
    --card: #102945;
    --text: #fffaf0;
    --muted: #b7c5d7;
    --line: rgba(116, 205, 255, .24);
    --blue: #2d8cff;
    --aqua: #69e2ff;
    --violet: #8178ff;
    --green: #48df87;
    --red: #ff7180;
}

body {
    font-size: 16px;
    line-height: 1.55;
    background: radial-gradient(circle at 75% 0, rgba(45, 140, 255, .08), transparent 32%), var(--bg);
}

.auth-brand, .app-brand { font-size: 17px; }
.auth-brand img, .app-brand img { border-radius: 10px; }
.auth-card { background: rgba(10, 25, 45, .92); border-color: rgba(116, 205, 255, .25); }
.auth-card label { font-size: 13px; }
.auth-card input { min-height: 52px; font-size: 16px; }
.auth-card-copy > p:last-child { color: var(--muted); font-size: 15px; }
.auth-tabs button, .demo-action, .code-action { min-height: 44px; font-size: 14px; }
.auth-session-note { margin: 2px 0 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.security-note, .form-message { font-size: 12px; }
.primary-action { min-height: 50px; font-size: 15px; box-shadow: 0 16px 40px rgba(45, 140, 255, .28); }

.sidebar { width: 258px; padding: 26px 18px; background: #07182c; }
.app-content { margin-left: 258px; }
.sidebar nav { gap: 7px; }
.sidebar nav button, .sign-out { min-height: 48px; font-size: 14px; color: #aebdd0; }
.sidebar nav button.active { background: linear-gradient(90deg, rgba(45, 140, 255, .24), rgba(45, 140, 255, .06)); }
.sidebar-note p, .sidebar-note b { font-size: 11px; }

.app-header { height: 82px; background: rgba(4, 16, 31, .9); }
.global-search input { font-size: 15px; }
.account-chip b { font-size: 13px; }
.account-chip small { font-size: 11px; }
.account-chip .account-mode-label, .data-provenance { font-size: 10px; }
main { max-width: 1320px; padding-top: 46px; }
.welcome-row h1, .page-heading h1 { font-weight: 800; }
.welcome-row > div > p:last-child, .page-heading > p:last-child, .portfolio-heading > div > p:last-child { color: var(--muted); font-size: 16px; line-height: 1.6; }
.eyebrow { font-size: 11px; color: var(--aqua); }
.outline-action, .section-row button, .insight-card button { min-height: 44px; font-size: 13px; }
.section-row h2 { font-size: 27px; }

.balance-card, .insight-card, .table-card, .allocation-card, .portfolio-stats article, .market-card, .search-card {
    border-color: var(--line);
    box-shadow: 0 16px 45px rgba(0, 0, 0, .16);
}
.card-top, .balance-foot { font-size: 12px; }
.balance-card > p, .insight-card > p:not(.eyebrow) { font-size: 13px; }
.insight-card h2 { font-size: 25px; }
.market-card { padding: 20px; background: #0c213a; }
.market-card h3 { font-size: 17px; }
.market-card p, .market-price span, .search-status { color: var(--muted); font-size: 12px; }
.market-price strong { font-size: 18px; }
.position-row { min-height: 62px; font-size: 13px; }
.position-row.header { font-size: 10px; }
.position-asset small { color: var(--muted); font-size: 11px; }
.discover-search { min-height: 58px; background: #0c213a; }
.discover-search input { font-size: 16px; }
.discover-search button { min-height: 44px; font-size: 14px; }
.search-card h2 { font-size: 21px; }
.search-card > p, .search-card button { font-size: 13px; }
.portfolio-stats span, .allocation-legend span { font-size: 12px; }
.portfolio-stats strong { font-size: 22px; }

button, .button, [role="button"] { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(105, 226, 255, .72); outline-offset: 3px; }

@media (max-width: 760px) {
    .sidebar { width: min(86vw, 290px); }
    .app-content { margin-left: 0; }
    .app-header { height: 72px; }
    main { padding-top: 30px; }
    .welcome-row h1, .page-heading h1 { font-size: 38px; }
    .market-cards, .search-results, .portfolio-stats { gap: 14px; }
}

/* Purposeful interaction motion shared with the native app. */
button, a, summary {
    -webkit-tap-highlight-color: transparent;
}

button:not(:disabled) {
    transform-origin: center;
}

button:not(:disabled):active,
.market-card:active,
.search-card:active,
.watch-card:active {
    transform: scale(.975);
    transition-duration: 80ms;
}

.view.active .page-heading,
.view.active .welcome-row,
.view.active .portfolio-heading {
    animation: averholtHeadingIn .55s cubic-bezier(.16, 1, .3, 1) both;
}

.research-disclosure[open] > p,
.research-disclosure[open] > div {
    animation: averholtDisclosureIn .3s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes averholtHeadingIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

@keyframes averholtDisclosureIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .view.active .page-heading,
    .view.active .welcome-row,
    .view.active .portfolio-heading,
    .research-disclosure[open] > p,
    .research-disclosure[open] > div {
        animation: none;
    }

    button:not(:disabled):active,
    .market-card:active,
    .search-card:active,
    .watch-card:active {
        transform: none;
    }
}

.auth-text-action {
    width: fit-content;
    margin: -4px 0 2px auto;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: var(--accent, #2f9dff);
    font: inherit;
    font-weight: 750;
}

.recovery-dialog {
    width: min(92vw, 520px);
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--accent, #2f9dff) 24%, transparent);
    border-radius: 26px;
    background: #0d1522;
    color: #f7f9fc;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
}

.recovery-dialog::backdrop {
    background: rgba(2, 7, 14, .76);
    backdrop-filter: blur(10px);
}

.recovery-card { position: relative; display: grid; gap: 16px; padding: 32px; }
.recovery-card h2 { margin: 4px 0 8px; font-size: clamp(28px, 5vw, 38px); }
.recovery-card p { color: #aeb9c8; line-height: 1.6; }
.recovery-card label { display: grid; gap: 7px; margin: 16px 0; font-weight: 700; }
.recovery-card input { min-height: 52px; }
.dialog-close { position: absolute; z-index: 2; inset: 16px 16px auto auto; width: 42px; height: 42px; border-radius: 50%; }
.password-checklist { display: grid; gap: 7px; margin: 12px 0 20px; padding: 0; list-style: none; color: #9aa7b8; }
.password-checklist li::before { content: "○"; display: inline-block; width: 24px; color: #758297; }
.password-checklist li.met { color: #67e4a4; }
.password-checklist li.met::before { content: "✓"; color: #67e4a4; }
.recovery-success { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 18px; border-radius: 20px; background: rgba(52, 211, 153, .14); color: #67e4a4; font-size: 34px; font-weight: 900; }

@media (max-width: 520px) {
    .recovery-card { padding: 28px 22px 24px; }
}
