/* Soft Layered design system — full token + component set
   Scoped under `.sx` so old style.css keeps working on un-migrated screens.
   When a screen is migrated, its container gets `class="sx"` and inherits
   the entire token + component set below. */

:root {
    --sx-bg-from: #f5f1ea;
    --sx-bg-to:   #ebe6dc;
    --sx-surface: #fdfbf6;
    --sx-text:    #2a2825;
    --sx-muted:   #656259;
    --sx-muted-2: #656259;
    --sx-faint:   #777368;
    --sx-soft-1:  rgba(0,0,0,0.02);
    --sx-soft-2:  rgba(0,0,0,0.03);
    --sx-soft-3:  rgba(0,0,0,0.04);
    --sx-soft-4:  rgba(0,0,0,0.05);
    --sx-soft-6:  rgba(0,0,0,0.06);
    --sx-row-hover: #f5f1ea;
    --sx-accent:  #b85c2a;
    --sx-pos:     #3a7a4a;
    --sx-neg:     #b54a3e;
    --bw-bonds:   var(--sx-text);
    --bw-equity:  var(--sx-accent);
    --bw-theme:   color-mix(in srgb, var(--sx-accent) 45%, var(--sx-bg-to));
    --bw-stock:   var(--sx-faint);
    --sx-card-radius: 14px;
    --sx-card-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 6px 18px -8px rgba(80,70,50,0.12);
    --sx-card-border: 1px solid rgba(0,0,0,0.04);
    --sx-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
    /* Numeric / ticker cells used to render in IBM Plex Mono via this variable.
       The app now uses a single sans stack everywhere (matches the watchlist's
       Helvetica-tabular look); --sx-mono is aliased to --sx-sans so existing
       `font-family: var(--sx-mono)` rules don't need touching. A real
       monospace stack is preserved as --sx-mono-strict for the rare case
       (raw JSON, debug panes) that genuinely needs fixed-width glyphs. */
    --sx-mono: "Helvetica Neue", Helvetica, Arial, sans-serif;
    --sx-mono-strict: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;
    /* Standard text-size scale — use these in inline styles instead of raw px/rem values */
    --sx-fs-tiny:  10px;   /* badges, option sub-labels */
    --sx-fs-xs:    10.5px; /* micro labels (same as .soft-micro) */
    --sx-fs-sm:    11px;   /* small secondary text, sub-lines */
    --sx-fs-base:  13px;   /* body, table cells, buttons */
    --sx-fs-md:    14px;   /* slightly prominent labels */
}

/* Container — the entry point. Apply to the wrapper of any migrated screen. */
.sx {
    font-family: var(--sx-sans);
    font-size: 13px;
    color: var(--sx-text);
    background: linear-gradient(180deg, var(--sx-bg-from) 0%, var(--sx-bg-to) 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.sx *, .sx *::before, .sx *::after { box-sizing: border-box; }
.sx h1, .sx h2, .sx h3 { margin: 0; font-weight: 500; letter-spacing: -0.02em; }

/* Type utilities */
.sx .num     { font-variant-numeric: tabular-nums; }
/* `.mono` is the class numeric cells use throughout the app. Despite the name,
   it renders in the sans stack with tabular-nums so percentages and prices
   match the watchlist look (Helvetica-Neue tabular). The literal monospace
   stack is still available via `font-family: var(--sx-mono)` and is used for
   ticker symbols (.col-ticker) and short CCY badges where mono is intentional. */
.sx .mono    { font-family: var(--sx-sans); font-variant-numeric: tabular-nums; }
.sx .pos     { color: var(--sx-pos); }
.sx .neg     { color: var(--sx-neg); }
.sx .acc     { color: var(--sx-accent); }
.sx .muted   { color: var(--sx-muted); }
.sx .muted-2 { color: var(--sx-muted-2); }
.sx .micro {
    font-size: 10.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sx-muted-2);
    font-weight: 500;
}

/* Card surface — the only "container" affordance. Hierarchy comes from layering, not borders. */
.sx .card {
    background: var(--sx-surface);
    border-radius: var(--sx-card-radius);
    box-shadow: var(--sx-card-shadow);
    border: var(--sx-card-border);
}

/* Row hover — used in any list/table */
.sx .row {
    transition: background 140ms;
    cursor: pointer;
}
.sx .row:hover { background: var(--sx-row-hover); }

/* Pills (tag-style) */
.sx .pill {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 11.5px;
    background: var(--sx-soft-3);
    color: var(--fp-muted, #5a5750);
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.sx .pill.on { background: var(--sx-text); color: var(--sx-surface); }

/* Buttons */
.sx .btn-prim {
    background: var(--sx-accent);
    color: var(--sx-surface);
    height: 36px;
    padding: 0 16px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 6px -2px rgba(var(--fp-accent-rgb, 184,92,42),0.5);
    font-family: inherit;
    transition: filter 120ms;
}
.sx .btn-prim:hover { filter: brightness(0.95); }
.sx .btn-ghost {
    background: var(--sx-soft-2);
    color: var(--sx-text);
    height: 36px;
    padding: 0 14px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: background 120ms;
}
.sx .btn-ghost:hover { background: rgba(0,0,0,0.07); }
.sx .btn-dark {
    background: var(--sx-text);
    color: var(--sx-surface);
    height: 36px;
    padding: 0 16px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}
/* btn-sm is also used by legacy .btn buttons elsewhere (where it means "small chip"),
   so scope this size override only to soft-system buttons. */
.sx .btn-prim.btn-sm,
.sx .btn-ghost.btn-sm,
.sx .btn-dark.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }

/* Top nav links */
.sx .nav {
    font-size: 13px;
    color: var(--sx-muted);
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 8px;
    background: none;
    border: none;
    font-family: inherit;
    text-decoration: none;
}
.sx .nav.on { background: var(--sx-soft-4); color: var(--sx-text); font-weight: 500; }
.sx .nav .nav-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 16px;
    padding: 0 5px;
    margin-left: 6px;
    background: var(--sx-accent);
    color: var(--sx-surface);
    font-family: var(--sx-mono);
    font-variant-numeric: tabular-nums;
    font-size: 9.5px;
    font-weight: 600;
    border-radius: 999px;
    vertical-align: middle;
}

/* Sub-tabs (within a card) */
.sx .tab {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--sx-muted);
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
}
.sx .tab.on, .sx .tab.active { background: var(--sx-text); color: var(--sx-surface); }

/* Inputs */
.sx .input {
    background: var(--sx-soft-2);
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    outline: none;
    font-family: inherit;
    color: var(--sx-text);
}
.sx .input:focus {
    background: var(--sx-surface);
    border-color: rgba(0,0,0,0.08);
}
.sx .input::placeholder { color: var(--sx-muted-2); }

/* Ticker chip — dark mono badge */
.sx .chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 28px;
    padding: 0 10px;
    background: var(--sx-text);
    color: var(--sx-surface);
    border-radius: 8px;
    font-family: var(--sx-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* TP-style mini-badge (subtle, in flex row with name) */
.sx .tp-badge {
    font-size: 9px;
    padding: 1px 5px;
    background: var(--sx-soft-6);
    border-radius: 4px;
    color: var(--sx-muted);
    letter-spacing: 0.05em;
    font-weight: 500;
}
.sx .tp-badge.on { background: rgba(var(--fp-accent-rgb, 184,92,42),0.18); color: var(--sx-accent); }

/* Avatar circle (top-right) */
.sx .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--sx-accent);
    color: var(--sx-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 13px;
}

/* Section header (inside cards) — kicker + title pattern */
.sx .section-header {
    margin-bottom: 18px;
}
.sx .section-header .kicker {
    font-size: 10.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sx-accent);
    font-weight: 500;
    margin-bottom: 6px;
}
.sx .section-header .title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}
.sx .section-header h2 {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.015em;
    margin: 0;
}
.sx .section-header .hint {
    font-size: 12px;
    color: var(--sx-muted-2);
}

/* StatRow (label · value with optional sub) */
.sx .stat-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 10px 0;
    border-bottom: 1px solid var(--sx-soft-3);
}
.sx .stat-row:last-child { border-bottom: none; }
.sx .stat-row .label { font-size: 13px; color: var(--fp-muted, #5a5750); }
.sx .stat-row .value { font-weight: 600; font-size: 14px; }
.sx .stat-row .sub { font-family: var(--sx-mono); font-size: 11px; color: var(--sx-muted-2); }

/* TopBar layout */
.sx .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    border-bottom: 1px solid var(--sx-soft-4);
    gap: 24px;
}
.sx .topbar-left  { display: flex; align-items: center; gap: 8px; }
.sx .topbar-right { display: flex; align-items: center; gap: 10px; }
.sx .account-switch { display: flex; align-items: center; gap: 8px; text-align: left; }
.sx .account-switch small { display: block; color: var(--sx-muted); font-size: 11px; }
.sx #account-identity { display: block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.sx .brand {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-right: 24px;
    text-decoration: none;
    color: var(--sx-text);
}

/* Table (CSS-grid based, not <table>) — standard 16px column gap */
.sx .grid-table { display: flex; flex-direction: column; }
.sx .grid-row {
    display: grid;
    column-gap: 16px;
    align-items: center;
    padding: 14px 20px;
}
.sx .grid-row.head {
    background: var(--sx-soft-1);
    border-bottom: 1px solid var(--sx-soft-4);
}
.sx .grid-row.body {
    border-bottom: 1px solid var(--sx-soft-3);
}
.sx .grid-row.body:last-child { border-bottom: none; }
.sx .grid-row .right { text-align: right; }
.sx .grid-row .center { text-align: center; }
.sx .grid-row .name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 16px;
    min-width: 0;
}
.sx .grid-row .name-cell .name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hero KPI strip */
.sx .kpi-strip {
    display: grid;
    column-gap: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--sx-soft-6);
}
.sx .kpi-label { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sx-muted-2); font-weight: 500; margin-bottom: 10px; }
.sx .kpi-value-lg { font-size: 44px; font-weight: 500; letter-spacing: -0.025em; line-height: 1; font-variant-numeric: tabular-nums; }
.sx .kpi-value-lg .cents { color: var(--fp-muted, #656259); font-size: 28px; }
.sx .kpi-value    { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.sx .kpi-sub      { font-size: 12px; color: var(--sx-muted-2); margin-top: 6px; font-variant-numeric: tabular-nums; }
.sx .kpi-pill-pos {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    padding: 3px 8px;
    background: rgba(58,122,74,0.10);
    color: var(--sx-pos);
    border-radius: 6px;
    font-variant-numeric: tabular-nums;
}
.sx .kpi-pill-neg {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    padding: 3px 8px;
    background: rgba(181,74,62,0.10);
    color: var(--sx-neg);
    border-radius: 6px;
    font-variant-numeric: tabular-nums;
}

/* Breadcrumb pattern (e.g. "← Portfolios · EUR · Brokerage") */
.sx .crumbs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.sx .crumbs .sep { color: var(--sx-faint); }

/* Focus states (accessibility) */
.sx button:focus-visible,
.sx a:focus-visible,
.sx .input:focus-visible,
.sx .nav:focus-visible,
.sx .tab:focus-visible,
.sx .pill:focus-visible {
    outline: 2px solid var(--sx-accent);
    outline-offset: 2px;
}

/* Portfolios list page */
.sx .portfolio-list-page {
    padding: 32px;
    max-width: 1100px;
    margin: 0 auto;
}
.sx .portfolio-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.sx .portfolio-list-header h1 {
    font-size: 30px;
    font-weight: 500;
    letter-spacing: -0.02em;
    margin: 0;
}
.sx .ret-select {
    background: var(--sx-card, var(--fp-surface, #fff));
    border: 1px solid var(--sx-border, #e5e7eb);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    color: var(--sx-text, #111);
    cursor: pointer;
}
/* ── Portfolio card grid ──────────────────────────────────────────────── */
.sx .pcards-section { margin-bottom: 36px; }
.sx .pcards-section:last-child { margin-bottom: 0; }
.sx .pcards-section-head { margin-bottom: 14px; }
.sx .pcards-section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fp-muted, #656259);
}
.sx .portfolio-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-items: stretch;
}
@media (max-width: 960px) { .sx .portfolio-cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .sx .portfolio-cards-grid { grid-template-columns: 1fr; } }

/* Card chrome */
.sx .pcard {
    background: var(--fp-surface, #fefdf9);
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 14px -6px rgba(80,70,50,0.10);
    padding: 22px 24px;
    min-height: 240px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: box-shadow 150ms, transform 150ms;
    text-decoration: none;
}
.sx .pcard:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.07), 0 8px 24px -8px rgba(80,70,50,0.15);
    transform: translateY(-2px);
}
.sx .pcard-plan-note { margin: 8px 0 18px; color: var(--sx-muted); font-size: 13px; line-height: 1.5; }
.sx .pcard-plan-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; }
.sx .pcard-plan-actions button { cursor: pointer; }
.sx .pcard a.pcard-name { color: inherit; text-decoration: none; }
.sx .pcard a.pcard-name:hover { text-decoration: underline; }

#invest-options > summary { display: none; }
#invest-footer-summary { display: none; }
.sx .modal-overlay.public-invest { padding: 16px; box-sizing: border-box; }
.sx .public-invest .modal-content { width: 100%; max-height: calc(100dvh - 32px); overflow: hidden; border-radius: 20px; }
.sx .public-invest .modal-header { flex-shrink: 0; padding: 22px 26px; background: var(--sx-surface); }
.sx .public-invest .modal-header h3 { font-size: 21px; letter-spacing: -.025em; }
.sx .public-invest .modal-close { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; }
.sx .public-invest .modal-close:hover { background: var(--sx-soft-3); }
.sx .public-invest .invest-scroll { min-height: 0; overflow-y: auto; padding: 24px 26px; overscroll-behavior: contain; }
.sx .public-invest .invest-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; margin-bottom: 28px; }
.sx .public-invest .invest-amt { color: var(--sx-muted); font-size: 13px; gap: 9px; }
.sx .public-invest .invest-in { width: min(100%, 220px); box-sizing: border-box; padding: 12px 14px; border-radius: 12px; }
.sx .public-invest .invest-in input { min-width: 0; width: 100%; font-size: 24px; }
.sx .public-invest #invest-options { max-width: 230px; font-size: 13px; color: var(--sx-muted); }
.sx .public-invest #invest-options > summary { display: list-item; cursor: pointer; }
.sx .public-invest .invest-frac { margin-top: 12px; padding: 0; align-items: flex-start; line-height: 1.5; }
.sx .public-invest .invest-fee-edit { margin-top: 12px; padding: 0; border: 0; background: none; color: var(--sx-accent); font: inherit; text-decoration: underline; cursor: pointer; }
.sx .public-invest .invest-list-heading h3 { margin: 0 0 6px; font-size: 16px; }
.sx .public-invest .invest-list-heading p { margin: 0; color: var(--sx-muted); font-size: 13px; line-height: 1.5; }
.sx .public-invest .invest-buy-list { list-style: none; margin: 14px 0 0; padding: 0; }
.sx .public-invest .invest-fund { padding: 18px 0; border-bottom: 1px solid var(--sx-soft-4); }
.sx .public-invest .invest-fund-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.sx .public-invest .invest-fund-identity { min-width: 0; }
.sx .public-invest .invest-fund h4 { margin: 0 0 7px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.sx .public-invest .invest-fund-identity > p { margin: 0; color: var(--sx-muted); font-size: 12px; line-height: 1.5; }
.sx .public-invest .invest-fund-amount { flex-shrink: 0; font-size: 17px; font-variant-numeric: tabular-nums; line-height: 1.5; }
.sx .public-invest .invest-fund-details { margin-top: 9px; color: var(--sx-muted); font-size: 12px; line-height: 1.6; }
.sx .public-invest .invest-fund-details summary, .sx .public-invest .invest-calculation > summary { cursor: pointer; }
.sx .public-invest .invest-fund-details p { margin: 8px 0; }
.sx .public-invest .invest-isin span { user-select: all; font-family: var(--sx-mono); overflow-wrap: anywhere; }
.sx .public-invest #invest-footer-summary { display: block; margin-left: auto; text-align: right; font-size: 12px; line-height: 1.7; color: var(--sx-muted); }
.sx .public-invest #invest-footer-summary b { color: var(--sx-text); font-weight: 600; margin-left: 8px; white-space: nowrap; }
.sx .public-invest .invest-fee-detail { margin-top: 10px; }
.sx .public-invest .invest-calculation { margin-top: 14px; font-size: 12px; line-height: 1.6; color: var(--sx-muted); }
.sx .public-invest .invest-calculation p { margin: 10px 0 6px; }
.sx .public-invest .invest-calculation ul { padding-left: 18px; }
.sx .public-invest .invest-next-hint { margin: 20px 0 0; color: var(--sx-muted); font-size: 12px; line-height: 1.6; }
.sx .public-invest .invest-footer { align-items: center; flex-shrink: 0; margin-top: 0 !important; padding: 16px 26px; border-top: 1px solid var(--sx-soft-4); background: var(--sx-surface); }
.sx .public-invest .invest-footer .btn { padding: 11px 16px; font-size: 14px; border-radius: 10px; }
@media (max-width: 520px) {
    .sx .modal-overlay.public-invest { padding: 8px; }
    .sx .public-invest .modal-content { max-height: calc(100dvh - 16px); border-radius: 16px; }
    .sx .public-invest .modal-header, .sx .public-invest .invest-scroll { padding: 18px; }
    .sx .public-invest .modal-header h3 { font-size: 18px; }
    .sx .public-invest .invest-top { grid-template-columns: minmax(0, 1fr); gap: 14px; margin-bottom: 22px; }
    .sx .public-invest #invest-options { max-width: none; }
    .sx .public-invest .invest-fund-main { gap: 12px; }
    .sx .public-invest .invest-fund-amount { font-size: 15px; }
    .sx .public-invest .invest-footer { padding: 14px 18px; }
    .sx .public-invest #invest-footer-summary { width: 100%; text-align: left; margin-left: 0; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
}

/* Header */
.sx .pcard-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 18px;
    gap: 10px;
}
.sx .pcard-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--fp-text, #2a2825);
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sx .pcard-ccy {
    font-size: 11px;
    font-weight: 500;
    color: var(--fp-muted, #656259);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* Shared label style */
.sx .pcard-label {
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fp-muted, #656259);
    font-weight: 500;
}

/* Value hero */
.sx .pcard-value-hero { margin-bottom: 18px; }
.sx .pcard { cursor: grab; }
.sx .pcard:active { cursor: grabbing; }
.sx .pcard-dragging { opacity: 0.4; transform: scale(0.98); }
.sx .pcard-drag-over { outline: 2px dashed var(--sx-accent); outline-offset: -2px; }
.sx .pcard-cash-sub {
    font-size: 11px;
    color: var(--fp-muted, #656259);
    font-variant-numeric: tabular-nums;
    margin-top: 4px;
}
.sx .pcard-value-num {
    font-size: 26px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.025em;
    color: var(--fp-text, #2a2825);
    line-height: 1.15;
    margin-top: 5px;
}

/* Total return line — sits below profit EUR amount */
.sx .pcard-total-ret {
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin-top: 3px;
    letter-spacing: -0.01em;
}
.sx .pcard-total-ret.ret-pos { color: var(--sx-pos); }
.sx .pcard-total-ret.ret-neg { color: var(--sx-neg); }
.sx .pcard-total-ret.ret-na  { color: var(--fp-muted, #656259); }
.sx .pcard-ret-method {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.65;
    margin-left: 2px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Today (daily change) — slim row above the Profit/YTD grid */
.sx .pcard-today {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 0 10px;
    margin: -4px 0 12px;
    border-top: 1px solid rgba(0,0,0,0.05);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.sx .pcard-today-vals {
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}
.sx .pcard-today-vals.ret-pos { color: var(--sx-pos); }
.sx .pcard-today-vals.ret-neg { color: var(--sx-neg); }
.sx .pcard-today-sep {
    opacity: 0.4;
    font-weight: 400;
}
.sx .pcard-today-pct {
    font-size: 12px;
    opacity: 0.85;
}

/* Profit + Return row */
.sx .pcard-mid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
    margin-bottom: 16px;
}
.sx .pcard-profit-amt {
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin-top: 5px;
    line-height: 1.2;
}
.sx .pcard-profit-amt.ret-pos { color: var(--sx-pos); }
.sx .pcard-profit-amt.ret-neg { color: var(--sx-neg); }
.sx .pcard-profit-amt.ret-na  { color: var(--fp-muted, #656259); }
.sx .pcard-profit-ofval {
    font-size: 11px;
    color: var(--fp-muted, #656259);
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
}
.sx .pcard-return-val {
    font-size: 20px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    margin-top: 5px;
    line-height: 1.15;
}
.sx .pcard-return-val.ret-pos { color: var(--sx-pos); }
.sx .pcard-return-val.ret-neg { color: var(--sx-neg); }
.sx .pcard-return-val.ret-na  { color: var(--fp-muted, #656259); font-size: 15px; font-weight: 500; }

/* Dividends row */
.sx .pcard-divs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.05);
}
.sx .pcard-divs-val {
    font-size: 13px;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    color: var(--fp-muted, #656259);
}

/* Target bar — pinned to bottom */
.sx .pcard-target {
    margin-top: auto;
    padding-top: 14px;
}
.sx .pcard-target-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 10px;
    color: var(--fp-muted, #656259);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}
.sx .pcard-target-row.reached { color: var(--sx-pos); }
.sx .pcard-target-pct {
    font-size: 11px;
    font-weight: 600;
    color: var(--fp-text, #2a2825);
    text-transform: none;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}
.sx .pcard-target-row.reached .pcard-target-pct { color: var(--sx-pos); }
.sx .pcard-target-bar {
    height: 3px;
    background: rgba(0,0,0,0.06);
    border-radius: 999px;
    overflow: hidden;
}
.sx .pcard-target-fill {
    height: 100%;
    background: var(--sx-accent);
    border-radius: 999px;
    transition: width 0.4s ease;
}
.sx .pcard-target-fill.complete { background: var(--sx-pos); }

/* Target display in portfolio summary header */
.sx .pf-target-strip {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 0 2px;
    margin-top: 4px;
    border-top: 1px solid var(--sx-soft-4);
}
.sx .pf-target-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sx-muted-2);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}
.sx .pf-target-bar-wrap {
    flex: 1;
    height: 6px;
    background: var(--sx-soft-4);
    border-radius: 999px;
    overflow: hidden;
}
.sx .pf-target-fill {
    height: 100%;
    background: var(--sx-accent);
    border-radius: 999px;
    transition: width 0.4s ease;
}
.sx .pf-target-fill.complete { background: var(--sx-pos); }
.sx .pf-target-text {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--sx-text);
    white-space: nowrap;
    flex-shrink: 0;
}
.sx .pf-target-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--sx-muted-2);
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
    line-height: 1.2;
}
.sx .pf-target-edit-btn:hover { color: var(--sx-text); background: var(--sx-soft-3); }

.sx .portfolio-empty {
    grid-column: 1 / -1;
    padding: 48px 24px;
    text-align: center;
    color: var(--sx-muted-2);
    background: var(--sx-surface);
    border-radius: var(--sx-card-radius);
    box-shadow: var(--sx-card-shadow);
    border: var(--sx-card-border);
}

/* Watchlists sub-tab strip (sits between TopBar and a watchlist content card) */
.sx .wl-subtabs {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 12px 32px 4px;
    flex-wrap: wrap;
}
.sx .wl-subtabs .tab.add {
    color: var(--sx-accent);
    font-size: 18px;
    font-weight: 500;
    padding: 6px 12px;
}

/* Watchlist filter card (search + add ticker + filter pills) */
.sx .wl-page { padding: 8px 0; }
.sx .wl-filter-card {
    background: var(--sx-surface);
    border-radius: var(--sx-card-radius);
    box-shadow: var(--sx-card-shadow);
    border: var(--sx-card-border);
    padding: 20px;
    margin-bottom: 16px;
}
.sx .wl-filter-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
    flex-wrap: wrap;
}
.sx .wl-filter-row .input { font-size: 13px; }
.sx .wl-filter-row .input.search { flex: 1; min-width: 180px; max-width: 320px; }
.sx .wl-filter-row .input.add { width: 220px; min-width: 160px; }
.sx .wl-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}
.sx .wl-pill-divider {
    width: 1px;
    height: 20px;
    background: rgba(0,0,0,0.08);
    margin: 0 4px;
}
/* Region pill colors (mockup palette) */
.sx .pill.region-us     { background: rgba(58,74,138,0.12);  color: #3a4a8a; border: 1px solid rgba(58,74,138,0.28); }
.sx .pill.region-eu     { background: rgba(122,58,170,0.12); color: #7a3aaa; border: 1px solid rgba(122,58,170,0.28); }
.sx .pill.region-jp     { background: rgba(170,58,138,0.12); color: #aa3a8a; border: 1px solid rgba(170,58,138,0.28); }
.sx .pill.flag-mag7     { background: rgba(201,122,26,0.12); color: #c97a1a; border: 1px solid rgba(201,122,26,0.28); }
.sx .pill.flag-risk     { background: rgba(181,74,62,0.12);  color: var(--sx-neg); border: 1px solid rgba(181,74,62,0.28); }
.sx .pill.flag-value    { background: rgba(58,122,74,0.12);  color: var(--sx-pos); border: 1px solid rgba(58,122,74,0.28); }
.sx .pill.flag-drop     { background: rgba(181,74,62,0.12);  color: var(--sx-neg); border: 1px solid rgba(181,74,62,0.28); }
/* Selected: solid fill in the pill's own color (the tinted rules above outrank .pill.on). */
.sx .pill.region-us.on  { background: #3a4a8a; color: var(--fp-surface, #fff); border-color: #3a4a8a; }
.sx .pill.region-eu.on  { background: #7a3aaa; color: var(--fp-surface, #fff); border-color: #7a3aaa; }
.sx .pill.region-jp.on  { background: #aa3a8a; color: var(--fp-surface, #fff); border-color: #aa3a8a; }
.sx .pill.flag-mag7.on  { background: #c97a1a; color: var(--fp-surface, #fff); border-color: #c97a1a; }
.sx .pill.flag-risk.on  { background: var(--sx-neg); color: var(--fp-surface, #fff); border-color: var(--sx-neg); }
.sx .pill.flag-value.on { background: var(--sx-pos); color: var(--fp-surface, #fff); border-color: var(--sx-pos); }
.sx .pill.flag-drop.on  { background: var(--sx-neg); color: var(--fp-surface, #fff); border-color: var(--sx-neg); }

/* Watchlist data card (grid table) — horizontally scrollable when columns
   exceed container width; columns are user-resizable via drag handles. */
.sx .wl-card {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 220px);
}
.sx .wl-grid {
    display: grid;
    column-gap: 16px;
    align-items: center;
    padding: 14px 20px;
    /* min-width: max-content keeps the grid from collapsing and forces
       horizontal scroll when card width < total grid width */
    min-width: max-content;
}
.sx .wl-grid.head {
    background: var(--sx-surface);
    border-bottom: 1px solid var(--sx-soft-4);
    position: sticky;
    top: 0;
    z-index: 10;
    /* Subtle shadow to separate from scrolling rows */
    box-shadow: 0 1px 0 var(--sx-soft-4);
}
.sx .wl-grid.row {
    border-bottom: 1px solid var(--sx-soft-3);
    transition: background 140ms;
    cursor: pointer;
}
.sx .wl-grid.row:last-child { border-bottom: none; }
.sx .wl-grid.row:hover { background: var(--sx-row-hover); }
.sx .wl-grid.row.target-hit { background: rgba(255,228,160,0.18); }
.sx .wl-grid.row.target-hit:hover { background: rgba(255,228,160,0.30); }
.sx .wl-grid.row.alert { background: rgba(255,228,160,0.18); }

/* Stocks/ETFs/SX5E grids: grid-template-columns are set inline by JS via _wlGridTemplate() */

.sx .wl-grid .name {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 16px;
    min-width: 0;
    overflow: hidden;
}
.sx .wl-compare-chk {
    flex-shrink: 0;
    margin: 0;
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--sx-accent);
}
.sx .wl-tab-badge {
    display: inline-block;
    min-width: 18px;
    padding: 0 5px;
    margin-left: 4px;
    border-radius: 9px;
    background: var(--sx-accent);
    color: var(--fp-surface, #fff);
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    font-weight: 600;
    vertical-align: middle;
}
.sx .wl-grid .name-text {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--sx-text);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    flex: 1 1 auto;
    min-width: 0;
}
.sx .wl-grid .name-text:hover { color: var(--sx-accent); }
.sx .wl-grid .right { text-align: right; }

/* Numeric / mono cells — single size for consistency */
.sx .wl-grid .col-ticker { font-family: var(--sx-mono); font-weight: 600; font-size: 13px; }
.sx .wl-grid .col-exch   { color: var(--sx-muted-2); font-size: 12px; }
.sx .wl-grid .col-mid {
    font-variant-numeric: tabular-nums;
    color: var(--sx-text); font-size: 13px;
}
.sx .wl-grid .col-price {
    font-variant-numeric: tabular-nums;
    color: var(--sx-text);
    font-weight: 500; font-size: 13px;
}
/* Override .mono on numeric cells inside the watchlist — match body font, not IBM Plex */
.sx .wl-grid .mono.num,
.sx .wl-grid .right .mono.num {
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    color: var(--sx-text);
    font-size: 13px;
}
/* Color overrides — must be more specific than the .mono.num rule above */
.sx .wl-grid .mono.num.pos     { color: var(--sx-pos); font-weight: 500; }
.sx .wl-grid .mono.num.neg     { color: var(--sx-neg); font-weight: 500; }
.sx .wl-grid .mono.num.muted-2 { color: var(--sx-muted-2); }

/* Header text — all header cells share the same base style */
.sx .wl-grid.head .micro { font-size: 12px; position: relative; }
.sx .wl-grid.head .hdr   { cursor: pointer; user-select: none; position: relative; }
.sx .wl-grid.head .hdr:hover { color: var(--sx-text); }

/* Column resize handle — a single 1px divider with enough contrast to find
   without hunting, but quiet enough to live alongside body text. Highlights to
   accent orange on hover/drag. */
.sx .wl-grid.head .hdr .col-resize,
.sx .wl-grid.head .micro .col-resize {
    position: absolute;
    top: -14px;
    right: -12px;
    bottom: -14px;
    width: 14px;
    cursor: col-resize;
    z-index: 2;
    background: linear-gradient(
        to right,
        transparent 0,
        transparent 6px,
        rgba(0,0,0,0.18) 6px,
        rgba(0,0,0,0.18) 7px,
        transparent 7px,
        transparent 14px
    );
    transition: background 120ms;
}
.sx .wl-grid.head .hdr .col-resize:hover,
.sx .wl-grid.head .hdr .col-resize.active,
.sx .wl-grid.head .micro .col-resize:hover,
.sx .wl-grid.head .micro .col-resize.active {
    background: linear-gradient(
        to right,
        transparent 0,
        transparent 5px,
        var(--sx-accent) 5px,
        var(--sx-accent) 8px,
        transparent 8px,
        transparent 14px
    );
}
.sx .wl-card.resizing { cursor: col-resize; user-select: none; }
/* tg-grid column resize handle */
.sx .tg-grid.head > div { position: relative; }
.sx .tg-col-resize {
    position: absolute;
    top: -14px; right: -10px; bottom: -14px; width: 14px;
    cursor: col-resize; z-index: 2;
    background: linear-gradient(to right, transparent 0, transparent 6px, rgba(0,0,0,0.18) 6px, rgba(0,0,0,0.18) 7px, transparent 7px);
    transition: background 120ms;
}
.sx .tg-col-resize:hover, .sx .tg-col-resize.active {
    background: linear-gradient(to right, transparent 0, transparent 5px, var(--sx-accent) 5px, var(--sx-accent) 8px, transparent 8px);
}
.sx .tg-grid.resizing { cursor: col-resize; user-select: none; }
.sx .wl-card.resizing .wl-grid.head .hdr .col-resize,
.sx .wl-card.resizing .wl-grid.head .micro .col-resize {
    background: linear-gradient(
        to right,
        transparent 0,
        transparent 5px,
        rgba(var(--fp-accent-rgb, 184,92,42),0.4) 5px,
        rgba(var(--fp-accent-rgb, 184,92,42),0.4) 8px,
        transparent 8px,
        transparent 14px
    );
}
.sx .wl-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    align-items: center;
}
.sx .wl-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 7px;
    color: var(--sx-muted);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: background 120ms, color 120ms;
}
.sx .wl-icon-btn:hover { background: var(--sx-soft-3); color: var(--sx-text); }
.sx .wl-icon-btn.danger:hover { background: rgba(181,74,62,0.10); color: var(--sx-neg); }
.sx .wl-loading {
    padding: 40px 24px;
    text-align: center;
    color: var(--sx-muted-2);
    font-size: 13px;
}

/* Allocation card head with view toggle */
.sx .alloc-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 8px;
    flex-wrap: wrap;
}

/* Per-view "?" on each allocation toggle, with its own hover tooltip */
.sx .tog-q {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    width: 12px; height: 12px; margin-left: 4px; border-radius: 50%;
    background: rgba(0,0,0,0.07); color: var(--sx-muted);
    font-size: 8px; font-weight: 700; line-height: 1; letter-spacing: 0;
    cursor: help; vertical-align: middle;
}
.sx .alloc-toggle-btn.on .tog-q { background: rgba(0,0,0,0.10); }
.sx .tog-q:hover { background: var(--sx-accent, var(--fp-accent, #b85c2a)); color: var(--fp-surface, #fff); }
.sx .tog-q:hover::after {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    z-index: 50; width: 210px; padding: 9px 11px;
    background: var(--fp-text, #2a2825); color: #f4f1ea;
    border-radius: 8px; box-shadow: 0 8px 22px -6px rgba(40,30,15,0.4);
    font-size: 11px; font-weight: 400; line-height: 1.5; letter-spacing: 0;
    text-transform: none; text-align: left; white-space: normal;
}
.sx .tog-q:hover::before {
    content: ''; position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%);
    border: 5px solid transparent; border-top-color: var(--fp-text, #2a2825); z-index: 50;
}
.sx .alloc-toggle {
    display: inline-flex;
    background: var(--sx-soft-3);
    border-radius: 8px;
    padding: 2px;
    gap: 0;
}
.sx .alloc-toggle-btn {
    background: transparent;
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    color: var(--sx-muted);
    cursor: pointer;
    font-family: inherit;
    transition: background 120ms, color 120ms;
}
.sx .alloc-toggle-btn:hover { color: var(--sx-text); }
.sx .alloc-toggle-btn.on {
    background: var(--sx-surface);
    color: var(--sx-text);
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    font-weight: 500;
}

/* ---------------- Portfolio detail shell ---------------- */
/* Hero card (breadcrumb + title + actions + KPI strip) */
.sx .pf-hero { padding: 26px 28px 24px; }
.sx .pf-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}
.sx .pf-hero .crumbs { margin-bottom: 12px; }
.sx .pf-back {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--sx-muted-2);
    padding: 0;
    font-family: inherit;
}
.sx .pf-back:hover { color: var(--sx-text); }
.sx .pf-title {
    font-size: 32px;
    font-weight: 500;
    letter-spacing: -0.025em;
    line-height: 1.05;
    color: var(--sx-text);
    margin: 0;
}
.sx .pf-edit-meta-btn {
    background: var(--sx-soft-3);
    border: 1px solid var(--sx-soft-6);
    cursor: pointer;
    color: var(--sx-muted);
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    line-height: 1.4;
    transition: color 0.15s, background 0.15s;
    align-self: center;
    flex-shrink: 0;
    font-family: inherit;
}
.sx .pf-edit-meta-btn:hover { color: var(--sx-text); background: var(--sx-soft-4); }
.sx .pf-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.sx .pf-actions .btn-ghost,
.sx .pf-actions .btn-prim { white-space: nowrap; }
.sx .btn-danger-ghost { color: var(--sx-neg); }
.sx .btn-danger-ghost:hover { background: rgba(181,74,62,0.10); color: var(--sx-neg); }

/* KPI strip — 5-up grid below the title */
.sx .pf-kpi-strip {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
    column-gap: 24px;
    padding-top: 24px;
    margin-top: 24px;
    border-top: 1px solid var(--sx-soft-6);
}
.sx .pf-total-return { margin-top: 9px; font-size: 12.5px; color: var(--sx-muted-2); display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.sx .pf-total-return .lbl { text-transform: uppercase; letter-spacing: .04em; font-size: 10.5px; color: var(--sx-muted-2); }
.sx .pf-total-return .num { font-weight: 700; }
.sx .pf-total-return .num.positive { color: var(--sx-pos); }
.sx .pf-total-return .num.negative { color: var(--sx-neg); }
/* Portfolio hero — redesigned big value + KPI cards (Full Pockets Redesign) */
.sx .pf-hero-value { margin-top: 22px; }
.sx .pf-hero-value .kpi-value-lg { font-size: 40px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; }
.sx .pf-hero-value .pf-cents { color: var(--sx-muted-2); font-size: 0.6em; font-weight: 500; }
.sx .pf-hero-sub { font-size: 12px; color: var(--sx-muted-2); margin-top: 8px; font-variant-numeric: tabular-nums; }
.sx .pf-kpi-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 20px; }
.sx .pf-kcard { background: rgba(0,0,0,0.025); border-radius: 10px; padding: 16px 18px; min-width: 0; }
.sx .pf-kcard.pf-kcard-tint { background: rgba(58,122,74,0.08); }
.sx .pf-kcard .pf-kc-lbl { margin-bottom: 8px; }
.sx .pf-kcard .pf-kc-val { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.sx .pf-kcard .pf-kc-sub { font-size: 12px; margin-top: 4px; color: var(--sx-muted-2); }
.sx .pf-kcard .pf-kc-val.positive, .sx .pf-kcard .pf-kc-sub.positive { color: var(--sx-pos); }
.sx .pf-kcard .pf-kc-val.negative, .sx .pf-kcard .pf-kc-sub.negative { color: var(--sx-neg); }
@media (max-width: 760px) { .sx .pf-kpi-cards { grid-template-columns: repeat(2, 1fr); } }
.sx .kpi-cell { min-width: 0; padding-right: 18px; border-right: 1px solid var(--sx-soft-6); }
.sx .kpi-cell:last-child { border-right: none; padding-right: 0; }
.sx .kpi-cell .kpi-label {
    font-size: 10.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sx-muted-2);
    font-weight: 500;
    margin-bottom: 10px;
    position: relative;
}
.sx .kpi-cell .kpi-value-lg {
    font-size: 38px;
    font-weight: 500;
    letter-spacing: -0.025em;
    line-height: 1;
    color: var(--sx-text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.sx .kpi-cell .kpi-value {
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--sx-text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.sx .kpi-cell .kpi-value.positive { color: var(--sx-pos); }
.sx .kpi-cell .kpi-value.negative { color: var(--sx-neg); }
.sx .kpi-cell .kpi-sub {
    font-size: 12px;
    color: var(--sx-muted-2);
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}
.sx .kpi-cell .kpi-return-pill {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 6px;
    margin-top: 10px;
    background: var(--sx-soft-3);
    color: var(--sx-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.sx .kpi-cell .kpi-return-pill.positive { background: rgba(58,122,74,0.10); color: var(--sx-pos); }
.sx .kpi-cell .kpi-return-pill.negative { background: rgba(181,74,62,0.10); color: var(--sx-neg); }

/* Tab strip inside the content card */
.sx .pf-content-card { overflow: hidden; }
.sx .pf-tab-strip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--sx-soft-4);
    flex-wrap: wrap;
}

/* Dividends tab — reference table pattern reused by Transactions / Closed */
.sx .dividends-page { padding: 16px 20px 20px; }
.sx .dividends-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.sx .div-grid {
    display: grid;
    grid-template-columns: 120px 100px 220px 140px 60px;
    column-gap: 18px;
    align-items: center;
    padding: 10px 16px;
}
.sx .div-grid.head {
    background: var(--sx-soft-1);
    border-radius: 8px;
    margin-bottom: 4px;
}
.sx .div-grid.head .micro { font-size: 12px; }
.sx .div-grid.row {
    padding: 12px 16px;
    border-bottom: 1px solid var(--sx-soft-3);
    border-radius: 8px;
    transition: background 140ms;
}
.sx .div-grid.row:last-child { border-bottom: none; }
.sx .div-grid.row:hover { background: var(--sx-row-hover); }
.sx .div-grid .right { text-align: right; }
.sx .div-grid .div-date {
    font-family: var(--sx-sans);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    color: var(--sx-muted);
}
.sx .div-grid .div-name {
    font-size: 13px;
    color: var(--sx-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sx .div-grid .div-amount {
    font-family: var(--sx-sans);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    font-size: 13px;
    color: var(--sx-text);
}
.sx .div-grid .div-del {
    background: none;
    border: none;
    color: var(--sx-neg);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 120ms;
}
.sx .div-grid .div-del:hover { background: rgba(181,74,62,0.10); }
.sx .div-empty {
    padding: 40px 24px;
    text-align: center;
    color: var(--sx-muted-2);
    font-size: 13px;
}

/* Transactions tab */
.sx .tx-page { padding: 16px 20px 20px; overflow-x: auto; }
.sx .tx-actions { margin-bottom: 12px; }
.sx .tx-grid {
    display: grid;
    column-gap: 16px;
    align-items: center;
    padding: 10px 16px;
    min-width: max-content;
}
.sx .tx-grid.head {
    background: var(--sx-soft-1);
    border-radius: 8px;
    margin-bottom: 4px;
}
.sx .tx-grid.head .micro { font-size: 12px; }
.sx .tx-grid.row {
    padding: 12px 16px;
    border-bottom: 1px solid var(--sx-soft-3);
    border-radius: 8px;
    transition: background 140ms;
}
.sx .tx-grid.row:last-child { border-bottom: none; }
.sx .tx-grid.row:hover { background: var(--sx-row-hover); }
.sx .tx-grid .right { text-align: right; }
.sx .tx-grid .tx-date {
    font-family: var(--sx-mono);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    color: var(--sx-muted);
}
.sx .tx-grid .tx-name {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sx .tx-grid .tx-ccy { font-family: var(--sx-mono); font-size: 11px; color: var(--sx-muted-2); }
.sx .tx-grid .tx-num {
    font-family: var(--sx-mono);
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    color: var(--sx-text);
}
.sx .tx-grid .tx-num.muted { color: var(--sx-muted); }
.sx .tx-type-pill {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 10px;
    border-radius: 999px;
    font-family: var(--sx-mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    font-weight: 600;
}
.sx .tx-type-pill.buy  { background: rgba(58,122,74,0.12);  color: var(--sx-pos); }
.sx .tx-type-pill.sell { background: rgba(181,74,62,0.12);  color: var(--sx-neg); }
.sx .tx-actions-cell { display: flex; gap: 4px; justify-content: flex-end; }
.sx .tx-icon-btn {
    background: transparent;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    color: var(--sx-muted);
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    transition: background 120ms, color 120ms;
}
.sx .tx-icon-btn:hover { background: var(--sx-soft-3); color: var(--sx-text); }
.sx .tx-icon-btn.danger:hover { background: rgba(181,74,62,0.10); color: var(--sx-neg); }
.sx .tx-empty {
    padding: 40px 24px;
    text-align: center;
    color: var(--sx-muted-2);
    font-size: 13px;
}

/* Closed Positions tab — variable columns via inline grid-template-columns */
.sx .closed-page { padding: 16px 20px 20px; overflow-x: auto; }
.sx .closed-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.sx .closed-grid {
    display: grid;
    column-gap: 16px;
    align-items: center;
    padding: 10px 16px;
    min-width: max-content;
}
.sx .closed-grid.head {
    background: var(--sx-soft-1);
    border-radius: 8px;
    margin-bottom: 4px;
}
.sx .closed-grid.row {
    padding: 12px 16px;
    border-bottom: 1px solid var(--sx-soft-3);
    border-radius: 8px;
    transition: background 140ms;
}
.sx .closed-grid.row:last-child { border-bottom: none; }
.sx .closed-grid.row:hover { background: var(--sx-row-hover); }
.sx .closed-grid .right { text-align: right; }
.sx .closed-grid .col-num {
    font-family: var(--sx-mono);
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    color: var(--sx-text);
}
.sx .closed-grid .col-num.muted { color: var(--sx-muted); }
.sx .closed-grid .col-name {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    min-width: 0;
}
.sx .closed-grid .col-name .name-text {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--sx-text);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}
.sx .closed-grid .col-name .name-text:hover { color: var(--sx-accent); }
.sx .closed-grid .col-date {
    font-family: var(--sx-mono);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    color: var(--sx-muted);
}
.sx .closed-grid .head-cell { cursor: pointer; user-select: none; font-size: 12px; }
.sx .closed-grid .head-cell:hover { color: var(--sx-text); }
.sx .closed-partial-pill {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    background: rgba(var(--fp-accent-rgb, 184,92,42),0.12);
    color: var(--sx-accent);
    margin-left: 8px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Targets tab */
.sx .targets-page { padding: 16px 20px 20px; overflow-x: auto; }
.sx .targets-actions { margin-bottom: 12px; }
.sx .tg-grid {
    display: grid !important;
    column-gap: 10px !important;
    align-items: center !important;
    padding: 12px 16px !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
    font-variant-numeric: tabular-nums !important;
    font-weight: 500 !important;
    color: var(--fp-text, #2a2825) !important;
}
/* Body rows need ellipsis truncation. Head cells must NOT clip overflow,
   otherwise the absolute-positioned resize handle (right: -10px, top/bottom
   negative) gets cropped away and you can't tell where the column edge is. */
.sx .tg-grid.row > div {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.sx .tg-grid.head > div { overflow: visible; }
.sx .wl-justetf {
    display: inline-block;
    margin-left: 6px;
    font-size: 11px;
    color: var(--sx-accent);
    text-decoration: none;
    padding: 1px 5px;
    border: 1px solid var(--sx-soft-5);
    border-radius: 4px;
    background: var(--sx-surface);
    transition: background 120ms, color 120ms;
    vertical-align: middle;
    line-height: 1;
}
.sx .wl-justetf:hover {
    background: var(--sx-accent);
    color: var(--fp-surface, #fff);
    border-color: var(--sx-accent);
}
.sx .hdr-sortable {
    cursor: pointer;
    user-select: none;
    transition: color 100ms;
}

/* Custom-watchlist subtabs: group separators + drag state */
.sx .cwl-tab { cursor: grab; }
.sx .cwl-tab:active { cursor: grabbing; }
.sx .cwl-dragging { opacity: 0.45; }
.sx .cwl-group-sep {
    margin: 0 4px;
    color: var(--sx-soft-6);
    font-size: 16px;
    line-height: 1;
    user-select: none;
}
.sx .cwl-group-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sx-muted-2);
    margin: 0 6px 0 2px;
    align-self: center;
}
.sx .hdr-sortable:hover { color: var(--sx-accent) !important; }
.sx .hdr-sortable .sort-icon { color: var(--sx-accent); margin-left: 2px; font-size: 9px; }
/* Cell wrapper. We deliberately do NOT cascade font-size to descendants here
   anymore — the previous `> div *` catch-all forced ticker chips (.chip) to
   render at 13px instead of their designed 11px, which made them overflow the
   68px ticker column and get clipped to a half-black background. Spans like
   .mono / .chip / .tg-num keep their own type styles; the wrapper rule below
   only sets cell-level defaults that descendants inherit when they don't
   specify their own size. */
.sx .tg-grid > div {
    font-size: 13px;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
    white-space: nowrap;
    font-weight: 500;
}
.sx .tg-grid .tg-name {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
    font-weight: 500 !important;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Header micros — grid column labels */
.sx .tg-grid.head .micro {
    font-size: 12px !important;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
    font-weight: 500 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    color: var(--sx-muted-2) !important;
}
/* Muted cells (Ticket, Inv. (EUR), Shares) — slightly subdued color but same size */
.sx .tg-grid .tg-num.muted { color: var(--sx-muted) !important; }
.sx .tg-grid.head {
    background: var(--sx-soft-1);
    border-radius: 8px;
    margin-bottom: 4px;
}
.sx .tg-grid.row {
    padding: 8px 14px;
    border-bottom: 1px solid var(--sx-soft-3);
    border-radius: 8px;
    transition: background 140ms;
}
.sx .tg-grid.row:last-child { border-bottom: none; }
.sx .tg-grid.row:hover { background: var(--sx-row-hover); }
.sx .tg-grid.row.total {
    background: var(--sx-soft-1);
    font-weight: 600;
    border-top: 2px solid var(--sx-soft-4);
    margin-top: 4px;
}
.sx .tg-grid .right { text-align: right; }
.sx .tg-grid .tg-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx .tg-grid .tg-num { font-family: var(--sx-sans); font-variant-numeric: tabular-nums; font-size: 11.5px; color: var(--sx-text); }
.sx .tg-grid .tg-num.muted { color: var(--sx-muted); }
.sx .tg-progress {
    position: relative;
    height: 18px;
    background: var(--sx-soft-3);
    border-radius: 4px;
    overflow: hidden;
}
.sx .tg-progress .tg-progress-fill {
    height: 100%;
    background: var(--sx-accent);
    opacity: 0.7;
}
.sx .tg-progress .tg-progress-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--sx-mono);
    font-variant-numeric: tabular-nums;
    font-size: 10.5px;
    color: var(--sx-text);
    font-weight: 500;
}

/* Options tab */
.sx .options-page { padding: 16px 20px 20px; overflow-x: auto; }
.sx .options-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.sx .options-summary {
    font-size: 13px;
    color: var(--sx-muted);
    font-variant-numeric: tabular-nums;
}
.sx .options-summary strong { color: var(--sx-text); font-weight: 600; }
.sx .opt-grid {
    display: grid;
    grid-template-columns: 70px 50px 90px minmax(140px, 1fr) 80px 80px 100px 60px 80px 60px 100px 100px 100px 50px 130px;
    column-gap: 14px;
    align-items: center;
    padding: 10px 14px;
    min-width: max-content;
}
.sx .opt-grid.head {
    background: var(--sx-soft-1);
    border-radius: 8px;
    margin-bottom: 4px;
}
.sx .opt-grid.row {
    padding: 12px 14px;
    border-bottom: 1px solid var(--sx-soft-3);
    border-radius: 8px;
    transition: background 140ms;
}
.sx .opt-grid.row:last-child { border-bottom: none; }
.sx .opt-grid.row:hover { background: var(--sx-row-hover); }
.sx .opt-grid .right { text-align: right; }
.sx .opt-grid .opt-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx .opt-grid .opt-num { font-family: var(--sx-sans); font-variant-numeric: tabular-nums; font-size: 13px; }
.sx .opt-grid .opt-ccy { font-family: var(--sx-mono); font-size: 11px; color: var(--sx-muted-2); }
.sx .opt-status,
.sx .opt-type {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    font-family: var(--sx-mono);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
}
.sx .opt-status.open     { background: rgba(33,150,243,0.12);  color: #2196f3; }
.sx .opt-status.expired  { background: rgba(58,122,74,0.12);   color: var(--sx-pos); }
.sx .opt-status.closed   { background: rgba(255,152,0,0.12);   color: #d77a00; }
.sx .opt-status.assigned { background: rgba(229,57,53,0.12);   color: var(--sx-neg); }
.sx .opt-type.sell_put,
.sx .opt-type.sell_call  { background: rgba(229,57,53,0.12);   color: var(--sx-neg); }
.sx .opt-type.buy_put,
.sx .opt-type.buy_call   { background: rgba(58,122,74,0.12);   color: var(--sx-pos); }
.sx .opt-itm { font-size: 9px; color: var(--sx-neg); margin-left: 4px; font-weight: 600; }
.sx .opt-otm { font-size: 9px; color: var(--sx-pos); margin-left: 4px; font-weight: 600; }
.sx .opt-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.sx .opt-actions .opt-btn {
    background: var(--sx-soft-2);
    border: none;
    color: var(--sx-text);
    font-size: 10px;
    padding: 4px 7px;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
    transition: background 120ms;
}
.sx .opt-actions .opt-btn:hover { background: var(--sx-soft-3); }
.sx .opt-actions .opt-btn.danger { color: var(--sx-neg); }
.sx .opt-actions .opt-btn.danger:hover { background: rgba(181,74,62,0.10); }
.sx .opt-empty {
    padding: 40px 24px;
    text-align: center;
    color: var(--sx-muted-2);
    font-size: 13px;
}

/* Report tab — wrapper padding only; inner table keeps existing markup for now */
.sx .report-page { padding: 16px 20px 20px; }
.sx .report-page .controls {
    background: var(--sx-soft-1);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

/* ============== Home / front page ============== */
/* Scoped under .home-page so it can't leak. Soft Layered tokens, real data. */
.sx .home-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 32px 80px;
    font-family: var(--sx-sans);
    background: var(--fp-soft, #faf8f3);
}
.sx .home-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 36px;
    gap: 20px;
    flex-wrap: wrap;
}
.sx .home-kicker {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sx-muted-2);
    margin-bottom: 6px;
}
.sx .home-title {
    font-family: "IBM Plex Serif", Georgia, serif;
    font-size: 36px;
    font-weight: 400;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--sx-text);
}
.sx .home-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--sx-mono);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    color: var(--sx-muted);
}
.sx .home-meta .market-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sx-pos);
}
.sx .home-meta.closed .market-dot { background: var(--sx-muted-2); }

.sx .home-section { margin-bottom: 32px; }
.sx .home-section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 14px;
    padding: 0 4px;
}
.sx .home-section-label {
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sx-muted-2);
    font-weight: 500;
}
.sx .home-section-action {
    font-size: 12px;
    color: var(--sx-text);
    background: rgba(0,0,0,0.04);
    border: none;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 999px;
    font-family: inherit;
    transition: background 0.15s;
}
.sx .home-section-action:hover { background: rgba(0,0,0,0.07); }

.sx .home-card {
    background: var(--fp-surface, #fefdf9);
    border-radius: 14px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 6px 18px -8px rgba(80,70,50,0.08);
    border: 1px solid var(--sx-soft-3);
}

/* Public Home: the next action for each saved portfolio. */
.sx .home-card.home-next-card { padding: 24px 26px; }
.sx .home-next-card h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.025em; }
.sx .home-next-note { margin: 10px 0 18px; font-size: 14px; line-height: 1.5; color: var(--sx-muted); }
.sx .home-next-list { list-style: none; padding: 0; margin: 0; }
.sx .home-next-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 0; border-top: 1px solid var(--sx-soft-4); }
.sx .home-next-row:last-child { padding-bottom: 0; }
.sx .home-next-row > div { min-width: 0; }
.sx .home-next-row h3 { margin: 0 0 6px; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.sx .home-next-row p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--sx-muted); }
.sx .home-next-row button { flex-shrink: 0; }
@media (max-width: 520px) {
    .sx .home-card.home-next-card { padding: 20px; }
    .sx .home-next-row { align-items: flex-start; flex-direction: column; gap: 14px; }
    .sx .home-next-row button { width: 100%; }
}

/* Movers — paired side-by-side cards */
.sx .movers-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}
.sx .movers-pair .home-section { margin-bottom: 0; }
@media (max-width: 900px) {
    .sx .movers-pair { grid-template-columns: 1fr; gap: 16px; }
}
.sx .movers-card { padding: 8px 28px; }

.sx .mover-row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 78px 84px;
    column-gap: 14px;
    align-items: baseline;
    padding: 14px 0;
    border-bottom: 1px solid var(--sx-soft-3);
    cursor: pointer;
}
.sx .mover-row:last-child { border-bottom: none; }
.sx .mover-row:hover { background: rgba(0,0,0,0.015); }
.sx .mover-ticker {
    font-family: var(--sx-mono);
    font-weight: 700;
    font-size: 13px;
    color: var(--sx-text);
    letter-spacing: 0.02em;
}
.sx .mover-name {
    font-size: 13px;
    color: var(--sx-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sx .mover-price {
    font-family: var(--sx-mono);
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    color: var(--sx-muted);
    text-align: right;
}
.sx .mover-pct {
    font-family: var(--sx-mono);
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
}
.sx .mover-pct.pos { color: var(--sx-pos); }
.sx .mover-pct.neg { color: var(--sx-neg); }

/* News */
.sx .home-news-list { padding: 4px 26px; }
.sx .home-news-row {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr) 80px;
    gap: 18px;
    padding: 18px 0;
    align-items: center;
    border-bottom: 1px solid var(--sx-soft-3);
    text-decoration: none;
    color: inherit;
}
.sx .home-news-row:last-child { border-bottom: none; }
.sx .home-news-row:hover { background: rgba(0,0,0,0.015); }
.sx .home-news-badge {
    font-family: var(--sx-mono);
    font-weight: 700;
    font-size: 13px;
    color: var(--sx-accent);
    letter-spacing: 0.02em;
}
.sx .home-news-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
}
.sx .home-news-headline {
    font-size: 14px;
    color: var(--sx-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sx .home-news-source {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sx-muted-2);
}
.sx .home-news-time {
    font-family: var(--sx-mono);
    font-size: 12px;
    color: var(--sx-muted-2);
    text-align: right;
}

/* Indices — 6-col strip */
.sx .home-indices {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
}
.sx .home-index-cell {
    padding: 22px 16px;
    border-right: 1px solid var(--sx-soft-3);
}
.sx .home-index-cell:last-child { border-right: none; }
.sx .home-index-name {
    font-size: 11px;
    color: var(--sx-muted);
    margin-bottom: 12px;
    font-weight: 500;
}
.sx .home-index-pct {
    font-family: var(--sx-mono);
    font-variant-numeric: tabular-nums;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 10px;
}
.sx .home-index-pct.pos { color: var(--sx-pos); }
.sx .home-index-pct.neg { color: var(--sx-neg); }
.sx .home-index-sub {
    font-family: var(--sx-mono);
    font-variant-numeric: tabular-nums;
    font-size: 11px;
    color: var(--sx-muted-2);
}
@media (max-width: 900px) {
    .sx .home-indices { grid-template-columns: repeat(3, 1fr); }
    .sx .home-index-cell:nth-child(3n) { border-right: none; }
    .sx .home-index-cell:nth-child(n+4) { border-top: 1px solid var(--sx-soft-3); }
}

/* Earnings — grouped by day */
.sx .home-earnings { padding: 4px 26px 12px; }
.sx .earnings-day {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 18px 0 10px;
    border-bottom: 1px solid var(--sx-soft-3);
}
.sx .earnings-day-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--sx-text);
}
.sx .earnings-day-label.today { color: var(--sx-accent); }
.sx .earnings-day-count {
    font-size: 10.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sx-muted-2);
    font-weight: 500;
}
.sx .earnings-row {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr) 110px 150px;
    gap: 16px;
    padding: 14px 0;
    align-items: baseline;
    border-bottom: 1px solid var(--sx-soft-3);
    cursor: pointer;
}
.sx .earnings-row:last-child { border-bottom: none; }
.sx .earnings-row:hover { background: rgba(0,0,0,0.015); }
.sx .earnings-ticker {
    font-family: var(--sx-mono);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.02em;
}
.sx .earnings-name {
    font-size: 13px;
    color: var(--sx-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sx .earnings-call {
    font-size: 10.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sx-muted-2);
    font-weight: 500;
    text-align: right;
}
.sx .earnings-eps {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 8px;
    font-family: var(--sx-mono);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    text-align: right;
}
.sx .earnings-est { color: var(--sx-muted-2); }
.sx .earnings-yoy {
    font-weight: 600;
    font-size: 11.5px;
}
.sx .earnings-yoy.pos { color: var(--sx-pos); }
.sx .earnings-yoy.neg { color: var(--sx-neg); }
.sx .home-empty {
    padding: 28px 28px;
    color: var(--sx-muted-2);
    font-size: 13px;
    text-align: center;
}

/* ---------------- Alerts page (legacy — currently unused; reachable if reintroduced) ---------------- */
/* All alerts styling is scoped under .alerts-page so it can't leak into other tabs. */
.sx .alerts-page { padding: 24px 32px; max-width: 1380px; margin: 0 auto; }

.sx .alerts-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}
.sx .alerts-page-header h1 {
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -0.02em;
    margin: 0;
}
.sx .alerts-sub {
    font-size: 13px;
    color: var(--sx-muted);
    margin-top: 6px;
}
.sx .alerts-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.sx .alerts-pills {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.sx .alerts-pills .pill {
    background: none;
    border: 1px solid transparent;
}
.sx .alerts-pills .pill:not(.on):hover { background: var(--sx-soft-3); }
.sx .alerts-pills .pill .count {
    margin-left: 6px;
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
}
.sx .alerts-pills .pill.drops {
    background: rgba(181,74,62,0.10);
    color: var(--sx-neg);
}
.sx .alerts-pills .pill.drops.on {
    background: var(--sx-neg);
    color: var(--sx-surface);
}

/* Alert card — severity-tinted background + dot */
.sx .alert-card {
    padding: 0;
    overflow: hidden;
    background: var(--sx-surface);
    border-radius: var(--sx-card-radius);
    box-shadow: var(--sx-card-shadow);
    border: var(--sx-card-border);
    margin-bottom: 10px;
}
.sx .alert-card.high { background: rgba(181,74,62,0.06); }
.sx .alert-card.med  { background: rgba(201,122,26,0.05); }
.sx .alert-card-grid {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 18px;
    padding: 18px 22px;
    align-items: flex-start;
}
.sx .alert-sev-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
}
.sx .alert-card.high .alert-sev-dot { background: var(--sx-neg); }
.sx .alert-card.med  .alert-sev-dot { background: #c97a1a; }
.sx .alert-card.info .alert-sev-dot { background: var(--fp-muted, #5a5750); }

.sx .alert-body { min-width: 0; }
.sx .alert-title-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.sx .alert-title { font-size: 14px; font-weight: 600; color: var(--sx-text); }
.sx .alert-card.high .alert-title { color: var(--sx-neg); }
.sx .alert-card.med  .alert-title { color: #c97a1a; }
.sx .alert-meta { font-size: 12px; color: var(--sx-muted-2); }

/* drop / etf cards — auto-fill grid of ticker rows */
.sx .alert-drop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}
.sx .alert-drop-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.03);
    border-radius: 8px;
}
.sx .alert-drop-row .name {
    font-size: 13px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Movers cards — two-column gainers/losers with proportional bars */
.sx .alert-movers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
@media (max-width: 720px) { .sx .alert-movers { grid-template-columns: 1fr; } }
.sx .alert-movers .mover-list { display: flex; flex-direction: column; gap: 4px; }
.sx .alert-movers .mover-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
}
.sx .alert-movers .mover-row .chip { min-width: 60px; }
.sx .alert-movers .mover-row .chip.pos { background: var(--sx-pos); }
.sx .alert-movers .mover-row .chip.neg { background: var(--sx-neg); }
.sx .alert-movers .mover-bar {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
}
.sx .alert-movers .mover-bar.pos { background: rgba(58,122,74,0.12); }
.sx .alert-movers .mover-bar.neg { background: rgba(181,74,62,0.12); }
.sx .alert-movers .mover-bar-fill { height: 100%; }
.sx .alert-movers .mover-bar.pos .mover-bar-fill { background: var(--sx-pos); }
.sx .alert-movers .mover-bar.neg .mover-bar-fill { background: var(--sx-neg); }
.sx .alert-movers .mover-pct {
    font-family: var(--sx-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 13px;
    min-width: 60px;
    text-align: right;
}

/* News card — headline rows */
.sx .alert-news-list { display: flex; flex-direction: column; gap: 6px; }
.sx .news-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 140ms;
}
.sx .news-row:hover { background: var(--sx-row-hover); }
.sx .news-row .headline {
    font-size: 13px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sx .news-row .arrow { font-size: 11px; color: var(--sx-muted-2); }
.sx .news-more {
    align-self: flex-start;
    margin-top: 4px;
    height: 28px;
    font-size: 12px;
}

/* Right rail — time + dismiss */
.sx .alert-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}
.sx .alert-time { font-size: 11px; color: var(--sx-muted-2); }
.sx .alert-dismiss { height: 28px; font-size: 12px; padding: 0 10px; }

.sx .alerts-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--sx-muted-2);
    font-size: 14px;
    background: var(--sx-surface);
    border-radius: var(--sx-card-radius);
    box-shadow: var(--sx-card-shadow);
    border: var(--sx-card-border);
}
.sx .alerts-footer-hint {
    margin-top: 20px;
    padding: 14px 18px;
    font-size: 12px;
    color: var(--sx-muted);
    text-align: center;
}
.sx .link-acc {
    background: none;
    border: none;
    color: var(--sx-accent);
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
    text-decoration: none;
}
.sx .link-acc:hover { text-decoration: underline; }

/* ---- Configure drawer (right slide-in) ---- */
.sx .drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.30);
    z-index: 998;
    animation: drawerOverlayIn 200ms ease;
}
@keyframes drawerOverlayIn { from { opacity: 0; } to { opacity: 1; } }
.sx .drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 100vw;
    background: var(--sx-surface);
    box-shadow: -8px 0 24px -8px rgba(0,0,0,0.18);
    z-index: 999;
    display: flex;
    flex-direction: column;
    animation: drawerSlideIn 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes drawerSlideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.sx .drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 22px 24px 16px;
    border-bottom: 1px solid var(--sx-soft-4);
    gap: 12px;
}
.sx .drawer-head h2 {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.015em;
    margin: 4px 0 0;
}
.sx .drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}
.sx .drawer-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 24px;
    border-top: 1px solid var(--sx-soft-4);
    background: var(--sx-surface);
}
.sx .drawer-section { margin-bottom: 22px; }
.sx .drawer-section .section-title {
    font-size: 10.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sx-muted-2);
    font-weight: 500;
    margin-bottom: 12px;
}
.sx .drawer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    gap: 12px;
}
.sx .drawer-row .label {
    font-size: 13px;
    color: var(--sx-text);
    flex: 1;
}
.sx .drawer-row .label .hint {
    display: block;
    font-size: 11.5px;
    color: var(--sx-muted-2);
    margin-top: 2px;
}
.sx .drawer-row input[type="number"],
.sx .drawer-row select,
.sx .drawer-row input[type="time"] {
    font-family: inherit;
    background: var(--sx-soft-2);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12.5px;
    color: var(--sx-text);
    min-width: 100px;
}
.sx .drawer-row input[type="number"]:focus,
.sx .drawer-row select:focus,
.sx .drawer-row input[type="time"]:focus {
    background: var(--sx-surface);
    border-color: rgba(0,0,0,0.10);
    outline: none;
}
.sx .drawer-row input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.sx .drawer-pills { display: flex; gap: 6px; flex-wrap: wrap; }

/* Statistics tab — 4-section story */
.sx .stats-page { padding: 24px; }
.sx .stats-page section { margin-bottom: 36px; }
.sx .stats-page section:last-child { margin-bottom: 0; }

/* Inline help dot — instant CSS tooltip via data-tip attribute */
.sx .help-dot {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--sx-soft-3);
    color: var(--sx-muted);
    font-size: 9px;
    font-weight: 600;
    cursor: help;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
}
.sx .help-dot:hover { background: var(--sx-accent); color: var(--sx-surface); }
.sx .help-dot[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translate(-50%, 8px);
    background: var(--sx-text);
    color: var(--sx-surface);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: 0.01em;
    text-transform: none;
    white-space: normal;
    width: max-content;
    max-width: 260px;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms;
    box-shadow: 0 6px 18px -8px rgba(0,0,0,0.4);
}
.sx .help-dot[data-tip]::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translate(-50%, 2px) rotate(45deg);
    width: 8px;
    height: 8px;
    background: var(--sx-text);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms;
}
.sx .help-dot[data-tip]:hover::after,
.sx .help-dot[data-tip]:hover::before { opacity: 1; }

/* Index Returns page — `.tab-content` wrapper already supplies 20×32 padding */
.sx .indices-page { }
.sx .indices-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.sx .indices-header h1 {
    font-size: 26px;
    font-weight: 500;
    letter-spacing: -0.02em;
    margin: 0;
}
.sx .indices-card { overflow: hidden; }
.sx .indices-grid {
    display: grid;
    grid-template-columns: 1.6fr 110px 120px 90px 90px 90px 90px 100px 40px;
    column-gap: 16px;
    align-items: center;
    padding: 14px 24px;
}
.sx .indices-grid.head {
    background: var(--sx-soft-1);
    border-bottom: 1px solid var(--sx-soft-4);
}
.sx .indices-grid.row {
    border-bottom: 1px solid var(--sx-soft-3);
    transition: background 140ms;
    cursor: default;
}
.sx .indices-grid.row:last-child { border-bottom: none; }
.sx .indices-grid.row:hover { background: var(--sx-row-hover); }
.sx .indices-grid .right { text-align: right; }
.sx .indices-grid .name {
    font-weight: 500;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Clickable index name → opens the chart modal */
.sx .indices-grid .ix-name {
    font: inherit; font-weight: 500; font-size: 13px; color: var(--sx-text);
    background: none; border: none; padding: 0; cursor: pointer; text-align: left;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.sx .indices-grid .ix-name:hover { color: var(--sx-accent, var(--fp-accent, #b85c2a)); text-decoration: underline; }
/* Region group band (US / Europe / Asia / Other) */
.sx .indices-group-head {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 24px; background: var(--sx-soft-2);
    border-bottom: 1px solid var(--sx-soft-4);
    position: sticky; top: 0; z-index: 1;
}
.sx .indices-group-head .g-name {
    font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
    color: var(--sx-text);
}
.sx .indices-group-head .g-count {
    font-size: 10px; font-weight: 600; color: var(--sx-muted-2);
    background: var(--sx-soft-3); border-radius: 8px; padding: 1px 7px;
}
.sx .indices-grid .symbol {
    font-family: var(--sx-mono);
    color: var(--sx-muted-2);
    font-size: 11px;
    font-weight: 400;
    margin-left: 4px;
}
.sx .indices-grid .region {
    font-size: 13px;
    color: var(--sx-muted);
}
.sx .indices-loading {
    padding: 40px 24px;
    text-align: center;
    color: var(--sx-muted-2);
    font-size: 13px;
}
.sx .ix-del {
    background: none;
    border: none;
    color: var(--sx-neg);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 120ms;
}
.sx .ix-del:hover { background: rgba(181,74,62,0.08); }

/* Scrollbar (subtle, matches surface) */
.sx ::-webkit-scrollbar { width: 10px; height: 10px; }
.sx ::-webkit-scrollbar-track { background: transparent; }
.sx ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 5px; }
.sx ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.16); }

/* ── Soft modal shell (used by new-entry, edit-pf-meta, etc.) ─────────── */
.sx .modal-box {
    background: var(--sx-surface);
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid var(--sx-soft-6);
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.sx .modal-box .modal-head,
.sx .modal-box .ne-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 0;
    gap: 12px;
    flex-shrink: 0;
}
.sx .modal-box .modal-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--sx-text);
}
.sx .modal-box .modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--sx-muted-2);
    font-size: 16px;
    padding: 4px 6px;
    border-radius: 6px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}
.sx .modal-box .modal-close:hover { color: var(--sx-text); background: var(--sx-soft-3); }
.sx .modal-box .modal-body {
    padding: 16px 20px 20px;
    overflow-y: auto;
}
.sx .modal-box .modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 12px 20px 18px;
    border-top: 1px solid var(--sx-soft-4);
    flex-shrink: 0;
}
.sx .field-label {
    display: block;
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sx-muted-2);
    margin-bottom: 6px;
}
.sx .field-input {
    width: 100%;
    background: var(--sx-soft-2);
    border: 1px solid var(--sx-soft-6);
    border-radius: 8px;
    padding: 8px 11px;
    font-size: 13px;
    color: var(--sx-text);
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
    box-sizing: border-box;
}
.sx .field-input:focus { border-color: var(--sx-accent); background: var(--sx-surface); }

/* New-entry modal tab strip */
.sx .ne-tabs {
    display: flex;
    gap: 2px;
    background: var(--sx-soft-3);
    border-radius: 8px;
    padding: 3px;
}
.sx .ne-tab {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--sx-muted);
    padding: 5px 14px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    line-height: 1.3;
}
.sx .ne-tab:hover { color: var(--sx-text); }
.sx .ne-tab.active { background: var(--sx-surface); color: var(--sx-text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.sx .ne-pane { padding: 16px 20px 20px; overflow-y: auto; }

/* ── More menu dropdown ───────────────────────────────────────────────── */
.sx .more-menu-wrap { position: relative; }
.sx .more-menu-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--sx-surface);
    border: 1px solid var(--sx-soft-6);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06);
    min-width: 160px;
    z-index: 500;
    padding: 4px;
    display: flex;
    flex-direction: column;
}
.sx .more-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 7px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 13px;
    color: var(--sx-text);
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: background 0.12s;
    white-space: nowrap;
}
.sx .more-menu-item:hover { background: var(--sx-soft-3); }
.sx .more-menu-item.danger { color: var(--sx-neg); }
.sx .more-menu-item.danger:hover { background: rgba(181,74,62,0.08); }
.sx .more-menu-sep { height: 1px; background: var(--sx-soft-4); margin: 3px 0; }

/* ── Column picker popover ────────────────────────────────────────────── */
.sx .wl-col-picker {
    position: absolute;
    z-index: 300;
    background: var(--sx-surface);
    border: var(--sx-card-border);
    border-radius: var(--sx-card-radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    padding: 6px 0;
    min-width: 150px;
    display: none;
}
.sx .wl-col-picker.open { display: block; }
.sx .wl-col-picker-title {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--sx-muted-2);
    padding: 4px 12px 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.sx .wl-col-picker-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    font-size: 12.5px;
    cursor: pointer;
    user-select: none;
    color: var(--sx-text);
}
.sx .wl-col-picker-row:hover { background: var(--sx-hover, rgba(0,0,0,0.04)); }
.sx .wl-col-picker-row input[type=checkbox] { cursor: pointer; accent-color: var(--sx-accent); }
.sx .wl-col-picker-btn {
    font-size: 11.5px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid var(--sx-soft-4);
    background: var(--sx-surface);
    color: var(--sx-muted);
    cursor: pointer;
    transition: all 120ms;
    white-space: nowrap;
}
.sx .wl-col-picker-btn:hover {
    border-color: var(--sx-accent);
    color: var(--sx-accent);
}

/* ═══════════════════════════════════════════════
   PORTFOLIO BUILDER
   ═══════════════════════════════════════════════ */

.bld-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 24px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Page header */
.bld-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}
.bld-page-title {
  font-family: ui-serif, Georgia, serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--sx-text);
  margin: 0 0 4px;
}
.bld-page-sub {
  font-size: 13px;
  color: var(--sx-muted-2);
  margin: 0;
  max-width: 480px;
}
.bld-header-controls {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.bld-ctrl-label {
  font-size: 11px;
  color: var(--sx-muted-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Total bar */
.bld-total-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--sx-soft-2);
  border: 1px solid var(--sx-soft-5);
  border-radius: 10px;
  padding: 12px 18px;
  flex-wrap: wrap;
}
.bld-total-label { font-size: 12px; color: var(--sx-muted-2); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }
.bld-total-num   { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 70px; }
.bld-total-num.ok   { color: var(--sx-pos); }
.bld-total-num.warn { color: var(--fp-accent, #b85c2a); }
.bld-part-sums { display: flex; gap: 18px; margin-left: auto; font-size: 13px; color: var(--sx-muted); }
.bld-part-sums b { color: var(--sx-text); }

/* Sections */
.bld-section {
  background: var(--sx-surface);
  border: 1px solid var(--sx-soft-4);
  border-radius: 12px;
  overflow: hidden;
}
.bld-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--sx-soft-4);
  background: var(--sx-soft-1);
  flex-wrap: wrap;
  gap: 8px;
}
.bld-section-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  margin-right: 6px;
}
.bld-section-badge.core  { background: #d4e8da; color: var(--fp-positive, #2d6a3a); }
.bld-section-badge.theme { background: #dce4f5; color: #2d4da0; }
.bld-section-badge.stock { background: var(--fp-selected, #f5e8d4); color: var(--fp-accent, #b85c2a); }
.bld-section-title  { font-size: 14px; font-weight: 600; color: var(--sx-text); }
.bld-section-target { font-size: 12px; }

/* Row header */
.bld-rows-header {
  display: grid;
  grid-template-columns: 80px 1fr 90px 90px 80px 28px;
  gap: 10px;
  padding: 7px 18px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sx-muted-2);
  border-bottom: 1px solid var(--sx-soft-3);
}
.bld-rows-header .right { text-align: right; }

/* Data rows */
.bld-rows { min-height: 40px; }
.bld-empty { padding: 18px; font-size: 13px; color: var(--sx-muted-2); font-style: italic; }
.bld-row {
  display: grid;
  grid-template-columns: 80px 1fr 90px 90px 80px 28px;
  gap: 10px;
  padding: 10px 18px;
  align-items: center;
  border-bottom: 1px solid var(--sx-soft-3);
  transition: background 120ms;
}
.bld-row:last-child { border-bottom: none; }
.bld-row:hover { background: var(--sx-row-hover); }

.bld-ticker {
  font-family: var(--sx-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--sx-text);
  background: var(--sx-soft-3);
  padding: 2px 6px;
  border-radius: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bld-name  { font-size: 13px; color: var(--sx-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bld-price { font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.bld-eur   { font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; font-weight: 500; color: var(--sx-text); }

.bld-weight-input {
  width: 62px;
  text-align: right;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  padding: 4px 6px;
  border: 1px solid var(--sx-soft-5);
  border-radius: 6px;
  background: var(--sx-surface);
  color: var(--sx-text);
  font-family: inherit;
  outline: none;
}
.bld-weight-input:focus { border-color: var(--sx-accent); }
.bld-pct-sym { font-size: 12px; color: var(--sx-muted); margin-left: -6px; }

.bld-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--sx-muted-2);
  font-size: 16px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 120ms, background 120ms;
}
.bld-remove:hover { color: var(--sx-neg); background: rgba(181,74,62,0.08); }

/* Picker panel */
.bld-picker-panel {
  background: var(--sx-surface);
  border-radius: 14px;
  width: min(520px, 95vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}
.bld-picker-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--sx-soft-4);
  flex-shrink: 0;
}
.bld-picker-title { font-size: 16px; font-weight: 600; color: var(--sx-text); }
.bld-picker-body  { overflow-y: auto; padding: 8px 0; flex: 1; }
.bld-picker-foot  { padding: 12px 20px; border-top: 1px solid var(--sx-soft-4); flex-shrink: 0; display: flex; justify-content: flex-end; }

.bld-pick-row {
  display: grid;
  grid-template-columns: 24px 80px 160px 1fr;
  gap: 10px;
  align-items: center;
  padding: 9px 20px;
  cursor: pointer;
  transition: background 120ms;
}
.bld-pick-row:hover   { background: var(--sx-row-hover); }
.bld-pick-row.selected { background: rgba(45,106,58,0.06); }
.bld-pick-ticker { font-family: var(--sx-mono); font-size: 11px; font-weight: 600; color: var(--sx-text); }
.bld-pick-label  { font-size: 13px; font-weight: 500; color: var(--sx-text); }
.bld-pick-name   { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bld-stock-search {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 20px 4px;
}

/* Autocomplete dropdown */
.bld-ac-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--sx-surface);
  border: 1px solid var(--sx-soft-5);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  z-index: 300;
  max-height: 280px;
  overflow-y: auto;
}
.bld-ac-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 100ms;
  border-bottom: 1px solid var(--sx-soft-3);
}
.bld-ac-item:last-of-type { border-bottom: none; }
.bld-ac-item:hover        { background: var(--sx-row-hover); }
.bld-ac-ticker  { font-family: var(--sx-mono); font-size: 11px; font-weight: 700; color: var(--sx-text); }
.bld-ac-name    { font-size: 13px; color: var(--sx-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bld-ac-price   { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--sx-muted); text-align: right; white-space: nowrap; }
.bld-ac-loading { padding: 10px 14px; font-size: 13px; color: var(--sx-muted-2); }
.bld-ac-empty   { padding: 10px 14px; font-size: 13px; color: var(--sx-muted-2); font-style: italic; }
.bld-ac-footer  {
  padding: 8px 14px;
  font-size: 12px;
  color: var(--sx-accent);
  cursor: pointer;
  border-top: 1px solid var(--sx-soft-4);
  background: var(--sx-soft-1);
}
.bld-ac-footer:hover { background: var(--sx-soft-3); }
.bld-pick-divider {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sx-muted-2);
  padding: 8px 20px 4px;
}

/* ═══════════════════════════════════════════════
   MOBILE — everything ≤ 768px
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Topbar: tighten, allow wrap ── */
  .sx .topbar {
    padding: 12px 16px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .sx .topbar-left {
    gap: 2px;
    flex-wrap: wrap;
    width: 100%;
    order: 2;
  }
  .sx .topbar-right {
    order: 1;
    margin-left: auto;
    gap: 8px;
  }
  .sx .brand {
    font-size: 17px;
    margin-right: 8px;
  }
  .sx .nav {
    padding: 5px 8px;
    font-size: 12px;
  }
  /* hide low-priority topbar items on small screens */
  #last-updated { display: none !important; }

  /* ── Home page ── */
  .sx .home-head {
    padding: 16px 16px 12px;
    flex-direction: column;
    gap: 6px;
  }
  .sx .home-title { font-size: 22px; }
  .sx .home-kicker { font-size: 11px; }
  .sx .movers-pair {
    grid-template-columns: 1fr !important;
    gap: 12px;
    padding: 0 12px 16px;
  }
  .sx .home-section { padding: 0; }
  .sx .home-card { padding: 0 4px; }
  .sx .home-indices-strip {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
    padding: 0 12px 12px;
  }

  /* ── KPI / summary strips ── */
  .sx .kpi-strip,
  .sx .pf-kpi-strip {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
    padding: 12px 14px;
  }
  .sx .kpi-value-lg { font-size: 26px; }
  .sx .kpi-value    { font-size: 18px; }
  .sx .kpi-label    { font-size: 10px; }

  /* ── Cards / sections ── */
  .sx .card {
    border-radius: 10px;
    padding: 14px 14px;
  }
  .sx .section-head { padding: 0 14px 10px; }

  /* ── Watchlist grid: let it scroll horizontally ── */
  .sx .wl-card { border-radius: 10px; }
  .sx .wl-filter-row {
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
  }
  .sx .wl-filter-row .input.add { width: 100%; min-width: 0; }
  .sx .chip-scroll { padding: 0 12px 10px; }
  /* hide col-resize handles (finger-unfriendly) */
  .sx .wl-grid.head .col-resize { display: none !important; }
  .sx .wl-grid .grid-row { padding: 10px 12px; font-size: 12px; }

  /* ── Portfolio layout: stack sidebar below ── */
  .sx .pf-title   { font-size: 22px; }
  .sx .pf-hero-top { padding: 14px 16px 10px; }
  .sx .pf-tabs    { padding: 0 16px; }
  .sx .tab-pane   { padding: 12px 12px; }

  /* ── Movers / report grids ── */
  .sx .report-grid,
  .sx .tg-grid { font-size: 11px; }

  /* ── Options grid: reduce columns ── */
  .sx .opt-grid {
    grid-template-columns: repeat(4, minmax(60px, 1fr)) !important;
    font-size: 11px;
  }
  .sx .opt-grid.head { display: none; } /* hide header row on mobile — too cramped */

  /* ── Modals: full-width on mobile ── */
  .sx .modal-panel,
  .sx .drawer {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 14px 14px 0 0;
    bottom: 0;
    top: auto;
    transform: none;
    position: fixed;
    left: 0;
    right: 0;
  }

  /* ── Detail / stock panel ── */
  .sx .detail-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }
  .sx .detail-stats-key {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* ── Buttons: easier tap targets ── */
  .sx .btn, .sx .btn-dark, .sx .btn-ghost {
    min-height: 36px;
    padding: 6px 12px;
    font-size: 13px;
  }

  /* ── Table rows: more breathing room ── */
  .sx .grid-row { padding: 10px 12px; }
  .sx .grid-row.head { font-size: 10px; }

  /* (Indices tab handled in dedicated mobile block below — horizontal scroll, all 9 cols.) */
}

/* ── Mobile portfolio + watchlist grids: horizontal scroll, NO sticky except holdings ── */
@media (max-width: 768px) {
  /* Transactions — pure horizontal scroll, nothing frozen */
  #transactions-section { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  .sx .tx-grid {
    min-width: 880px !important;
    grid-template-columns: 90px 50px 70px 180px 50px 80px 80px 70px 90px !important;
    font-size: 11.5px !important;
    column-gap: 10px !important;
    padding: 9px 12px !important;
  }

  /* Closed positions — pure horizontal scroll */
  #closed-section { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  .sx .closed-grid {
    min-width: 820px !important;
    font-size: 11.5px !important;
    column-gap: 10px !important;
    padding: 9px 12px !important;
  }

  /* Dividends — pure horizontal scroll */
  #dividends-section { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  .sx .div-grid {
    min-width: 520px !important;
    grid-template-columns: 90px 60px minmax(180px, 1fr) 110px 50px !important;
    column-gap: 10px !important;
    padding: 10px 12px !important;
    font-size: 12px !important;
  }

  /* Watchlist — pure horizontal scroll */
  .sx .wl-card {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    max-height: none !important;
  }
  .sx .wl-grid {
    min-width: 900px !important;
    font-size: 12px !important;
  }
  .sx .wl-grid.head .col-resize { display: none !important; }
  .sx .wl-filter-row { flex-wrap: wrap; gap: 6px; padding: 10px 12px; }
  .sx .wl-filter-row .input.search { width: 100% !important; max-width: 100% !important; min-width: 0; }
  .sx .wl-filter-row .input.add    { width: 100% !important; min-width: 0; }
  .sx .chip-scroll { padding: 0 12px 10px; }

  /* Indices — 3-row stacked card per index, no horizontal scroll.
     Original col order: 1=name 2=region 3=price 4=daily% 5=weekly% 6=monthly% 7=YTD% 8=52W% 9=delete */
  .sx .indices-card { overflow-x: hidden !important; }
  .sx .indices-grid.head { display: none !important; }
  .sx .indices-grid.row {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-template-rows: auto auto auto !important;
    column-gap: 8px !important;
    row-gap: 10px !important;
    padding: 14px 14px !important;
    align-items: start !important;
    border-bottom: 1px solid var(--sx-soft-3);
  }

  /* Row 1: name (3 cols) | price (1 col) */
  .sx .indices-grid.row > *:nth-child(1) {
    grid-column: 1 / 4; grid-row: 1;
    font-size: 14px !important; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .sx .indices-grid.row > *:nth-child(3) {  /* price */
    grid-column: 4 / 5; grid-row: 1;
    text-align: right !important; font-weight: 600 !important;
    font-size: 13px !important;
  }

  /* Row 2: region (3 cols) | daily% (1 col) */
  .sx .indices-grid.row > *:nth-child(2) {  /* region */
    grid-column: 1 / 4; grid-row: 2;
    color: var(--sx-muted) !important; font-size: 11px !important;
  }
  .sx .indices-grid.row > *:nth-child(4) {  /* daily% */
    grid-column: 4 / 5; grid-row: 2;
    text-align: right !important; font-size: 12px !important;
  }
  /* Show "TODAY" label above daily% so it's clearer */
  .sx .indices-grid.row > *:nth-child(4)::before {
    content: "Today";
    display: block;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sx-muted-2);
    margin-bottom: 2px;
  }

  /* Row 3: 4 mini-stats with labels */
  .sx .indices-grid.row > *:nth-child(5),  /* weekly% */
  .sx .indices-grid.row > *:nth-child(6),  /* monthly% */
  .sx .indices-grid.row > *:nth-child(7),  /* YTD% */
  .sx .indices-grid.row > *:nth-child(8) { /* 52W% */
    grid-row: 3;
    text-align: center !important;
    font-size: 12px !important;
    padding-top: 6px;
    border-top: 1px solid var(--sx-soft-3);
  }
  .sx .indices-grid.row > *:nth-child(5) { grid-column: 1 / 2; }
  .sx .indices-grid.row > *:nth-child(6) { grid-column: 2 / 3; }
  .sx .indices-grid.row > *:nth-child(7) { grid-column: 3 / 4; }
  .sx .indices-grid.row > *:nth-child(8) { grid-column: 4 / 5; }

  /* Inject column labels above each value via ::before */
  .sx .indices-grid.row > *:nth-child(5)::before { content: "Week"; }
  .sx .indices-grid.row > *:nth-child(6)::before { content: "Month"; }
  .sx .indices-grid.row > *:nth-child(7)::before { content: "YTD"; }
  .sx .indices-grid.row > *:nth-child(8)::before { content: "52W High"; }
  .sx .indices-grid.row > *:nth-child(5)::before,
  .sx .indices-grid.row > *:nth-child(6)::before,
  .sx .indices-grid.row > *:nth-child(7)::before,
  .sx .indices-grid.row > *:nth-child(8)::before {
    display: block;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sx-muted-2);
    margin-bottom: 3px;
  }

  /* Hide delete button on mobile (still accessible via long-press or desktop) */
  .sx .indices-grid.row > *:nth-child(9) { display: none !important; }

  .sx .indices-page   { padding: 12px 12px 40px !important; }
  .sx .indices-header { padding: 0 0 12px !important; flex-wrap: wrap; gap: 8px; }
  .sx .indices-header h1 { font-size: 20px !important; }

  /* Statistics — fix cropped overflow */
  #stats-section { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  .sx .stats-page { padding: 14px 12px !important; }
  .sx .stats-page section { margin-bottom: 22px !important; }
  /* If any inner stat-grid uses fixed columns, force responsive single-column */
  .sx .stats-page .stat-grid,
  .sx .stats-page .stats-grid,
  .sx .stats-page .stat-row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  /* Allow KPI tiles to wrap into rows of 2 instead of overflowing */
  .sx .stats-page [class*="grid"] {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
  }
}

/* ── Extra-small phones ≤ 480px ── */
@media (max-width: 480px) {
  .sx .topbar { padding: 10px 12px; }
  .sx .nav { font-size: 11px; padding: 4px 6px; }
  .sx .brand { font-size: 15px; }
  .sx .kpi-strip,
  .sx .pf-kpi-strip { grid-template-columns: 1fr 1fr !important; }
  .sx .home-title { font-size: 19px; }
  .sx .home-indices-strip { grid-template-columns: 1fr 1fr !important; }
  /* hide earnings + refresh btn to save space */
  #earnings-btn { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Portfolio Builder v3 — vertical stacked tiers, soft layered design
   ═══════════════════════════════════════════════════════════════════════════ */
.sx .pb3 { font-family: var(--sx-sans); color: var(--fp-text, #2a2825); background: var(--fp-canvas, #f0ede4); min-height: 100vh; padding-bottom: 48px; }
.sx .pb3 .pb3-mono { font-family: var(--sx-mono); font-variant-numeric: tabular-nums; }
.sx .pb3 .pb3-num  { font-variant-numeric: tabular-nums; }
.sx .pb3 .pb3-micro { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fp-muted, #656259); font-weight: 500; }

/* header card — inset & rounded to match the tier cards below */
.sx .pb3 .pb3-topcard { background: var(--fp-surface, #fdfbf6); border-radius: 12px; border: 1px solid rgba(0,0,0,0.05); margin: 20px 32px 16px; overflow: hidden; }

/* page header */
.sx .pb3 .pb3-page-head { border-bottom: 1px solid rgba(0,0,0,0.06); padding: 20px 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.sx .pb3 .pb3-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 2px; color: var(--fp-text, #2a2825); }
.sx .pb3 .pb3-sub { font-size: 12.5px; color: var(--fp-muted, #656259); margin: 0; }
.sx .pb3 .pb3-head-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sx .pb3 .pb3-field { height: 36px; background: rgba(0,0,0,0.05); border: 1px solid transparent; border-radius: 8px; padding: 0 12px; font-size: 13px; font-family: inherit; outline: none; color: var(--fp-text, #2a2825); box-sizing: border-box; }
.sx .pb3 .pb3-field:focus { background: var(--fp-surface, #fdfbf6); border-color: var(--fp-accent, #b85c2a); }
.sx .pb3 .pb3-amt-wrap { position: relative; display: inline-flex; align-items: center; }
.sx .pb3 .pb3-amt-sym  { position: absolute; left: 10px; font-size: 13px; color: var(--fp-muted, #656259); pointer-events: none; }
.sx .pb3 .pb3-seg { display: flex; background: rgba(0,0,0,0.05); border-radius: 8px; padding: 3px; gap: 2px; }
.sx .pb3 .pb3-seg button { flex: 1; min-width: 76px; height: 28px; padding: 0 10px; border: none; border-radius: 5px; font-size: 11.5px; cursor: pointer; font-family: inherit; background: transparent; color: var(--fp-muted, #656259); }
.sx .pb3 .pb3-seg button.on { background: var(--fp-surface, #fdfbf6); color: var(--fp-text, #2a2825); font-weight: 500; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.sx .pb3 .pb3-btn-prim { background: var(--fp-accent, #b85c2a); color: var(--fp-surface, #fdfbf6); height: 36px; padding: 0 20px; border: none; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit; white-space: nowrap; }
.sx .pb3 .pb3-btn-prim:hover { background: #a04a1f; }

/* allocation strip */
.sx .pb3 .pb3-alloc-strip { padding: 18px 32px; }

/* custom target-split editor */
.sx .pb3 .pb3-custom-tgt { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid rgba(0,0,0,0.06); }
.sx .pb3 .pb3-ct-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fp-muted, #656259); font-weight: 600; }
.sx .pb3 .pb3-ct-field { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--fp-muted, #656259); background: rgba(0,0,0,0.04); border-radius: 8px; padding: 5px 10px; }
.sx .pb3 .pb3-ct-field input { width: 52px; height: 28px; background: var(--fp-surface, #fdfbf6); border: 1px solid rgba(0,0,0,0.08); border-radius: 6px; padding: 0 8px; font-size: 13px; font-family: var(--sx-mono); font-variant-numeric: tabular-nums; text-align: right; outline: none; color: var(--fp-text, #2a2825); box-sizing: border-box; }
.sx .pb3 .pb3-ct-field input:focus { border-color: var(--fp-accent, #b85c2a); }
.sx .pb3 .pb3-ct-pct { color: var(--fp-muted, #656259); font-size: 12px; }
.sx .pb3 .pb3-ct-total { font-size: 12.5px; font-family: var(--sx-mono); font-variant-numeric: tabular-nums; font-weight: 600; }
.sx .pb3 .pb3-ct-total.ok { color: var(--fp-positive, #2d6a3a); }
.sx .pb3 .pb3-ct-total.warn { color: #a06a1f; }
.sx .pb3 .pb3-ct-even { background: rgba(0,0,0,0.05); border: none; border-radius: 7px; height: 30px; padding: 0 14px; font-size: 12px; cursor: pointer; font-family: inherit; color: var(--fp-muted, #656259); }
.sx .pb3 .pb3-ct-even:hover { background: rgba(0,0,0,0.09); color: var(--fp-text, #2a2825); }
.sx .pb3 .pb3-alloc-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 16px; flex-wrap: wrap; }
.sx .pb3 .pb3-alloc-legend { display: flex; gap: 20px; flex-wrap: wrap; }
.sx .pb3 .pb3-alloc-item   { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.sx .pb3 .pb3-alloc-dot    { width: 8px; height: 8px; border-radius: 2px; }
.sx .pb3 .pb3-alloc-label  { color: var(--fp-muted, #656259); }
.sx .pb3 .pb3-alloc-cur    { font-family: var(--sx-mono); font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 600; color: var(--fp-text, #2a2825); }
.sx .pb3 .pb3-alloc-cur.warn { color: var(--fp-negative, #a23a2e); }
.sx .pb3 .pb3-alloc-tgt    { font-size: 11px; color: #b0aea5; }
.sx .pb3 .pb3-alloc-right  { display: flex; align-items: center; gap: 12px; }
.sx .pb3 .pb3-unalloc      { font-size: 12px; color: var(--fp-muted, #656259); }
.sx .pb3 .pb3-over-warn    { background: rgba(162,58,46,0.08); border-radius: 6px; padding: 8px 12px; font-size: 12px; color: var(--fp-negative, #a23a2e); }
.sx .pb3 .pb3-total-num    { font-size: 18px; font-weight: 500; letter-spacing: -0.02em; color: var(--fp-text, #2a2825); }
.sx .pb3 .pb3-total-num.ok   { color: var(--fp-positive, #2d6a3a); }
.sx .pb3 .pb3-total-num.over { color: var(--fp-negative, #a23a2e); }
.sx .pb3 .pb3-pct          { font-size: 12px; color: var(--fp-muted, #656259); font-weight: 500; }
.sx .pb3 .pb3-abar         { height: 8px; border-radius: 4px; overflow: hidden; background: rgba(0,0,0,0.07); display: flex; }
.sx .pb3 .pb3-abar-current { margin-bottom: 5px; }
.sx .pb3 .pb3-abar > div   { transition: width 160ms; height: 100%; }
.sx .pb3 .pb3-bar-caption  { font-size: 10px; color: var(--fp-muted, #656259); margin-top: 4px; }

/* live diversification + cost insights */
.sx .pb3 .pb3-insights { display: grid; grid-template-columns: 1fr 1fr 200px; gap: 24px; margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(0,0,0,0.06); align-items: start; }
.sx .pb3 .pb3-geo-div { border-left: 1px solid rgba(0,0,0,0.06); padding-left: 24px; }
.sx .pb3 .pb3-insights-label { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fp-muted, #656259); font-weight: 600; }
.sx .pb3 .pb3-insights-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.sx .pb3 .pb3-geo-caption { font-size: 13px; color: var(--fp-text, #4a4845); font-weight: 500; }
.sx .pb3 .pb3-geo-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: rgba(0,0,0,0.06); }
.sx .pb3 .pb3-geo-seg { height: 100%; transition: width 200ms; }
.sx .pb3 .pb3-geo-empty { width: 100%; height: 100%; }
.sx .pb3 .pb3-geo-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
.sx .pb3 .pb3-geo-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fp-muted, #656259); }
.sx .pb3 .pb3-geo-item b { color: var(--fp-text, #2a2825); font-weight: 600; font-variant-numeric: tabular-nums; }
.sx .pb3 .pb3-geo-dot { width: 8px; height: 8px; border-radius: 2px; }
.sx .pb3 .pb3-geo-hint { font-size: 12px; color: #b0aea5; }
/* neutral tilt note — deliberately NOT a heads-up banner: plain grey text, no icon, not dismissible */
.sx .pb3 .pb3-geo-note { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--fp-muted, #656259); line-height: 1.45; }
.sx .pb3 .pb3-note-row { display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; }
.sx .pb3 .pb3-note-x { background: none; border: none; color: #b0aea5; font-size: 15px; line-height: 1; cursor: pointer; padding: 0 2px; flex-shrink: 0; }
.sx .pb3 .pb3-note-x:hover { color: var(--fp-muted, #656259); }
.sx .pb3 .pb3-cost { border-left: 1px solid rgba(0,0,0,0.06); padding-left: 24px; }
.sx .pb3 .pb3-cost-main { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; color: var(--fp-text, #2a2825); margin-top: 6px; }
.sx .pb3 .pb3-cost-unit { font-size: 13px; font-weight: 500; color: var(--fp-muted, #656259); }
.sx .pb3 .pb3-cost-sub { font-size: 12.5px; color: var(--fp-muted, #656259); margin-top: 3px; }
.sx .pb3 .pb3-cost-note { font-size: 11px; color: #a06a1f; margin-top: 5px; }

/* overlap notice — informational, dismissible, never blocks */
.sx .pb3 .pb3-overlap { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; padding: 11px 14px; background: rgba(var(--fp-accent-rgb, 184,92,42),0.07); border: 1px solid rgba(var(--fp-accent-rgb, 184,92,42),0.18); border-radius: 9px; }
.sx .pb3 .pb3-overlap-icon { color: var(--fp-accent, #b85c2a); font-size: 14px; line-height: 1.4; }
.sx .pb3 .pb3-overlap-body { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: #6a4a35; line-height: 1.45; }
.sx .pb3 .pb3-overlap-x { background: none; border: none; color: #9a8575; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
.sx .pb3 .pb3-overlap-x:hover { color: #6a4a35; }
@media (max-width: 900px) {
  .sx .pb3 .pb3-insights { grid-template-columns: 1fr; gap: 16px; }
  .sx .pb3 .pb3-geo-div { border-left: none; padding-left: 0; border-top: 1px solid rgba(0,0,0,0.06); padding-top: 12px; }
  .sx .pb3 .pb3-cost { border-left: none; padding-left: 0; border-top: 1px solid rgba(0,0,0,0.06); padding-top: 12px; }
}

/* tier cards */
.sx .pb3 .pb3-tiers { padding-top: 0; }
.sx .pb3 .pb3-tier  { background: var(--fp-surface, #fdfbf6); border-radius: 12px; border: 1px solid rgba(0,0,0,0.05); margin: 0 32px 16px; overflow: hidden; }
.sx .pb3 .pb3-tier-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid rgba(0,0,0,0.05); gap: 12px; flex-wrap: wrap; }
.sx .pb3 .pb3-tier-head-left  { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sx .pb3 .pb3-tier-head-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sx .pb3 .pb3-tier-label   { font-size: 14px; font-weight: 600; }
.sx .pb3 .pb3-tier-hint    { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fp-muted, #656259); font-weight: 500; }
.sx .pb3 .pb3-tier-weight  { font-family: var(--sx-mono); font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; color: var(--fp-positive, #2d6a3a); }
.sx .pb3 .pb3-tier-weight.off { color: var(--fp-negative, #a23a2e); }

/* badges */
.sx .pb3 .pb3-badge   { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; }
.sx .pb3 .pb3-b-core     { background: #e4ede0; color: #2d5a20; }
.sx .pb3 .pb3-b-thematic { background: #e2e5f5; color: #2a3d8a; }
.sx .pb3 .pb3-b-stocks   { background: #fce8dc; color: #7a3012; }

/* row buttons */
.sx .pb3 .pb3-btn-sm   { background: transparent; color: var(--fp-muted, #656259); height: 28px; padding: 0 10px; border: 1px solid rgba(0,0,0,0.1); border-radius: 6px; font-size: 12px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.sx .pb3 .pb3-btn-sm:hover { background: rgba(0,0,0,0.04); }
.sx .pb3 .pb3-btn-sm.dirty { background: rgba(var(--fp-accent-rgb, 184,92,42),0.16); color: var(--fp-accent, #b85c2a); border-color: var(--fp-accent, #b85c2a); font-weight: 600; box-shadow: 0 0 0 0 rgba(var(--fp-accent-rgb, 184,92,42),0.45); animation: pb3-dirty-pulse 1.6s ease-out infinite; }
.sx .pb3 .pb3-btn-sm.dirty:hover { background: rgba(var(--fp-accent-rgb, 184,92,42),0.24); }
.sx .pb3 .pb3-dirty-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--fp-accent, #b85c2a); margin-right: 6px; vertical-align: middle; }
@keyframes pb3-dirty-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(var(--fp-accent-rgb, 184,92,42),0.40); }
  70%  { box-shadow: 0 0 0 6px rgba(var(--fp-accent-rgb, 184,92,42),0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--fp-accent-rgb, 184,92,42),0); }
}
.sx .pb3 .pb3-btn-add  { background: var(--fp-accent, #b85c2a); color: var(--fp-surface, #fdfbf6); height: 28px; padding: 0 12px; border: none; border-radius: 6px; font-size: 12px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.sx .pb3 .pb3-btn-add:hover { background: #a04a1f; }
.sx .pb3 .pb3-btn-danger   { background: transparent; border: none; color: #c0b8b0; font-size: 12px; cursor: pointer; font-family: inherit; padding: 0 4px; }
.sx .pb3 .pb3-btn-danger:hover { color: var(--fp-negative, #b54a3e); }

/* rows */
.sx .pb3 .pb3-col-heads { display: grid; grid-template-columns: 92px minmax(180px, 1fr) 156px 120px 78px 112px 32px; column-gap: 14px; padding: 9px 24px; background: rgba(0,0,0,0.02); border-bottom: 1px solid rgba(0,0,0,0.04); }
.sx .pb3 .pb3-row { display: grid; grid-template-columns: 92px minmax(180px, 1fr) 156px 120px 78px 112px 32px; column-gap: 14px; padding: 14px 24px; align-items: center; border-bottom: 1px solid rgba(0,0,0,0.04); transition: background 100ms; }
.sx .pb3 .pb3-row:last-child { border-bottom: 0; }
.sx .pb3 .pb3-row:hover { background: rgba(0,0,0,0.02); }
.sx .pb3 .pb3-row:hover .pb3-del { opacity: 1; }
.sx .pb3 .pb3-empty  { padding: 16px 24px; font-size: 13px; color: #b0aea5; text-align: center; }
.sx .pb3 .pb3-ticker { font-family: var(--sx-mono); font-size: 14px; font-weight: 700; letter-spacing: 0.02em; color: var(--fp-text, #2a2825); }
.sx .pb3 .pb3-name   { font-size: 14.5px; color: var(--fp-text, #2a2825); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx .pb3 .pb3-name.empty { color: #b0aea5; }
.sx .pb3 .pb3-region { font-size: 13px; color: var(--fp-muted, #656259); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx .pb3 .pb3-region-pill { display: inline-block; padding: 3px 10px; border-radius: 11px; background: rgba(58,122,74,0.10); color: #2d5a35; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.sx .pb3 .pb3-price  { font-family: var(--sx-mono); font-variant-numeric: tabular-nums; text-align: right; font-size: 14px; color: var(--fp-text, #4a4845); }
.sx .pb3 .pb3-ter    { font-family: var(--sx-mono); font-variant-numeric: tabular-nums; text-align: right; font-size: 13px; color: var(--fp-muted, #656259); }
.sx .pb3 .pb3-ter.muted-dash { color: #b0aea5; }
.sx .pb3 .pb3-w-wrap { display: flex; align-items: center; gap: 5px; justify-content: flex-end; }
.sx .pb3 .pb3-w-inp  { width: 82px; height: 34px; background: rgba(0,0,0,0.05); border: 1px solid transparent; border-radius: 7px; padding: 0 9px; font-size: 14px; font-family: var(--sx-mono); font-variant-numeric: tabular-nums; text-align: right; outline: none; color: var(--fp-text, #2a2825); box-sizing: border-box; }
.sx .pb3 .pb3-w-inp:focus { background: var(--fp-surface, #fdfbf6); border-color: var(--fp-accent, #b85c2a); }
.sx .pb3 .pb3-w-inp::-webkit-outer-spin-button,
.sx .pb3 .pb3-w-inp::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sx .pb3 .pb3-w-inp { -moz-appearance: textfield; appearance: textfield; }
.sx .pb3 .pb3-w-sym  { font-size: 13px; color: var(--fp-muted, #656259); }
.sx .pb3 .pb3-del    { opacity: 0; background: none; border: none; color: #bab8b0; cursor: pointer; font-size: 17px; line-height: 1; padding: 0; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 3px; transition: opacity 120ms; }
.sx .pb3 .pb3-del:hover { color: var(--fp-negative, #b54a3e); opacity: 1; }

/* tier-off (tier hidden) */
.sx .pb3 .pb3-tier-off { border: 1.5px dashed rgba(0,0,0,0.1); border-radius: 12px; margin: 0 32px 16px; padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sx .pb3 .pb3-tier-off-left { display: flex; align-items: center; gap: 10px; }
.sx .pb3 .pb3-tier-off-text { font-size: 13px; color: var(--fp-muted, #656259); }

/* mobile tweaks */
@media (max-width: 720px) {
  .sx .pb3 .pb3-page-head, .sx .pb3 .pb3-alloc-strip { padding-left: 16px; padding-right: 16px; }
  .sx .pb3 .pb3-topcard, .sx .pb3 .pb3-tier, .sx .pb3 .pb3-tier-off { margin-left: 16px; margin-right: 16px; }
  .sx .pb3 .pb3-col-heads, .sx .pb3 .pb3-row { grid-template-columns: 72px 1fr 70px 80px 22px; column-gap: 8px; padding-left: 12px; padding-right: 12px; }
  /* Region/Theme/Sector and TER columns are dropped on narrow screens to keep the row readable. */
  .sx .pb3 .pb3-region, .sx .pb3 .pb3-ter { display: none; }
  .sx .pb3 .pb3-col-heads .pb3-micro:nth-child(3),
  .sx .pb3 .pb3-col-heads .pb3-micro:nth-child(5) { display: none; }
}

/* Mobile: stack — categories on top as horizontal chips, list below */
@media (max-width: 720px) {
  .sx .etfp-panel { width: 100vw; height: 100vh; border-radius: 0; }
  .sx .etfp-body  { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sx .etfp-cats  { border-right: none; border-bottom: 1px solid rgba(0,0,0,0.06); padding: 8px 12px; display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; }
  .sx .etfp-cat-item { border-left: none; border: 1px solid rgba(0,0,0,0.1); border-radius: 16px; padding: 6px 12px; white-space: nowrap; }
  .sx .etfp-cat-item.active { background: var(--fp-accent, #b85c2a); color: var(--fp-surface, #fdfbf6); border-color: var(--fp-accent, #b85c2a); }
  .sx .etfp-cat-item.active .etfp-cat-count { background: var(--fp-surface, #fdfbf6); color: var(--fp-accent, #b85c2a); }
  .sx .etfp-thead, .sx .etfp-row { grid-template-columns: 30px 1fr 80px 56px 60px; column-gap: 8px; padding-left: 12px; padding-right: 12px; }
  .sx .etfp-thead .h-isin, .sx .etfp-thead .h-dist, .sx .etfp-row .etfp-isin, .sx .etfp-row .etfp-dist { display: none; }
  .sx .etfp-table { margin: 8px 12px 12px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ETF catalog picker — v2 (matches the soft layered redesign)
   ═══════════════════════════════════════════════════════════════════════════ */
.sx .etfp-overlay { position: fixed; inset: 0; background: rgba(20,18,14,0.45); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.sx .etfp-panel   { background: var(--fp-canvas, #f0ede4); border-radius: 16px; box-shadow: 0 24px 80px rgba(0,0,0,0.22); width: min(1180px, 96vw); height: min(800px, 94vh); display: flex; flex-direction: column; overflow: hidden; font-family: var(--sx-sans); color: var(--fp-text, #2a2825); }

/* header */
.sx .etfp-head    { padding: 20px 28px; background: var(--fp-surface, #fdfbf6); border-bottom: 1px solid rgba(0,0,0,0.06); display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.sx .etfp-head-titleblock { min-width: 0; }
.sx .etfp-kicker  { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fp-accent, #b85c2a); font-weight: 600; margin-bottom: 4px; }
.sx .etfp-title   { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0; color: var(--fp-text, #2a2825); }
.sx .etfp-head-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.sx .etfp-search-wrap { position: relative; display: flex; align-items: center; }
.sx .etfp-search-ico  { position: absolute; left: 14px; color: var(--fp-muted, #656259); font-size: 14px; pointer-events: none; }
.sx .etfp-search-input { width: 320px; height: 38px; background: rgba(0,0,0,0.045); border: 1px solid transparent; border-radius: 10px; padding: 0 14px 0 36px; font-size: 13px; font-family: inherit; outline: none; color: var(--fp-text, #2a2825); box-sizing: border-box; }
.sx .etfp-search-input::placeholder { color: var(--fp-muted, #656259); }
.sx .etfp-search-input:focus { background: var(--fp-surface, #fdfbf6); border-color: var(--fp-accent, #b85c2a); }
.sx .etfp-close   { background: rgba(0,0,0,0.045); border: none; width: 38px; height: 38px; border-radius: 10px; font-size: 18px; line-height: 1; color: var(--fp-muted, #656259); cursor: pointer; }
.sx .etfp-close:hover { background: rgba(0,0,0,0.08); color: var(--fp-text, #2a2825); }

/* body grid */
.sx .etfp-body    { display: grid; grid-template-columns: 256px 1fr; flex: 1; overflow: hidden; }

/* sidebar */
.sx .etfp-cats-wrap { background: var(--fp-surface, #fdfbf6); border-right: 1px solid rgba(0,0,0,0.06); overflow-y: auto; padding: 18px 14px; }
.sx .etfp-cats-label { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fp-muted, #656259); font-weight: 600; padding: 0 10px 10px; }
.sx .etfp-cats    { display: flex; flex-direction: column; gap: 2px; }
.sx .etfp-cat-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; border-radius: 10px; transition: background 100ms; }
.sx .etfp-cat-item:hover { background: rgba(0,0,0,0.03); }
.sx .etfp-cat-item.active { background: var(--fp-selected, #f5e8d4); }
.sx .etfp-cat-icon { width: 30px; height: 30px; border-radius: 8px; background: rgba(0,0,0,0.05); display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.sx .etfp-cat-item.active .etfp-cat-icon { background: var(--fp-surface, #fdfbf6); }
.sx .etfp-cat-text { min-width: 0; flex: 1; }
.sx .etfp-cat-title { font-size: 13.5px; font-weight: 500; color: var(--fp-text, #2a2825); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx .etfp-cat-item.active .etfp-cat-title { color: var(--fp-accent, #b85c2a); font-weight: 600; }
.sx .etfp-cat-sub { font-size: 11.5px; color: var(--fp-muted, #656259); margin-top: 2px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx .etfp-cat-count { font-size: 10.5px; color: var(--fp-surface, #fdfbf6); background: var(--fp-accent, #b85c2a); min-width: 18px; height: 18px; border-radius: 9px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.sx .etfp-cat-count.zero { display: none; }

/* right pane */
.sx .etfp-list-wrap { background: var(--fp-canvas, #f0ede4); overflow-y: auto; }
.sx .etfp-list-head { padding: 22px 28px 14px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.sx .etfp-list-title { font-size: 18px; font-weight: 700; margin: 0; color: var(--fp-text, #2a2825); letter-spacing: -0.01em; }
.sx .etfp-list-meta  { font-size: 12px; color: var(--fp-muted, #656259); margin: 4px 0 0; }
.sx .etfp-list-head-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sx .etfp-filter-seg  { display: flex; background: rgba(0,0,0,0.045); border-radius: 10px; padding: 3px; gap: 2px; }
.sx .etfp-filter-seg button { height: 30px; padding: 0 14px; border: none; border-radius: 7px; font-size: 12px; cursor: pointer; font-family: inherit; background: transparent; color: var(--fp-muted, #656259); }
.sx .etfp-filter-seg button.on { background: var(--fp-surface, #fdfbf6); color: var(--fp-text, #2a2825); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.sx .etfp-add-manual { height: 36px; padding: 0 14px; border: 1px solid rgba(var(--fp-accent-rgb, 184,92,42),0.35); background: transparent; color: var(--fp-accent, #b85c2a); border-radius: 9px; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.sx .etfp-add-manual:hover { background: rgba(var(--fp-accent-rgb, 184,92,42),0.06); }

.sx .etfp-list    { padding: 0 28px 24px; }
.sx .etfp-list-empty { padding: 80px 24px; text-align: center; color: var(--fp-muted, #656259); font-size: 13px; }

/* column headers (no card) */
.sx .etfp-thead { display: grid; grid-template-columns: 40px 1.5fr 90px 120px 100px 72px 64px; column-gap: 18px; padding: 10px 22px 8px; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fp-muted, #656259); font-weight: 600; }
.sx .etfp-thead .r { text-align: right; }
.sx .etfp-thead .c { text-align: center; }
/* sortable / resizable header cells */
.sx .etfp-th { position: relative; display: flex; align-items: center; gap: 5px; min-width: 0; user-select: none; }
.sx .etfp-th.r { justify-content: flex-end; }
.sx .etfp-th.c { justify-content: center; }
.sx .etfp-th-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx .etfp-th-sort { cursor: pointer; }
.sx .etfp-th-sort:hover { color: var(--fp-accent, #b85c2a); }
.sx .etfp-th.sorted { color: var(--fp-accent, #b85c2a); }
.sx .etfp-sort-ind { font-size: 8px; line-height: 1; opacity: 0; transition: opacity 100ms; }
.sx .etfp-sort-ind.on { opacity: 1; }
.sx .etfp-th-sort:hover .etfp-sort-ind { opacity: 0.5; }
.sx .etfp-th-sort:hover .etfp-sort-ind.on { opacity: 1; }
.sx .etfp-col-resize { position: absolute; right: -10px; top: -4px; bottom: -4px; width: 11px; cursor: col-resize; z-index: 2; }
.sx .etfp-col-resize::after { content: ''; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 1px; background: rgba(0,0,0,0.08); transition: background 100ms; }
.sx .etfp-col-resize:hover::after { background: var(--fp-accent, #b85c2a); left: 4px; width: 2px; }
body.etfp-col-resizing { cursor: col-resize !important; user-select: none !important; }

/* row cards */
.sx .etfp-row   { display: grid; grid-template-columns: 40px 1.5fr 90px 120px 100px 72px 64px; column-gap: 18px; padding: 14px 22px; align-items: center; background: var(--fp-surface, #fdfbf6); border: 1px solid rgba(0,0,0,0.05); border-radius: 10px; margin-bottom: 8px; cursor: pointer; transition: border-color 100ms, background 100ms; }
.sx .etfp-row > span, .sx .etfp-row > div { min-width: 0; }
.sx .etfp-row .etfp-tk, .sx .etfp-row .etfp-isin { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx .etfp-row:hover { border-color: rgba(var(--fp-accent-rgb, 184,92,42),0.3); }
.sx .etfp-row.checked { border-color: var(--fp-accent, #b85c2a); background: var(--fp-surface, #fdfbf6); }
.sx .etfp-row input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--fp-accent, #b85c2a); border-radius: 4px; }
.sx .etfp-row .etfp-name   { font-size: 13.5px; color: var(--fp-text, #2a2825); font-weight: 500; overflow-wrap: anywhere; white-space: normal; line-height: 1.35; }
.sx .etfp-row .etfp-tk     { font-family: var(--sx-mono); font-size: 12px; font-weight: 700; color: var(--fp-text, #2a2825); letter-spacing: 0.04em; }
.sx .etfp-row .etfp-isin   { font-family: var(--sx-mono); font-size: 12px; color: var(--fp-muted, #656259); letter-spacing: 0.02em; }
.sx .etfp-row .etfp-aum    { font-family: var(--sx-mono); font-size: 13px; text-align: right; color: var(--fp-text, #2a2825); font-variant-numeric: tabular-nums; font-weight: 500; }
.sx .etfp-row .etfp-ter    { font-family: var(--sx-mono); font-size: 12px; text-align: right; color: var(--fp-muted, #656259); font-variant-numeric: tabular-nums; }
.sx .etfp-row .etfp-dist   { font-size: 11px; font-weight: 600; text-align: center; letter-spacing: 0.03em; padding: 4px 10px; border-radius: 12px; justify-self: center; min-width: 46px; }
.sx .etfp-row .etfp-dist.acc  { background: #e4ede0; color: #2d5a20; }
.sx .etfp-row .etfp-dist.dist { background: #e2e5f5; color: #2a3d8a; }
.sx .etfp-row .etfp-dist.unknown { background: rgba(0,0,0,0.05); color: var(--fp-muted, #656259); }

/* footer */
.sx .etfp-foot    { padding: 14px 28px; background: var(--fp-surface, #fdfbf6); border-top: 1px solid rgba(0,0,0,0.06); display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.sx .etfp-foot-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sx .etfp-selcount { font-size: 13px; color: var(--fp-muted, #656259); font-weight: 500; }
.sx .etfp-selcount.has { color: var(--fp-accent, #b85c2a); font-weight: 600; }
.sx .etfp-foot-hint { font-size: 12px; color: var(--fp-muted, #656259); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx .etfp-foot-right { display: flex; gap: 10px; }
.sx .etfp-btn-ghost { height: 38px; padding: 0 18px; background: var(--fp-surface, #fdfbf6); color: var(--fp-text, #2a2825); border: 1px solid rgba(0,0,0,0.12); border-radius: 9px; font-size: 13px; cursor: pointer; font-family: inherit; }
.sx .etfp-btn-ghost:hover { background: rgba(0,0,0,0.03); }
.sx .etfp-btn-prim  { height: 38px; padding: 0 22px; background: var(--fp-accent, #b85c2a); color: var(--fp-surface, #fdfbf6); border: none; border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
.sx .etfp-btn-prim:hover:not(:disabled) { background: #a04a1f; }
.sx .etfp-btn-prim:disabled { background: #ecd3c2; color: var(--fp-surface, #fdfbf6); cursor: not-allowed; }

/* mobile */
@media (max-width: 720px) {
  .sx .etfp-panel { width: 100vw; height: 100vh; border-radius: 0; }
  .sx .etfp-body  { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sx .etfp-cats-wrap { border-right: none; border-bottom: 1px solid rgba(0,0,0,0.06); padding: 10px 12px; }
  .sx .etfp-cats  { flex-direction: row; gap: 6px; overflow-x: auto; }
  .sx .etfp-cat-item { flex-shrink: 0; padding: 6px 10px; }
  .sx .etfp-cat-sub, .sx .etfp-cats-label { display: none; }
  .sx .etfp-search-input { width: 180px; }
  .sx .etfp-thead, .sx .etfp-row { grid-template-columns: 30px 1fr 70px 70px 56px; column-gap: 8px; padding-left: 12px; padding-right: 12px; }
  .sx .etfp-thead .h-isin, .sx .etfp-thead .h-ter, .sx .etfp-row .etfp-isin, .sx .etfp-row .etfp-ter { display: none; }
  .sx .etfp-list { padding: 0 12px 12px; }
  .sx .etfp-list-head { padding: 14px 12px 8px; }
  .sx .etfp-foot { flex-wrap: wrap; padding: 12px; }
  .sx .etfp-foot-hint { display: none; }
}

/* ETF picker — v2 additions: chip basket, custom checkbox, manual form */
.sx .etfp-row .etfp-cb { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid rgba(0,0,0,0.2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 100ms; background: transparent; font-size: 13px; color: transparent; }
.sx .etfp-row.checked { box-shadow: 0 0 0 1px var(--fp-accent, #b85c2a); background: rgba(var(--fp-accent-rgb, 184,92,42),0.03); }
.sx .etfp-row.checked .etfp-cb { background: var(--fp-accent, #b85c2a); border-color: var(--fp-accent, #b85c2a); color: var(--fp-surface, #fff); }

/* Footer chips */
.sx .etfp-foot { gap: 14px; }
.sx .etfp-chips { display: flex; gap: 6px; flex: 1; overflow-x: auto; padding: 2px 0; min-width: 0; }
.sx .etfp-chip  { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 4px 0 10px; border-radius: 7px; background: rgba(0,0,0,0.05); font-size: 12px; white-space: nowrap; flex-shrink: 0; }
.sx .etfp-chip b { font-family: var(--sx-mono); font-weight: 700; letter-spacing: 0.03em; }
.sx .etfp-chip button { background: none; border: none; color: var(--fp-muted, #656259); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 6px; }
.sx .etfp-chip button:hover { color: var(--fp-negative, #b54a3e); }
.sx .etfp-chips-empty { font-size: 12.5px; color: var(--fp-muted, #656259); padding: 4px 4px; }

/* Manual ETF form */
.sx .etfp-manual-form { margin: 14px 28px 6px; padding: 18px; background: var(--fp-surface, #fdfbf6); border: 1.5px solid rgba(var(--fp-accent-rgb, 184,92,42),0.4); border-radius: 12px; }
.sx .etfp-mf-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.sx .etfp-mf-title { font-size: 14px; font-weight: 600; }
.sx .etfp-mf-hint  { font-size: 12px; color: var(--fp-muted, #656259); }
.sx .etfp-mf-grid  { display: grid; grid-template-columns: 96px 1fr 150px 80px; gap: 10px; margin-bottom: 12px; }
.sx .etfp-mf-lbl   { display: block; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fp-muted, #656259); font-weight: 600; margin-bottom: 5px; }
.sx .etfp-mf-inp   { width: 100%; height: 36px; background: rgba(0,0,0,0.04); border: 1px solid transparent; border-radius: 8px; padding: 0 11px; font-size: 13px; font-family: inherit; outline: none; color: var(--fp-text, #2a2825); box-sizing: border-box; }
.sx .etfp-mf-inp.mono { font-family: var(--sx-mono); }
.sx .etfp-mf-inp:focus { background: var(--fp-surface, #fdfbf6); border-color: var(--fp-accent, #b85c2a); }
.sx .etfp-mf-row2  { display: flex; align-items: center; gap: 14px; }
.sx .etfp-mf-seg   { display: flex; background: rgba(0,0,0,0.045); border-radius: 8px; padding: 3px; gap: 2px; width: 220px; }
.sx .etfp-mf-seg button { flex: 1; height: 28px; border: none; border-radius: 6px; font-size: 12px; cursor: pointer; font-family: inherit; background: transparent; color: var(--fp-muted, #656259); }
.sx .etfp-mf-seg button.on { background: var(--fp-surface, #fdfbf6); color: var(--fp-text, #2a2825); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.sx .etfp-mf-actions { margin-left: auto; display: flex; gap: 8px; }

/* Hide native checkbox in rows (we use the custom .etfp-cb div) */
.sx .etfp-row input[type="checkbox"] { display: none; }

/* Update sidebar active style to translucent orange (matches reference) */
.sx .etfp-cat-item.active { background: rgba(var(--fp-accent-rgb, 184,92,42),0.1); }
.sx .etfp-cat-item.active .etfp-cat-icon { background: rgba(var(--fp-accent-rgb, 184,92,42),0.15); }

@media (max-width: 720px) {
  .sx .etfp-manual-form { margin: 10px 12px; padding: 12px; }
  .sx .etfp-mf-grid { grid-template-columns: 1fr 1fr; }
  .sx .etfp-mf-row2 { flex-wrap: wrap; }
  .sx .etfp-chips { display: none; }
}

/* Manual ETF form — live search autocomplete + custom row markers */
.sx .etfp-mf-searchwrap { position: relative; margin-bottom: 14px; }
.sx .etfp-mf-search-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--fp-muted, #656259); font-size: 14px; pointer-events: none; }
.sx .etfp-mf-search { width: 100%; height: 40px; background: var(--fp-surface, #fdfbf6); border: 1px solid rgba(0,0,0,0.12); border-radius: 9px; padding: 0 14px 0 36px; font-size: 13.5px; font-family: inherit; outline: none; color: var(--fp-text, #2a2825); box-sizing: border-box; }
.sx .etfp-mf-search:focus { border-color: var(--fp-accent, #b85c2a); }
.sx .etfp-mf-status { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 11.5px; color: var(--fp-muted, #656259); }
.sx .etfp-mf-aclist { position: absolute; top: 44px; left: 0; right: 0; background: var(--fp-surface, #fdfbf6); border: 1px solid rgba(0,0,0,0.1); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,0.14); z-index: 30; max-height: 280px; overflow-y: auto; }
.sx .etfp-mf-ac-item { display: grid; grid-template-columns: 80px 1fr 70px; column-gap: 12px; align-items: center; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid rgba(0,0,0,0.04); }
.sx .etfp-mf-ac-item:last-child { border-bottom: 0; }
.sx .etfp-mf-ac-item:hover { background: rgba(var(--fp-accent-rgb, 184,92,42),0.06); }
.sx .etfp-mf-ac-tk { font-family: var(--sx-mono); font-size: 12px; font-weight: 700; color: var(--fp-text, #2a2825); }
.sx .etfp-mf-ac-nm { font-size: 12.5px; color: var(--fp-text, #4a4845); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx .etfp-mf-ac-px { font-family: var(--sx-mono); font-size: 12px; color: var(--fp-muted, #656259); text-align: right; }
.sx .etfp-mf-ac-loading, .sx .etfp-mf-ac-empty { padding: 12px 14px; font-size: 12.5px; color: var(--fp-muted, #656259); }

/* custom row marker + delete */
.sx .etfp-custom-tag { display: inline-block; margin-left: 8px; font-size: 9px; font-weight: 700; letter-spacing: 0.08em; color: var(--fp-accent, #b85c2a); background: rgba(var(--fp-accent-rgb, 184,92,42),0.12); padding: 2px 6px; border-radius: 4px; vertical-align: middle; }
.sx .etfp-row.is-custom { border-style: dashed; }
.sx .etfp-row-del { margin-left: 8px; background: none; border: none; color: #c0b8b0; font-size: 16px; line-height: 1; cursor: pointer; padding: 0 4px; vertical-align: middle; }
.sx .etfp-row-del:hover { color: var(--fp-negative, #b54a3e); }

/* Builder tier — custom tag, basket-fit warning + popover */
.sx .pb3 .pb3-custom-tag { display: inline-block; margin-left: 8px; font-size: 9px; font-weight: 700; letter-spacing: 0.08em; color: var(--fp-accent, #b85c2a); background: rgba(var(--fp-accent-rgb, 184,92,42),0.12); padding: 2px 6px; border-radius: 4px; vertical-align: middle; }
.sx .pb3 .pb3-fit-warn { display: inline-flex; align-items: center; justify-content: center; margin-left: 8px; width: 18px; height: 18px; border-radius: 50%; border: none; background: #e8a33d; color: var(--fp-surface, #fff); font-weight: 800; font-size: 12px; line-height: 1; cursor: pointer; vertical-align: middle; }
.sx .pb3 .pb3-fit-warn:hover { background: #d8902a; }
.sx .pb3 .pb3-row.has-warn { background: rgba(232,163,61,0.05); }

.sx .pb3-fit-pop { position: absolute; z-index: 3000; width: 340px; background: var(--fp-surface, #fdfbf6); border: 1px solid rgba(0,0,0,0.1); border-radius: 12px; box-shadow: 0 16px 48px rgba(0,0,0,0.2); padding: 14px 16px; font-family: var(--sx-sans); }
.sx .pb3-fit-pop-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sx .pb3-fit-pop-ico { width: 20px; height: 20px; border-radius: 50%; background: #e8a33d; color: var(--fp-surface, #fff); font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.sx .pb3-fit-pop-title { font-size: 14px; font-weight: 600; color: var(--fp-text, #2a2825); flex: 1; }
.sx .pb3-fit-pop-x { background: none; border: none; font-size: 18px; color: var(--fp-muted, #656259); cursor: pointer; line-height: 1; padding: 0 4px; }
.sx .pb3-fit-pop-x:hover { color: var(--fp-text, #2a2825); }
.sx .pb3-fit-pop-warn  { font-size: 13px; color: #a06414; margin: 0 0 8px; line-height: 1.45; }
.sx .pb3-fit-pop-guide { font-size: 12.5px; color: var(--fp-muted, #656259); margin: 0; line-height: 1.5; }

/* Builder — Save portfolio modal (Model vs Actual) */
.sx .bsave-panel { background: var(--fp-canvas, #f0ede4); border-radius: 16px; box-shadow: 0 24px 80px rgba(0,0,0,0.22); width: min(820px, 96vw); max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; font-family: var(--sx-sans); color: var(--fp-text, #2a2825); }
.sx .bsave-head { padding: 20px 26px; background: var(--fp-surface, #fdfbf6); border-bottom: 1px solid rgba(0,0,0,0.06); display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.sx .bsave-body { padding: 22px 26px; overflow-y: auto; }

/* chooser cards */
.sx .bsave-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sx .bsave-card { text-align: left; background: var(--fp-surface, #fdfbf6); border: 1px solid rgba(0,0,0,0.08); border-radius: 14px; padding: 20px; cursor: pointer; font-family: inherit; transition: border-color 120ms, box-shadow 120ms, transform 80ms; }
.sx .bsave-card:hover { border-color: var(--fp-accent, #b85c2a); box-shadow: 0 8px 26px rgba(var(--fp-accent-rgb, 184,92,42),0.12); transform: translateY(-1px); }
.sx .bsave-card-ico { font-size: 26px; margin-bottom: 10px; }
.sx .bsave-card-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.sx .bsave-card-desc { font-size: 12.5px; color: var(--fp-muted, #656259); line-height: 1.5; margin-bottom: 14px; }
.sx .bsave-card-cta { font-size: 13px; font-weight: 600; color: var(--fp-accent, #b85c2a); }
@media (max-width: 640px){ .sx .bsave-cards { grid-template-columns: 1fr; } }

/* actual trades table */
.sx .bsave-actual-hint { font-size: 12.5px; color: var(--fp-muted, #656259); line-height: 1.5; margin-bottom: 14px; }
.sx .bsave-thead, .sx .bsave-trow { display: grid; grid-template-columns: 110px 1fr 80px 84px 80px 130px 28px; column-gap: 10px; align-items: center; }
.sx .bsave-thead { padding: 0 4px 8px; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fp-muted, #656259); font-weight: 600; }
.sx .bsave-thead .r { text-align: right; }
.sx .bsave-tbody { display: flex; flex-direction: column; gap: 6px; }
.sx .bsave-trow { background: var(--fp-surface, #fdfbf6); border: 1px solid rgba(0,0,0,0.05); border-radius: 9px; padding: 8px 4px 8px 12px; }
.sx .bsave-tk { font-family: var(--sx-mono); font-size: 12px; font-weight: 700; }
.sx .bsave-tkinp { font-family: var(--sx-mono); font-weight: 700; text-transform: uppercase; }
.sx .bsave-row-del { background: none; border: none; color: #c0b8b0; font-size: 18px; line-height: 1; cursor: pointer; padding: 0; width: 24px; height: 24px; border-radius: 6px; transition: all 100ms; }
.sx .bsave-row-del:hover { color: var(--fp-negative, #b54a3e); background: rgba(181,74,62,0.08); }
.sx .bsave-addrow { margin-top: 10px; background: none; border: 1px dashed rgba(var(--fp-accent-rgb, 184,92,42),0.4); color: var(--fp-accent, #b85c2a); font-size: 12.5px; font-weight: 600; padding: 9px 14px; border-radius: 9px; cursor: pointer; width: 100%; transition: all 100ms; }
.sx .bsave-addrow:hover { background: rgba(var(--fp-accent-rgb, 184,92,42),0.06); border-color: var(--fp-accent, #b85c2a); }
.sx .bsave-nm { font-size: 12.5px; color: var(--fp-text, #4a4845); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx .bsave-inp { height: 32px; background: rgba(0,0,0,0.04); border: 1px solid transparent; border-radius: 7px; padding: 0 8px; font-size: 12.5px; font-family: inherit; outline: none; color: var(--fp-text, #2a2825); box-sizing: border-box; width: 100%; }
.sx .bsave-inp.mono { font-family: var(--sx-mono); text-align: right; }
.sx .bsave-inp:focus { background: var(--fp-surface, #fdfbf6); border-color: var(--fp-accent, #b85c2a); }
.sx .bsave-import-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-bottom:16px; }
.sx .bsave-import-actions .hint { flex-basis:100%; margin:0; }
.sx .bsave-actual-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
@media (max-width: 640px){
  .sx .bsave-thead { display: none; }
  .sx .bsave-trow { grid-template-columns: 1fr 1fr; row-gap: 6px; }
  .sx .bsave-nm { grid-column: span 2; }
}

/* Builder save — CSV template link */
.sx .bsave-tmpl-link { font-size: 12.5px; color: var(--fp-accent, #b85c2a); cursor: pointer; align-self: center; }
.sx .bsave-tmpl-link:hover { text-decoration: underline; }

/* ETF picker rail — asset-class group headers (Core) */
.sx .etfp-cat-group { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fp-muted, #656259); font-weight: 700; padding: 14px 12px 6px; }
.sx .etfp-cat-group:first-child { padding-top: 4px; }

/* ── A+B grouped holdings view (sleeve cards + grouped sections) ───────────── */
.hsleeve-cards {
  display: grid;
  /* min raised so the expanded P&L split (label · € · %) never gets clipped */
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: 12px;
  margin: 4px 0 18px;
}
.hsleeve-card {
  background: var(--fp-surface, #fff);
  border: 1px solid var(--fp-border, #ece8df);
  border-top: 3px solid #ccc;
  border-radius: 10px;
  padding: 12px 14px 13px;
  box-shadow: 0 1px 2px rgba(40,38,34,0.03);
}
.hsleeve-card-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; margin-bottom: 8px;
}
.hsleeve-card-n {
  font-size: 10px; font-weight: 600; color: var(--fp-muted, #656259);
  background: var(--fp-soft, #f3f0e8); border-radius: 8px; padding: 1px 6px; letter-spacing: 0;
}
.hsleeve-card-val { font-size: 19px; font-weight: 600; color: var(--fp-text, #2a2825); line-height: 1.15; }
.hsleeve-card-pnl { font-size: 12.5px; font-weight: 600; }
.hsleeve-card-pnl-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 3px;
}

/* Little toggle that reveals the P&L split (unrealized / realized / dividends) */
.hsleeve-split-btn {
  flex: none; width: 20px; height: 20px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #e6e1d6; border-radius: 6px; background: var(--fp-soft, #faf8f3);
  color: var(--fp-muted, #656259); font-size: 10px; line-height: 1; cursor: pointer;
  transition: transform 0.18s ease, background 0.15s ease, color 0.15s ease;
}
.hsleeve-split-btn:hover { background: var(--fp-hover, #f2ede3); color: var(--fp-muted, #5a5750); }
.hsleeve-split-btn.open { transform: rotate(180deg); color: var(--fp-accent, #b85c2a); border-color: var(--fp-border, #e7cdb8); background: var(--fp-selected, #fbf1e8); }

.hsleeve-split {
  display: none;
  margin-top: 8px; padding: 8px 9px;
  background: var(--fp-soft, #faf8f3); border: 1px solid var(--fp-inset, #f0ece3); border-radius: 8px;
  /* label grows, € and % size to their content and share tracks across rows */
  grid-template-columns: 1fr auto auto;
  column-gap: 8px; row-gap: 3px; align-items: baseline;
}
.hsleeve-split.open { display: grid; }
/* rows dissolve into the parent grid so all three columns line up vertically */
.hsleeve-split-row { display: contents; }
.hsleeve-split-row .lbl { font-size: 11px; color: var(--fp-muted, #656259); }
.hsleeve-split-row .eur { font-size: 11.5px; font-weight: 600; text-align: right; white-space: nowrap; }
.hsleeve-split-row .pct { font-size: 11px; font-weight: 600; text-align: right; white-space: nowrap; }
.hsleeve-split-div { grid-column: 1 / -1; border-top: 1px solid #ece7dc; margin: 2px 0; }
.hsleeve-split-row.total .lbl { color: var(--fp-text, #2a2825); font-weight: 600; white-space: nowrap; }
.hsleeve-split-row .muted { color: #b0aca3; }

/* Target allocation block inside each sleeve card */
.hsleeve-card-alloc { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--fp-inset, #f0ece3); }
.hsleeve-alloc-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--fp-muted, #656259); gap: 8px;
}
.hsleeve-alloc-now b { color: var(--fp-text, #2a2825); font-weight: 600; }
.hsleeve-alloc-tgt { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.hsleeve-target-inp {
  width: 42px; text-align: right;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--fp-text, #2a2825);
  border: 1px solid var(--fp-border, #ddd6c8); border-radius: 6px; background: var(--fp-surface, #fff);
  padding: 2px 5px; -moz-appearance: textfield;
}
.hsleeve-target-inp::-webkit-outer-spin-button,
.hsleeve-target-inp::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.hsleeve-target-inp:focus { outline: none; border-color: var(--fp-accent, #b85c2a); }
.hsleeve-sum.ok { color: var(--fp-positive, #3a7a4a); }
.hsleeve-sum.warn { color: var(--fp-accent, #b85c2a); }
.hsleeve-target-bar {
  height: 6px; border-radius: 4px; background: var(--fp-inset, #efeae0);
  margin-top: 7px; overflow: hidden;
}
.hsleeve-target-fill { height: 100%; border-radius: 4px; transition: width 0.25s ease; }
.hsleeve-target-bar.over .hsleeve-target-fill { background: var(--fp-accent, #b85c2a) !important; }
.hsleeve-target-reached { font-size: 10.5px; color: var(--fp-muted, #656259); margin-top: 4px; }

/* Cash reserve card: editable manual amount */
.hsleeve-card-val .hsleeve-cash-inp {
  font: inherit; font-size: 19px; font-weight: 600; color: var(--fp-text, #2a2825); line-height: 1.15;
  border: 1px solid var(--fp-border, #ddd6c8); border-radius: 6px; background: var(--fp-surface, #fff);
  padding: 0 6px; width: 130px; -moz-appearance: textfield; vertical-align: baseline;
}
.hsleeve-cash-inp::-webkit-outer-spin-button,
.hsleeve-cash-inp::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.hsleeve-cash-inp:focus { outline: none; border-color: #4a8a7a; }
/* Cash amount is click-to-edit (opens the Set-cash-balance dialog) */
.hsleeve-cash-val { cursor: pointer; border-radius: 6px; transition: color 0.12s; }
.hsleeve-cash-val:hover { color: #4a8a7a; }

/* ── Report page: honest header + reconciling KPI strip ── */
.sx .rpt-head { margin: 2px 0 12px; }
.sx .rpt-head-title { font-size: 15px; font-weight: 700; color: var(--fp-text, #2a2825); letter-spacing: -0.01em; }
.sx .rpt-head-sub { font-size: 12px; font-weight: 400; color: var(--fp-muted, #656259); letter-spacing: 0; }
/* Profit breakdown above the KPI strip — 3 cards (period headline + since-inception sub) */
.sx .rpt-pnl-cap {
  font-size: 10px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--fp-muted, #656259); margin: 0 0 7px;
}
.sx .rpt-pnl-cap span { color: #b7b3ab; font-weight: 500; }
.sx .rpt-pnl3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 16px; }
.sx .rpt-pnl-box {
  background: var(--fp-soft, #faf8f3); border: 1px solid var(--fp-inset, #f0ece3); border-radius: 10px; padding: 11px 14px;
}
.sx .rpt-pnl-lbl {
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fp-muted, #656259); margin-bottom: 6px;
}
.sx .rpt-pnl-val {
  font-size: 19px; font-weight: 600; color: var(--fp-text, #2a2825); line-height: 1.1;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.sx .rpt-pnl-val.positive { color: var(--fp-positive, #3a7a4a); }
.sx .rpt-pnl-val.negative { color: var(--fp-negative, #b54a3e); }
.sx .rpt-pnl-pct { font-size: 12px; font-weight: 600; margin-left: 8px; }
.sx .rpt-pnl-sub {
  font-size: 11px; color: var(--fp-muted, #656259); margin-top: 6px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.sx .rpt-pnl-sub b { font-weight: 600; color: var(--fp-muted, #656259); }
@media (max-width: 768px) { .sx .rpt-pnl3 { grid-template-columns: 1fr; gap: 8px; } }

.sx .rpt-kpi-strip {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 0;
  border: 1px solid var(--fp-border, #ece8df); border-radius: 12px; background: var(--fp-surface, #fff);
  padding: 16px 4px; margin-bottom: 20px; overflow: hidden;
}
.sx .rpt-hero, .sx .rpt-kpi { padding: 2px 18px; border-left: 1px solid var(--fp-inset, #f0ece3); min-width: 0; }
.sx .rpt-hero { border-left: none; }
.sx .rpt-kpi-lbl {
  font-size: 10px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--fp-muted, #656259); margin-bottom: 6px;
}
.sx .rpt-hero-val {
  font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.05;
  font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.sx .rpt-hero-gain { font-size: 14px; font-weight: 600; }
.sx .rpt-kpi-val {
  font-size: 20px; font-weight: 600; color: var(--fp-text, #2a2825); line-height: 1.1;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.sx .rpt-kpi-strong { color: var(--fp-text, #2a2825); }
.sx .rpt-hero-val.positive, .sx .rpt-hero-gain.positive { color: var(--fp-positive, #3a7a4a); }
.sx .rpt-hero-val.negative, .sx .rpt-hero-gain.negative { color: var(--fp-negative, #b54a3e); }
#portfolio-report-content table td.num { font-variant-numeric: tabular-nums; }
.hsleeve-card-x {
  float: right; cursor: pointer; color: var(--fp-muted, #777368); font-weight: 600;
  font-size: 12px; letter-spacing: 0; padding: 0 2px;
}
.hsleeve-card-x:hover { color: var(--fp-negative, #b54a3e); }

/* Ghost "+ Add cash reserve" card */
.hsleeve-card-add {
  border-top: 3px solid #e0dbd0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; cursor: pointer; color: var(--fp-muted, #656259); min-height: 120px;
  background: var(--fp-soft, #faf8f3);
}
.hsleeve-card-add:hover { color: #4a8a7a; border-color: #4a8a7a; background: #f5f8f6; }
.hsleeve-add-plus { font-size: 26px; line-height: 1; font-weight: 300; }
.hsleeve-add-label { font-size: 12px; font-weight: 600; letter-spacing: 0.03em; }

.hsleeve-group:first-child .hsleeve-section-head { margin-top: 4px; }
/* Section head uses the SAME grid as .holdings-soft-row so its subtotals sit
   directly above the Value / P&L / P&L% columns of the rows below. Left padding
   is 14px − 3px border so the grid origin matches the rows' (margin 6 + pad 14). */
.hsleeve-section-head {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 110px 80px 116px 72px 116px 80px minmax(120px, 140px);
  gap: 10px; align-items: baseline;
  padding: 9px 14px 9px 11px; margin: 16px 6px 2px;
  background: var(--fp-soft, #faf8f3); border-left: 3px solid #ccc; border-radius: 4px;
  cursor: pointer; user-select: none;
}
.hsleeve-section-head:hover { background: #f4f1ea; }
.hsleeve-caret {
  grid-column: 1; font-size: 10px; color: var(--fp-muted, #656259); align-self: center;
  transition: transform 0.15s ease; display: inline-block;
}
.hsleeve-section-head.collapsed .hsleeve-caret { transform: rotate(-90deg); }
.hsleeve-section-lbl { grid-column: 2 / 5; display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.hsleeve-section-name { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.hsleeve-section-count { font-size: 11px; color: var(--fp-muted, #656259); white-space: nowrap; }
.hsleeve-section-tot { grid-column: 5; font-size: 13px; font-weight: 600; color: var(--fp-text, #2a2825); text-align: right; white-space: nowrap; }
.hsleeve-section-wt { grid-column: 6; font-size: 12px; font-weight: 600; color: var(--fp-muted, #656259); text-align: right; white-space: nowrap; }
.hsleeve-section-pnl { grid-column: 7; font-size: 13px; font-weight: 600; text-align: right; white-space: nowrap; }
.hsleeve-section-pct { grid-column: 8; font-size: 13px; font-weight: 600; text-align: right; white-space: nowrap; }
.hsleeve-section-pnl.positive, .hsleeve-section-pct.positive, .hsleeve-card-pnl.positive { color: var(--fp-positive, #3a7a4a); }
.hsleeve-section-pnl.negative, .hsleeve-section-pct.negative, .hsleeve-card-pnl.negative { color: var(--fp-negative, #b54a3e); }

/* ── Statistics: per-part filter bar (scope the whole page to a part) ──────── */
.sx .stats-part-filter {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
  margin-bottom: 24px;
}
.sx .stats-part-filter .spf-label {
  font-size: 10px; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--sx-muted-2); font-weight: 600; margin-right: 3px;
}
.sx .spf-chip {
  background: var(--sx-soft-3); border: 1px solid transparent;
  color: var(--sx-muted); font-family: inherit; font-size: 12px; font-weight: 500;
  padding: 5px 13px; border-radius: 999px; cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.sx .spf-chip:hover { color: var(--sx-text); }
.sx .spf-chip.on {
  background: var(--sx-surface); color: var(--sx-text); font-weight: 600;
  border-color: var(--spf, var(--sx-accent, var(--fp-accent, #b85c2a)));
  box-shadow: inset 0 0 0 1px var(--spf, var(--sx-accent, var(--fp-accent, #b85c2a)));
}

/* ══════════════════════════════════════════════════════════════════════════
   Portfolio Builder v5 (pb4) — two-column layout, model templates, sticky
   summary sidebar with allocation donut + portfolio checks. Coexists with the
   pb3 insight engine (regional / asset / cost), which renders inside the
   sidebar via the .pb4-ins-scope override below.
   ══════════════════════════════════════════════════════════════════════════ */
.sx .pb4 { font-family: var(--sx-sans); color: var(--fp-text, #2a2825); background: var(--fp-canvas, #f0ede4); min-height: 100vh; }
.sx .pb4 .pb4-mono { font-family: var(--sx-mono, "IBM Plex Mono", ui-monospace, monospace); font-variant-numeric: tabular-nums; }
.sx .pb4 .pb4-c-core  { color: var(--fp-positive, #3a7a4a); }
.sx .pb4 .pb4-c-theme { color: #3a4a8a; }
.sx .pb4 .pb4-c-stock { color: var(--fp-accent, #b85c2a); }

.sx .pb4 .pb4-wrap { display: grid; grid-template-columns: 1fr 332px; gap: 24px; align-items: start; padding: 24px 4px 56px; max-width: 1360px; margin: 0 auto; }
@media (max-width: 1000px){ .sx .pb4 .pb4-wrap { grid-template-columns: 1fr; } }

.sx .pb4 .pb4-h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 4px; }
.sx .pb4 .pb4-lead { font-size: 13.5px; color: var(--fp-muted, #656259); margin: 0 0 16px; max-width: 580px; line-height: 1.5; }
.sx .pb4 .pb4-lbl { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fp-muted, #656259); font-weight: 600; margin-bottom: 7px; display: block; }

/* model templates */
.sx .pb4 .pb4-models { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
@media (max-width: 760px){ .sx .pb4 .pb4-models { grid-template-columns: repeat(2, 1fr); } }
.sx .pb4 .pb4-model { background: var(--fp-surface, #fdfbf6); border: 1.5px solid rgba(0,0,0,0.06); border-radius: 12px; padding: 13px 14px; cursor: pointer; text-align: left; transition: all 120ms; font-family: inherit; }
.sx .pb4 .pb4-model:hover { border-color: rgba(var(--fp-accent-rgb, 184,92,42),0.4); }
.sx .pb4 .pb4-model.on { border-color: var(--fp-accent, #b85c2a); background: rgba(var(--fp-accent-rgb, 184,92,42),0.05); }
.sx .pb4 .pb4-model-name { font-size: 13.5px; font-weight: 600; margin-bottom: 3px; color: var(--fp-text, #2a2825); }
.sx .pb4 .pb4-model-desc { font-size: 11.5px; color: var(--fp-muted, #656259); line-height: 1.35; margin-bottom: 8px; min-height: 30px; }
.sx .pb4 .pb4-model-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 600; color: var(--fp-muted, #656259); background: rgba(0,0,0,0.045); border-radius: 5px; padding: 3px 7px; font-family: var(--sx-mono, monospace); }

/* setup card */
.sx .pb4 .pb4-setup { background: var(--fp-surface, #fdfbf6); border-radius: 14px; border: 1px solid rgba(0,0,0,0.05); padding: 20px 22px; margin-bottom: 18px; }
.sx .pb4 .pb4-setup-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; margin-bottom: 16px; }
.sx .pb4 .pb4-field { width: 100%; height: 40px; background: rgba(0,0,0,0.04); border: 1px solid transparent; border-radius: 9px; padding: 0 13px; font-size: 14px; font-family: inherit; outline: none; color: var(--fp-text, #2a2825); box-sizing: border-box; }
.sx .pb4 .pb4-field:focus { background: var(--fp-surface, #fdfbf6); border-color: var(--fp-accent, #b85c2a); }
.sx .pb4 .pb4-amt { position: relative; display: block; }
.sx .pb4 .pb4-amt-sym { position: absolute; left: 13px; top: 11px; font-size: 14px; color: var(--fp-muted, #656259); pointer-events: none; }
.sx .pb4 .pb4-amt .pb4-field { padding-left: 24px; }

.sx .pb4 .pb4-seg { display: flex; background: rgba(0,0,0,0.045); border-radius: 9px; padding: 3px; gap: 3px; height: 40px; box-sizing: border-box; }
.sx .pb4 .pb4-seg button { flex: 1; border: none; border-radius: 6px; font-size: 12.5px; cursor: pointer; font-family: inherit; background: transparent; color: var(--fp-muted, #656259); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; line-height: 1.1; }
.sx .pb4 .pb4-seg button.on { background: var(--fp-surface, #fdfbf6); color: var(--fp-text, #2a2825); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.sx .pb4 .pb4-seg button span.s { font-size: 9.5px; color: var(--fp-muted, #656259); letter-spacing: 0.02em; }
.sx .pb4 .pb4-seg button.on span.s { color: var(--fp-accent, #b85c2a); }

.sx .pb4 .pb4-custom-split { display: flex; align-items: center; gap: 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(0,0,0,0.05); flex-wrap: wrap; }
.sx .pb4 .pb4-cs-field { display: flex; align-items: center; gap: 6px; }
.sx .pb4 .pb4-cs-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.sx .pb4 .pb4-cs-lbl { font-size: 12px; color: var(--fp-muted, #656259); }
.sx .pb4 .pb4-cs-inp { width: 46px; height: 28px; background: rgba(0,0,0,0.05); border: 1px solid transparent; border-radius: 6px; padding: 0 6px; font-size: 12.5px; font-family: var(--sx-mono, monospace); text-align: right; outline: none; color: var(--fp-text, #2a2825); }
.sx .pb4 .pb4-cs-inp:focus { background: var(--fp-surface, #fdfbf6); border-color: var(--fp-accent, #b85c2a); }
.sx .pb4 .pb4-cs-pct { font-size: 12px; color: var(--fp-muted, #656259); }
.sx .pb4 .pb4-cs-sum { margin-left: auto; font-size: 11.5px; font-weight: 600; }
.sx .pb4 .pb4-cs-sum.ok { color: var(--fp-positive, #2d6a3a); }
.sx .pb4 .pb4-cs-sum.warn { color: var(--fp-negative, #a23a2e); }
.sx .pb4 .pb4-cs-even { background: transparent; border: 1px solid rgba(0,0,0,0.12); color: var(--fp-muted, #656259); height: 28px; padding: 0 10px; border-radius: 6px; font-size: 11.5px; cursor: pointer; font-family: inherit; }
.sx .pb4 .pb4-cs-even:hover { background: rgba(0,0,0,0.04); }

/* tier cards */
.sx .pb4 .pb4-tgrid { display: grid; grid-template-columns: 84px 1fr 118px 88px 58px 88px 22px; column-gap: 14px; }
.sx .pb4 .pb4-tier { background: var(--fp-surface, #fdfbf6); border-radius: 14px; border: 1px solid rgba(0,0,0,0.05); margin-bottom: 14px; overflow: hidden; }
.sx .pb4 .pb4-tier-head { display: flex; align-items: center; gap: 14px; padding: 15px 20px 13px; }
.sx .pb4 .pb4-tier-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.sx .pb4 .pb4-tier-titles { flex: 1; min-width: 0; }
.sx .pb4 .pb4-tier-title { font-size: 15px; font-weight: 600; }
.sx .pb4 .pb4-tier-sub { font-size: 12px; color: var(--fp-muted, #656259); margin-top: 1px; }
.sx .pb4 .pb4-tprog { width: 90px; flex-shrink: 0; }
.sx .pb4 .pb4-tprog-nums { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 13px; }
.sx .pb4 .pb4-tprog-tgt { font-size: 11px; color: var(--fp-muted, #656259); }
.sx .pb4 .pb4-tprog-track { height: 6px; border-radius: 3px; background: rgba(0,0,0,0.07); overflow: hidden; }
.sx .pb4 .pb4-tprog-fill { height: 100%; border-radius: 3px; transition: width 160ms; }

.sx .pb4 .pb4-colheads { padding: 8px 20px; background: rgba(0,0,0,0.018); border-top: 1px solid rgba(0,0,0,0.04); border-bottom: 1px solid rgba(0,0,0,0.04); align-items: center; }
.sx .pb4 .pb4-micro { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fp-muted, #656259); font-weight: 500; }
.sx .pb4 .pb4-row { padding: 11px 20px; align-items: center; border-bottom: 1px solid rgba(0,0,0,0.035); transition: background 100ms; position: relative; }
.sx .pb4 .pb4-row:hover { background: rgba(0,0,0,0.018); }
.sx .pb4 .pb4-row:hover .pb4-del { opacity: 1; }
.sx .pb4 .pb4-ticker { font-size: 12px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--fp-text, #2a2825); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx .pb4 .pb4-name { font-size: 13px; color: var(--fp-text, #2a2825); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.sx .pb4 .pb4-name.empty { color: #b0aea5; }
.sx .pb4 .pb4-region { text-align: left; overflow: hidden; }
.sx .pb4 .pb4-region-pill { display: inline-block; font-size: 11px; color: var(--fp-muted, #656259); background: rgba(0,0,0,0.05); border-radius: 5px; padding: 2px 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx .pb4 .pb4-price { text-align: right; font-size: 12.5px; color: var(--fp-muted, #656259); }
.sx .pb4 .pb4-ter { text-align: right; font-size: 12px; color: var(--fp-muted, #656259); }
.sx .pb4 .pb4-muted-dash { color: #c0bcb2; }
.sx .pb4 .pb4-w-wrap { display: flex; align-items: center; gap: 5px; justify-content: flex-end; }
.sx .pb4 .pb4-w-inp { width: 50px; height: 30px; background: rgba(0,0,0,0.05); border: 1px solid transparent; border-radius: 7px; padding: 0 6px; font-size: 13px; text-align: right; outline: none; color: var(--fp-text, #2a2825); -moz-appearance: textfield; }
.sx .pb4 .pb4-w-inp::-webkit-outer-spin-button, .sx .pb4 .pb4-w-inp::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sx .pb4 .pb4-w-inp:focus { background: var(--fp-surface, #fdfbf6); border-color: var(--fp-accent, #b85c2a); }
.sx .pb4 .pb4-w-sym { font-size: 12px; color: var(--fp-muted, #656259); }
.sx .pb4 .pb4-del { opacity: 0; background: none; border: none; color: #bab8b0; cursor: pointer; font-size: 17px; line-height: 1; padding: 0; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 4px; transition: opacity 120ms; justify-self: end; }
.sx .pb4 .pb4-del:hover { color: var(--fp-negative, #b54a3e); }
.sx .pb4 .pb4-custom-tag { font-size: 9px; font-weight: 700; letter-spacing: 0.05em; color: var(--fp-accent, #b85c2a); background: rgba(var(--fp-accent-rgb, 184,92,42),0.12); border-radius: 4px; padding: 1px 5px; flex-shrink: 0; }
.sx .pb4 .pb4-fit-warn { background: #cf9a4a; color: var(--fp-surface, #fff); border: none; border-radius: 50%; width: 16px; height: 16px; font-size: 11px; font-weight: 700; cursor: pointer; flex-shrink: 0; line-height: 1; }
.sx .pb4 .pb4-empty { padding: 18px 20px; font-size: 12.5px; color: #b0aea5; text-align: center; }

.sx .pb4 .pb4-tier-foot { display: flex; gap: 8px; padding: 11px 20px; border-top: 1px solid rgba(0,0,0,0.04); align-items: center; }
.sx .pb4 .pb4-btn-add { background: rgba(var(--fp-accent-rgb, 184,92,42),0.1); color: var(--fp-accent, #b85c2a); height: 32px; padding: 0 14px; border: none; border-radius: 8px; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.sx .pb4 .pb4-btn-add:hover { background: rgba(var(--fp-accent-rgb, 184,92,42),0.16); }
.sx .pb4 .pb4-btn-text { background: transparent; color: var(--fp-muted, #656259); height: 32px; padding: 0 10px; border: none; border-radius: 8px; font-size: 12.5px; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 6px; }
.sx .pb4 .pb4-btn-text:hover { background: rgba(0,0,0,0.04); color: var(--fp-text, #2a2825); }
.sx .pb4 .pb4-btn-text.dirty { color: var(--fp-accent, #b85c2a); }
.sx .pb4 .pb4-dirty-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fp-accent, #b85c2a); }
.sx .pb4 .pb4-btn-remove { margin-left: auto; background: transparent; border: none; color: #c0b8b0; font-size: 12px; cursor: pointer; font-family: inherit; }
.sx .pb4 .pb4-btn-remove:hover { color: var(--fp-negative, #b54a3e); }

/* add-tier ghost */
.sx .pb4 .pb4-addtier { border: 1.5px dashed rgba(0,0,0,0.12); border-radius: 14px; margin-bottom: 14px; padding: 15px 20px; display: flex; align-items: center; gap: 13px; cursor: pointer; transition: all 120ms; }
.sx .pb4 .pb4-addtier:hover { border-color: var(--fp-accent, #b85c2a); background: rgba(var(--fp-accent-rgb, 184,92,42),0.03); }
.sx .pb4 .pb4-addtier-plus { width: 34px; height: 34px; border-radius: 9px; background: rgba(0,0,0,0.05); display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--fp-muted, #656259); flex-shrink: 0; }
.sx .pb4 .pb4-addtier-title { font-size: 14px; font-weight: 600; }
.sx .pb4 .pb4-addtier-sub { font-size: 12px; color: var(--fp-muted, #656259); margin-top: 1px; }

/* sidebar */
.sx .pb4 .pb4-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 1000px){ .sx .pb4 .pb4-side { position: static; } }
.sx .pb4 .pb4-card { background: var(--fp-surface, #fdfbf6); border-radius: 14px; border: 1px solid rgba(0,0,0,0.05); padding: 20px; }
.sx .pb4 .pb4-card .pb4-micro { margin-bottom: 14px; display: block; }
.sx .pb4 .pb4-donut-wrap { position: relative; display: flex; justify-content: center; margin-bottom: 16px; }
.sx .pb4 .pb4-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sx .pb4 .pb4-donut-num { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; color: var(--fp-text, #2a2825); font-variant-numeric: tabular-nums; }
.sx .pb4 .pb4-donut-num.over { color: var(--fp-negative, #a23a2e); }
.sx .pb4 .pb4-donut-num.ok { color: var(--fp-positive, #2d6a3a); }
.sx .pb4 .pb4-donut-cap { font-size: 11px; color: var(--fp-muted, #656259); }
.sx .pb4 .pb4-sum-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.sx .pb4 .pb4-sum-row + .pb4-sum-row { border-top: 1px solid rgba(0,0,0,0.05); }
.sx .pb4 .pb4-sum-dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.sx .pb4 .pb4-sum-lbl { font-size: 13px; flex: 1; }
.sx .pb4 .pb4-sum-eur { font-size: 12px; color: var(--fp-muted, #656259); }
.sx .pb4 .pb4-sum-pct { font-size: 13px; font-weight: 600; width: 42px; text-align: right; }
.sx .pb4 .pb4-sum-pct.off { color: var(--fp-negative, #a23a2e); }

/* checks card */
.sx .pb4 .pb4-check { display: flex; align-items: flex-start; gap: 9px; padding: 9px 0; font-size: 12.5px; line-height: 1.4; }
.sx .pb4 .pb4-check + .pb4-check { border-top: 1px solid rgba(0,0,0,0.05); }
.sx .pb4 .pb4-check-txt { flex: 1; min-width: 0; }
.sx .pb4 .pb4-check-x { background: none; border: none; color: #bab5aa; font-size: 14px; line-height: 1; cursor: pointer; padding: 0 2px; flex-shrink: 0; margin-top: 1px; }
.sx .pb4 .pb4-check-x:hover { color: var(--fp-muted, #656259); }
.sx .pb4 .pb4-check-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.sx .pb4 .pb4-check-warn .pb4-check-dot { background: #c97a1a; }
.sx .pb4 .pb4-check-info .pb4-check-dot { background: #3a4a8a; }
.sx .pb4 .pb4-check-good .pb4-check-dot { background: var(--fp-positive, #2d6a3a); }
.sx .pb4 .pb4-check-warn { color: #7a4a12; }
.sx .pb4 .pb4-check-good { color: var(--fp-positive, #2d6a3a); }
.sx .pb4 .pb4-check-info { color: var(--fp-text, #4a4845); }

/* save card */
.sx .pb4 .pb4-btn-prim { background: var(--fp-accent, #b85c2a); color: var(--fp-surface, #fdfbf6); height: 44px; width: 100%; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; margin-bottom: 10px; }
.sx .pb4 .pb4-btn-prim:hover:not(:disabled) { background: var(--fp-accent, #a34e22); }
.sx .pb4 .pb4-btn-prim:disabled { background: #d8cfc6; cursor: not-allowed; }
.sx .pb4 .pb4-save-row { display: flex; gap: 8px; }
.sx .pb4 .pb4-btn-sm { flex: 1; background: transparent; color: var(--fp-muted, #656259); height: 32px; padding: 0 11px; border: 1px solid rgba(0,0,0,0.1); border-radius: 8px; font-size: 12px; cursor: pointer; font-family: inherit; }
.sx .pb4 .pb4-btn-sm:hover { background: rgba(0,0,0,0.04); }

/* pb3 insight engine, re-scoped for the narrow sidebar card */
.sx .pb3.pb4-ins-scope { background: transparent; min-height: 0; padding: 18px 20px; }
.sx .pb3.pb4-ins-scope .pb3-insights { display: block; margin-top: 0; padding-top: 0; border-top: none; }
.sx .pb3.pb4-ins-scope .pb3-geo-div,
.sx .pb3.pb4-ins-scope .pb3-cost { border-left: none; padding-left: 0; border-top: 1px solid rgba(0,0,0,0.06); padding-top: 14px; margin-top: 14px; }
.sx .pb3.pb4-ins-scope .pb3-cost-main { font-size: 20px; }

/* Builder v5 — risk-profile suggestions: profile description, core hint / stock
   cap tier notes, and the asset-class target tick. */
.sx .pb4 .pb4-profile-desc { font-size: 12px; color: var(--fp-muted, #656259); line-height: 1.4; margin-top: 10px; }
.sx .pb4 .pb4-tier-note { display: flex; align-items: flex-start; gap: 8px; padding: 9px 20px; font-size: 12px; line-height: 1.4; color: #5a6a55; background: rgba(58,122,74,0.06); border-top: 1px solid rgba(0,0,0,0.04); }
.sx .pb4 .pb4-tier-note.warn { color: #7a4a12; background: rgba(201,122,26,0.08); }
.sx .pb4 .pb4-tier-note-ico { flex-shrink: 0; font-weight: 700; color: var(--fp-positive, #3a7a4a); line-height: 1.4; }
.sx .pb4 .pb4-tier-note.warn .pb4-tier-note-ico { color: #c97a1a; }
.sx .pb4 .pb4-tier-note-x { margin-left: auto; background: none; border: none; color: #b0aba0; font-size: 15px; line-height: 1; cursor: pointer; padding: 0 2px; flex-shrink: 0; }
.sx .pb4 .pb4-tier-note-x:hover { color: #6a4a12; }
/* suggested-equity boundary marker on the asset-class bar (bar stays clipped;
   tick is full-height with white edges so it reads on any segment colour) */
.sx .pb3.pb4-ins-scope .pb3-geo-bar { position: relative; }
.sx .pb4-ac-tick { position: absolute; top: 0; bottom: 0; width: 4px; background: var(--fp-text, #2a2825); border-left: 1px solid rgba(253,251,246,0.9); border-right: 1px solid rgba(253,251,246,0.9); box-sizing: border-box; transform: translateX(-2px); z-index: 2; }

/* ══════════════════════════════════════════════════════════════════════════
   Builder onboarding tour (Driver.js) — "?" replay control + popover theming
   ══════════════════════════════════════════════════════════════════════════ */
.sx .pb4 .pb4-h1-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sx .pb4 .pb4-tour-btn {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  height: 30px; padding: 0 12px 0 10px;
  background: var(--fp-surface, #fdfbf6); color: var(--fp-accent, #b85c2a);
  border: 1px solid #e6ddd2; border-radius: 999px;
  font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.sx .pb4 .pb4-tour-btn:hover { background: #f7efe6; border-color: #d8c3ad; color: var(--fp-accent, #a34e22); }
.sx .pb4 .pb4-tour-btn > span { letter-spacing: .01em; }

/* Driver.js popover — reskin to match the warm builder palette */
.driver-popover.pb4-tour {
  background: var(--fp-surface, #fdfbf6);
  color: var(--fp-text, #2a2825);
  border-radius: 14px;
  box-shadow: 0 18px 48px -12px rgba(28,36,23,0.45), 0 0 0 1px rgba(42,40,37,0.06);
  padding: 18px 18px 14px;
  max-width: 320px;
  font-family: 'Inter', system-ui, sans-serif;
}
.driver-popover.pb4-tour .driver-popover-title {
  font-size: 15.5px; font-weight: 700; line-height: 1.3; color: var(--fp-text, #2a2825);
  margin: 0 0 6px;
}
.driver-popover.pb4-tour .driver-popover-description {
  font-size: 13.5px; line-height: 1.5; color: var(--fp-muted, #656259); margin: 0;
}
.driver-popover.pb4-tour .driver-popover-arrow { color: var(--fp-surface, #fdfbf6); }
/* Driver draws the arrow via borders; tint the visible edge to the paper bg */
.driver-popover.pb4-tour .driver-popover-arrow-side-left.driver-popover-arrow  { border-left-color: var(--fp-surface, #fdfbf6); }
.driver-popover.pb4-tour .driver-popover-arrow-side-right.driver-popover-arrow { border-right-color: var(--fp-surface, #fdfbf6); }
.driver-popover.pb4-tour .driver-popover-arrow-side-top.driver-popover-arrow   { border-top-color: var(--fp-surface, #fdfbf6); }
.driver-popover.pb4-tour .driver-popover-arrow-side-bottom.driver-popover-arrow{ border-bottom-color: var(--fp-surface, #fdfbf6); }

.driver-popover.pb4-tour .driver-popover-footer {
  margin-top: 14px; display: flex; align-items: center; gap: 8px;
}
.driver-popover.pb4-tour .driver-popover-progress-text {
  color: var(--fp-muted, #656259); font-size: 11.5px; font-weight: 600; letter-spacing: .04em;
}
.driver-popover.pb4-tour .driver-popover-navigation-btns {
  display: flex; gap: 8px; margin-left: auto;
}
/* Base button reset for all footer buttons */
.driver-popover.pb4-tour button {
  text-shadow: none; background: var(--fp-canvas, #f0ede4); color: var(--fp-text, #4a4845);
  border: 1px solid #e6ddd2; border-radius: 8px;
  padding: 7px 14px; font-family: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: background .12s, color .12s, border-color .12s;
}
.driver-popover.pb4-tour button:hover { background: #e8e2d7; color: var(--fp-text, #2a2825); }
/* Next / Done = primary terracotta */
.driver-popover.pb4-tour .driver-popover-next-btn {
  background: var(--fp-accent, #b85c2a); color: var(--fp-surface, #fdfbf6); border-color: var(--fp-accent, #b85c2a);
}
.driver-popover.pb4-tour .driver-popover-next-btn:hover { background: var(--fp-accent, #a34e22); border-color: var(--fp-accent, #a34e22); }
/* Skip — quiet ghost button, sits on the left of the footer (space-between) */
.driver-popover.pb4-tour .pb4-tour-skip {
  background: transparent; border-color: transparent; color: var(--fp-muted, #656259);
  padding: 7px 4px;
}
.driver-popover.pb4-tour .pb4-tour-skip:hover { background: transparent; color: var(--fp-negative, #b54a3e); }
/* Hide the default top-right X — the labelled Skip button replaces it */
.driver-popover.pb4-tour .driver-popover-close-btn { display: none; }

/* ══════════════════════════════════════════════════════════════════════════
   Learn tab (greta-only) — shared educational FAQ accordion
   ══════════════════════════════════════════════════════════════════════════ */
.sx .learn-page { max-width: 780px; margin: 0 auto; padding: 8px 0 40px; }
.sx .learn-head { text-align: center; margin: 8px auto 40px; max-width: 640px; }
.sx .learn-kicker { font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--fp-accent, #b85c2a); }
.sx .learn-title { font-size: clamp(26px, 4vw, 38px); line-height: 1.14; letter-spacing: -.02em;
  color: var(--fp-text, #2a2825); margin: 12px 0 0; font-weight: 700; }
.sx .learn-sub { color: var(--fp-muted, #656259); font-size: 17px; margin: 14px 0 0; }
.sx .learn-disclaimer { margin-top: 40px; padding-top: 20px; border-top: 1px solid #e6ddd2;
  font-size: 12.5px; line-height: 1.7; color: var(--fp-muted, #656259); text-align: center; }

.sx .learn-guide { margin-bottom: 40px; border: 1px solid #dfd2c2; border-radius: 16px;
  background: var(--sx-surface); overflow: hidden; box-shadow: var(--sx-card-shadow); }
.sx .learn-guide-card { display: grid; grid-template-columns: 210px 1fr; cursor: pointer;
  list-style: none; background: var(--fp-inset, #eee3d4); color: var(--sx-text); }
.sx .learn-guide-card::-webkit-details-marker { display: none; }
.sx .learn-guide-card:hover { background: #e9dccb; }
.sx .learn-guide-card:focus-visible { outline: 3px solid var(--sx-accent); outline-offset: -5px; }
.sx .learn-guide-art { position: relative; display: grid; place-items: center;
  min-height: 246px; background: #d8b599; overflow: hidden; }
.sx .learn-guide-sheet { display: flex; flex-direction: column; gap: 14px; width: 146px;
  padding: 22px 16px; border-radius: 8px; background: var(--fp-surface, #fdfbf6); transform: rotate(-9deg);
  box-shadow: 8px 10px 0 #b85c2a33; font-size: 11px; color: var(--fp-muted, #656259); }
.sx .learn-guide-sheet b { color: var(--sx-accent); font-size: 36px; letter-spacing: -.04em;
  border-bottom: 1px solid #e6ddd2; padding-bottom: 10px; }
.sx .learn-guide-seal { position: absolute; right: 10px; bottom: 24px; display: grid;
  align-content: center; width: 66px; height: 66px; border-radius: 50%; background: #3e5946;
  color: var(--fp-surface, #fff); text-align: center; font-size: 26px; font-weight: 600; line-height: 1; transform: rotate(8deg); }
.sx .learn-guide-seal small { font-size: 11px; font-weight: 400; margin-top: 4px; }
.sx .learn-guide-cover { display: flex; flex-direction: column; align-items: flex-start; padding: 26px 30px; }
.sx .learn-guide-meta { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--fp-muted, #76543c); }
.sx .learn-guide-question { margin-top: 12px; font-size: clamp(23px, 3.2vw, 32px);
  font-weight: 750; line-height: 1.1; letter-spacing: -.035em; }
.sx .learn-guide-teaser { margin-top: 12px; color: var(--fp-muted, #656259); font-size: 14px; line-height: 1.5; max-width: 32ch; }
.sx .learn-guide-action { display: flex; gap: 24px; margin-top: 18px; color: var(--fp-accent, #92451d); font-size: 13px; font-weight: 600; }
.sx .learn-guide-close, .sx .learn-guide[open] .learn-guide-read { display: none; }
.sx .learn-guide[open] .learn-guide-close { display: inline; }
.sx .learn-guide[open] .learn-guide-action > span:last-child { transform: rotate(-90deg); }
.sx .learn-guide-body { padding: 28px 32px; border-top: 1px solid #dfd2c2; }
.sx .learn-guide-body p, .sx .learn-guide-body li { font-size: 15px; line-height: 1.75; color: var(--fp-text, #4a4845); }
.sx .learn-guide-body p { margin: 10px 0 0; }
.sx .learn-guide-body .learn-guide-intro { margin: 0; font-size: 17px; }
.sx .learn-guide-body section { margin-top: 28px; }
.sx .learn-guide-body h2 { font-size: 19px; font-weight: 600; line-height: 1.4; }
.sx .learn-guide-body h2 span { color: var(--sx-accent); font-size: 13px; margin-right: 8px; }
.sx .learn-guide-body ul { padding-left: 22px; }
.sx .learn-ter-table { width: 100%; margin: 18px 0; border-collapse: collapse; font-size: 14px; }
.sx .learn-ter-table caption { text-align: left; color: var(--fp-muted, #656259); font-size: 12px; margin-bottom: 10px; }
.sx .learn-ter-table th, .sx .learn-ter-table td { padding: 12px; text-align: left;
  border-bottom: 1px solid #e6ddd2; line-height: 1.5; vertical-align: top; white-space: normal; }
.sx .learn-ter-table th { background: transparent; color: var(--sx-text); text-transform: none;
  letter-spacing: normal; font-size: inherit; cursor: auto; user-select: text; }
.sx .learn-ter-table thead { background: var(--fp-inset, #eee3d4); position: static; }
.sx .learn-ter-table tbody th { width: 32%; font-weight: 600; }
.sx .learn-guide-sources { border-top: 1px solid #e6ddd2; margin-top: 28px; padding-top: 18px; }
.sx .learn-guide-sources h3 { font-size: 13px; font-weight: 600; }
.sx .learn-guide-sources p { font-size: 12px; }
.sx .learn-guide-sources a { color: var(--fp-accent, #92451d); text-underline-offset: 3px; }
.sx .learn-allocation .learn-guide-art { background: #b9c7b5; }
.sx .learn-allocation .learn-guide-seal { background: var(--fp-accent, #92451d); }
.sx .learn-behaviour .learn-guide-art { background: #bccbd3; }
.sx .learn-behaviour .learn-guide-seal { background: #405f70; }
.sx .learn-behaviour .learn-guide-sheet b { font-size: 29px; }
.sx .learn-overlap .learn-guide-art { background: #cdc0d2; }
.sx .learn-overlap .learn-guide-seal { background: #695471; }
.sx .learn-overlap .learn-guide-sheet b { font-size: 29px; }
.sx .learn-risk .learn-guide-art { background: #dec4bb; }
.sx .learn-risk .learn-guide-seal { background: #965a45; }
.sx .learn-risk .learn-guide-sheet b { font-size: 29px; }
.sx .learn-rebalancing .learn-guide-art { background: #bfd0ca; }
.sx .learn-rebalancing .learn-guide-seal { background: #3e6b61; }
.sx .learn-rebalancing .learn-guide-sheet b { font-size: 29px; }
.sx .learn-mix-table tbody th { width: 46%; }
@media (max-width: 540px) {
  .sx .learn-guide-card { grid-template-columns: 105px 1fr; }
  .sx .learn-guide-art { min-height: 230px; }
  .sx .learn-guide-sheet { width: 100px; padding: 18px 10px; font-size: 9px; transform: rotate(-9deg) translateX(-8px); }
  .sx .learn-guide-sheet b { font-size: 30px; }
  .sx .learn-behaviour .learn-guide-sheet b { font-size: 23px; }
  .sx .learn-overlap .learn-guide-sheet b { font-size: 23px; }
  .sx .learn-risk .learn-guide-sheet b { font-size: 23px; }
  .sx .learn-rebalancing .learn-guide-sheet b { font-size: 23px; }
  .sx .learn-rebalancing .learn-guide-question { font-size: 21px; }
  .sx .learn-overlap .learn-guide-question { font-size: 21px; }
  .sx .learn-guide-seal { width: 51px; height: 51px; right: 5px; bottom: 18px; font-size: 22px; }
  .sx .learn-guide-cover { padding: 22px 16px; }
  .sx .learn-guide-meta { font-size: 9px; }
  .sx .learn-guide-question { font-size: 23px; }
  .sx .learn-guide-body { padding: 22px 18px; }
  .sx .learn-ter-table th, .sx .learn-ter-table td { padding: 10px 7px; }
  .sx .learn-mix-table { font-size: 12px; }
  .sx .learn-mix-table th, .sx .learn-mix-table td { padding: 10px 4px; }
}

.sx .faq { max-width: 780px; margin: 0 auto; }
.sx .faq-group { margin-bottom: 36px; }
.sx .faq-group:last-child { margin-bottom: 0; }
.sx .faq-group-title { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--fp-accent, #b85c2a); margin: 0 0 4px;
  padding-bottom: 12px; border-bottom: 1px solid #e6ddd2; }
.sx .faq-item { border-bottom: 1px solid #ece4d7; }
.sx .faq-q { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  cursor: pointer; list-style: none; padding: 17px 2px; font-size: 16px; font-weight: 600; color: var(--fp-text, #2a2825); }
.sx .faq-q::-webkit-details-marker { display: none; }
.sx .faq-q:hover { color: var(--fp-accent, #b85c2a); }
.sx .faq-q-txt { flex: 1; }
.sx .faq-q-ico { flex: 0 0 auto; position: relative; width: 15px; height: 15px; margin-top: 4px; }
.sx .faq-q-ico::before, .sx .faq-q-ico::after { content: ""; position: absolute; background: var(--fp-accent, #b85c2a);
  border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.sx .faq-q-ico::before { top: 6.5px; left: 0; width: 15px; height: 2px; }
.sx .faq-q-ico::after { left: 6.5px; top: 0; width: 2px; height: 15px; }
.sx .faq-item[open] .faq-q-ico::after { transform: scaleY(0); opacity: 0; }
.sx .faq-a { padding: 0 2px 18px; }
.sx .faq-a p { margin: 0; color: var(--fp-text, #4a4845); font-size: 15.5px; line-height: 1.7; max-width: 70ch; }

/* ── Saved order lists (standalone broker order tables) ─────────────────────
   Two views in one modal: the saved-list index (.ol-row) and the row editor
   (.ol-item). Deliberately plain — this is a utility, not a dashboard. */
.ol-list { display: flex; flex-direction: column; gap: 6px; }
.ol-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px; border: 1px solid var(--fp-border, #ece8df); border-radius: 10px;
  background: var(--fp-surface, #fdfbf6); cursor: pointer;
  transition: background 120ms, border-color 120ms;
}
.ol-row:hover { background: #f7f3ea; border-color: var(--fp-border, #ddd6c8); }
.ol-row-main { flex: 1; min-width: 0; }
.ol-row-name { font-size: 14px; font-weight: 600; color: var(--fp-text, #2a2825); }
.ol-row-sub { font-size: 11.5px; color: var(--fp-muted, #656259); margin-top: 2px; font-variant-numeric: tabular-nums; }
.ol-row-go { color: #b0aca3; font-size: 18px; line-height: 1; }

.ol-items-head, .ol-item {
  display: grid; grid-template-columns: 1fr 130px 48px 30px;
  gap: 8px; align-items: center;
}
.ol-items-head {
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fp-muted, #656259); font-weight: 600; padding: 0 2px 6px;
  border-bottom: 1px solid var(--fp-inset, #f0ece3);
}
.ol-items { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; max-height: 320px; overflow-y: auto; }
.ol-inp {
  font: inherit; font-size: 13px; color: var(--fp-text, #2a2825);
  border: 1px solid var(--fp-border, #ddd6c8); border-radius: 7px; background: var(--fp-surface, #fff); padding: 6px 9px;
  width: 100%; min-width: 0;
}
.ol-inp:focus { outline: none; border-color: var(--fp-accent, #b85c2a); }
.ol-inp-tk { text-transform: uppercase; font-weight: 600; }
.ol-inp-amt { text-align: right; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.ol-inp-amt::-webkit-outer-spin-button, .ol-inp-amt::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ol-ccy { font-size: 11px; font-weight: 600; color: var(--fp-muted, #656259); letter-spacing: 0.04em; }
.ol-del {
  border: none; background: none; cursor: pointer; padding: 0;
  color: #b0aca3; font-size: 17px; line-height: 1;
}
.ol-del:hover { color: var(--fp-negative, #b54a3e); }

@media (max-width: 768px) {
  .ol-items-head, .ol-item { grid-template-columns: 1fr 104px 42px 26px; gap: 6px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Portfolio Builder — "Builder Simple" guided wizard (imported from Claude
   Design project "Full Pockets" / Builder Simple.html). Warm-cream editorial
   look, all scoped under .bs so it can't leak into the rest of the app. The
   step / funds / review / done screens + sticky sidebar are rendered by
   bwRender() in builder.js. ETF universe, allocation targets and the check
   engine are the app's existing logic — only the presentation is the design.
   ══════════════════════════════════════════════════════════════════════════ */
#builder-tab { padding: 0; }
.bs { font-family: var(--sx-sans); color: var(--fp-text, #2a2825); background: var(--fp-canvas, #f0ede4); min-height: 100vh; -webkit-font-smoothing: antialiased; }
.bs *, .bs *::before, .bs *::after { box-sizing: border-box; }
.bs input, .bs button, .bs select, .bs textarea { font-family:inherit; }
.bs a { color: var(--fp-accent, #b85c2a); text-decoration: none; }
.bs a:hover { color: var(--fp-accent, #8f451e); text-decoration: underline; }
.bs .mono { font-family: var(--sx-sans); font-variant-numeric: tabular-nums; }
.bs .num { font-variant-numeric: tabular-nums; }
.bs .acc { color: var(--fp-accent, #b85c2a); }

/* shell: main column + sticky sidebar */
.bs .shell { display: grid; grid-template-columns: minmax(0,1fr) 296px; gap: 32px; max-width: 1080px; margin: 0 auto; padding: 36px 24px 80px; align-items: start; }
.bs .shell.shell-full { grid-template-columns: minmax(0,1fr); max-width: 1080px; }
.bs .shell > .wrap { max-width: none; margin: 0; padding: 0; }
.bs .wrap { max-width: 680px; margin: 0 auto; padding: 36px 24px 60px; }
@media (max-width: 1000px) { .bs .shell { grid-template-columns: 1fr; } .bs .sp { position: static; } }

/* sidebar */
.bs .sp { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 14px; }
.bs .sp .lbl { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--fp-muted, #656259); font-weight: 600; margin-bottom: 14px; }
.bs .sp .big { font-size: 25px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.bs .sp .sub { font-size: 12px; color: var(--fp-muted, #656259); margin-top: 4px; }
.bs .sprow { display: grid; grid-template-columns: 9px 1fr auto 34px; column-gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid rgba(0,0,0,.06); font-size: 13px; }
.bs .sprow .e { font-size: 12px; color: var(--fp-muted, #656259); }
.bs .sprow .p { font-weight: 600; text-align: right; }
.bs .chk { display: grid; grid-template-columns: 7px 1fr 14px; column-gap: 9px; padding: 11px 0; font-size: 12.5px; line-height: 1.45; align-items: start; }
.bs .chk + .chk { border-top: 1px solid rgba(0,0,0,.06); }
.bs .chk i { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; }
.bs .chk .x { background: none; border: none; color: var(--fp-muted, #656259); cursor: pointer; font-size: 14px; padding: 0; line-height: 1; }
.bs .chk .x:hover { color: var(--fp-muted, #656259); }
.bs .chk.warn i { background: #c97a1a; } .bs .chk.warn { color: #7a4a12; }
.bs .chk.info i { background: #3a4a8a; }
.bs .chk.good i { background: var(--fp-positive, #2d6a3a); } .bs .chk.good { color: var(--fp-positive, #2d6a3a); }
.bs .spsec + .spsec { margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(0,0,0,.07); }
.bs .minibar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: rgba(0,0,0,.07); margin: 12px 0 10px; }
.bs .exrow { display: grid; grid-template-columns: 8px 1fr auto; column-gap: 9px; align-items: center; padding: 5px 0; font-size: 12.5px; }
.bs .exrow .p { font-weight: 600; font-size: 12px; }
.bs .empty { font-size: 12.5px; color: var(--fp-muted, #656259); margin: 10px 0 0; }
.bs .cost { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin-top: 12px; }
.bs .costsub { font-size: 12px; color: var(--fp-muted, #656259); margin-top: 4px; }

/* review */
.bs .revcard { background: var(--fp-surface, #fdfbf6); border-radius: 14px; border: 1px solid rgba(0,0,0,.05); padding: 22px 24px; margin-bottom: 14px; }
.bs .revhd { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; margin-bottom: 4px; }
.bs .revname { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.bs .revmeta { font-size: 13px; color: var(--fp-muted, #656259); }
.bs .revgrp { margin-top: 20px; }
.bs .revgrp-h { display: flex; align-items: center; gap: 9px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--fp-muted, #656259); padding-bottom: 8px; border-bottom: 1px solid rgba(0,0,0,.1); }
.bs .revgrp-h .m { margin-left: auto; letter-spacing: 0; text-transform: none; font-size: 12.5px; color: var(--fp-text, #2a2825); }
.bs .revrow { display: grid; grid-template-columns: 1fr auto; column-gap: 14px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid rgba(0,0,0,.05); }
.bs .revrow:last-child { border-bottom: none; }
.bs .revrow .n { font-size: 14px; }
.bs .revrow .t { font-size: 11.5px; color: var(--fp-muted, #656259); margin-left: 8px; }
.bs .revrow .d { font-size: 12px; color: var(--fp-muted, #656259); margin-top: 2px; }
.bs .revrow .v { font-size: 14.5px; font-weight: 600; }
.bs .revtot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 18px; padding-top: 14px; border-top: 1.5px solid rgba(0,0,0,.14); font-size: 15px; font-weight: 600; }
.bs .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 24px; }
.bs .fact { padding: 11px 0; border-bottom: 1px solid rgba(0,0,0,.05); display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.bs .fact .k { color: var(--fp-muted, #656259); }
.bs .fact .v { font-weight: 600; text-align: right; }
.bs .expect { display: grid; grid-template-columns: 7px 1fr; column-gap: 11px; padding: 9px 0; font-size: 13px; line-height: 1.5; color: var(--fp-muted, #656259); align-items: start; }
.bs .expect i { width: 7px; height: 7px; border-radius: 50%; background: #c8c4ba; margin-top: 6px; }
.bs .done-tick { width: 54px; height: 54px; border-radius: 50%; background: rgba(45,106,58,.12); color: var(--fp-positive, #2d6a3a); display: flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 18px; }
.bs h1 { font-size: 27px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 6px; }
.bs .lede { font-size: 15px; color: var(--fp-muted, #656259); line-height: 1.55; margin: 0 0 8px; max-width: 520px; }
.bs .lede b { color: var(--fp-text, #2a2825); font-weight: 600; }

/* numbered step */
.bs .step { display: flex; gap: 16px; padding: 28px 0; border-top: 1px solid rgba(0,0,0,.07); }
.bs .step:first-of-type { border-top: none; }
.bs .step-n { width: 27px; height: 27px; border-radius: 50%; background: var(--fp-text, #2a2825); color: var(--fp-surface, #fdfbf6); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none; margin-top: 1px; }
.bs .step-b { flex: 1; min-width: 0; }
.bs .q { font-size: 18px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 4px; }
.bs .hint { font-size: 13.5px; color: var(--fp-muted, #656259); line-height: 1.5; margin: 0 0 16px; max-width: 470px; }
.bs .card { background: var(--fp-surface, #fdfbf6); border-radius: 14px; border: 1px solid rgba(0,0,0,.05); padding: 20px 22px; }

/* amount */
.bs .amt-wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bs .amt { position: relative; flex: none; }
.bs .amt .cur { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 24px; color: var(--fp-muted, #656259); pointer-events: none; }
.bs .amt input { width: 230px; height: 58px; background: var(--fp-surface, #fdfbf6); border: 1.5px solid rgba(0,0,0,.12); border-radius: 12px; padding: 0 16px 0 40px; font-size: 24px; font-family: var(--sx-sans); font-variant-numeric: tabular-nums; color: var(--fp-text, #2a2825); outline: none; }
.bs .amt input:focus { border-color: var(--fp-accent, #b85c2a); }
.bs .quick { display: flex; gap: 8px; }
.bs .quick button { height: 34px; padding: 0 13px; background: rgba(0,0,0,.045); border: none; border-radius: 8px; font-size: 13px; font-family: inherit; color: var(--fp-muted, #656259); cursor: pointer; }
.bs .quick button:hover { background: rgba(0,0,0,.08); color: var(--fp-text, #2a2825); }

/* text field */
.bs .txt { width: 100%; max-width: 360px; height: 48px; background: var(--fp-surface, #fdfbf6); border: 1.5px solid rgba(0,0,0,.12); border-radius: 11px; padding: 0 15px; font-size: 15px; font-family: inherit; color: var(--fp-text, #2a2825); outline: none; }
.bs .txt:focus { border-color: var(--fp-accent, #b85c2a); }

/* choices */
.bs .choices { display: flex; flex-direction: column; gap: 10px; }
.bs .choices.two { flex-direction: row; }
.bs .choices.two .choice { flex: 1; }
.bs .choice { display: flex; align-items: flex-start; gap: 14px; background: var(--fp-surface, #fdfbf6); border: 1.5px solid rgba(0,0,0,.07); border-radius: 13px; padding: 16px 18px; cursor: pointer; text-align: left; font-family: inherit; transition: border-color 120ms, background 120ms; width: 100%; }
.bs .choice:hover { border-color: rgba(var(--fp-accent-rgb, 184,92,42),.45); }
.bs .choice.on { border-color: var(--fp-accent, #b85c2a); background: rgba(var(--fp-accent-rgb, 184,92,42),.045); }
.bs .radio { width: 19px; height: 19px; border-radius: 50%; border: 1.5px solid rgba(0,0,0,.2); flex: none; margin-top: 2px; display: flex; align-items: center; justify-content: center; }
.bs .choice.on .radio, .bs .fund.on .radio { border-color: var(--fp-accent, #b85c2a); }
.bs .choice.on .radio::after, .bs .fund.on .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--fp-accent, #b85c2a); }
.bs .choice-t { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.bs .choice-d { font-size: 13.5px; color: var(--fp-muted, #656259); line-height: 1.5; max-width: 640px; }
.bs .meter { display: flex; gap: 3px; margin-top: 9px; }
.bs .meter i { width: 22px; height: 5px; border-radius: 3px; background: rgba(0,0,0,.09); }
.bs .meter i.f { background: var(--fp-accent, #b85c2a); }

/* mix */
.bs .bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: rgba(0,0,0,.06); margin-bottom: 18px; }
.bs .bar span { transition: width 200ms; }
.bs .mixrow { display: grid; grid-template-columns: 11px 1fr auto; column-gap: 13px; align-items: center; padding: 15px 0; border-top: 1px solid rgba(0,0,0,.06); }
.bs .mixrow:first-of-type { border-top: none; padding-top: 2px; }
.bs .swatch { width: 11px; height: 11px; border-radius: 3px; }
.bs .mixname { font-size: 14.5px; font-weight: 600; margin-bottom: 2px; }
.bs .mixdesc { font-size: 12.5px; color: var(--fp-muted, #656259); line-height: 1.45; }
.bs .mixmoney { text-align: right; white-space: nowrap; }
.bs .mixmoney .m { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.bs .mixmoney .p { font-size: 11.5px; color: var(--fp-muted, #656259); margin-top: 2px; }
.bs .mixfoot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; padding-top: 14px; border-top: 1.5px solid rgba(0,0,0,.14); font-size: 14px; font-weight: 600; }
.bs .adjust { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.bs .editbtn { background: transparent; border: none; font-family: inherit; font-size: 13px; color: var(--fp-accent, #b85c2a); cursor: pointer; padding: 0; text-decoration: underline; }
.bs .editbtn:hover { color: var(--fp-accent, #8f451e); }
.bs .editrow { display: grid; grid-template-columns: 11px 1fr 130px 78px; column-gap: 13px; align-items: center; padding: 13px 0; border-top: 1px solid rgba(0,0,0,.06); }
.bs .editrow:first-of-type { border-top: none; padding-top: 2px; }
.bs .editrow .en { font-size: 14px; }
.bs .editnote { font-size: 12.5px; color: var(--fp-muted, #656259); line-height: 1.5; margin: 14px 0 0; }
.bs .warn { display: flex; gap: 9px; align-items: flex-start; background: rgba(201,122,26,.09); border-radius: 10px; padding: 12px 14px; margin-top: 12px; font-size: 13px; line-height: 1.5; color: #7a4a12; max-width: 470px; }
.bs .warn i { width: 7px; height: 7px; border-radius: 50%; background: #c97a1a; flex: none; margin-top: 6px; }

/* fund picking */
.bs .back { background: transparent; border: none; font-family: inherit; font-size: 13.5px; color: var(--fp-muted, #656259); cursor: pointer; padding: 0; margin: 0 0 20px; display: inline-flex; gap: 6px; }
.bs .back:hover { color: var(--fp-text, #2a2825); }
.bs .part { background: var(--fp-surface, #fdfbf6); border: 1px solid rgba(0,0,0,.05); border-left: 4px solid #ccc; border-radius: 12px; padding: 18px 20px 20px; margin-bottom: 16px; }
.bs .part-head { display: flex; align-items: center; gap: 11px; margin-bottom: 4px; }
.bs .part-tag { font-size: 9.5px; font-weight: 700; letter-spacing: .09em; color: var(--fp-surface, #fff); padding: 3px 8px; border-radius: 5px; line-height: 1; }
.bs .part-t { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.bs .part-m { margin-left: auto; font-size: 14px; font-weight: 600; white-space: nowrap; }
.bs .part-d { font-size: 13px; color: var(--fp-muted, #656259); line-height: 1.5; margin: 4px 0 14px 0; }
.bs .pickedlist { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.bs .picked { display: grid; grid-template-columns: 1fr auto auto; column-gap: 14px; align-items: center; background: var(--fp-surface, #fdfbf6); border: 1.5px solid rgba(45,106,58,.35); border-radius: 12px; padding: 14px 16px; }
.bs .picked .pn { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bs .picked .pd { font-size: 12.5px; color: var(--fp-muted, #656259); line-height: 1.45; margin-top: 3px; }
.bs .change { background: transparent; border: none; font-family: inherit; font-size: 13px; color: var(--fp-accent, #b85c2a); cursor: pointer; text-decoration: underline; padding: 0; }
.bs .fee { text-align: right; white-space: nowrap; }
.bs .fee .f1 { font-size: 13.5px; font-weight: 600; }
.bs .fee .f2 { font-size: 11.5px; color: var(--fp-muted, #656259); margin-top: 2px; }
.bs .browse { width: 100%; height: 52px; background: var(--fp-surface, #fdfbf6); border: 1.5px solid var(--fp-accent, #b85c2a); border-radius: 12px; color: var(--fp-accent, #b85c2a); font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.bs .browse:hover { background: rgba(var(--fp-accent-rgb, 184,92,42),.06); }
.bs .browse.small { height: 44px; font-size: 14px; border-style: dashed; }
.bs .totals { background: var(--fp-surface, #fdfbf6); border-radius: 14px; border: 1px solid rgba(0,0,0,.05); padding: 20px 22px; margin-top: 30px; }
.bs .trow { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; font-size: 14px; }
.bs .trow + .trow { border-top: 1px solid rgba(0,0,0,.06); }
.bs .trow .k { color: var(--fp-muted, #656259); }
.bs .trow .v { font-weight: 600; }
.bs .trow .v .s { display: block; font-size: 11.5px; color: var(--fp-muted, #656259); font-weight: 400; margin-top: 2px; text-align: right; }

/* slider */
.bs .adjust .lbl { font-size: 13.5px; color: var(--fp-muted, #656259); }
.bs .slider { flex: 1; -webkit-appearance: none; appearance: none; height: 5px; border-radius: 3px; background: rgba(0,0,0,.1); outline: none; }
.bs .slider::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--fp-surface, #fdfbf6); border: 1.5px solid var(--fp-accent, #b85c2a); cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.bs .slider::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--fp-surface, #fdfbf6); border: 1.5px solid var(--fp-accent, #b85c2a); cursor: pointer; }

/* save / buttons */
.bs .btn { background: var(--fp-accent, #b85c2a); color: var(--fp-surface, #fdfbf6); height: 48px; padding: 0 28px; border: none; border-radius: 11px; font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer; }
.bs .btn:hover { background: #a4501f; }
.bs .btn:disabled { background: #d8cfc6; cursor: not-allowed; }
.bs .save-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.bs .btn-quiet { background: transparent; color: var(--fp-muted, #656259); height: 48px; padding: 0 6px; border: none; font-size: 14px; font-family: inherit; cursor: pointer; text-decoration: underline; }
.bs .btn-quiet:hover { color: var(--fp-text, #2a2825); }
.bs .reassure { font-size: 13px; color: var(--fp-muted, #656259); line-height: 1.55; margin: 14px 0 0; max-width: 470px; }

/* Editable per-fund amount on the funds screen (guided wizard) */
.bs .pamt-wrap { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.bs .pcur { font-size: 13px; color: var(--fp-muted, #656259); }
.bs .pamt { width: 78px; height: 32px; text-align: right; background: var(--fp-surface, #fdfbf6); border: 1.5px solid rgba(0,0,0,.12); border-radius: 8px; padding: 0 9px; font-size: 13.5px; font-family: var(--sx-sans); font-variant-numeric: tabular-nums; color: var(--fp-text, #2a2825); outline: none; -moz-appearance: textfield; }
.bs .pamt:focus { border-color: var(--fp-accent, #b85c2a); }
.bs .pamt:disabled { background: rgba(0,0,0,.03); color: #a8a59a; }
.bs .pamt::-webkit-outer-spin-button, .bs .pamt::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* €/% edit-unit toggle on the funds screen (guided wizard) */
.bs .unitrow { display: flex; align-items: center; gap: 12px; margin: 0 0 24px; }
.bs .unitlbl { font-size: 13px; color: var(--fp-muted, #656259); }
.bs .unitseg { display: inline-flex; background: rgba(0,0,0,.05); border-radius: 9px; padding: 3px; gap: 2px; }
.bs .unitseg button { height: 30px; padding: 0 13px; border: none; border-radius: 7px; background: transparent; color: var(--fp-muted, #656259); font-size: 13px; font-family: inherit; cursor: pointer; }
.bs .unitseg button.on { background: var(--fp-surface, #fdfbf6); color: var(--fp-text, #2a2825); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* Add-or-skip prompt for an undecided Themes/Stocks sleeve (guided wizard) */
.bs .skip-row { display: flex; gap: 10px; align-items: stretch; }
.bs .skip-row .browse { flex: 1; width: auto; }
.bs .skip-btn { flex: 1; height: 52px; background: var(--fp-surface, #fdfbf6); border: 1.5px solid rgba(0,0,0,.12); border-radius: 12px; color: var(--fp-muted, #656259); font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.bs .skip-btn:hover { background: rgba(0,0,0,.03); border-color: rgba(0,0,0,.22); }

/* Allocate screen (step 3) — editable sleeve rows with a stepper + Remove,
   and a muted ghost row for a removed (0%) optional sleeve. */
.bs .mixrow-edit { padding: 15px 0; border-top: 1px solid rgba(0,0,0,.06); }
.bs .mixrow-edit .mixrow-top { display: grid; grid-template-columns: 11px 1fr auto; column-gap: 13px; align-items: center; }
.bs .mixrow-ctrl { display: flex; align-items: center; gap: 10px; margin: 10px 0 0 24px; }
.bs .step-btn { width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid rgba(0,0,0,.12); background: var(--fp-surface, #fdfbf6); color: var(--fp-text, #2a2825); font-size: 16px; font-weight: 600; cursor: pointer; line-height: 1; font-family: inherit; }
.bs .step-btn:hover { background: rgba(0,0,0,.04); }
.bs .stepper-inp { width: 56px; height: 30px; text-align: center; border: 1.5px solid rgba(0,0,0,.12); border-radius: 8px; font-family: var(--sx-sans); font-size: 14px; color: var(--fp-text, #2a2825); -moz-appearance: textfield; }
.bs .stepper-inp::-webkit-outer-spin-button, .bs .stepper-inp::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bs .ghost-row { width: 100%; height: 48px; margin-top: 12px; background: transparent; border: 1.5px dashed rgba(0,0,0,.15); border-radius: 12px; color: var(--fp-muted, #656259); font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.bs .ghost-row:hover { border-color: rgba(0,0,0,.3); color: var(--fp-muted, #656259); }

/* Core funds screen — Equity/Bonds sub-split + running total (guided wizard) */
.bs .core-mix-note { font-size: 12.5px; color: var(--fp-muted, #656259); margin: 0 0 20px; }
.bs .core-sub { margin-bottom: 22px; padding-bottom: 4px; }
.bs .core-sub-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1.5px solid rgba(0,0,0,.1); }
.bs .core-sub-tag { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--fp-muted, #656259); }
.bs .core-sub-target { font-size: 13px; color: var(--fp-muted, #656259); }
.bs .core-total { margin-top: 6px; }
.bs .core-total-row { font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.bs .core-total-bar { height: 10px; border-radius: 5px; background: rgba(0,0,0,.06); overflow: hidden; }
.bs .core-total-fill { height: 100%; background: var(--fp-positive, #2d6a3a); transition: width 150ms, background 150ms; }
.bs .core-total-fill.over { background: var(--fp-negative, #a23a2e); }

/* ── Holdings lookup ("who holds it?") on the My Portfolios page ─────────────
   One search box that answers which portfolios hold a given instrument, so the
   position doesn't have to be hunted portfolio by portfolio. */
.sx .hl-card { padding: 14px 16px; margin-bottom: 16px; }
.sx .hl-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sx .hl-label { font-size: var(--sx-fs-md); font-weight: 600; white-space: nowrap; }
.sx .hl-input {
    flex: 1 1 260px; min-width: 0; padding: 8px 12px;
    font-family: var(--sx-sans); font-size: var(--sx-fs-base);
    color: var(--sx-text); background: var(--sx-surface);
    border: 1px solid var(--sx-soft-6); border-radius: 9px;
}
.sx .hl-input:focus { outline: none; border-color: var(--sx-accent); }
.sx .hl-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 14px 0 8px; }
.sx .hl-head h4 { font-size: var(--sx-fs-md); font-weight: 600; }
.sx .hl-head .hl-sub { font-size: var(--sx-fs-sm); color: var(--sx-muted); }
.sx .hl-card table { width: 100%; border-collapse: collapse; font-size: var(--sx-fs-base); }
.sx .hl-card th, .sx .hl-card td { padding: 7px 10px; text-align: left; white-space: nowrap; }
.sx .hl-card th { font-size: var(--sx-fs-sm); color: var(--sx-muted); font-weight: 600; border-bottom: 1px solid var(--sx-soft-6); }
.sx .hl-card td { border-bottom: 1px solid var(--sx-soft-2); }
.sx .hl-card tr:hover td { background: var(--sx-row-hover); }
.sx .hl-card .num { text-align: right; font-variant-numeric: tabular-nums; }
.sx .hl-card tr.hl-total td { border-top: 1px solid var(--sx-soft-6); border-bottom: none; font-weight: 600; background: transparent; }
.sx .hl-empty { padding: 14px 2px; color: var(--sx-muted); font-size: var(--sx-fs-base); }
@media (max-width: 720px) {
  .sx .hl-card { overflow-x: auto; }
  .sx .hl-label { flex: 1 1 100%; }
}

/* ── Portfolio total-return chart ─────────────────────────────────────────── */
.sx .pf-return-card { padding: 18px 20px 12px; margin-bottom: 16px; }
.sx .pf-ret-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.sx .pf-ret-val { font-size: 24px; font-weight: 500; letter-spacing: -0.01em; margin-top: 2px; }
.sx .pf-ret-val.positive { color: var(--sx-pos); }
.sx .pf-ret-val.negative { color: var(--sx-neg); }
.sx .pf-ret-vals { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sx .pf-ret-eur { font-size: 16px; font-weight: 500; }
.sx .pf-ret-eur.positive { color: var(--sx-pos); }
.sx .pf-ret-eur.negative { color: var(--sx-neg); }
.sx .pf-ret-ctrls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sx .pf-ret-sub { font-size: var(--sx-fs-sm); color: var(--sx-muted-2); margin-top: 2px; min-height: 14px; }
.sx .pf-ret-ranges { display: inline-flex; background: var(--sx-soft-3); border-radius: 9px; padding: 3px; gap: 2px; }
.sx .pf-ret-ranges button {
    border: 0; background: transparent; color: var(--sx-muted); cursor: pointer;
    font: 500 var(--sx-fs-base)/1 var(--sx-sans); padding: 6px 10px; border-radius: 7px;
}
.sx .pf-ret-ranges button:hover { color: var(--sx-text); }
.sx .pf-ret-ranges button.active { background: var(--sx-surface); color: var(--sx-text); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.sx .pf-ret-chart { width: 100%; height: 220px; margin-top: 10px; }
.sx .pf-ret-method { text-transform: none; letter-spacing: 0; color: var(--sx-muted-2); font-weight: 400; margin-left: 4px; }

/* Builder amount step: two labelled fields with preset chips. */
.bs .amt-label { display: block; font-size: 13px; font-weight: 600; color: var(--fp-text, #2a2825); margin: 0 0 8px; }
.bs .amt-wrap + .amt-label { margin-top: 20px; }
.bs .quick .chip-num {
  height: 34px; padding: 0 13px; background: rgba(0,0,0,.045); border: 1.5px solid transparent;
  border-radius: 8px; font-size: 13px; font-family: var(--sx-mono-strict); font-variant-numeric: tabular-nums;
  color: var(--fp-muted, #5a5750); cursor: pointer;
}
.bs .quick .chip-num:hover { background: rgba(0,0,0,.08); color: var(--fp-text, #2a2825); }
.bs .quick .chip-num[aria-pressed="true"] { background: rgba(var(--fp-accent-rgb, 184,92,42),.10); border-color: var(--fp-accent, #b85c2a); color: #8f4620; font-weight: 600; }
.bs .amt-note {
  margin: 14px 0 0; padding: 10px 14px; border-radius: 10px;
  background: #fdf3e0; border: 1px solid #e8d4a8; color: #6b5420;
  font-size: 14px; line-height: 1.45;
}

/* Builder: whole shares vs fractions. */
.bs .fracline { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 13px; color: var(--fp-muted, #5a5750); cursor: pointer; }
.bs .fracline input { width: 16px; height: 16px; accent-color: var(--fp-accent, #b85c2a); cursor: pointer; }
.bs .fracnote { font-size: 13px; line-height: 1.55; color: var(--fp-muted, #5a5750); background: rgba(0,0,0,.03); border-radius: 10px; padding: 11px 14px; margin: 0 0 16px; }
.bs .fracnote.fracnote-over { background: rgba(var(--fp-accent-rgb, 184,92,42),.08); color: #7a3d18; }
.bs .fracnote b { font-weight: 600; }
.bs .fracnote-funds { display: block; margin-top: 4px; }
.bs .picked.strained { border-color: rgba(var(--fp-accent-rgb, 184,92,42),.5); background: rgba(var(--fp-accent-rgb, 184,92,42),.045); }

/* Builder: broker fees. */
.bs .brkgrp { margin-bottom: 18px; }
.bs .brkgrp-h { font-size: 14px; font-weight: 600; color: var(--fp-text, #2a2825); margin-bottom: 4px; }
.bs .brkfields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.bs .brkf { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--fp-muted, #5a5750); }
.bs .brkin { display: flex; align-items: center; gap: 6px; background: var(--fp-surface, #fff); border: 1px solid #e3ded2; border-radius: 9px; padding: 8px 11px; }
.bs .brkin i { font-style: normal; color: var(--fp-muted, #656259); font-size: 13px; }
.bs .brkin input { border: 0; outline: 0; background: none; width: 100%; font: 500 15px/1.2 var(--sx-sans); color: var(--fp-text, #2a2825); }
.bs .brkin:focus-within { border-color: var(--fp-accent, #b85c2a); }

/* Starting-mix picker */
.bs .mix-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.bs .mix-choice { position:relative; display:flex; flex-direction:column; gap:10px; padding:20px; border:1px solid var(--sx-faint); border-radius:14px; background:var(--sx-surface); cursor:pointer; }
.bs .mix-choice.on { border-color:var(--sx-accent); box-shadow:inset 0 0 0 1px var(--sx-accent); }
.bs .mix-choice:has(input:focus-visible) { outline:3px solid var(--sx-accent); outline-offset:4px; }
.bs .mix-choice input { align-self:flex-start; accent-color:var(--sx-accent); width:18px; height:18px; margin:0; }
.bs .mix-choice-name { font-size:19px; font-weight:600; }
.bs .mix-swing { color:var(--sx-muted); font-size:14px; }
.bs .mix-composition { display:flex; height:12px; overflow:hidden; border-radius:4px; margin-top:8px; }
.bs .mix-percentages { font-family:var(--sx-sans); font-size:12px; line-height:1.7; }
.bs .mix-scratch { grid-column:1 / -1; border-style:dashed; }
.bs .mix-legend { display:flex; flex-wrap:wrap; gap:12px 20px; margin:18px 0; font-size:12px; }
.bs .mix-legend span { display:flex; gap:7px; align-items:center; }
.bs .mix-legend i { width:12px; height:12px; border-radius:2px; }
.bs .mix-risk-link { display:inline-block; text-decoration:underline; margin-bottom:8px; }
.bs .mix-locked { background:var(--sx-soft-4); color:var(--sx-muted); }
.bs .mix-locked .mixname, .bs .mix-locked .swatch { opacity:.5; }
.bs .mix-switch { display:flex; gap:8px; align-items:center; margin-left:auto; font-size:13px; }
.bs .mix-switch input { accent-color:var(--sx-accent); width:20px; height:20px; }
.bs .mix-weight { width:85px; padding:8px; border:1px solid var(--sx-faint); border-radius:6px; font-family:var(--sx-sans); background:var(--sx-surface); color:var(--sx-text); }
.bs .mix-weight:disabled { opacity:.5; }
.bs .mix-weight:focus-visible, .bs .mix-switch input:focus-visible { outline:3px solid var(--sx-accent); outline-offset:3px; }
.mix-confirm { font-family:var(--sx-sans); max-width:480px; width:calc(100% - 32px); padding:28px; border:1px solid var(--sx-faint); border-radius:14px; background:var(--sx-surface); color:var(--sx-text); }
.mix-confirm::backdrop { background:rgba(42,40,37,.4); }
.mix-confirm h2 { margin:0 0 14px; font-size:21px; }
.mix-confirm p { line-height:1.6; }
.mix-dialog-actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:22px; }
.mix-dialog-actions button { font-family:inherit; padding:10px 16px; border:1px solid var(--sx-accent); border-radius:7px; background:var(--sx-surface); color:var(--sx-accent); cursor:pointer; }
.mix-dialog-actions button:focus-visible { outline:3px solid var(--sx-accent); outline-offset:3px; }
.mix-dialog-actions [data-add] { background:var(--sx-accent); color:var(--sx-surface); }
@media(max-width:700px) { .bs .mix-options { grid-template-columns:1fr; } }
/* Split controls keep a single amount and editable percentage together. */
.bs .split-value { margin-left:auto; white-space:nowrap; font-family:var(--sx-sans); }
.bs .split-exact { width:3.5em; border:0; border-bottom:1px dashed var(--sx-faint); background:transparent; color:inherit; font:inherit; text-align:right; appearance:textfield; }
.bs .split-exact::-webkit-inner-spin-button { appearance:none; }
.bs .split-exact:focus-visible { outline:2px solid var(--sx-accent); }
.bs .split-custom:not([hidden]) { display:inline-block; padding:5px 10px; margin-bottom:16px; border-radius:6px; background:var(--sx-soft-4); font-size:12px; }
.bs .mix-locked .slider { opacity:.4; }
.bs .mix-switch input[role="switch"] { appearance:none; width:34px; height:20px; border-radius:12px; background:var(--sx-faint); position:relative; cursor:pointer; }
.bs .mix-switch input[role="switch"]::after { content:''; position:absolute; width:14px; height:14px; top:3px; left:3px; border-radius:50%; background:var(--sx-surface); }
.bs .mix-switch input[role="switch"]:checked { background:var(--sx-accent); }
.bs .mix-switch input[role="switch"]:checked::after { left:17px; }
.bs .fund-add { border:1px dashed var(--sx-faint); color:var(--sx-text); background:var(--sx-surface); }
.bs .picked details summary { cursor:pointer; }
.bs .picked .f2 { display:block; }
.bs .rest-tag { font-size:11px; background:var(--sx-soft-4); border-radius:5px; padding:2px 5px; }
.bs .check-count { border-radius:12px; background:var(--sx-soft-4); padding:2px 7px; }
.bs .checks-footnote { display:flex; align-items:center; gap:7px; margin:14px 0 0; font-size:11px; color:var(--sx-muted); }
.bs .region-market-help { border:0; padding:0; flex-shrink:0; }
.bs .region-market-help[data-tip]::after { left:auto; right:0; transform:translateY(8px); max-width:min(260px,calc(100vw - 64px)); white-space:pre-line; text-align:left; }
.bs .region-market-help:focus::before,.bs .region-market-help:focus::after { opacity:1; }
.bs .region-market-help:focus-visible { outline:2px solid var(--sx-accent); outline-offset:3px; }
.bs .checks-group h3 { font-size:13px; margin:14px 0 6px; }
.bs .check-item { display:block; width:100%; padding:9px 0; border:0; border-top:1px solid var(--sx-soft-4); background:transparent; color:var(--sx-text); text-align:left; font:inherit; font-size:12px; cursor:pointer; }
.bs .check-item:focus-visible,.bs .picked:focus-visible,.bs .core-sub:focus-visible { outline:2px solid var(--sx-accent); outline-offset:3px; }
.bs .core-sub-head { font-size:16px; }
.bs .etfp-dist { color:var(--sx-text); background:var(--sx-soft-4); }
.etfp-price { text-align:right; font-family:var(--sx-sans); }
#etfp-modal .etfp-dist { color:var(--sx-text); background:var(--sx-soft-4); }
#etfp-modal .etfp-th { white-space:normal; }
.bs .region-row { margin:12px 0; }
.bs .lookthrough-tabs { display:flex; flex-wrap:wrap; gap:8px; border-bottom:1px solid var(--border); margin:12px 0 16px; }
.bs .lookthrough-tabs button { flex:1 0 auto; min-width:0; padding:9px 6px; border:0; border-bottom:2px solid transparent; background:transparent; color:inherit; font:inherit; font-size:11px; cursor:pointer; }
.bs .lookthrough-tabs button[aria-selected="true"] { border-bottom-color:var(--bw-equity); color:var(--bw-equity); font-weight:600; }
.bs .lookthrough-tabs button:focus-visible,.bs .lookthrough-companies button:focus-visible { outline:2px solid var(--bw-equity); outline-offset:2px; }
.bs .lookthrough-companies { list-style:none; padding:0; margin:0; }
.bs .lookthrough-companies button { display:grid; grid-template-columns:18px minmax(0,1fr) auto; gap:8px; align-items:start; width:100%; padding:10px 0; border:0; border-bottom:1px solid var(--border); background:transparent; color:inherit; font:inherit; font-size:12px; text-align:left; cursor:pointer; }
.bs .lookthrough-companies button:hover { background:var(--bg); }
.bs .company-rank { opacity:.55; }
.bs .company-value { text-align:right; white-space:nowrap; }
.bs .company-value small { display:block; font:inherit; opacity:.65; margin-top:3px; }
.bs .region-label { display:flex; justify-content:space-between; gap:12px; font-size:12px; margin-bottom:5px; }
.bs .region-track { position:relative; height:8px; background:var(--sx-soft-4); border-radius:3px; }
.bs .region-fill { display:block; height:100%; background:var(--bw-equity); border-radius:3px; }
.bs .region-market { position:absolute; top:-3px; width:2px; height:14px; background:var(--sx-text); transform:translateX(-1px); }
.bs .region-legend { display:flex; gap:8px; align-items:center; font-size:11px; margin:16px 0 7px; }
.bs .region-legend i { display:block; width:2px; height:13px; background:var(--sx-text); flex-shrink:0; }
.bs .region-sources { font-size:11px; line-height:1.6; margin:12px 0 22px; overflow-wrap:anywhere; }
.bs .region-sources summary { cursor:pointer; }
.bs .region-sources ul { padding-left:16px; }
.bs .region-sources li { margin:7px 0; }
.bs .region-sources a { text-decoration:underline; }
.bs .region-sources p { margin:12px 0; }
.bs .strategy-comparison { margin-bottom:22px; font-size:12px; overflow-wrap:anywhere; }
.bs .strategy-comparison table { width:100%; border-collapse:collapse; table-layout:fixed; }
.bs .strategy-comparison th,.bs .strategy-comparison td { padding:10px 6px; border-bottom:1px solid var(--border); vertical-align:top; text-align:left; }
.bs .strategy-comparison th:first-child { width:26%; }
.bs .strategy-comparison p { margin:7px 0; }
.bs .strategy-comparison summary { cursor:pointer; }
.bs .strategy-comparison a { text-decoration:underline; }
.bs .fund-cost-summary { margin-top:22px; padding-top:20px; border-top:1px solid var(--sx-soft-6); }

/* Fund cards keep percentage, amount and remove controls aligned across rows. */
.bs #fund-fractional { margin:12px 0 20px; }
.bs .core-sub-head { margin-top:0; gap:10px; flex-wrap:wrap; }
.bs .core-sub-title { margin:0; font:inherit; font-weight:600; }
.bs .section-equal { padding:4px 9px; border:1px solid var(--sx-faint); border-radius:6px; background:transparent; color:var(--sx-accent); font-size:12px; white-space:nowrap; cursor:pointer; }
.bs .section-equal:disabled { opacity:.45; color:var(--sx-muted); cursor:default; }
.bs .section-equal:focus-visible { outline:2px solid var(--sx-accent); outline-offset:3px; }
.bs .fund-card { grid-template-columns:minmax(0,1fr) 148px 80px 24px; gap:3px 10px; padding:10px 12px; margin-bottom:6px; border:1px solid color-mix(in srgb,var(--sx-faint) 35%,var(--sx-surface)); border-radius:10px; }
.bs .fund-identity { grid-column:1; grid-row:1 / 3; min-width:0; }
.bs .fund-card .pn { font-size:14px; line-height:1.35; gap:6px; }
.bs .fund-description { margin-top:3px; font-size:12px; line-height:1.35; color:var(--sx-muted); }
.bs .fund-weight-field { grid-column:2; grid-row:1; width:148px; display:grid; grid-template-columns:36px minmax(0,1fr) 36px; gap:4px; align-items:center; text-align:right; font-size:13.5px; }
.bs .fund-weight-value { position:relative; min-width:0; }
.bs .fund-weight-field .pamt { width:100%; height:36px; padding:0 21px 0 6px; border-width:1px; border-radius:6px; }
.bs .fund-weight-value > span { position:absolute; right:7px; top:50%; transform:translateY(-50%); pointer-events:none; }
.bs .fund-weight-step { width:36px; height:36px; display:inline-flex; align-items:center; justify-content:center; padding:0; border:1px solid var(--sx-soft-4); border-radius:7px; background:var(--sx-surface); color:var(--sx-text); font:400 20px/1 var(--sx-sans); cursor:pointer; }
.bs .fund-weight-step:hover:not(:disabled) { background:var(--sx-soft-3); border-color:var(--sx-accent); }
.bs .fund-weight-step:focus-visible { outline:2px solid var(--sx-accent); outline-offset:2px; }
.bs .fund-weight-step:disabled { opacity:.35; cursor:default; }
.bs .fund-amount { grid-column:3; grid-row:1; text-align:right; font-size:13.5px; white-space:nowrap; }
.bs .fund-fee { grid-column:2 / 4; grid-row:2; text-align:right; font-size:11.5px; color:var(--sx-muted); }
.bs .fund-remove { grid-column:4; grid-row:1 / 3; width:24px; height:28px; color:var(--sx-faint); font-size:18px; text-decoration:none; }
.bs .fund-remove:hover, .bs .fund-remove:focus-visible { color:var(--sx-accent); }
@media(max-width:560px) {
  .bs .fund-identity { grid-column:1 / -1; grid-row:1; margin-bottom:5px; }
  .bs .fund-weight-field, .bs .fund-amount { grid-row:2; }
  .bs .fund-weight-field { grid-column:1 / 3; justify-self:start; }
  .bs .fund-fee { grid-column:1 / 4; grid-row:3; }
  .bs .fund-remove { grid-row:2 / 4; }
  .bs .region-legend { position:relative; }
  .bs .region-market-help { position:static; }
  .bs .region-market-help[data-tip]::after { left:0; right:auto; max-width:calc(100vw - 96px); }
  .bs .region-market-help[data-tip]::before { display:none; }
}

/* Fund allocation status and column help. */
.bs .fund-assignment { margin:12px 0; }
.bs .assignment-track { height:6px; overflow:hidden; border-radius:4px; background:var(--sx-soft-6); }
.bs .assignment-track > span { display:block; height:100%; background:var(--sx-accent); }
.bs .fund-assignment.over .assignment-track > span { background:var(--fp-negative, #a23a2e); }
.bs .fund-assignment.over .hint { color:var(--fp-negative, #a23a2e); }
.bs .fund-assignment .hint { margin:6px 0 0; }
.bs .fund-columns { display:flex; justify-content:flex-end; align-items:center; gap:6px; padding-right:126px; margin:12px 0 7px; font-size:12px; color:var(--sx-muted); }
.bs .fund-columns .help-dot { border:0; padding:0; }
.split-help { position:fixed; inset:auto; margin:0; width:340px; max-width:calc(100vw - 24px); box-sizing:border-box; padding:16px; border:1px solid var(--sx-faint); border-radius:10px; background:var(--sx-surface); color:var(--sx-text); box-shadow:0 8px 24px #0002; font:13px/1.5 var(--sx-sans); }
.split-help p { margin:0 0 10px; }
.split-help a { color:var(--sx-accent); text-decoration:underline; }
@media(max-width:560px) { .bs .fund-columns { padding-right:114px; } }

/* Checks scroll with the sidebar; only the new-check notice stays available. */
.bs .sp { top:90px; max-height:calc(100dvh - 190px); overflow:auto; scrollbar-width:thin; scroll-padding-top:12px; padding:0 4px 4px; }
.bs .checks-dock { position:static; }
.bs .checks-card { position:relative; padding:20px; }
.bs .checks-header { display:flex; align-items:center; gap:11px; margin-bottom:16px; }
.bs .checks-header h2 { margin:0 0 3px; font-size:20px; line-height:1.2; letter-spacing:-.02em; }
.bs .checks-header p { margin:0; font-size:12px; line-height:1.4; color:var(--sx-muted); }
.bs .check-icon { width:20px; height:20px; flex-shrink:0; }
.bs .checks-round { display:grid; place-items:center; width:42px; height:42px; flex-shrink:0; border-radius:50%; color:#a34823; background:#faede6; }
.bs .checks-round.clear { color:var(--sx-muted); background:var(--sx-soft-4); }
.bs .checks-list { max-height:none; overflow:visible; padding:3px; margin:-3px; scrollbar-width:thin; }
.bs .checks-group { display:grid; gap:8px; }
.bs .checks-group + .checks-group { margin-top:8px; }
.bs .check-item { display:grid; grid-template-columns:18px minmax(0,1fr) 10px; align-items:start; gap:8px; width:100%; padding:12px 8px; border:0; border-left:3px solid transparent; border-radius:0 10px 10px 0; background:var(--sx-soft-4); color:var(--sx-text); text-align:left; font:12px/1.5 var(--sx-sans); cursor:pointer; transition:background .18s,transform .18s; }
.bs .check-item > .check-icon { width:18px; height:18px; margin-top:1px; }
.bs .check-finish { background:#faede6; border-left-color:var(--sx-accent); color:#72351d; }
.bs .check-chevron { opacity:0; align-self:center; transition:opacity .18s; }
.bs .check-chevron .check-icon { width:10px; height:14px; }
.bs .check-item:hover,.bs .check-item:focus-visible { background:var(--sx-soft-6); transform:translateX(2px); }
.bs .check-finish:hover,.bs .check-finish:focus-visible { background:var(--fp-selected, #f4dfd2); }
.bs .check-item:hover .check-chevron,.bs .check-item:focus-visible .check-chevron { opacity:1; }
.bs .checks-mobile-bar,.bs .checks-close { display:none; }
.bs .fund-name-line { display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
.bs .fund-name-line details { min-width:0; }
.bs .fund-check-link { display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; width:25px; height:25px; padding:3px; border:0; border-radius:50%; color:var(--sx-muted); background:transparent; cursor:pointer; }
.bs .fund-check-link .check-icon { width:16px; height:16px; }
.bs .fund-check-link:hover { color:var(--sx-accent); background:var(--sx-soft-6); }
.bs .fund-check-link:focus-visible { outline:2px solid var(--sx-accent); }
.bs .check-target-flash { animation:check-target 1.5s ease-out; }
.bs .check-enter { animation:check-enter 1s ease-out; }
.bs .check-leave { pointer-events:none; animation:check-leave .22s ease-in forwards; }
@keyframes check-target { 0%,65% { box-shadow:inset 0 0 0 2px var(--fp-accent, #b85c2a); background-color:var(--fp-selected, #f4dfd2); } 100% { box-shadow:inset 0 0 0 2px transparent; } }
@keyframes check-enter { 0% { opacity:0; } 25%,65% { opacity:1; box-shadow:inset 0 0 0 1px #b85c2a80; } 100% { box-shadow:inset 0 0 0 1px transparent; } }
@keyframes check-leave { to { opacity:0; transform:translateY(-4px); } }
@media(max-width:1000px) {
  .bs .sp { position:static; max-height:none; overflow:visible; padding:0; }
  .bs .checks-dock { position:static; }
  .bs .checks-list { max-height:none; }

}
@media(prefers-reduced-motion:reduce) {
  .bs .check-item,.bs .check-chevron { transition:none; }
  .bs .check-enter,.bs .check-leave { animation-duration:.01ms; }
  .bs .check-target-flash { animation:none; outline:2px solid var(--sx-accent); }
}

.bs .fund-check-links { display:inline-flex; flex-wrap:wrap; gap:2px; }
.bs .checks-footnote + .checks-footnote { margin-top:5px; }

/* Shared broker-fee selector in the builder and portfolio settings. */
.broker-fee-editor { border:0; padding:0; margin:20px 0; min-width:0; font:inherit; }
.broker-fee-editor legend { font-weight:600; margin-bottom:14px; }
.broker-fee-options { display:grid; gap:12px; }
.broker-fee-options label { display:flex; align-items:center; gap:10px; cursor:pointer; }
.broker-fee-options input { accent-color:var(--sx-accent); width:16px; height:16px; }
.broker-fee-fields { display:flex; flex-wrap:wrap; gap:14px; margin-top:18px; }
.broker-fee-fields:empty { display:none; }
.broker-fee-field { display:grid; gap:6px; font-size:13px; }
.broker-fee-input { display:flex; align-items:center; gap:8px; padding:8px 12px; border:1px solid var(--sx-faint); border-radius:9px; background:var(--sx-surface); }
.broker-fee-input input { width:100px; min-width:0; border:0; background:none; color:inherit; font:inherit; }
.broker-fee-input:focus-within { outline:2px solid var(--sx-accent); }
.broker-fee-example { font-size:13px; margin:14px 0 0; color:var(--sx-muted); }
.broker-fee-example:empty { display:none; }
.broker-fee-change { border:0; background:none; color:var(--sx-accent); text-decoration:underline; cursor:pointer; font:inherit; }
.cost-summary-line { margin:10px 0; line-height:1.6; }
.bs .cost-summary-line .mono { font-family:"IBM Plex Mono",monospace; }

/* Actual trades: fixed identities and visible edits, with prices entered in euros. */
.sx .bsave-panel { width:min(1120px,96vw); }
.sx .bsave-thead, .sx .bsave-trow { grid-template-columns:130px minmax(200px,1fr) 90px 110px 95px 145px 28px; }
.sx .bsave-nm { white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; line-height:1.45; }
.bsave-identity small { display:block; font-size:10px; margin-top:4px; color:var(--sx-muted); }
.bsave-money { display:flex; align-items:center; position:relative; }
.bsave-money > span { position:absolute; left:8px; pointer-events:none; font-size:12px; }
.sx .bsave-money .bsave-inp { padding-left:20px; text-align:right; }
.sx .bsave-inp.bsave-edited { background:rgba(var(--fp-accent-rgb, 184,92,42),.11); border-color:rgba(var(--fp-accent-rgb, 184,92,42),.3); }
@media(max-width:900px) {
 .sx .bsave-thead { display:none; }
 .sx .bsave-trow { grid-template-columns:repeat(2,minmax(0,1fr)); row-gap:10px; }
 .sx .bsave-nm { grid-column:1 / -1; }
 .sx .bsave-trow > label::before { content:attr(data-label); display:block; font-size:11px; color:var(--sx-muted); margin-bottom:4px; }
 .sx .bsave-money { display:block; }
 .sx .bsave-money > span { bottom:8px; }
}

.broker-availability { display:block; margin-top:8px; font-size:12px; font-weight:400; }
.broker-availability summary { cursor:pointer; color:var(--sx-muted); text-decoration:underline; width:fit-content; }
.broker-availability > div { display:flex; flex-wrap:wrap; gap:12px; padding:10px 0; }
.broker-availability button { border:0; background:none; color:var(--sx-accent); cursor:pointer; font:inherit; padding:4px 0; }

.bs .checks-new-rail { position:sticky; top:8px; z-index:3; align-self:flex-end; height:0; flex:0 0 0; }
.bs .checks-new-rail:has([hidden]) { display:none; }
.bs .checks-new-pill { border:1px solid var(--sx-faint); border-radius:999px; background:var(--sx-surface); color:var(--sx-accent); padding:7px 12px; font:600 12px var(--sx-sans); box-shadow:0 2px 8px #0001; cursor:pointer; }
.bs .checks-card.is-clear { padding:12px 16px; }
.bs .checks-clear { margin:0; font-size:13px; color:var(--sx-muted); }

/* The public portfolio keeps a smaller set of controls and summary cards. */
.sx.public-account .family-only { display: none !important; }
@media (min-width: 761px) {
    .sx.public-account .pf-kpi-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
