/* MarketAI workspace: shared visual system, loaded after legacy component styles. */
:root {
    color-scheme: dark;
    --bg-primary: #111514; --bg-secondary: #151a18; --bg-tertiary: #1b211f;
    --bg-card: #191f1d; --bg-card-hover: #202824;
    --accent-primary: #8edac1; --accent-secondary: #addfce; --accent-glow: #8edac111;
    --text-primary: #edf2ef; --text-secondary: #a0aea7; --text-tertiary: #88978f;
    --border-color: #2b3530; --border-hover: #46584e;
    --color-bullish: #80cfaf; --color-bearish: #e49292;
    --color-bullish-bg: #80cfaf0d; --color-bearish-bg: #e492920d;
    --shadow-sm: none; --shadow-md: none; --shadow-lg: 0 12px 48px #0003; --shadow-glow: none;
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius-md: 10px; --radius-lg: 12px; --radius-xl: 14px;
}
body { background: var(--bg-primary); font-size: 14px; -webkit-font-smoothing: antialiased; }
body::before { display: none; }
button, input, select { font-family: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent-primary) !important; outline-offset: 4px; }
button:disabled { opacity: .5; cursor: wait; }
a { color: var(--accent-primary); }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 20000; padding: 10px 18px; background: var(--accent-primary); color: #14221d; }
.skip-link:focus { top: 10px; }
.sidebar { transform: none; width: 244px; background: #131816; border-right: 1px solid var(--border-color); z-index: 100; padding: 0; }
.sidebar-header { padding: 34px 24px 32px; gap: 11px; border: 0; }
.logo { width: 36px; height: 40px; background: none; color: var(--accent-primary); box-shadow: none; border-radius: 0; }
.brand-name { font-size: 23px; letter-spacing: -1px; color: var(--text-primary); font-weight: 650; background: none; -webkit-text-fill-color: currentColor; }
.brand-name > span { color: var(--accent-primary); }
.brand-name small { display: block; color: var(--text-tertiary); letter-spacing: 1.35px; font-size: 7px; margin-top: 0; font-weight: 500; }
.sidebar-nav { padding: 12px 16px; }
.nav-title { padding: 0 12px; margin-bottom: 14px; font-size: 9px; font-weight: 600; letter-spacing: 1.5px; color: var(--text-tertiary); }
.nav-section { margin-bottom: 38px; }
.nav-item { padding: 12px 14px; margin-bottom: 5px; border-radius: 7px; font-size: 12px; gap: 13px; color: #a0aea7; border: 1px solid transparent; }
.nav-item.active { background: #23352c; border-color: #344b3e; color: #c1e9d8; }
.nav-item:hover { background: #202823; transform: none; color: #edf2ef; }
.nav-item.active::before { display: none; }
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.sidebar .market-card { background: transparent; border-radius: 0; padding: 13px 12px; margin: 0; border-bottom: 1px solid var(--border-color); display: grid; grid-template-columns: 1fr auto; gap: 3px; }
.market-label { grid-column: 1 / -1; font-size: 10px; color: var(--text-secondary); }
.market-value { font-size: 15px; font-weight: 500; }
.market-change { font-size: 11px; align-self: center; }
.sidebar-bottom { margin-top: auto; padding: 20px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--border-color); font-size: 10px; color: #c4cec8; }
.sidebar-bottom small { display: block; color: var(--text-tertiary); font-size: 9px; margin-top: 3px; }
.workspace-mark { border: 1px solid #42574a; color: var(--accent-primary); border-radius: 7px; padding: 5px 9px; }
.main-content { margin-left: 244px; min-width: 0; padding: 0 40px; width: calc(100% - 244px); }
.workspace-topbar { height: 70px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-color); gap: 12px; }
.breadcrumb { display: flex; align-items: center; gap: 12px; color: var(--text-secondary); font-size: 11px; }
.breadcrumb span:first-child { color: #697b70; }
.topbar-actions { display: flex; align-items: center; gap: 20px; }
.workspace-date { color: var(--text-tertiary); font-size: 10px; text-transform: capitalize; }
.account-button { display: flex; gap: 9px; align-items: center; background: transparent; border: 1px solid var(--border-color); color: var(--text-primary); border-radius: 7px; padding: 7px 12px; font-size: 11px; cursor: pointer; }
.account-avatar { display: grid; place-items: center; width: 23px; height: 23px; background: #304238; color: var(--accent-primary); border-radius: 5px; }
.header { background: none; padding: 32px 0 27px; border: 0; position: static; backdrop-filter: none; }
.page-heading { padding-top: 32px; padding-bottom: 26px; margin-bottom: 0 !important; }
.header.page-heading { padding-top: 32px; }
.page-title, .page-heading h1 { background: none; font-size: clamp(25px, 2.3vw, 34px) !important; letter-spacing: -1.2px; line-height: 1.25; font-weight: 500 !important; margin: 5px 0 10px !important; }
.page-subtitle, .page-heading p { font-size: 12px !important; color: var(--text-secondary); }
.eyebrow, .page-heading p.eyebrow { font-size: 9px !important; letter-spacing: 1.65px; font-weight: 600; color: var(--text-tertiary); margin-bottom: 10px; }
.overview-banner { border: 1px solid #34463b; border-radius: 12px; background: #1d2b23; padding: 30px 32px; display: grid; grid-template-columns: 1fr 1fr; position: relative; overflow: hidden; margin-bottom: 22px; }
.overview-banner .eyebrow { color: #9eb7a8; }
.overview-banner h2 { font-size: clamp(25px, 2.2vw, 33px); font-weight: 500; letter-spacing: -1px; line-height: 1.2; margin: 11px 0 13px; }
.overview-banner p { font-size: 12px; line-height: 1.8; color: #aabfb0; }
.overview-banner .btn-primary { display: inline-flex; margin-top: 22px; font-size: 11px; gap: 24px; padding: 10px 15px; }
.overview-art { position: relative; margin: 20px 0 0 40px; display: flex; align-items: center; }
.art-grid { position: absolute; inset: 28px 0 35px; background-image: linear-gradient(#a0bea00b 1px, transparent 1px), linear-gradient(90deg, #a0bea00b 1px, transparent 1px); background-size: 40px 40px; }
.overview-art svg { width: 100%; position: relative; }
.art-label, .art-caption { position: absolute; font-family: var(--font-mono); letter-spacing: 1.4px; font-size: 8px; color: #7f9d89; }
.art-label { top: 0; right: 0; }
.art-caption { bottom: 0; right: 0; }
.btn-primary, .btn-submit { background: #addfc8; color: #14251c; border: 1px solid #addfc8; border-radius: 7px; box-shadow: none; font-size: 12px; font-weight: 600; justify-content: center; }
.btn-primary:hover, .btn-submit:hover { background: #c0edd8; box-shadow: none; transform: none; }
.btn-secondary, .btn-google { background: #202723; border: 1px solid var(--border-color); border-radius: 7px; color: var(--text-primary); box-shadow: none; font-size: 12px; }
.btn-secondary:hover, .btn-google:hover { background: #2b352e; border-color: var(--border-hover); transform: none; }
.stats-grid { padding: 0; gap: 16px; margin: 0 0 30px; grid-template-columns: repeat(4,minmax(0,1fr)); }
.overview-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
.stat-card { background: var(--bg-card); padding: 19px 22px; border: 1px solid var(--border-color); border-radius: 10px; box-shadow: none; }
.stat-card::before, .prediction-card::before { display: none; }
.stat-card:hover, .prediction-card:hover, .news-card:hover, .commodity-card:hover { transform: none; box-shadow: none; }
.stat-header { margin-bottom: 5px; }
.stat-label { font-size: 11px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.stat-icon { width: 18px; height: 18px; opacity: .7; }
.stat-value { font-size: 32px; letter-spacing: -1px; font-weight: 500; line-height: 1.4; }
.stat-context { font-size: 10px; color: var(--text-tertiary); display: flex; justify-content: space-between; margin-top: 6px; }
.stat-context span { font-size: 16px; }
.predictions-section { padding: 0; margin-bottom: 28px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 0 16px; gap: 10px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.section-title { margin: 0; font-size: 17px; font-weight: 500; letter-spacing: -.4px; }
.section-note { border: 1px solid var(--border-color); border-radius: 5px; padding: 5px 9px; color: var(--text-secondary); font-size: 9px; }
.predictions-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.prediction-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 22px; }
.prediction-card:hover { border-color: #64796b; background: #1c2420; }
.card-header { margin-bottom: 21px; }
.stock-symbol { font-size: 17px; letter-spacing: -.4px; font-weight: 600; }
.company-name { font-size: 10px; color: var(--text-tertiary); }
.badge { background: #27302b; border: 1px solid #364239; border-radius: 4px; padding: 3px 7px; font-size: 9px; font-weight: 500; }
.price-section { padding: 0 0 17px; margin: 0 0 17px; border-bottom: 1px solid var(--border-color); }
.price-row { margin-bottom: 9px; gap: 12px; }
.price-label { font-size: 10px; }
.price-value { font-size: 16px; font-weight: 500; }
.target-price { font-size: 12px; }
.confidence-header { font-size: 10px; }
.confidence-label, .confidence-value { font-size: 10px; }
.progress-bar { height: 4px; background: #303b34; }
.progress-fill { box-shadow: none; }
.prediction-description { font-size: 11px; line-height: 1.8; margin-top: 14px; color: var(--text-secondary); }
.dashboard-bottom-grid { padding: 0; gap: 20px; grid-template-columns: 1fr 1fr; margin-bottom: 30px; }
.dashboard-card { background: var(--bg-card); padding: 24px; border-radius: 10px; }
.dashboard-card-header { margin-bottom: 18px; }
.dashboard-card .section-title { font-size: 15px; }
.quick-search-box { display: flex; gap: 8px; }
.quick-search-box input { min-width: 0; width: 100%; }
.chip { background: #202923; border: 1px solid #364339; color: #b7c9bd; border-radius: 5px; font-family: var(--font-mono); font-size: 10px; padding: 6px 9px; }
.chip:hover { background: #354b3e; color: #e0f1e8; }
.empty-state { grid-column: 1/-1; text-align: center; padding: 36px 20px; font-size: 12px; color: var(--text-secondary); }
.recent-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.recent-empty strong { color: #c2cec6; font-size: 12px; font-weight: 500; }
.recent-empty > span:last-child { font-size: 10px; }
.empty-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 8px; border-radius: 10px; border: 1px solid #3b4c41; color: var(--accent-primary); font-size: 28px; }
.main-content > div[style^="padding:"] { padding: 0 !important; }
.markets-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-bottom: 25px; }
.market-tab { padding: 10px 17px; border: 1px solid var(--border-color); border-radius: 6px; background: transparent; color: var(--text-secondary); font-size: 12px; margin-bottom: 24px; }
.market-tab.active { background: #2e4135; border-color: #45634f; color: #c3e7d4; }
.market-card-big, .commodity-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 22px; }
.market-card-big .mcb-value { font-size: 27px; font-weight: 500; font-variant-numeric: tabular-nums; }
.market-card-big .mcb-symbol { font-size: 14px; font-weight: 600; }
.mcb-name, .mcb-footer { font-size: 10px !important; }
.badge-open, .badge-closed { border-radius: 5px; font-size: 9px; padding: 4px 7px; }
.news-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.news-card { border-radius: 10px; background: var(--bg-card); }
.news-content { padding: 23px; display: flex; flex-direction: column; height: 100%; }
.news-source { text-transform: uppercase; letter-spacing: 1px; font-size: 9px; color: var(--accent-primary); }
.news-date { font-size: 10px; }
.news-title { font-size: 16px; font-weight: 500; line-height: 1.5; letter-spacing: -.3px; }
.news-description { font-size: 12px; line-height: 1.8; margin: 12px 0 20px; }
.news-link { margin-top: auto; font-size: 11px; }
#sentimentSummary > div { flex: 1; background: var(--bg-card) !important; border-color: var(--border-color) !important; border-radius: 9px !important; }
#sentimentSummary > div > span:empty { display: none; }
#carteraList { overflow-x: auto; }
.modal { backdrop-filter: blur(7px); background: #060b08b8; padding: 18px; }
.modal-content { border: 1px solid #45564a; border-radius: 13px; box-shadow: 0 24px 100px #0006; padding: 32px; max-height: 90dvh; overflow-y: auto; }
.modal-close { color: var(--text-secondary); min-width: 35px; min-height: 35px; }
.auth-tabs { border-bottom-color: var(--border-color); }
.auth-tab { font-size: 12px; }
.auth-tab.active { color: var(--accent-primary); border-bottom-color: var(--accent-primary); }
.auth-form h2 { font-size: 23px; font-weight: 500; letter-spacing: -.6px; }
.form-group label { font-size: 11px; }
.form-group input { background: var(--bg-primary); border-radius: 7px; font-size: 13px; }
.workspace-footer { display: flex; gap: 15px; justify-content: space-between; border-top: 1px solid var(--border-color); margin-top: 30px; padding: 22px 0; color: var(--text-tertiary); font-size: 9px; }
.footer-separator { color: #526658; margin: 0 7px; }
.profile-container { max-width: 860px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.profile-heading, #alertBox { grid-column: 1/-1; }
.profile-heading h1 { font-size: 30px; font-weight: 500; letter-spacing: -1px; }
.profile-heading > p:last-child { color: var(--text-secondary); font-size: 12px; margin-top: 8px; }
.profile-card { margin: 0; border-radius: 10px; padding: 26px; }
.profile-card:last-child { grid-column: 1/-1; padding: 18px; }
.profile-avatar-big { background: #314c3c; border: 1px solid #4d715b; border-radius: 18px; color: var(--accent-primary); }
.profile-topbar { padding: 22px 40px; }
.menu-toggle { display: none; background: transparent; color: var(--text-primary); border: 1px solid var(--border-color); padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.menu-backdrop { display: none; }
@media (min-width:1600px) { .main-content { padding-left: 60px; padding-right: 60px; } }
@media (max-width:1150px) {
    .sidebar { width: 218px; } .sidebar-header { padding-left: 18px; }
    .main-content { margin-left: 218px; width: calc(100% - 218px); padding: 0 25px; }
    .predictions-grid, .markets-grid, .news-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .stats-grid:not(.overview-stats) { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .overview-art { margin-left: 10px; }
    .overview-banner { padding: 25px; }
    .workspace-date { display: none; }
}
@media (max-width:768px) {
    .sidebar { width: 244px; transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .main-content { width: 100%; margin: 0; padding: 0 20px; }
    .workspace-topbar { height: 64px; }
    .menu-toggle { display: inline-flex; }
    .breadcrumb { margin-right: auto; font-size: 10px; }
    .breadcrumb span:first-child, .breadcrumb .breadcrumb-slash { display: none; }
    .menu-backdrop.visible { display: block; position: fixed; inset: 0; background: #0008; border: 0; z-index: 99; }
    .page-heading, .header.page-heading { padding-top: 27px; padding-bottom: 23px; }
    .page-title { font-size: 28px !important; }
    .overview-banner { grid-template-columns: 1fr; padding: 24px; }
    .overview-art { display: none; }
    .overview-banner h2 { font-size: 30px; }
    .dashboard-bottom-grid { grid-template-columns: 1fr; }
    .overview-stats { gap: 12px; }
    .stat-card { padding: 17px; }
    .stat-value { font-size: 28px; }
    .stat-context { font-size: 9px; }
    .workspace-footer { flex-direction: column; gap: 5px; }
    .profile-container { grid-template-columns: 1fr; margin: 25px auto; }
    .profile-topbar { padding: 18px; }
    .profile-topbar a:last-child { font-size: 10px !important; }
}
@media (max-width:480px) {
    .main-content { padding: 0 16px; }
    .predictions-grid, .markets-grid, .news-grid { grid-template-columns: 1fr; }
    .section-note { max-width: 110px; text-align: center; }
    .stat-icon { display: none; }
    .stat-label { font-size: 10px; }
    .stat-context span { display: none; }
    .desktop-break { display: none; }
    .modal-content { padding: 24px 18px; }
    #modalPredStats { gap: 6px !important; }
    #modalPredStats > div { padding: 10px 4px !important; }
    .market-tab { padding: 10px; font-size: 10px; }
}
@media (prefers-reduced-motion:reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }

#carteraGrid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)) !important; }
.recent-avatar { background: #30483a; color: var(--accent-primary); }
.recent-info { min-width: 0; }
.recent-date { font-size: 9px; max-width: 90px; }
.recent-symbol { font-size: 12px; }
@media (max-width: 480px) { .recent-item { gap: 9px; } .recent-date { max-width: 65px; } }

/* Data provenance and readable supporting text. */
:root { --text-secondary: #b3c0b9; --text-tertiary: #a4b4aa; }
.company-name, .price-label, .confidence-label, .confidence-value, .confidence-header,
.section-note, .stat-context, .news-date, .news-source, .market-label, .recent-date,
.workspace-date, .workspace-footer { font-size: .8125rem; }
.prediction-description, .news-description, .data-note, .confidence-help { font-size: .875rem; line-height: 1.65; }
.mcb-name, .mcb-footer { font-size: .8125rem !important; }
.data-note { color: var(--text-secondary); margin: .65rem 0; overflow-wrap: anywhere; }
.confidence-help { color: var(--text-secondary); margin: .75rem 0 1.25rem; }
.confidence-help summary { color: var(--accent-primary); cursor: pointer; }
.confidence-help p { margin-top: .5rem; max-width: 85ch; }
.market-link { color: var(--accent-primary); text-decoration: underline; text-underline-offset: 3px; font-size: .875rem; }
.breadcrumb span:first-child, .art-label, .art-caption { color: var(--text-secondary); }
#analysisProgress { margin-top: -1rem; }
#retryFeatured { margin-bottom: 1rem; }
#indexAnalysis { margin: 1rem 0; }
#modalAnalysis { margin-bottom: 1rem; }
[hidden] { display: none !important; }
