:root {
    --bg: #f3f6fb;
    --bg-elevated: #ffffff;
    --bg-soft: #edf2f8;
    --bg-strong: #101936;
    --text: #10182d;
    --text-soft: #5f6c82;
    --text-faint: #8793a7;
    --border: #dce4ef;
    --border-strong: #c8d3e1;
    --brand: #f04b2f;
    --brand-dark: #d83a20;
    --brand-soft: rgba(240, 75, 47, 0.11);
    --green: #0b9f6a;
    --green-soft: rgba(11, 159, 106, 0.11);
    --red: #d94a59;
    --red-soft: rgba(217, 74, 89, 0.11);
    --blue: #3976e8;
    --pink: #d94fb3;
    --teal: #0d9f9a;
    --yellow: #d89713;
    --shadow-sm: 0 8px 22px rgba(27, 38, 65, 0.06);
    --shadow-md: 0 18px 50px rgba(27, 38, 65, 0.10);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 26px;
    --shell: 1280px;
    --chart-grid: rgba(32, 50, 82, 0.08);
    --chart-tick: #6c7890;
    --header-bg: rgba(243, 246, 251, 0.88);
}

html[data-theme="dark"] {
    --bg: #080d18;
    --bg-elevated: #111827;
    --bg-soft: #172033;
    --bg-strong: #17244a;
    --text: #f4f7fb;
    --text-soft: #9da9bc;
    --text-faint: #6f7c91;
    --border: #253149;
    --border-strong: #344158;
    --brand: #ff5a3c;
    --brand-dark: #ff735a;
    --brand-soft: rgba(255, 90, 60, 0.13);
    --green: #20c98a;
    --green-soft: rgba(32, 201, 138, 0.12);
    --red: #f06472;
    --red-soft: rgba(240, 100, 114, 0.12);
    --blue: #5d8ff2;
    --pink: #ec68c5;
    --teal: #27bbb5;
    --yellow: #e9b23f;
    --shadow-sm: 0 8px 28px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 24px 64px rgba(0, 0, 0, 0.28);
    --chart-grid: rgba(255, 255, 255, 0.065);
    --chart-tick: #8f9bb0;
    --header-bg: rgba(8, 13, 24, 0.86);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% 6%, var(--brand-soft), transparent 26rem),
        radial-gradient(circle at 92% 13%, rgba(57, 118, 232, 0.10), transparent 28rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
button { color: inherit; }

.shell { width: min(calc(100% - 32px), var(--shell)); margin-inline: auto; }
.main-shell { padding-block: 42px 56px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: 12px; z-index: 1000; transform: translateY(-160%); padding: 10px 14px; border-radius: 10px; background: var(--text); color: var(--bg); text-decoration: none; font-weight: 700; }
.skip-link:focus { transform: translateY(0); }

.site-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid color-mix(in srgb, var(--border) 82%, transparent); background: var(--header-bg); backdrop-filter: blur(18px); }
.header-inner { min-height: 72px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; min-width: max-content; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(145deg, #22335f, #17213e); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 8px 22px rgba(19,30,58,.18); }
.brand-mark svg { width: 22px; height: 22px; stroke-width: 2; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -.01em; }
.brand small { color: var(--text-soft); font-size: 11px; margin-top: 1px; }
.primary-nav { justify-self: center; display: flex; align-items: center; gap: 5px; padding: 4px; border: 1px solid var(--border); background: color-mix(in srgb, var(--bg-elevated) 75%, transparent); border-radius: 13px; }
.nav-link { padding: 8px 13px; border-radius: 9px; text-decoration: none; color: var(--text-soft); font-size: 13px; font-weight: 700; transition: background .2s ease, color .2s ease; }
.nav-link:hover { color: var(--text); background: var(--bg-soft); }
.nav-link.is-active { background: var(--bg-strong); color: #fff; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.sync-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-soft); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); box-shadow: 0 0 0 4px color-mix(in srgb, var(--text-faint) 14%, transparent); }
.sync-pill.is-loading .status-dot { animation: pulse 1.3s ease-in-out infinite; }
.sync-pill.is-online { color: var(--green); border-color: color-mix(in srgb, var(--green) 28%, var(--border)); background: var(--green-soft); }
.sync-pill.is-online .status-dot { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.sync-pill.is-error { color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, var(--border)); background: var(--red-soft); }
.sync-pill.is-error .status-dot { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-elevated); cursor: pointer; transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.icon-button:hover { transform: translateY(-1px); border-color: var(--border-strong); background: var(--bg-soft); }
.icon-button svg { width: 18px; height: 18px; }
html[data-theme="dark"] .theme-icon-moon, html[data-theme="light"] .theme-icon-sun { display: none; }

.hero { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .55fr); gap: 28px; align-items: stretch; margin-bottom: 26px; }
.hero-copy { padding: 31px 3px 28px; }
.eyebrow, .section-kicker, .status-kicker { display: block; color: var(--brand); font-size: 11px; line-height: 1.2; font-weight: 850; text-transform: uppercase; letter-spacing: .12em; }
.hero h1, .fund-hero h1 { max-width: 760px; margin: 12px 0 14px; font-size: clamp(34px, 5vw, 62px); line-height: 1.01; letter-spacing: -.055em; }
.hero-copy > p, .fund-hero > div > p { max-width: 720px; margin: 0; color: var(--text-soft); font-size: clamp(15px, 1.7vw, 18px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 10px 16px; border-radius: 12px; border: 1px solid transparent; text-decoration: none; font-size: 13px; font-weight: 800; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease; }
.button svg { width: 18px; height: 18px; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); box-shadow: 0 12px 26px color-mix(in srgb, var(--brand) 22%, transparent); }
.button-primary:hover { box-shadow: 0 16px 32px color-mix(in srgb, var(--brand) 30%, transparent); }
.button-secondary { border-color: var(--border); background: var(--bg-elevated); color: var(--text); }
.button-secondary:hover { border-color: var(--border-strong); background: var(--bg-soft); }
.button[disabled] { opacity: .65; cursor: wait; transform: none; }
.hero-status { position: relative; overflow: hidden; display: flex; align-items: flex-end; min-height: 210px; padding: 26px; border-radius: var(--radius-lg); background: linear-gradient(145deg, #17264f, #0f1730); color: #fff; box-shadow: var(--shadow-md); }
.hero-status::after { content: ""; position: absolute; width: 170px; height: 170px; right: -38px; top: -48px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; }
.hero-status > div:last-child { position: relative; z-index: 2; }
.hero-status strong { display: block; margin-top: 8px; font-size: 22px; letter-spacing: -.03em; }
.hero-status p { max-width: 310px; margin: 6px 0 0; color: #aebbd3; font-size: 13px; }
.status-orbit { position: absolute; right: 27px; top: 25px; width: 74px; height: 74px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; animation: rotate 12s linear infinite; }
.status-orbit span { position: absolute; border-radius: 50%; background: var(--brand); }
.status-orbit span:nth-child(1) { width: 10px; height: 10px; left: 8px; top: 8px; }
.status-orbit span:nth-child(2) { width: 6px; height: 6px; right: 3px; top: 33px; background: #66a2ff; }
.status-orbit span:nth-child(3) { width: 8px; height: 8px; left: 31px; bottom: -4px; background: #23c98c; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { position: relative; overflow: hidden; min-height: 152px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-md); background: color-mix(in srgb, var(--bg-elevated) 94%, transparent); box-shadow: var(--shadow-sm); }
.metric-card::after { content: ""; position: absolute; right: -30px; bottom: -50px; width: 110px; height: 110px; border-radius: 50%; background: var(--bg-soft); opacity: .8; }
.metric-head { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--text-soft); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .055em; }
.metric-icon { width: 31px; height: 31px; display: grid; place-items: center; color: var(--text-soft); border-radius: 10px; background: var(--bg-soft); }
.metric-icon svg { width: 16px; height: 16px; }
.metric-value { position: relative; z-index: 1; display: block; margin-top: 15px; font-size: clamp(28px, 3.5vw, 40px); line-height: 1; letter-spacing: -.045em; }
.metric-value-text { font-size: 29px; }
.metric-card p { position: relative; z-index: 1; margin: 10px 0 0; color: var(--text-soft); font-size: 12px; }
.metric-positive .metric-value { color: var(--green); }
.metric-negative .metric-value { color: var(--red); }
.metric-positive .metric-icon { color: var(--green); background: var(--green-soft); }
.metric-negative .metric-icon { color: var(--red); background: var(--red-soft); }
.skeleton-text { min-width: 82px; min-height: 40px; border-radius: 9px; color: transparent; background: linear-gradient(90deg, var(--bg-soft), color-mix(in srgb, var(--bg-soft) 55%, var(--bg-elevated)), var(--bg-soft)); background-size: 220% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton-text.is-loaded { min-height: 0; color: inherit; background: none; animation: none; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, .82fr); gap: 18px; margin-bottom: 18px; }
.panel { border: 1px solid var(--border); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--bg-elevated) 96%, transparent); box-shadow: var(--shadow-sm); }
.performance-panel, .allocation-panel, .stats-panel, .matrix-panel { padding: 22px; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.panel-header.compact { margin-bottom: 12px; }
.panel-header h2, .section-heading-row h2, .insight-banner h2, .note-card h2 { margin: 6px 0 0; font-size: 19px; line-height: 1.25; letter-spacing: -.025em; }
.panel-header p, .section-heading-row p, .filter-row p { margin: 6px 0 0; color: var(--text-soft); font-size: 12px; }
.segmented { display: inline-flex; padding: 4px; border-radius: 11px; border: 1px solid var(--border); background: var(--bg-soft); }
.segmented button { min-width: 47px; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text-soft); font-size: 11px; font-weight: 850; cursor: pointer; }
.segmented button.is-active { background: var(--bg-elevated); color: var(--text); box-shadow: 0 3px 10px rgba(15, 23, 42, .08); }
.chart-wrap { position: relative; width: 100%; }
.chart-large { height: 390px; }
.chart-medium { height: 330px; }
.chart-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text-soft); font-size: 13px; background: color-mix(in srgb, var(--bg-elevated) 92%, transparent); border-radius: 14px; }
.chart-loading span { width: 17px; height: 17px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--brand); animation: rotate .8s linear infinite; }
.chart-loading[hidden] { display: none; }
.tiny-badge, .helper-chip { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-soft); color: var(--text-soft); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.allocation-chart-wrap { position: relative; height: 210px; margin: 2px 0 15px; }
.allocation-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.allocation-center strong { font-size: 24px; line-height: 1; }
.allocation-center span { margin-top: 5px; color: var(--text-soft); font-size: 10px; text-transform: uppercase; letter-spacing: .09em; }
.allocation-list { display: grid; gap: 8px; }
.allocation-row { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 11px; border: 1px solid var(--border); background: var(--bg-soft); }
.allocation-dot { width: 8px; height: 8px; border-radius: 50%; }
.allocation-row strong { font-size: 12px; }
.allocation-row span { color: var(--text-soft); font-size: 11px; }
.allocation-row b { font-size: 12px; }

.stats-panel { margin-bottom: 28px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 730px; }
.data-table th, .data-table td { padding: 13px 14px; border-bottom: 1px solid var(--border); text-align: right; font-size: 12px; }
.data-table th { position: sticky; top: 0; z-index: 1; background: var(--bg-soft); color: var(--text-soft); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: color-mix(in srgb, var(--bg-soft) 55%, transparent); }
.indicator-cell { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.series-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; }
.return-positive { color: var(--green); font-weight: 850; }
.return-negative { color: var(--red); font-weight: 850; }
.return-neutral { color: var(--text-faint); }
.loading-row td { padding: 30px; text-align: center !important; color: var(--text-soft); }

.history-section { margin-bottom: 24px; }
.section-heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.text-button { padding: 8px 0; border: 0; background: transparent; color: var(--brand); font-size: 12px; font-weight: 850; cursor: pointer; }
.text-button:hover { text-decoration: underline; }
.gain-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.gain-summary article { padding: 17px; border: 1px solid var(--border); border-radius: 15px; background: var(--bg-elevated); box-shadow: var(--shadow-sm); }
.gain-summary span { display: block; color: var(--text-soft); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.gain-summary strong { display: block; margin-top: 5px; color: var(--green); font-size: 24px; }
.gain-summary .gain-total { color: #fff; border-color: transparent; background: linear-gradient(135deg, #173e34, #102d27); }
.gain-summary .gain-total span { color: #a7c8bd; }
.gain-summary .gain-total strong { color: #6fe1b7; }
.event-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.event-item { display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 13px; min-height: 76px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-elevated); }
.event-item time { color: var(--text-soft); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.event-item strong, .event-item span { display: block; }
.event-item strong { font-size: 12px; }
.event-item span { margin-top: 2px; color: var(--text-soft); font-size: 10px; }
.event-item b { color: var(--green); font-size: 13px; }
.event-list.is-collapsed .event-item:nth-child(n+5) { display: none; }

.disclosure { display: flex; align-items: flex-start; gap: 14px; padding: 17px 18px; border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--border)); border-radius: 16px; background: var(--brand-soft); }
.disclosure-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--brand); }
.disclosure-icon svg { width: 18px; height: 18px; }
.disclosure strong { font-size: 13px; }
.disclosure p { margin: 4px 0 0; color: var(--text-soft); font-size: 11px; }

.site-footer { border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 92%, transparent); }
.footer-inner { min-height: 48px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; }
.footer-brand { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 850; }
.footer-brand span { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.footer-inner > p { margin: 0; text-align: center; color: var(--text-faint); font-size: 10px; }
.creator-badge { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--border)); border-radius: 999px; background: var(--brand-soft); color: var(--text-soft); font-size: 10px; text-decoration: none; transition: transform .2s ease, color .2s ease, background .2s ease, border-color .2s ease; }
.creator-badge strong { color: var(--brand); }
.creator-badge:hover { transform: translateY(-1px); color: var(--text); background: color-mix(in srgb, var(--brand) 18%, transparent); border-color: color-mix(in srgb, var(--brand) 42%, var(--border)); }

.toast { position: fixed; left: 50%; bottom: 22px; z-index: 100; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; max-width: min(420px, calc(100% - 32px)); padding: 11px 14px; border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-md); font-size: 12px; font-weight: 750; transition: opacity .2s ease, transform .2s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Fundamentals */
.fund-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 24px; padding: 20px 2px 7px; }
.fund-hero h1 { max-width: 760px; font-size: clamp(34px, 4.6vw, 58px); }
.fund-metrics { margin-bottom: 18px; }
.insight-banner { display: flex; align-items: flex-start; gap: 16px; padding: 20px 22px; margin-bottom: 18px; }
.insight-banner-icon { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 13px; color: var(--yellow); background: color-mix(in srgb, var(--yellow) 13%, transparent); }
.insight-banner-icon svg { width: 21px; height: 21px; }
.insight-banner p { margin: 7px 0 0; color: var(--text-soft); font-size: 12px; }
.tabs { position: sticky; top: 82px; z-index: 20; display: flex; gap: 4px; width: fit-content; max-width: 100%; overflow-x: auto; padding: 5px; margin: 0 0 18px; border: 1px solid var(--border); border-radius: 14px; background: color-mix(in srgb, var(--bg-elevated) 92%, transparent); backdrop-filter: blur(14px); }
.tab-button { min-height: 38px; padding: 8px 13px; border: 0; border-radius: 10px; background: transparent; color: var(--text-soft); font-size: 12px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.tab-button:hover { color: var(--text); background: var(--bg-soft); }
.tab-button.is-active { color: #fff; background: var(--bg-strong); }
.tab-panel { animation: fadeIn .24s ease; }
.filter-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.bank-filter { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.bank-filter button { min-height: 34px; padding: 7px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-elevated); color: var(--text-soft); font-size: 11px; font-weight: 850; cursor: pointer; }
.bank-filter button:hover { color: var(--text); border-color: var(--border-strong); }
.bank-filter button.is-active { color: #fff; border-color: var(--brand); background: var(--brand); }
.fund-chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
.fund-chart-grid .panel { padding: 21px; }
.matrix-panel { margin-bottom: 22px; }
.matrix-scroll { max-height: 650px; }
.matrix-table { min-width: 1020px; }
.matrix-table th:first-child, .matrix-table td:first-child { position: sticky; left: 0; z-index: 2; width: 220px; max-width: 220px; background: var(--bg-elevated); }
.matrix-table th:first-child { z-index: 4; background: var(--bg-soft); }
.matrix-table th:nth-child(2), .matrix-table td:nth-child(2) { position: sticky; left: 220px; z-index: 2; width: 160px; min-width: 160px; background: var(--bg-elevated); }
.matrix-table th:nth-child(2) { z-index: 4; background: var(--bg-soft); }
.matrix-table td { min-width: 120px; vertical-align: top; }
.matrix-table .bank-name { font-weight: 850; white-space: normal; }
.matrix-value { display: block; font-weight: 850; }
.matrix-yoy { display: block; margin-top: 3px; font-size: 10px; }
.metric-name { color: var(--text-soft); font-weight: 750; white-space: normal; }
.notes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.note-card { padding: 20px; border: 1px solid var(--border); border-left: 4px solid var(--green); border-radius: 17px; background: var(--bg-elevated); box-shadow: var(--shadow-sm); }
.note-card.note-watch { border-left-color: var(--yellow); }
.note-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bank-code { font-size: 11px; font-weight: 900; letter-spacing: .09em; }
.rating { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .055em; }
.rating-strong { color: var(--green); background: var(--green-soft); }
.rating-moderate { color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); }
.rating-watch { color: var(--yellow); background: color-mix(in srgb, var(--yellow) 13%, transparent); }
.note-card h2 { margin-top: 14px; font-size: 17px; }
.note-card p { margin: 8px 0 0; color: var(--text-soft); font-size: 12px; }
.note-card .note-trend { color: var(--text); }
.note-card .negative { color: var(--red); }

/* 404 */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.error-card { max-width: 620px; text-align: center; padding: 42px; border: 1px solid var(--border); border-radius: 28px; background: var(--bg-elevated); box-shadow: var(--shadow-md); }
.error-code { color: var(--brand); font-size: 80px; line-height: 1; font-weight: 900; letter-spacing: -.08em; }
.error-card h1 { margin: 12px 0 8px; font-size: 30px; }
.error-card p { margin: 0 auto 22px; color: var(--text-soft); }

@keyframes shimmer { to { background-position: -220% 0; } }
@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1040px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .allocation-panel { display: grid; grid-template-columns: minmax(250px, .75fr) minmax(280px, 1fr); column-gap: 20px; }
    .allocation-panel .panel-header { grid-column: 1 / -1; }
    .allocation-chart-wrap { margin: 0; }
    .fund-chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    .header-inner { grid-template-columns: auto 1fr; min-height: 66px; }
    .primary-nav { order: 3; grid-column: 1 / -1; justify-self: stretch; justify-content: center; margin-bottom: 9px; }
    .header-actions { justify-self: end; }
    .hero { grid-template-columns: 1fr; }
    .hero-copy { padding-bottom: 4px; }
    .hero-status { min-height: 175px; }
    .fund-hero { align-items: flex-start; flex-direction: column; }
    .tabs { top: 113px; }
    .filter-row { align-items: flex-start; flex-direction: column; }
    .bank-filter { justify-content: flex-start; }
    .notes-grid { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: auto auto; }
    .footer-inner > p { display: none; }
}

@media (max-width: 640px) {
    .shell { width: min(calc(100% - 22px), var(--shell)); }
    .main-shell { padding-block: 28px 40px; }
    .brand small { display: none; }
    .brand-mark { width: 36px; height: 36px; }
    .sync-pill { max-width: 112px; overflow: hidden; text-overflow: ellipsis; }
    .nav-link { flex: 1; text-align: center; padding-inline: 8px; }
    .hero h1, .fund-hero h1 { font-size: 39px; }
    .hero-actions { display: grid; grid-template-columns: 1fr; }
    .button { width: 100%; }
    .metric-grid { grid-template-columns: 1fr; }
    .metric-card { min-height: 138px; }
    .panel-header { flex-direction: column; }
    .segmented { width: 100%; }
    .segmented button { flex: 1; }
    .performance-panel, .allocation-panel, .stats-panel, .matrix-panel { padding: 16px; border-radius: 20px; }
    .chart-large { height: 330px; }
    .chart-medium { height: 290px; }
    .allocation-panel { display: block; }
    .allocation-chart-wrap { height: 195px; }
    .gain-summary { grid-template-columns: 1fr; }
    .event-list { grid-template-columns: 1fr; }
    .event-item { grid-template-columns: 78px 1fr auto; }
    .section-heading-row { align-items: flex-start; flex-direction: column; }
    .disclosure { padding: 15px; }
    .footer-inner { min-height: 58px; display: flex; justify-content: space-between; }
    .creator-badge { max-width: 190px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .matrix-table th:first-child, .matrix-table td:first-child { position: static; width: auto; max-width: none; }
    .matrix-table th:nth-child(2), .matrix-table td:nth-child(2) { position: static; width: auto; min-width: 150px; }
    .fund-hero .button { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Bank Q2 2026 updates */
.q2-spotlight { margin-bottom: 18px; padding: 22px; overflow: hidden; position: relative; }
.q2-spotlight::after { content: ''; position: absolute; inset: 0 0 auto auto; width: 260px; height: 260px; border-radius: 50%; transform: translate(34%, -48%); background: color-mix(in srgb, var(--brand) 11%, transparent); pointer-events: none; }
.q2-heading { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 18px; }
.q2-heading h2 { margin: 6px 0 5px; font-size: clamp(21px, 2.5vw, 30px); letter-spacing: -.035em; }
.q2-heading p { max-width: 700px; margin: 0; color: var(--text-soft); font-size: 12px; }
.update-badge { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 30px; padding: 6px 10px; border: 1px solid color-mix(in srgb, var(--brand) 32%, var(--border)); border-radius: 999px; color: var(--brand); background: var(--brand-soft); font-size: 10px; font-weight: 900; letter-spacing: .045em; text-transform: uppercase; }
.q2-kpi-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.q2-kpi-grid article { min-width: 0; padding: 15px; border: 1px solid var(--border); border-radius: 14px; background: color-mix(in srgb, var(--bg-soft) 70%, transparent); }
.q2-kpi-grid span, .q2-detail-grid span { display: block; color: var(--text-faint); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .045em; }
.q2-kpi-grid strong { display: block; margin-top: 7px; font-size: clamp(21px, 2.1vw, 29px); letter-spacing: -.035em; }
.q2-kpi-grid small, .q2-detail-grid small { display: block; margin-top: 4px; font-size: 10px; font-weight: 850; }
.q2-detail-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; margin-top: 12px; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--border); }
.q2-detail-grid > div { min-width: 0; padding: 12px 13px; background: var(--bg-elevated); }
.q2-detail-grid strong { display: block; margin-top: 5px; font-size: 16px; }
.q2-spotlight-nisp { border-color: color-mix(in srgb, var(--green) 30%, var(--border)); }
.q2-spotlight-nisp::after { background: color-mix(in srgb, var(--green) 16%, transparent); }
.section-kicker-nisp { color: var(--green); }
.update-badge-nisp { color: var(--green); border-color: color-mix(in srgb, var(--green) 34%, var(--border)); background: var(--green-soft); }
.update-badge-bbca { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 32%, var(--border)); background: var(--brand-soft); }
.q2-spotlight-bbca { border-color: color-mix(in srgb, var(--brand) 28%, var(--border)); }
.q2-spotlight-bbca::after { background: color-mix(in srgb, var(--brand) 15%, transparent); }
.q2-spotlight-bbni { border-color: color-mix(in srgb, var(--yellow) 34%, var(--border)); }
.q2-spotlight-bbni::after { background: color-mix(in srgb, var(--yellow) 18%, transparent); }
.section-kicker-bbni { color: var(--yellow); }
.update-badge-bbni { color: var(--yellow); border-color: color-mix(in srgb, var(--yellow) 38%, var(--border)); background: color-mix(in srgb, var(--yellow) 12%, transparent); }
.update-badge-secondary { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 32%, var(--border)); background: color-mix(in srgb, var(--blue) 11%, transparent); }
.insight-banner-nisp { border-color: color-mix(in srgb, var(--green) 28%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, var(--green) 9%, var(--bg-elevated)), var(--bg-elevated)); }
.insight-banner-nisp .insight-banner-icon { color: var(--green); background: var(--green-soft); }
.insight-banner-bbca { border-color: color-mix(in srgb, var(--brand) 26%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 8%, var(--bg-elevated)), var(--bg-elevated)); }
.insight-banner-bbca .insight-banner-icon { color: var(--brand); background: var(--brand-soft); }
.insight-banner-bmri { border-color: color-mix(in srgb, var(--blue) 26%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 8%, var(--bg-elevated)), var(--bg-elevated)); }
.insight-banner-bmri .insight-banner-icon { color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); }
.insight-banner-bbni { border-color: color-mix(in srgb, var(--yellow) 30%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, var(--yellow) 9%, var(--bg-elevated)), var(--bg-elevated)); }
.insight-banner-bbni .insight-banner-icon { color: var(--yellow); background: color-mix(in srgb, var(--yellow) 13%, transparent); }
.coverage-note { margin: -4px 0 14px; color: var(--text-faint); font-size: 10px; }
.matrix-pending { color: var(--text-faint); }
.note-card.note-featured { grid-column: span 2; }
.note-card.note-featured-nisp { border-left-color: var(--green); background: linear-gradient(135deg, color-mix(in srgb, var(--green) 8%, var(--bg-elevated)), var(--bg-elevated)); }
.note-card.note-featured-bbca { border-left-color: var(--brand); background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 7%, var(--bg-elevated)), var(--bg-elevated)); }
.note-card.note-featured-bmri { border-left-color: var(--blue); background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 7%, var(--bg-elevated)), var(--bg-elevated)); }
.note-card.note-featured-bbni { border-left-color: var(--yellow); background: linear-gradient(135deg, color-mix(in srgb, var(--yellow) 8%, var(--bg-elevated)), var(--bg-elevated)); }

@media (max-width: 900px) {
    .q2-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .q2-detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .q2-spotlight { padding: 17px; border-radius: 20px; }
    .q2-heading { flex-direction: column; gap: 12px; }
    .q2-kpi-grid { grid-template-columns: 1fr; }
    .q2-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .note-card.note-featured { grid-column: auto; }
}
@media (max-width: 620px) {
    .q2-detail-grid > div:last-child { grid-column: 1 / -1; }
}
