/* Trellia Portfolio Analytics design handoff overlay.
   This layer maps the prototype's visual system onto the live Jinja/JS app. */

@font-face {
    font-family: "Aeonik";
    src: url("/static/fonts/Aeonik-Light.woff2?v=85a636dcaac11ca9") format("woff2"),
         url("/static/fonts/Aeonik-Light.otf?v=d35e8cdca0b54583") format("opentype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Aeonik";
    src: url("/static/fonts/Aeonik-Regular.woff2?v=7ebabfba08aff260") format("woff2"),
         url("/static/fonts/Aeonik-Regular.otf?v=cdd8de1c7cb7a759") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Aeonik";
    src: url("/static/fonts/Aeonik-Bold.woff2?v=88c041e9df7f3631") format("woff2"),
         url("/static/fonts/Aeonik-Bold.otf?v=0b9aa117448147a6") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Rund Text";
    src: url("/static/fonts/RundText-Light.woff2?v=fc8f0063b7c80405") format("woff2"),
         url("/static/fonts/RundText-Light.otf?v=46438479b0821dad") format("opentype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light;

    --brand-dark-teal: #26474f;
    --brand-teal: #89b5ba;
    --brand-mid-teal: #4a8b92;
    --brand-warm-bg: #faf7f6;
    --brand-text-dark: #2a2b2c;
    --brand-gray: #545454;
    --brand-white: #ffffff;

    --teal-900: #1b363c;
    --teal-700: #3d6a72;
    --teal-300: #b6d2d5;
    --teal-100: #e8f0f1;

    --positive: #2c8d2c;
    --negative: #c0252a;
    --warning: #b46400;

    --bg-canvas: #ffffff;
    --bg-surface: #ffffff;
    --bg-subtle: #f5f6f7;
    --bg-paper: #fafafb;
    --fg-primary: #2a2b2c;
    --fg-heading: #26474f;
    --fg-secondary: #545454;
    --fg-tertiary: #8a8a8a;
    --border-hair: #ecedee;
    --border-default: #dee0e2;
    --border-strong: #c7cacd;
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-bg-strong: rgba(255, 255, 255, 0.88);
    --glass-border: rgba(38, 71, 79, 0.08);
    --grid-dot: rgba(38, 71, 79, 0.04);

    --font-sans: "Aeonik", "Helvetica Neue", Arial, system-ui, sans-serif;
    --font-mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
    --font-accent: "Rund Text", "Aeonik", sans-serif;

    --shadow-hair: 0 1px 0 rgba(38, 71, 79, 0.06);
    --shadow-md: 0 4px 16px -6px rgba(38, 71, 79, 0.14);
    --shadow-lg: 0 18px 48px -16px rgba(38, 71, 79, 0.28);
    --glow-teal: 0 1px 0 rgba(38, 71, 79, 0.04), 0 12px 36px -16px rgba(38, 71, 79, 0.14);

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --dur: 200ms;
    --nav-h: 60px;
    --row-h: 38px;

    /* Legacy variable aliases used by the existing CSS/JS widgets. */
    --bg-0: var(--bg-canvas);
    --bg-1: var(--bg-surface);
    --bg-2: var(--bg-subtle);
    --bg-3: var(--bg-paper);
    --fg-0: var(--fg-primary);
    --fg-1: var(--fg-primary);
    --fg-2: var(--fg-secondary);
    --fg-3: var(--fg-tertiary);
    --border-0: var(--border-hair);
    --border-1: var(--border-default);
    --border-hi: var(--border-strong);
    --accent: var(--brand-dark-teal);
    --accent-hi: var(--brand-dark-teal);
    --accent-lo: var(--teal-900);
    --accent-bg: rgba(38, 71, 79, 0.1);
    --ok: var(--positive);
    --warn: var(--warning);
    --danger: var(--negative);
    --info: var(--brand-mid-teal);
}

:root[data-density="compact"] { --row-h: 32px; }
:root[data-density="cozy"] { --row-h: 38px; }
:root[data-density="comfy"] { --row-h: 46px; }

:root[data-canvas="warm"] {
    --bg-canvas: #faf7f6;
    --grid-dot: rgba(38, 71, 79, 0.055);
}

:root[data-canvas="mist"] {
    --bg-canvas: #f2f5f6;
    --grid-dot: rgba(38, 71, 79, 0.05);
}

:root[data-canvas="dark"] {
    color-scheme: dark;
    --bg-canvas: #0e1012;
    --bg-surface: #16191c;
    --bg-subtle: #1c2024;
    --bg-paper: #1a1d20;
    --fg-primary: #e8eaec;
    --fg-heading: #ffffff;
    --fg-secondary: #a8adb2;
    --fg-tertiary: #6e7479;
    --border-hair: #24282c;
    --border-default: #2e333a;
    --border-strong: #3d434a;
    --glass-bg: rgba(22, 25, 28, 0.78);
    --glass-bg-strong: rgba(22, 25, 28, 0.92);
    --glass-border: rgba(255, 255, 255, 0.06);
    --grid-dot: rgba(255, 255, 255, 0.04);
    --teal-100: #2a4a52;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 300;
    line-height: 1.45;
    color: var(--fg-primary);
    background-color: var(--bg-canvas);
    background-image: radial-gradient(circle at 1px 1px, var(--grid-dot) 1px, transparent 0);
    background-size: 28px 28px;
    background-attachment: fixed;
    font-feature-settings: normal;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

body > main.shell {
    width: 100%;
    max-width: none;
    min-height: calc(100vh - var(--nav-h) - 8px);
    margin: 0;
    padding: 0 0 48px;
}

.mono,
.num,
.kbd,
.fund-row-apir,
.picker-table-head:where(:not(.sp-header)),
.picker-row:where(:not(.sp-row)) .apir,
.data-table .mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.muted { color: var(--fg-secondary); }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 400;
    color: var(--fg-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "-";
    color: var(--brand-teal);
    letter-spacing: 0;
}

.kbd {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    color: var(--fg-secondary);
    background: var(--bg-subtle);
    border: 1px solid var(--border-hair);
    border-radius: 3px;
    font-size: 10px;
    font-weight: 400;
}

/* Top nav — always visible, regardless of which container scrolls. */
.topnav {
    height: var(--nav-h);
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 24px;
    background: #fff;
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
}
body > main.shell {
    padding-top: var(--nav-h);
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--nav-h);
    padding-right: 20px;
    margin-right: 0;
    border-right: 1px solid var(--border-hair);
    color: var(--fg-heading);
    text-decoration: none;
    flex: 0 0 auto;
}

.brand-mark .brand-glyph {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
}

.brand-mark .name {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 14px;
    font-weight: 400;
    color: var(--fg-heading);
}

.brand-mark .sub {
    font-size: 11px;
    color: var(--fg-secondary);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.topnav ul.nav-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    height: var(--nav-h);
    margin: 0;
    padding: 0;
    list-style: none;
}

.topnav .nav-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: var(--nav-h);
    padding: 0 18px;
    border-radius: 0;
    color: var(--fg-secondary);
    background: transparent;
    box-shadow: none;
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
}

.topnav .nav-tabs li:first-child .nav-tab { padding-right: 22px; }

.topnav .nav-tab .num {
    color: var(--fg-tertiary);
    font-size: 10px;
}

.topnav .nav-tab:hover,
.topnav .nav-tab.active {
    color: var(--fg-heading);
    background: transparent;
}

.topnav .nav-tab.active::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: -1px;
    height: 2px;
    background: var(--brand-dark-teal);
}

.topnav .spacer { flex: 1 1 auto; }

.live-ticker {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 30px;
    max-width: 360px;
    padding: 0 18px;
    margin: 0 14px;
    overflow: hidden;
    position: relative;
    flex: 1 1 280px;
    background: var(--bg-surface);
    border: 1px solid var(--border-hair);
    border-radius: 999px;
}

.live-ticker .pulse {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--positive);
    position: relative;
    z-index: 3;
    flex-shrink: 0;
    animation: ticker-pulse 2.4s ease-out infinite;
}

.live-ticker::before,
.live-ticker::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 2;
    pointer-events: none;
}

.live-ticker::before {
    left: 0;
    width: 60px;
    background: linear-gradient(to right, var(--bg-surface) 0%, var(--bg-surface) 55%, transparent 100%);
}

.live-ticker::after {
    right: 0;
    width: 28px;
    background: linear-gradient(to left, var(--bg-surface) 30%, transparent 100%);
}

.ticker-track {
    display: flex;
    gap: 28px;
    white-space: nowrap;
    padding-right: 28px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--fg-secondary);
    animation: ticker-slide var(--ticker-duration, 38s) linear infinite;
}

.ticker-track .item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ticker-track .sym { color: var(--fg-heading); }
.ticker-track .v { color: var(--fg-primary); }
.ticker-track .delta.up { color: var(--positive); }
.ticker-track .delta.down { color: var(--negative); }
.ticker-track .delta.flat { color: var(--fg-secondary); }

@keyframes ticker-slide {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@keyframes ticker-pulse {
    0% { box-shadow: 0 0 0 0 rgba(44, 141, 44, 0.55); }
    60% { box-shadow: 0 0 0 9px rgba(44, 141, 44, 0); }
    100% { box-shadow: 0 0 0 0 rgba(44, 141, 44, 0); }
}

.search-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid var(--border-hair);
    border-radius: 4px;
    background: var(--bg-surface);
    color: var(--fg-secondary);
    font-size: 13px;
    font-weight: 300;
    transition: border-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}

.search-btn:hover {
    color: var(--fg-heading);
    border-color: var(--border-strong);
}

.search-btn span:first-of-type {
    flex: 1;
    text-align: left;
}

.icon-btn {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-hair);
    border-radius: 4px;
    background: transparent;
    color: var(--fg-secondary);
    margin-left: 8px;
    padding: 0;
}

.icon-btn:hover {
    color: var(--fg-heading);
    border-color: var(--border-strong);
}

.settings-wrap {
    position: relative;
    display: inline-flex;
}

.settings-btn.active {
    color: var(--brand-dark-teal);
    border-color: var(--brand-dark-teal);
    background: var(--teal-100);
}

.settings-pop {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 280px;
    padding: 14px;
    z-index: 100;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    box-shadow: 0 1px 0 rgba(38, 71, 79, 0.04), 0 24px 60px -20px rgba(38, 71, 79, 0.28);
}

.settings-pop::before {
    content: "";
    position: absolute;
    top: -5px;
    right: 10px;
    width: 10px;
    height: 10px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-default);
    border-left: 1px solid var(--border-default);
    transform: rotate(45deg);
}

.settings-section + .settings-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-hair);
}

.settings-label {
    margin-bottom: 9px;
    font-family: var(--font-mono);
    font-size: 9.5px;
    color: var(--fg-tertiary);
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.settings-canvas {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.settings-account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.settings-account-name {
    font-size: 12px;
    color: var(--fg-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-signout-form {
    flex: none;
    margin: 0;
}

.settings-signout {
    flex: none;
    font-size: 11.5px;
    text-decoration: none;
}

.canvas-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 6px 7px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--fg-secondary);
    cursor: pointer;
}

.canvas-swatch:hover,
.canvas-swatch.active {
    background: var(--bg-paper);
    color: var(--fg-heading);
}

.canvas-swatch.active {
    border-color: var(--brand-dark-teal);
}

.canvas-swatch .sw {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border-default);
    box-shadow: inset 0 0 0 2px var(--bg-surface), inset 0 0 0 3px rgba(38, 71, 79, 0.06);
}

.canvas-swatch .lab {
    font-size: 11px;
}

.settings-seg {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding: 3px;
    background: var(--bg-paper);
    border: 1px solid var(--border-default);
    border-radius: 8px;
}

.settings-seg-btn {
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--fg-secondary);
    padding: 7px 0;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 100ms ease-out, color 100ms ease-out;
}

.settings-seg-btn:hover:not(.active) {
    background: rgba(0, 0, 0, 0.04);
    color: var(--fg-primary);
}

.settings-seg-btn.active {
    background: var(--bg-surface);
    color: var(--fg-heading);
    box-shadow: 0 1px 2px rgba(38, 71, 79, 0.08);
}

.footer-stripe {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    height: 8px;
    background: var(--brand-dark-teal);
}

/* Shared issue / optimisation reporter ----------------------------------- */
.issue-reporter {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 60;
}

.issue-reporter-toggle {
    margin-left: 0;
    color: var(--fg-secondary);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
}

.issue-reporter-toggle.active {
    color: var(--brand-dark-teal);
    border-color: var(--brand-dark-teal);
    background: var(--teal-100);
}

.issue-reporter-toggle svg { width: 18px; height: 18px; }

.issue-reporter-panel {
    position: absolute;
    right: 0;
    bottom: 44px;
    width: min(390px, calc(100vw - 24px));
    padding: 16px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    background: var(--bg-surface);
    box-shadow: 0 1px 0 rgba(38, 71, 79, 0.04), 0 24px 60px -20px rgba(38, 71, 79, 0.28);
}

.issue-reporter textarea {
    display: block;
    width: 100%;
    min-height: 116px;
    resize: vertical;
    padding: 10px 11px;
    border: 1px solid var(--border-default);
    border-radius: 6px;
    outline: none;
    background: var(--bg-paper);
    color: var(--fg-primary);
    font: 12.5px/1.45 var(--font-sans);
}

.issue-reporter textarea::placeholder {
    color: var(--fg-tertiary);
    opacity: 1;
}

.issue-reporter textarea:focus {
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-teal) 12%, transparent);
}

.issue-reporter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.issue-reporter-attach,
.issue-reporter-submit {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    height: 32px;
    margin: 0;
    padding: 0 11px;
    border: 1px solid #26474f !important;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.issue-reporter-attach {
    border-color: var(--border-default) !important;
    background: #fff !important;
    color: var(--fg-secondary) !important;
}

.issue-reporter-attach:hover {
    border-color: var(--fg-secondary) !important;
    background: var(--bg-paper) !important;
    color: var(--fg-secondary) !important;
}

.issue-reporter-submit {
    margin-left: auto;
    background: #26474f !important;
    color: #fff !important;
}

.issue-reporter-submit:hover {
    border-color: #1d3940 !important;
    background: #1d3940 !important;
    color: #fff !important;
}

.issue-reporter-submit:disabled {
    cursor: wait;
    opacity: 0.65;
}

.issue-reporter-files {
    display: grid;
    gap: 5px;
    margin-top: 9px;
}

.issue-reporter-file {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 28px;
    padding: 5px 7px 5px 9px;
    border: 1px solid var(--border-hair);
    border-radius: 5px;
    background: var(--bg-paper);
    color: var(--fg-tertiary);
    font-size: 11px;
}

.issue-reporter-file-name {
    min-width: 0;
    flex: 1 1 auto;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.issue-reporter-file-delete {
    flex: none;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--fg-secondary);
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.issue-reporter-file-delete:hover { color: var(--fg-heading); }

.issue-reporter-status {
    min-height: 18px;
    margin: 8px 0 0;
    color: var(--fg-secondary);
    font-size: 11.5px;
}

.issue-reporter-status.error { color: var(--negative, var(--danger)); }
.issue-reporter-status.success { color: var(--positive, var(--ok)); }

@media (max-width: 560px) {
    .issue-reporter { right: 12px; bottom: 18px; }
    .issue-reporter-panel { width: calc(100vw - 24px); }
}

/* Workbench */
.workbench {
    display: grid;
    grid-template-columns: 296px minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
    min-height: calc(100vh - var(--nav-h) - 8px);
}

.workbench > .sidebar {
    position: sticky;
    top: var(--nav-h);
    align-self: start;
    height: calc(100vh - var(--nav-h) - 8px);
    display: flex;
    flex-direction: column;
    gap: 22px;
    overflow-y: auto;
    padding: 20px 20px 32px;
    background: transparent;
    border: 0;
    border-right: 1px solid var(--glass-border);
    border-radius: 0;
    box-shadow: none;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.selection-section {
    margin-top: 0;
}

.row-between,
.sb-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.fund-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0;
    margin-left: 8px;
    border-radius: 999px;
    background: var(--brand-dark-teal);
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0;
    text-align: center;
}

.btn-ghost {
    height: 22px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--fg-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.btn-ghost:hover {
    color: var(--fg-heading);
    background: transparent;
}

.segmented {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    padding: 2px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    backdrop-filter: blur(8px);
}

.segmented.three { grid-template-columns: repeat(3, 1fr); }
.segmented.four { grid-template-columns: repeat(4, 1fr); }

.seg {
    all: unset;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 28px;
    border-radius: 3px;
    color: var(--fg-secondary);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
    white-space: nowrap;
}

.seg:hover { color: var(--fg-heading); }

.seg.active {
    background: var(--brand-dark-teal);
    color: #ffffff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 6px 18px -8px rgba(38, 71, 79, 0.4);
}

:root[data-canvas="dark"] .seg.active {
    background: var(--brand-teal);
    color: var(--brand-dark-teal);
}

.fund-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fund-row-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fund-row-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2px;
    color: var(--fg-tertiary);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.fund-row {
    display: grid;
    grid-template-columns: 4px minmax(0, 1fr) 26px;
    align-items: stretch;
    gap: 0;
    padding: 0;
    overflow: hidden;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.fund-row:hover {
    border-color: var(--border-strong);
}

.fund-row-swatch {
    all: unset;
    width: 4px;
    align-self: stretch;
    min-height: 48px;
    cursor: pointer;
}

.fund-row-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    padding: 8px 4px 8px 10px;
    line-height: 1.25;
}

.fund-row-apir {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--fg-heading);
    font-size: 11px;
    font-weight: 400;
}

.fund-row-name {
    color: var(--fg-secondary);
    font-size: 11.5px;
    font-weight: 300;
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
    line-height: 1.3;
}

.fund-row-rm {
    all: unset;
    display: grid;
    place-items: center;
    width: 26px;
    color: var(--fg-tertiary);
    border-left: 1px solid var(--border-hair);
    cursor: pointer;
}

.fund-row-rm:hover {
    color: var(--negative);
    background: var(--bg-subtle);
}

.type-pill {
    display: inline-grid;
    place-items: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--teal-100);
    color: var(--brand-dark-teal);
    font-size: 9px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.add-fund {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    height: 36px;
    padding: 0 10px 0 12px;
    background: var(--glass-bg);
    border: 1px dashed var(--border-default);
    border-radius: 4px;
    color: var(--fg-secondary);
    font-size: 12px;
    font-weight: 400;
}

.add-fund:hover {
    color: var(--fg-heading);
    background: var(--bg-surface);
    border-style: solid;
    border-color: var(--brand-dark-teal);
    box-shadow: 0 0 0 4px rgba(38, 71, 79, 0.06);
}

.add-fund .kbd { margin-left: auto; }

.select {
    height: 32px;
    width: 100%;
    padding: 0 28px 0 10px;
    color: var(--fg-primary);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-hair);
    border-radius: 4px;
    font-size: 12.5px;
    font-weight: 400;
}

.slider-wrap {
    --slider-track-height: 4px;
    --slider-thumb-size: 14px;
    position: relative;
    height: 28px;
    margin: 4px 0;
}

.slider-track,
.slider-track-bg {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: var(--slider-track-height);
    transform: translateY(-50%);
    border-radius: 999px;
    background: var(--bg-subtle);
}

.slider-fill {
    background: var(--brand-dark-teal);
    border-radius: 999px;
}

.slider-thumb::-webkit-slider-thumb {
    width: var(--slider-thumb-size);
    height: var(--slider-thumb-size);
    background: #ffffff;
    border: 2px solid var(--brand-dark-teal);
    border-radius: 50%;
    margin-top: calc((var(--slider-track-height) - var(--slider-thumb-size)) / 2);
}

.window-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    color: var(--fg-primary);
    font-size: 11px;
}

.window-summary .window-label {
    color: var(--fg-tertiary);
    font-family: var(--font-sans);
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.switch {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--fg-primary);
    font-size: 12.5px;
    font-weight: 400;
}

.switch-track {
    width: 30px;
    height: 18px;
    background: var(--border-default);
    border: 0;
}

.switch-thumb {
    width: 14px;
    height: 14px;
    background: #ffffff;
}

.switch input:checked + .switch-track {
    background: var(--brand-dark-teal);
    border-color: var(--brand-dark-teal);
}

.canvas {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 14px;
    padding: 18px 24px 24px;
}

.insights-ribbon {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.insights-ribbon[hidden] {
    display: none !important;
}

.insights-ribbon .ribbon-rule {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--brand-dark-teal) 0%, var(--brand-mid-teal) 50%, #b8c7d9 100%);
}

.insights-ribbon .ribbon-tag {
    flex-shrink: 0;
    margin-left: 8px;
    padding: 4px 8px;
    border: 1px solid var(--border-default);
    border-radius: 999px;
    color: var(--brand-dark-teal);
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.16em;
}

.insights-ribbon .ribbon-body {
    flex: 1;
    color: var(--fg-primary);
    font-size: 12.5px;
    line-height: 1.5;
}

.insights-ribbon .ribbon-fund {
    color: var(--fg-heading);
    font-weight: 400;
}

.insights-ribbon .ribbon-num {
    font-family: var(--font-mono);
}

.insights-ribbon .ribbon-num.neu { color: var(--brand-dark-teal); }
.insights-ribbon .ribbon-num.pos { color: var(--positive); }
.insights-ribbon .ribbon-num.neg { color: var(--negative); }

.insights-ribbon .ribbon-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
    color: var(--fg-tertiary);
    font-family: var(--font-mono);
    font-size: 10px;
}

.canvas-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 0 4px 4px;
    flex-wrap: wrap;
}

.canvas-head h2 {
    margin: 4px 0 0;
    color: var(--fg-heading);
    font-family: var(--font-sans);
    font-size: 30px;
    font-weight: 400;
    line-height: 1.18;
}

.canvas-meta {
    display: flex;
    align-items: flex-end;
    gap: 24px;
}

.kpi {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.kpi .lab {
    color: var(--fg-secondary);
    font-size: 9.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.kpi .lab::before {
    content: ".";
    margin-right: 4px;
    color: var(--brand-teal);
}

.kpi .val {
    color: var(--fg-heading);
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 400;
}

.kpi .val.pos { color: var(--positive); }
.kpi .val.neg { color: var(--negative); }

.view-tabs,
.portfolios-workbench .tabs {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--glass-border);
    border-radius: 0;
}

.view-tab,
.portfolios-workbench .tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 0 auto;
    height: 38px;
    padding: 0 22px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--fg-secondary);
    font-size: 12.5px;
    font-weight: 400;
    /* Anchor-based tabs (pm sub-nav) must render exactly like button tabs —
       no browser link underline. */
    text-decoration: none;
    cursor: pointer;
}

.view-tab:hover,
.portfolios-workbench .tab:hover {
    color: var(--fg-heading);
}

.view-tab.active,
.portfolios-workbench .tab.active {
    color: var(--fg-heading);
    background: transparent;
    box-shadow: none;
}

.view-tab.active::after,
.portfolios-workbench .tab.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--brand-teal), var(--brand-dark-teal));
}

.view-tab.disabled {
    color: var(--fg-tertiary);
    opacity: 0.55;
    cursor: pointer;
}

.view-tab-badge {
    display: none;
    padding: 1px 6px;
    border: 1px solid var(--border-hair);
    border-radius: 999px;
    background: var(--bg-surface);
    color: var(--fg-tertiary);
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-transform: uppercase;
}

.view-tab.disabled .view-tab-badge {
    display: inline-flex;
}

.chart-container {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 520px;
    padding: 18px;
    overflow: hidden;
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    box-shadow: var(--glow-teal);
    backdrop-filter: saturate(160%) blur(14px);
}

.chart-container::before {
    content: "";
    position: absolute;
    top: 12px;
    right: 12px;
    width: 14px;
    height: 14px;
    border-top: 1px solid var(--glass-border);
    border-right: 1px solid var(--glass-border);
    pointer-events: none;
}

.chart-legend {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 0;
    padding: 0 0 6px;
    border-bottom: 0;
}

.chart-legend.chart-legend-active:not(:empty) {
    display: flex;
}

.legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 10px;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: var(--glass-bg);
    color: var(--fg-primary);
    font-size: 11px;
    backdrop-filter: blur(8px);
}

.legend-chip .legend-line,
.legend-line {
    width: 18px;
    border-radius: 1px;
}

.legend-chip .legend-apir,
.legend-apir {
    color: var(--fg-heading);
    font-size: 11px;
    font-weight: 400;
}

.legend-name {
    color: var(--fg-secondary);
}

.chart-root {
    width: 100%;
    flex: 1 1 auto;
    min-height: 460px;
    height: 460px;
}

.chart-empty {
    position: absolute;
    inset: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    background: var(--bg-surface);
}

.placeholder {
    border: 1px dashed var(--border-default);
    border-radius: 6px;
    color: var(--fg-secondary);
    background: var(--bg-surface);
}

.placeholder h2 {
    color: var(--fg-heading);
    font-weight: 400;
}

.u-wrap { font-family: var(--font-sans); }
.u-legend { display: none; }
.u-axis { color: var(--fg-secondary); }
.u-cursor-x,
.u-cursor-y {
    background: var(--fg-tertiary);
    opacity: 0.55;
}

.summary-wrap.table-wrap {
    margin-top: 0;
    overflow: auto;
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    box-shadow: var(--glow-teal);
    backdrop-filter: blur(10px);
}

.summary-wrap .data-table thead th {
    background: transparent;
}

.summary-wrap .data-table {
    min-width: 900px;
}

.summary-wrap .fund-swatch {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 999px;
}

.delta-pos { color: var(--positive) !important; }
.delta-neg { color: var(--negative) !important; }
.coverage-partial { color: var(--negative) !important; }
.coverage-red { color: var(--negative) !important; font-weight: 500; }

/* Availability and tables */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 48px;
    flex-wrap: wrap;
    margin: 0;
    /* Right padding matches the topnav settings-button right gap (24px),
       so the stat-row and the right edge of every page line up with the
       gear icon column. Left padding stays at 40px to align with the
       sidebar grid margin. */
    padding: 32px 24px 24px 40px;
    border-bottom: 1px solid var(--glass-border);
    position: relative;
}

.page-header::after {
    content: "";
    position: absolute;
    left: 40px;
    bottom: -1px;
    width: 64px;
    height: 2px;
    background: linear-gradient(90deg, var(--brand-dark-teal), transparent);
}

.title-block {
    max-width: 560px;
}

.title-block h1 {
    margin: 0;
    color: var(--fg-heading);
    font-family: var(--font-sans);
    font-size: 40px;
    font-weight: 400;
    line-height: 1.05;
}

.title-block p {
    max-width: 520px;
    margin: 12px 0 0;
    color: var(--fg-secondary);
    font-size: 14px;
    font-weight: 300;
    line-height: 1.55;
}

.stat-row {
    display: flex;
    align-items: flex-end;
    gap: 36px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat .label,
.stat .lab {
    color: var(--fg-secondary);
    font-size: 9.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.stat .value,
.stat .val {
    color: var(--fg-heading);
    font-family: var(--font-mono);
    font-size: 26px;
    font-weight: 400;
    line-height: 1;
}

.stat .value-note,
.stat .sub {
    margin-left: 4px;
    color: var(--fg-secondary);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 300;
}

.stat .value.accent,
.stat .val.accent {
    color: var(--brand-dark-teal);
}

.page-header [data-availability-stats]:not([hidden]),
.page-header [data-modelling-stats]:not([hidden]),
.page-header [data-validation-header-stats]:not([hidden]) {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 36px;
    flex-wrap: wrap;
    margin-left: auto;
}

.page-header [data-availability-stats] > .stat,
.page-header [data-modelling-stats] > .stat,
.page-header [data-validation-header-stats] > .stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.page-header [data-availability-stats] .label,
.page-header [data-modelling-stats] .label,
.page-header [data-validation-header-stats] .label {
    color: var(--fg-secondary);
    font-family: var(--font-sans);
    font-size: 9.5px;
    font-style: normal;
    font-weight: 400;
    letter-spacing: 0.14em;
    line-height: 1.2;
    text-transform: uppercase;
}

.page-header [data-availability-stats] .value,
.page-header [data-modelling-stats] .value,
.page-header [data-validation-header-stats] .value {
    color: var(--fg-heading);
    font-family: var(--font-mono);
    font-size: 20px;
    font-style: normal;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.page-header [data-availability-stats] .value-note,
.page-header [data-modelling-stats] .value-note,
.page-header [data-validation-header-stats] .value-note {
    margin-left: 4px;
    color: var(--fg-secondary);
    font-family: var(--font-sans);
    font-size: 11px;
    font-style: normal;
    font-weight: 300;
    line-height: 1;
    vertical-align: baseline;
}

.page-header [data-availability-stats] .value.accent,
.page-header [data-modelling-stats] .value.accent,
.page-header [data-validation-header-stats] .value.accent {
    color: var(--brand-dark-teal);
}

.table-panel {
    /* Right margin matches the page-header right padding (24px) so the
       table panel aligns with the topnav settings button. Left stays at
       40px for the sidebar gutter. */
    margin: 0 24px 40px 40px;
    overflow: hidden;
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    box-shadow: var(--glow-teal);
    backdrop-filter: blur(12px);
}

.table-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--glass-border);
}

.table-search {
    width: 280px;
    height: 32px;
    padding: 0 12px 0 32px;
    background-color: var(--bg-paper);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23545454' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='M21 21l-4.3-4.3'/></svg>");
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 14px;
    border: 1px solid var(--border-hair);
    border-radius: 4px;
    color: var(--fg-primary);
    font-size: 12.5px;
}

.table-filter-count {
    margin-left: auto;
}

.table-wrap {
    overflow: auto;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.table-panel > .table-wrap {
    max-height: calc(100vh - 320px);
}

.data-table {
    width: 100%;
    min-width: 1180px;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 12.5px;
}

.data-table[data-fit-container="1"] {
    min-width: 0;
}

.data-table.resizable-columns.resizable-ready {
    table-layout: fixed;
}

.data-table.resizable-columns.resizable-ready thead th,
.data-table.resizable-columns.resizable-ready tbody td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    vertical-align: middle;
}

.data-table.resizable-columns.resizable-ready tbody td {
    height: auto;
    line-height: 1.4;
    padding-top: calc((var(--row-h) - 1.4em) / 2);
    padding-bottom: calc((var(--row-h) - 1.4em) / 2);
    padding-left: 14px;
    padding-right: 14px;
}

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px 14px;
    background: var(--bg-paper);
    color: var(--fg-secondary);
    border-bottom: 1px solid var(--glass-border);
    font-size: 9.5px;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table tbody td {
    height: var(--row-h);
    padding: 0 14px;
    border-bottom: 1px solid var(--glass-border);
    color: var(--fg-primary);
    font-weight: 300;
    white-space: nowrap;
    vertical-align: middle;
}

.data-table tbody tr:hover td {
    background: linear-gradient(90deg, rgba(38, 71, 79, 0.05), transparent);
}

.data-table .td-strong,
.data-table .strong {
    color: var(--fg-heading);
    font-weight: 400;
}

.data-table th.num,
.data-table td.num,
.data-table th.r,
.data-table td.r {
    text-align: right;
}

.sortable-col::after {
    color: var(--fg-tertiary);
}

.proxy-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 8px;
    background: var(--teal-100);
    border: 1px solid var(--teal-300);
    border-radius: 999px;
    color: var(--brand-dark-teal);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
}

.proxy-chip-off {
    background: var(--bg-paper);
    border-color: var(--border-hair);
    color: var(--fg-tertiary);
}

.proxy-chip .bps,
.bps {
    padding: 1px 7px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 10px;
}

.bps-drag,
.bps.drag {
    background: rgba(192, 37, 42, 0.1);
    color: var(--negative);
}

.bps-boost,
.bps.boost {
    background: rgba(44, 141, 44, 0.1);
    color: var(--positive);
}

.btn {
    /* Explicit border (not just border-color) so the user-agent's default
       outset/groove style on <button> doesn't bleed through. */
    border: 1px solid var(--border-hair);
    border-radius: 6px;
    background: var(--bg-surface);
    color: var(--fg-primary);
    font-family: inherit;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    transition: background-color 120ms ease-out, opacity 120ms ease-out,
                border-color 120ms ease-out, transform 80ms ease-out;
}

.btn:hover {
    background: var(--bg-paper);
    border-color: var(--border-strong);
}

.btn.primary {
    background: var(--brand-dark-teal);
    border-color: var(--brand-dark-teal);
    color: #ffffff;
}

.modelling-form .btn.primary.settings-action-btn:not([hidden]),
.validation-sidebar .btn.primary.settings-action-btn:not([hidden]),
.pm-page .sidebar .btn.primary.settings-action-btn:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 34px;
    min-height: 34px;
    max-height: 34px;
    flex: 0 0 34px;
    padding: 2px;
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    background:
        linear-gradient(var(--brand-dark-teal), var(--brand-dark-teal)) content-box,
        var(--glass-bg) border-box;
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 400;
    line-height: normal;
    letter-spacing: 0;
    text-transform: none;
    box-shadow: none;
    opacity: 1;
}

.modelling-form .btn.primary.settings-action-btn:disabled,
.modelling-form .btn.primary.settings-action-btn[disabled],
.validation-sidebar .btn.primary.settings-action-btn:disabled,
.validation-sidebar .btn.primary.settings-action-btn[disabled],
.pm-page .sidebar .btn.primary.settings-action-btn:disabled,
.pm-page .sidebar .btn.primary.settings-action-btn[disabled] {
    opacity: 1;
}

:root[data-canvas="dark"] .modelling-form .btn.primary.settings-action-btn,
:root[data-canvas="dark"] .validation-sidebar .btn.primary.settings-action-btn,
:root[data-canvas="dark"] .pm-page .sidebar .btn.primary.settings-action-btn {
    color: var(--brand-dark-teal);
    background:
        linear-gradient(var(--brand-teal), var(--brand-teal)) content-box,
        var(--glass-bg) border-box;
}

.btn.primary:hover {
    /* Keep the brand colour, just lift it slightly. The default .btn:hover
       resets the background to bg-paper which clashes with primary. */
    background: var(--brand-dark-teal);
    border-color: var(--brand-dark-teal);
    opacity: 0.85;
}

.btn:disabled,
.btn[disabled] {
    cursor: not-allowed;
    opacity: 0.5;
}

.btn.primary:disabled:hover,
.btn.primary[disabled]:hover {
    /* Don't intensify hover on disabled buttons. */
    opacity: 0.5;
}

/* Picker */
.picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 72px 16px 24px;
    background: rgba(20, 39, 43, 0.18);
    backdrop-filter: blur(4px);
    animation: picker-fade var(--dur) var(--ease);
}

.picker-overlay.open { display: flex; }

@keyframes picker-fade { from { opacity: 0; } to { opacity: 1; } }

.picker {
    width: min(960px, calc(100vw - 32px));
    height: min(720px, calc(100vh - 96px));
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    box-shadow: 0 24px 80px -20px rgba(38, 71, 79, 0.5);
    backdrop-filter: saturate(180%) blur(20px);
    animation: picker-pop var(--dur) var(--ease);
}

@keyframes picker-pop {
    from { transform: translateY(-8px) scale(0.98); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

.picker-header {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 50px;
    padding: 0 14px;
    border-bottom: 1px solid var(--glass-border);
    color: var(--fg-secondary);
}

.picker-header::before {
    content: ">";
    margin-left: 4px;
    margin-right: -4px;
    color: var(--brand-teal);
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
}

.picker-header input {
    flex: 1;
    height: 28px;
    border: 0;
    background: transparent;
    color: var(--fg-primary);
    font-size: 14px;
    font-weight: 300;
}
.picker-header input:focus-visible { outline: none; box-shadow: none; }

.picker-tabs {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
    min-height: 42px;
    padding: 0 10px;
    border-bottom: 1px solid var(--glass-border);
    background: var(--bg-paper);
    overflow-x: auto;
    scrollbar-width: thin;
}

.picker-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    height: 42px;
    min-width: 0;
    padding: 0 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--fg-secondary);
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.picker-tab + .picker-tab::before {
    content: "";
    position: absolute;
    left: 0;
    top: 13px;
    bottom: 13px;
    width: 1px;
    background: var(--glass-border);
}

.picker-tab:hover,
.picker-tab.active {
    background: transparent;
    color: var(--fg-heading);
}

.picker-tab.active {
    box-shadow: inset 0 0 0 1px var(--border-1);
}

.picker-tab.active::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: -1px;
    height: 2px;
    background: var(--brand-dark-teal);
}

.picker-group-controls {
    background: var(--bg-paper);
    border-bottom: 1px solid var(--glass-border);
}

.picker-group-tile {
    border-color: var(--glass-border);
    color: var(--fg-secondary);
    border-radius: 4px;
}

.picker-group-tile:hover,
.picker-group-tile.active {
    background: linear-gradient(90deg, rgba(38, 71, 79, 0.07), transparent);
    border-color: var(--brand-teal);
    color: var(--fg-heading);
}

.picker-results {
    flex: 1;
    overflow-y: auto;
    padding: 0 4px 4px;
}

.picker-table-head:where(:not(.sp-header)),
.picker-row:where(:not(.sp-row)) {
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
}

.picker-table-head:where(:not(.sp-header)) {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--bg-surface);
    color: var(--fg-secondary);
    border-bottom: 1px solid var(--glass-border);
    font-size: 10.5px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: 0 -8px 0 8px var(--bg-surface);
}

.picker-row:where(:not(.sp-row)) {
    color: var(--fg-secondary);
    border-left: 2px solid transparent;
    border-radius: 4px;
    font-size: 12.5px;
}
.picker-row:where(:not(.sp-row)) .apir {
    color: var(--fg-secondary);
    font-weight: 400;
}

.picker-accordion-head:where(:not(.sp-group-toggle)) {
    color: var(--fg-primary);
    border-left: 2px solid transparent;
    border-radius: 4px;
}

.picker-accordion-head:where(:not(.sp-group-toggle)):hover {
    background: linear-gradient(90deg, rgba(38, 71, 79, 0.07), transparent);
    border-left-color: var(--brand-teal);
}

.picker-accordion-head:where(:not(.sp-group-toggle)).level-1 {
    background: var(--bg-paper);
    color: var(--fg-heading);
}

.picker-accordion-head:where(:not(.sp-group-toggle)).level-2 {
    color: var(--fg-primary);
    font-weight: 500;
}

.picker-row:where(:not(.sp-row)):hover,
.picker-results.keyboard-nav .picker-row:where(:not(.sp-row)).active {
    background: linear-gradient(90deg, rgba(38, 71, 79, 0.07), transparent);
    border-left-color: var(--brand-teal);
    color: var(--fg-secondary);
}

.picker-row:where(:not(.sp-row)).added,
.picker-row:where(:not(.sp-row)).added:hover,
.picker-row:where(:not(.sp-row)).added.active,
.picker-accordion-line:where(:not(.sp-group)).added,
.picker-carveout-row:where(:not(.sp-row)).added {
    background: var(--accent-bg);
}
.picker-row:where(:not(.sp-row)).added::after { content: none; display: none; }

.picker-footer {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 14px;
    border-top: 1px solid var(--glass-border);
    background: var(--bg-paper);
    color: var(--fg-secondary);
    font-size: 11px;
}
.picker-footer .spacer { flex: 1; }

/* Portfolio-specific tab panes */
.coverage-banner {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
}

.coverage-banner .coverage-pct {
    color: var(--fg-heading);
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 400;
}

.coverage-banner .coverage-detail {
    color: var(--fg-secondary);
    font-size: 11px;
}

.tab-section {
    padding: 14px 16px;
}

/* Dialog and popover theme hooks */
.fund-settings-pop,
.proxy-modal {
    background: var(--bg-surface);
    color: var(--fg-primary);
    border-color: var(--border-strong);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

@media (max-width: 1180px) {
    .live-ticker {
        display: none;
    }
}

@media (max-width: 960px) {
    .topnav {
        padding: 0 12px;
    }

    .brand-mark {
        padding-right: 14px;
        margin-right: 8px;
    }

    .brand-mark .sub,
    .search-btn span:first-of-type {
        display: none;
    }

    .search-btn {
        min-width: 0;
        width: auto;
    }

    .workbench {
        grid-template-columns: 1fr;
    }

    .workbench > .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--glass-border);
    }

    .canvas {
        padding: 16px;
    }

    .table-panel {
        margin: 0 16px 32px;
    }

    .page-header {
        padding: 24px 16px 20px;
    }

    .page-header::after {
        left: 16px;
    }
}

@media (max-width: 640px) {
    .topnav .nav-tab {
        padding: 0 10px;
    }

    .topnav .nav-tab .num {
        display: none;
    }

    .canvas-meta {
        width: 100%;
        justify-content: space-between;
    }

    .insights-ribbon {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .table-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .table-search {
        width: 100%;
    }
}

/* Pill chips used by the Modelling page's holdings-mapping table. */
.pill {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
}
.pill-ok    { background: rgba(34, 139, 34, 0.15); color: #2c8d2c; }
.pill-warn  { background: rgba(180, 100, 0, 0.15); color: #b46400; }
