/* The Investments overview page (/admin/investments): page-specific styles on top of investments-area.css (tokens,
   grid, cards, chips, hero recipe, marquee). Prefix ivo-. Every color is an --iv-* / --ah-* / --rc-* token, so light and
   dark follow the theme; the few dark-only touches sit in [data-bs-theme="dark"] blocks beside their light rule.
   Sections: page frame, hero, ticker, rules roll-up (carousel, recent alerts, unread inbox, empty state), income,
   retirement and rings, performance insights, movers, market data, allocation, portfolio health, motion. */

/* ------------------------------------------------------------------ Page frame */

.ivo-page { gap: 1rem; }
.ivo-signals { min-width: 0; }
.ivo-empty { margin-top: .5rem; }

@media (min-width: 1400px) {
    .ivo-page, .ivo-row, .ivo-row > .iv-col { gap: 1.25rem; }
}

/* Between 768px and 1199px the main rows stack: their side columns pair up instead of running long. */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .ivo-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    .ivo-side > :only-child { grid-column: 1 / -1; }
}

/* A card's "Details >" link in its header. */
.ivo-card-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: 4px 8px;
    border-radius: 9px;
    color: var(--iv-green);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s ease;
}

.ivo-card-link:hover { background: var(--iv-icon-bg); color: var(--iv-green-strong); }
.ivo-card-link .tx-glyph { font-size: 10px; }

/* A small empty state inside a card (no income yet, no quality report...). */
.ivo-mini-empty { display: flex; align-items: flex-start; gap: 12px; padding: 4px 2px; }
.ivo-mini-empty strong { display: block; font-family: var(--tx-font); font-size: 14px; font-weight: 600; color: var(--iv-text); }
.ivo-mini-empty p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--iv-muted); }

.ivo-mini-empty-chip {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--iv-icon-bg);
    color: var(--iv-icon);
    font-size: 16px;
}

/* An empty or failed chart. */
.ivo-chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 180px;
    padding: 20px;
    border: 1px dashed var(--iv-tile-border);
    border-radius: 14px;
    color: var(--iv-muted);
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

.ivo-chart-empty-glyph { font-size: 22px; color: var(--iv-light); }
.ivo-chart { min-width: 0; }

.ivo-link-btn {
    margin-left: auto;
    padding: 0 4px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.ivo-tone-positive { color: var(--iv-positive); }
.ivo-tone-negative { color: var(--iv-negative); }
.ivo-tone-neutral { color: var(--iv-text); }
.ivo-tone-caution { color: var(--iv-caution); }

/* ------------------------------------------------------------------ Hero */

.ivo-hero .ah-hero { min-height: 330px; }

@media (min-width: 1200px) {
    .ivo-hero .ah-hero { min-height: 360px; }
    .ivo-hero .ah-content { padding: 1rem 1.25rem; }
}

.ivo-hero-content { gap: .4rem; }
.ivo-value-pill { padding: 4px 10px; border-radius: 12px; }

.ivo-value {
    font-family: var(--tx-font);
    font-size: clamp(1.5rem, 1.1rem + 1.25vw, 2.125rem);
    font-weight: 600;
    letter-spacing: -.01em;
}

.ivo-hero-pills { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
.ivo-gain-pill { background: var(--iv-icon-bg); color: var(--iv-tone, var(--ah-text)); }
.ivo-gain-pill .ivo-gain-text { color: var(--iv-tone, var(--ah-text)); font-weight: 700; }
.ivo-gain-glyph { color: var(--iv-tone, var(--ah-text)); }
.ivo-cost-pill { background: var(--iv-icon-bg); }
.ivo-cost-pill b { color: var(--ah-text); }

[data-bs-theme="dark"] .ivo-gain-pill,
[data-bs-theme="dark"] .ivo-cost-pill { background: var(--iv-pill); }

/* Top right: when prices last updated and the market refresh. */
.ivo-hero-tools {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: .35rem;
}

.ivo-hero-tools .ah-refresh { position: static; opacity: .75; }

.ivo-hero-updated {
    padding: 2px 8px;
    border-radius: 8px;
    background: var(--ah-pill);
    color: var(--ah-muted);
    font-size: .6875rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Bottom right, over the range bar: the alerts status pill and the chart legend. */
.ivo-hero-overlay {
    position: absolute;
    right: 14px;
    bottom: 48px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    max-width: min(70%, 360px);
}

.ivo-alert-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    max-width: 100%;
    padding: 4px 10px;
    border: 1px solid var(--ah-border);
    border-radius: 12px;
    background: var(--ah-pill);
    color: var(--ah-text);
    font-size: .6875rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}

.ivo-alert-pill:hover { border-color: var(--iv-green); }
.ivo-alert-pill:active { transform: scale(.98); }
.ivo-alert-pill span { overflow: hidden; text-overflow: ellipsis; }
.ivo-alert-pill-glyph { color: var(--iv-icon); font-size: 11px; }
.ivo-alert-pill-chev { color: var(--ah-muted); font-size: 9px; }
.ivo-alert-pill.has-unread .ivo-alert-pill-glyph { animation: ivo-bell-ring 2.6s ease-in-out infinite; transform-origin: 50% 0; }

.ivo-hero-legend {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    color: var(--ah-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.ivo-legend-item { display: inline-flex; align-items: center; gap: .35rem; }
.ivo-swatch { display: inline-block; width: 14px; height: 0; border-radius: 2px; }
.ivo-swatch-line { border-top: 2.25px solid var(--iv-hero-line); }
.ivo-swatch-dash { border-top: 1.5px dashed var(--iv-hero-secondary); }

/* The estimate note, between the chart and the ticker. */
.ivo-hero-note {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin: 0;
    padding: 6px 14px;
    border-top: 1px solid var(--ah-border);
    background: var(--ah-tiles-bg);
    color: var(--ah-muted);
    font-size: 11px;
    line-height: 1.35;
}

.ivo-hero-note-glyph { color: var(--iv-icon); font-size: 10.5px; }

/* The KPI tiles: the top holding tile is a link to Securities. */
.ivo-tile { min-width: 0; }

.ivo-tile-link {
    margin: -4px;
    padding: 4px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color .15s ease;
}

.ivo-tile-link:hover { background: var(--iv-row-hover); }
.ivo-tile-link:hover .ah-tile-value { color: var(--iv-green); }
.ivo-tile-link .ah-tile-caption, .ivo-tile-link .ah-tile-value { display: block; }

.ivo-unavailable { margin: 0; }

@media (max-width: 575.98px) {
    .ivo-hero .ah-hero { min-height: 312px; }
    .ivo-hero-updated { display: none; }
    .ivo-hero-overlay { right: 10px; bottom: 46px; max-width: calc(100% - 20px); }
    .ivo-hero-legend { gap: .5rem; }
}

/* ------------------------------------------------------------------ Ticker tape */

.ivo-ticker { display: flex; align-items: center; }
.ivo-ticker-run { display: flex; align-items: center; margin: 0; padding: 0; list-style: none; }
.ivo-ticker-li { display: flex; align-items: center; }

.ivo-ticker-li::after {
    content: "";
    width: 3px;
    height: 3px;
    margin: 0 2px;
    border-radius: 50%;
    background: var(--ah-border, var(--iv-border));
}

.ivo-ticker-item {
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ah-text, var(--iv-text));
    font: inherit;
    font-size: 12px;
    line-height: 1.2;
    cursor: default;
}

button.ivo-ticker-item { cursor: pointer; transition: background-color .15s ease; }
button.ivo-ticker-item:hover { background: var(--iv-row-hover); }
.ivo-ticker-symbol { font-weight: 700; letter-spacing: .01em; }
.ivo-ticker-price { color: var(--ah-muted, var(--iv-muted)); font-variant-numeric: tabular-nums; }
.ivo-ticker-item.is-cash .ivo-ticker-price { color: var(--ah-text, var(--iv-text)); }
.ivo-ticker-change { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ivo-ticker-caret { font-size: 10px; }

.ivo-ticker.is-loading { padding: 0 14px; }

.ivo-ticker-loading {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--ah-muted, var(--iv-muted));
    font-size: 11px;
}

.ivo-ticker-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--iv-green);
    animation: ivo-pulse 1.2s ease-in-out infinite;
}

/* ------------------------------------------------------------------ Investment rules roll-up */

.ivo-rules .iv-card-actions { flex-wrap: nowrap; }
.ivo-new-rule { min-height: 34px; padding: 5px 12px; font-size: 12.5px; }
.ivo-bell.has-unread { box-shadow: 0 0 0 0 transparent; }
.ivo-rules-error { margin-bottom: 12px; }

@media (max-width: 575.98px) {
    .ivo-new-rule { padding: 5px 10px; }
    .ivo-new-rule span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

/* The carousel: one card and a peek on phones, two in a mid column, three across a wide one. */
.ivo-carousel-wrap { container-type: inline-size; min-width: 0; }

.ivo-carousel {
    display: flex;
    gap: 12px;
    padding: 2px 2px 10px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 2px;
    scrollbar-width: thin;
    scroll-behavior: smooth;
}

.ivo-carousel:focus-visible { outline: 2px solid var(--iv-focus); outline-offset: 2px; border-radius: 16px; }
.ivo-slide { display: flex; flex: 0 0 86%; min-width: 0; scroll-snap-align: start; }
.ivo-slide > * { flex: 1 1 auto; min-width: 0; }

@container (min-width: 520px) {
    .ivo-slide { flex-basis: calc((100% - 12px) / 2); }
}

@container (min-width: 840px) {
    .ivo-slide { flex-basis: calc((100% - 24px) / 3); }
}

.ivo-carousel-foot { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 2px; }
.ivo-carousel-btn { width: 30px; height: 30px; background: var(--iv-neutral-soft); color: var(--iv-text); font-size: 12px; }
.ivo-carousel-btn:hover:not(:disabled) { background: var(--iv-icon-bg); color: var(--iv-icon); opacity: 1; }
.ivo-dots { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 0; }

.ivo-dot {
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 20px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    transition: width .25s ease;
}

.ivo-dot::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--iv-muted);
    opacity: .35;
    transition: width .25s ease, opacity .25s ease, background-color .25s ease;
}

.ivo-dot:hover::before { opacity: .6; }
.ivo-dot.is-current { width: 28px; }
.ivo-dot.is-current::before { width: 20px; background: var(--iv-green); opacity: 1; }
.ivo-dots-count { min-width: 4ch; color: var(--iv-muted); font-size: 12px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.ivo-hint { margin: 4px 0 0; color: var(--iv-muted); font-size: 11px; text-align: center; }

/* Recent alerts under the carousel. */
.ivo-recent { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--iv-tile-border); }
.ivo-recent-title { margin-top: 0; }

.ivo-recent-all {
    margin-left: auto;
    color: var(--iv-green);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0;
    text-decoration: none;
    text-transform: none;
}

.ivo-recent-all:hover { text-decoration: underline; }
.ivo-recent-empty { padding: 6px 0 2px; }

.ivo-alert-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }

.ivo-alert {
    --ivo-sev: var(--iv-accent);
    position: relative;
    display: grid;
    grid-template-columns: 4px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px 8px 0;
    overflow: hidden;
    border: 1px solid var(--iv-tile-border);
    border-radius: 12px;
    background: var(--iv-tile);
    color: var(--iv-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.ivo-alert:hover { background: var(--iv-row-hover); border-color: var(--iv-border); }
.ivo-sev-caution { --ivo-sev: var(--iv-caution); }
.ivo-sev-negative { --ivo-sev: var(--iv-negative); }
.ivo-sev-positive { --ivo-sev: var(--iv-positive); }
.ivo-alert-bar { align-self: stretch; width: 4px; margin: -8px 0; background: var(--ivo-sev); }
.ivo-alert-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.ivo-alert-title {
    display: -webkit-box;
    overflow: hidden;
    font-family: var(--tx-font);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ivo-alert.is-unread .ivo-alert-title { font-weight: 700; }

.ivo-alert-message {
    overflow: hidden;
    color: var(--iv-muted);
    font-size: 12px;
    line-height: 1.35;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ivo-alert-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--iv-muted); font-size: 11px; }
.ivo-alert-time { white-space: nowrap; }

.ivo-alert-symbol {
    padding: 0 6px;
    border-radius: 6px;
    background: var(--iv-icon-bg);
    color: var(--iv-icon);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1.6;
}

.ivo-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--iv-accent); }
.ivo-alert-chev { color: var(--iv-light); font-size: 10px; }

/* The unread alerts list beside the bell (a slide-up panel on phones). */
.ivo-inbox-anchor { position: relative; display: inline-flex; }

.ivo-inbox-scrim {
    position: fixed;
    inset: 0;
    z-index: 1040;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: default;
}

.ivo-inbox {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1041;
    display: flex;
    flex-direction: column;
    width: min(380px, calc(100vw - 32px));
    max-height: min(70vh, 560px);
    overflow: hidden;
    border: 1px solid var(--iv-card-border);
    border-radius: 18px;
    background: var(--iv-menu-bg);
    box-shadow: 0 24px 60px rgba(15, 23, 42, .18);
    text-align: left;
    animation: ivo-pop .18s ease-out both;
}

[data-bs-theme="dark"] .ivo-inbox { border-color: var(--iv-card-border); box-shadow: 0 24px 60px rgba(0, 0, 0, .55); }
.ivo-inbox:focus { outline: none; }

.ivo-inbox::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 140px;
    background: radial-gradient(120% 100% at 0 0, var(--iv-green-soft), transparent 70%);
    pointer-events: none;
}

.ivo-inbox-head { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 14px 14px 10px; }

.ivo-inbox-chip {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: var(--iv-icon-bg);
    color: var(--iv-icon);
    font-size: 14px;
}

.ivo-inbox-titles { flex: 1 1 auto; min-width: 0; }
.ivo-inbox-title { margin: 0; font-family: var(--tx-font); font-size: 16px; font-weight: 700; color: var(--iv-text); }
.ivo-inbox-sub { margin: 2px 0 0; color: var(--iv-muted); font-size: 12px; }
.ivo-inbox-close { flex: 0 0 auto; background: var(--iv-neutral-soft); color: var(--iv-text); }
.ivo-inbox-list { position: relative; flex: 1 1 auto; overflow-y: auto; padding: 0 12px 10px; overscroll-behavior: contain; }

.ivo-inbox-empty {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 20px 22px;
    color: var(--iv-muted);
    font-size: 12.5px;
    text-align: center;
}

.ivo-inbox-empty strong { color: var(--iv-text); font-family: var(--tx-font); font-size: 14px; }
.ivo-inbox-empty-chip { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--iv-positive-soft); color: var(--iv-positive); font-size: 18px; }

.ivo-inbox-foot {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--iv-tile-border);
}

.ivo-inbox-foot .iv-btn { min-height: 34px; padding: 5px 12px; font-size: 12.5px; }

@media (max-width: 575.98px) {
    .ivo-inbox-scrim { background: rgba(15, 23, 42, .38); }

    .ivo-inbox {
        position: fixed;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: auto;
        max-height: 82vh;
        border-radius: 22px 22px 0 0;
        animation: ivo-slide-up .24s cubic-bezier(.2, .8, .2, 1) both;
    }
}

/* The empty state: why rules help, the Starter Pack and the editor. */
.ivo-rules-empty { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 20px; align-items: start; }
.ivo-rules-empty-art { position: relative; display: grid; place-items: center; width: 120px; height: 120px; }

.ivo-rules-empty-ring {
    position: absolute;
    inset: 22px;
    border: 1.5px solid var(--iv-border);
    border-radius: 50%;
    animation: ivo-breathe 3.2s ease-in-out infinite;
}

.ivo-rules-empty-ring.is-outer { inset: 4px; border-style: dashed; opacity: .7; animation-delay: .8s; }

.ivo-rules-empty-chip {
    position: relative;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--iv-icon-bg);
    color: var(--iv-icon);
    font-size: 20px;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--iv-green) 22%, transparent);
}

.ivo-rules-empty-copy { min-width: 0; }
.ivo-rules-empty-title { margin: 0 0 6px; font-family: var(--tx-font); font-size: 16px; font-weight: 600; color: var(--iv-text); }
.ivo-rules-empty-copy p { margin: 0 0 8px; color: var(--iv-muted); font-size: 13px; line-height: 1.5; }
.ivo-rules-empty-cta { color: var(--iv-text) !important; }
.ivo-rules-empty-cta a { color: var(--iv-green); font-weight: 600; text-decoration: underline; }
.ivo-rules-empty-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

@media (max-width: 767.98px) {
    .ivo-rules-empty { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
    .ivo-rules-empty-actions { justify-content: center; }
}

/* ------------------------------------------------------------------ Dividend income */

.ivo-income .rc-card-body { container-type: inline-size; }
.ivo-income-top { display: flex; flex-direction: column; gap: 4px; }
.ivo-income-figure { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.ivo-income-value {
    color: var(--iv-text);
    font-family: var(--tx-font);
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -.01em;
    font-variant-numeric: tabular-nums;
}

.ivo-income-change { font-size: 11px; }
.ivo-income-run { color: var(--iv-muted); font-size: 12px; font-weight: 500; }

.ivo-mini-bars {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    align-items: end;
    gap: 6px;
    height: 96px;
    margin: 14px 0 4px;
}

.ivo-mini-col { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.ivo-mini-track { display: flex; flex: 1 1 auto; align-items: flex-end; width: 100%; border-radius: 6px; }

.ivo-mini-fill {
    width: 100%;
    height: var(--ivo-h, 0%);
    border-radius: 6px 6px 3px 3px;
    background: linear-gradient(180deg, var(--iv-green-bright) 0%, var(--iv-green-strong) 100%);
    transform-origin: bottom;
    animation: ivo-grow .7s cubic-bezier(.2, .8, .2, 1) both;
}

.ivo-mini-fill.is-zero { height: 3px; background: var(--iv-track); }
.ivo-mini-col:hover .ivo-mini-fill:not(.is-zero) { filter: brightness(1.08); }
.ivo-mini-label { color: var(--iv-muted); font-size: 10px; font-weight: 600; }

.ivo-income-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; }

.ivo-income-fact {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--iv-tile-border);
    border-radius: 12px;
    background: var(--iv-tile);
}

.ivo-income-fact dt { color: var(--iv-muted); font-size: 9.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.ivo-income-fact dd { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 0; }

.ivo-income-fact-main,
.ivo-income-fact-sub { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.ivo-income-fact-main { color: var(--iv-text); font-family: var(--tx-font); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ivo-income-fact-sub { color: var(--iv-muted); font-size: 11px; }

@container (max-width: 400px) {
    .ivo-income-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ivo-income-fact:first-child { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------------ Rings (retirement readiness, portfolio health) */

.ivo-ring-wrap { position: relative; display: grid; place-items: center; width: 128px; height: 128px; flex: 0 0 auto; }
.ivo-ring-wrap.ivo-ring-lg { width: 156px; height: 156px; }
.ivo-ring { display: block; width: 100%; height: 100%; overflow: visible; }
.ivo-ring-track { fill: none; stroke: var(--iv-track); stroke-width: 10; }

.ivo-ring-fill {
    fill: none;
    stroke: var(--iv-tone, var(--iv-green));
    stroke-width: 10;
    stroke-linecap: round;
    filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--iv-tone, var(--iv-green)) 35%, transparent));
    animation: ivo-ring-in 1.1s cubic-bezier(.2, .8, .2, 1) both;
}

.iv-tone-neutral .ivo-ring-fill { stroke: var(--iv-green); }

.ivo-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.ivo-ring-value { color: var(--iv-text); font-family: var(--tx-font); font-size: 24px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ivo-ring-lg .ivo-ring-value { font-size: 34px; }
.ivo-ring-caption { color: var(--iv-muted); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; }
.ivo-ring-bone { width: 112px; height: 112px; border-radius: 50%; }
.ivo-ring-bone-lg { width: 156px; height: 156px; }

/* ------------------------------------------------------------------ Retirement */

.ivo-retire .rc-card-body { container-type: inline-size; }
.ivo-retire-plan { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; }
.ivo-retire-copy { min-width: 0; }
.ivo-retire-headline { margin: 0 0 10px; color: var(--iv-text); font-family: var(--tx-font); font-size: 14px; font-weight: 600; line-height: 1.4; }
.ivo-retire-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin: 0; }
.ivo-retire-facts > div { min-width: 0; }
.ivo-retire-facts dt { color: var(--iv-muted); font-size: 9.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.ivo-retire-facts dd { margin: 1px 0 0; overflow: hidden; color: var(--iv-text); font-size: 14px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.ivo-retire-bones { flex: 1 1 auto; }

.ivo-retire-cta { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: start; }
.ivo-retire-art { position: relative; display: grid; place-items: center; width: 112px; height: 112px; }
.ivo-ring-demo { position: absolute; inset: 0; }
.ivo-ring-demo .ivo-ring-fill { stroke-dasharray: 6 9 !important; stroke-dashoffset: 0 !important; stroke-linecap: round; animation: ivo-spin-slow 24s linear infinite; transform-box: fill-box; transform-origin: center; filter: none; }

.ivo-retire-art-glyph {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--iv-icon-bg);
    color: var(--iv-icon);
    font-size: 20px;
}

.ivo-retire-cta-copy { min-width: 0; }
.ivo-retire-cta-title { margin: 0 0 6px; color: var(--iv-text); font-family: var(--tx-font); font-size: 16px; font-weight: 600; }
.ivo-retire-cta-copy > p { margin: 0 0 10px; color: var(--iv-muted); font-size: 13px; line-height: 1.5; }
.ivo-checklist { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.ivo-checklist li { display: flex; align-items: flex-start; gap: 8px; color: var(--iv-text); font-size: 12.5px; line-height: 1.4; }
.ivo-checklist .tx-glyph { margin-top: 2px; color: var(--iv-green); font-size: 12px; }
.ivo-retire-cta-btn { text-decoration: none; }
.ivo-retire-cta-btn:hover { color: #FFFFFF; }
[data-bs-theme="dark"] .ivo-retire-cta-btn:hover { color: #0B0F19; }

@container (max-width: 380px) {
    .ivo-retire-plan, .ivo-retire-cta { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
    .ivo-retire-facts { text-align: left; }
    .ivo-checklist li { text-align: left; }
}

/* ------------------------------------------------------------------ Performance insights */

.ivo-insights-menu { max-width: 100%; margin: -2px 0 12px; overflow-x: auto; }
.ivo-takeaway { margin: 0 0 12px; }
.ivo-insight-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.ivo-insight-chart { min-width: 0; min-height: 120px; margin: 0; }
.ivo-insights.is-wide .ivo-insight-tiles { gap: 10px; }

@media (max-width: 575.98px) {
    .ivo-insight-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ivo-insight-tiles > :first-child { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------------ Today's movers */

.ivo-movers .rc-card-body { container-type: inline-size; }
.ivo-movers-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.ivo-mover {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 12px;
    overflow: hidden;
    border: 1px solid var(--iv-tile-border);
    border-radius: 16px;
    background: var(--iv-mover-top);
    color: var(--iv-text);
    font: inherit;
    text-align: left;
}

.ivo-mover-worst { background: var(--iv-mover-worst); }
button.ivo-mover { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
button.ivo-mover:hover { border-color: var(--iv-border); box-shadow: var(--iv-shadow); transform: translateY(-1px); }
button.ivo-mover-worst:hover { border-color: color-mix(in srgb, var(--iv-negative) 35%, transparent); }
.ivo-mover-head { display: flex; align-items: center; gap: 8px; }

.ivo-mover-chip {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--iv-icon-bg);
    color: var(--iv-icon);
    font-size: 11px;
}

.ivo-mover-worst .ivo-mover-chip { background: var(--iv-negative-soft); color: var(--iv-negative); }
.ivo-mover-caption { color: var(--iv-muted); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ivo-mover-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ivo-mover-worst .iv-logo { background: var(--iv-negative-soft); color: var(--iv-negative); }
.ivo-mover-names { display: flex; flex-direction: column; min-width: 0; }
.ivo-mover-symbol { overflow: hidden; color: var(--iv-text); font-family: var(--tx-font); font-size: 16px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.ivo-mover-name { overflow: hidden; color: var(--iv-muted); font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }
.ivo-mover-change { display: grid; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ivo-swap { grid-area: 1 / 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ivo-swap-a { animation: ivo-swap-a 5s ease-in-out infinite; }
.ivo-swap-b { opacity: 0; animation: ivo-swap-b 5s ease-in-out infinite; }
.ivo-mover-value { color: var(--iv-muted); font-size: 11px; font-variant-numeric: tabular-nums; }

@container (max-width: 330px) {
    .ivo-movers-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------------ Market data quality */

.ivo-quality .rc-card-body { container-type: inline-size; }
.ivo-coverage { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.ivo-coverage-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ivo-coverage-label { color: var(--iv-muted); font-size: 12px; font-weight: 600; }
.ivo-coverage-value { color: var(--iv-text); font-family: var(--tx-font); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ivo-qchips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }

.ivo-qchip {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--iv-tile-border);
    border-radius: 12px;
    background: var(--iv-tile);
}

.ivo-qchip dt { overflow: hidden; color: var(--iv-muted); font-size: 9.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; text-overflow: ellipsis; }
.ivo-qchip dd { min-width: 0; margin: 0; overflow: hidden; color: var(--iv-text); font-size: 14px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.ivo-qchip .iv-pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

@container (max-width: 360px) {
    .ivo-qchips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.ivo-disclosure {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin-top: 12px;
    padding: 4px 6px 4px 2px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--iv-green);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

.ivo-disclosure:hover { background: var(--iv-icon-bg); }
.ivo-disclosure-chev { font-size: 10px; transition: transform .2s ease; }
.ivo-disclosure.is-open .ivo-disclosure-chev { transform: rotate(90deg); }
.ivo-unmatched { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; animation: ivo-fade .2s ease both; }

.ivo-unmatched-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 12px;
    background: var(--iv-tile);
}

.ivo-unmatched-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ivo-unmatched-name { display: flex; gap: .4rem; min-width: 0; overflow: hidden; color: var(--iv-text); font-size: 12.5px; white-space: nowrap; text-overflow: ellipsis; }
.ivo-unmatched-name span { overflow: hidden; text-overflow: ellipsis; }
.ivo-unmatched-reason { color: var(--iv-caution); font-size: 11.5px; line-height: 1.35; }
.ivo-quality-foot { display: flex; align-items: center; gap: .4rem; }
.ivo-quality-foot .tx-glyph { font-size: 10px; }

/* ------------------------------------------------------------------ Allocation */

.ivo-allocation .rc-card-body { container-type: inline-size; container-name: ivo-alloc; }
.ivo-group-chips { margin: -2px 0 14px; }
.ivo-alloc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px 28px; transition: opacity .2s ease; }
.ivo-alloc.is-loading { opacity: .55; pointer-events: none; }
.ivo-alloc-loading { padding: 8px 0; }
.ivo-alloc-chart { position: relative; justify-self: center; width: 100%; max-width: 360px; margin: 0; }

/* The doughnut's gaps take the card's color in either theme. */
.ivo-donut [id*="_Series_0_Point_"] { stroke: var(--rc-card, var(--iv-card)); }

.ivo-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    text-align: center;
}

.ivo-donut-total { color: var(--iv-text); font-family: var(--tx-font); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ivo-donut-sub { color: var(--iv-muted); font-size: 11.5px; }
.ivo-alloc-rows { display: flex; flex-direction: column; gap: 2px; min-width: 0; margin: 0; padding: 0; list-style: none; }

.ivo-alloc-row {
    display: grid;
    grid-template-columns: 10px minmax(0, 1.4fr) minmax(60px, 1fr) auto 12px;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 8px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--iv-text);
    font: inherit;
    text-align: left;
}

.ivo-alloc-row.is-clickable { cursor: pointer; transition: background-color .15s ease; }
.ivo-alloc-row.is-clickable:hover { background: var(--iv-row-hover); }
.ivo-alloc-row.is-other { color: var(--iv-muted); }
.ivo-alloc-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ivo-dot, var(--iv-slice-other)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ivo-dot, var(--iv-slice-other)) 18%, transparent); }
.ivo-alloc-label { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ivo-alloc-name { overflow: hidden; font-family: var(--tx-font); font-size: 13.5px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.ivo-alloc-sub { overflow: hidden; color: var(--iv-muted); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.ivo-alloc-bar .iv-bar-fill { background: var(--ivo-dot, var(--iv-slice-other)); }
.ivo-alloc-figs { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; }
.ivo-alloc-value { font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ivo-alloc-pct { color: var(--iv-muted); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ivo-alloc-chev { color: var(--iv-light); font-size: 10px; }

@container ivo-alloc (min-width: 760px) {
    .ivo-alloc { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); align-items: center; }
}

@container ivo-alloc (max-width: 480px) {
    .ivo-alloc-row { grid-template-columns: 10px minmax(0, 1fr) auto 12px; row-gap: 6px; }
    .ivo-alloc-bar { grid-column: 2 / 4; grid-row: 2; }
}

/* ------------------------------------------------------------------ Portfolio health */

.ivo-health .rc-card-body { container-type: inline-size; container-name: ivo-health; }
.ivo-health-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }

.ivo-health-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 14px;
    border-radius: 18px;
    background: var(--iv-callout);
    text-align: center;
}

.ivo-health-grade { padding: 3px 12px; font-size: 12px; }
.ivo-health-summary { max-width: 34ch; margin: 0; color: var(--iv-muted); font-size: 12.5px; line-height: 1.45; }
.ivo-health-tally { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 2px 0 0; padding: 0; list-style: none; font-size: 11.5px; }
.ivo-health-tally li { display: inline-flex; align-items: center; gap: 4px; color: var(--iv-muted); }
.ivo-health-tally .tx-glyph { color: var(--iv-tone); font-size: 11px; }
.ivo-health-tally b { color: var(--iv-text); }
.ivo-health-bones { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }

.ivo-health-checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ivo-check {
    position: relative;
    display: flex;
    gap: 12px;
    min-width: 0;
    padding: 12px 12px 12px 14px;
    overflow: hidden;
    border: 1px solid var(--iv-tile-border);
    border-radius: 16px;
    background: var(--iv-tile);
    animation: ivo-rise .4s cubic-bezier(.2, .8, .2, 1) both;
}

.ivo-check::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: var(--iv-tone); }
.ivo-check.iv-tone-neutral::before { background: var(--iv-tile-border); }

.ivo-check-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--iv-tone-soft);
    color: var(--iv-tone);
    font-size: 13px;
}

.ivo-check-body { display: flex; flex: 1 1 auto; flex-direction: column; gap: 3px; min-width: 0; }
.ivo-check-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 4px 8px; }
.ivo-check-title { flex: 1 1 8rem; min-width: 0; }
.ivo-check-title { margin: 0; color: var(--iv-text); font-family: var(--tx-font); font-size: 13px; font-weight: 700; line-height: 1.3; }
.ivo-check-status { flex: 0 0 auto; }
.ivo-check-value { color: var(--iv-text); font-family: var(--tx-font); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ivo-check-detail { margin: 0; color: var(--iv-muted); font-size: 12px; line-height: 1.45; }

.ivo-check-action {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: .3rem;
    margin-top: 4px;
    color: var(--iv-green);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.ivo-check-action:hover { text-decoration: underline; }
.ivo-check-action .tx-glyph { font-size: 10px; }

.ivo-health-checks > li:nth-child(2) { animation-delay: .04s; }
.ivo-health-checks > li:nth-child(3) { animation-delay: .08s; }
.ivo-health-checks > li:nth-child(4) { animation-delay: .12s; }
.ivo-health-checks > li:nth-child(5) { animation-delay: .16s; }
.ivo-health-checks > li:nth-child(n + 6) { animation-delay: .2s; }

@container ivo-health (min-width: 760px) {
    .ivo-health-layout { grid-template-columns: 250px minmax(0, 1fr); align-items: start; }
    .ivo-health-score { position: sticky; top: 1rem; }
}

/* ------------------------------------------------------------------ Motion */

@keyframes ivo-ring-in { from { stroke-dashoffset: var(--ivo-ring-circ, 327); } }
@keyframes ivo-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes ivo-pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ivo-slide-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes ivo-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ivo-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ivo-spin-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes ivo-pulse { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }
@keyframes ivo-breathe { 0%, 100% { opacity: .55; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.03); } }

@keyframes ivo-bell-ring {
    0%, 70%, 100% { transform: rotate(0); }
    74% { transform: rotate(14deg); }
    80% { transform: rotate(-12deg); }
    86% { transform: rotate(8deg); }
    92% { transform: rotate(-4deg); }
}

/* The movers' change line: dollars for 2.5 s, then percent for 2.5 s (a 180 ms fade each way). */
@keyframes ivo-swap-a {
    0%, 46.4% { opacity: 1; transform: none; }
    50%, 96.4% { opacity: 0; transform: translateY(-3px); }
    100% { opacity: 1; transform: none; }
}

@keyframes ivo-swap-b {
    0%, 46.4% { opacity: 0; transform: translateY(3px); }
    50%, 96.4% { opacity: 1; transform: none; }
    100% { opacity: 0; transform: translateY(3px); }
}

@media (prefers-reduced-motion: reduce) {
    .ivo-ring-fill, .ivo-mini-fill, .ivo-inbox, .ivo-check, .ivo-unmatched,
    .ivo-ring-demo .ivo-ring-fill, .ivo-ticker-pulse, .ivo-rules-empty-ring, .ivo-alert-pill-glyph {
        animation: none !important;
    }

    .ivo-carousel { scroll-behavior: auto; }
    .ivo-dot, .ivo-dot::before, .ivo-alloc, .ivo-disclosure-chev, button.ivo-mover, .ivo-alert, .ivo-alert-pill { transition: none; }
    button.ivo-mover:hover { transform: none; }

    /* Both halves of the movers' change line show at once instead of cross-fading. */
    .ivo-mover-change { display: flex; flex-wrap: wrap; gap: 2px 10px; }
    .ivo-swap-a, .ivo-swap-b { grid-area: auto; opacity: 1; transform: none; animation: none; }
}
