/* The Investments checkup and market radar (new on the web): the green Checkup launcher in the area header, the checkup
   dialog (summary hero with the health ring, to-dos, the radar table, health checks, alert and data coverage), the
   Overview's "Needs a look" and "Market radar" cards, and the Securities "Market signals" card. Built on the
   investments-area.css tokens, so light and dark follow the area; the dialog is appended to <body>, which is why the
   tokens live on :root. */

:root {
    --ivk-task-bg: #FFFFFF;
    --ivk-row-line: #EEF2F6;
    --ivk-head-bg: #F6F9FC;
    --ivk-range-fill: rgba(22, 163, 74, .18);
}

[data-bs-theme="dark"] {
    --ivk-task-bg: rgba(255, 255, 255, .03);
    --ivk-row-line: rgba(255, 255, 255, .06);
    --ivk-head-bg: rgba(255, 255, 255, .03);
    --ivk-range-fill: rgba(52, 211, 153, .22);
}

/* ------------------------------------------------------------------ The Checkup launcher (green take on .rc-launcher) */

.rc-launcher.iv-launcher { position: relative; }
.iv-launcher .iv-launcher-icon { background: var(--iv-icon-bg); color: var(--iv-icon); }

.rc-launcher.iv-launcher:hover:not(:disabled),
.rc-launcher.iv-launcher:focus-visible { border-color: var(--iv-green); background: var(--iv-icon-bg); }

.rc-launcher.iv-launcher:hover:not(:disabled) .iv-launcher-icon,
.rc-launcher.iv-launcher:focus-visible .iv-launcher-icon { background: var(--iv-green); color: #FFFFFF; }

[data-bs-theme="dark"] .rc-launcher.iv-launcher:hover:not(:disabled) .iv-launcher-icon,
[data-bs-theme="dark"] .rc-launcher.iv-launcher:focus-visible .iv-launcher-icon { color: #0B0F19; }

.iv-launcher-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--iv-negative);
    color: #FFFFFF;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--tx-page, #FFFFFF);
}

[data-bs-theme="dark"] .iv-launcher-badge { color: #0B0F19; box-shadow: 0 0 0 2px #0B0F19; }

/* ------------------------------------------------------------------ The dialog */

.e-dialog.ivk-dialog .rc-dialog-root { background: var(--tx-page, #FCFDFD); }
.ivk-menu { margin-bottom: 0; }
.ivk-scroll { display: flex; flex-direction: column; gap: 14px; }
.ivk-foot { margin-top: 4px; }
.ivk-section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .25rem 1rem; }
.ivk-section-head .iv-subhead { margin: 2px 0 0; }
.ivk-more { align-self: flex-start; }

/* Summary hero: the ring, the headline with the tally, three stat tiles. */
.ivk-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 18px;
    align-items: center;
    padding: 16px 18px;
    border: 1px solid var(--iv-border);
    border-radius: 20px;
    background: var(--iv-hero-bg);
}

.ivk-hero-score { position: relative; width: 116px; height: 116px; }
.ivk-ring { width: 116px; height: 116px; }
.ivk-ring .ivo-ring-fill { stroke: var(--iv-tone, var(--iv-green)); }
.ivk-ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ivk-ring-value { font-family: var(--tx-font); font-size: 30px; font-weight: 700; line-height: 1; color: var(--iv-text); font-variant-numeric: tabular-nums; }
.ivk-ring-caption { margin-top: 3px; font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--iv-muted); }
.ivk-hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.ivk-grade { padding: 3px 11px; font-size: 11.5px; }
.ivk-headline { margin: 0; font-family: var(--tx-font); font-size: 17px; font-weight: 600; line-height: 1.35; color: var(--iv-text); }
.ivk-tally { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }

.ivk-tally li {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--iv-tone-soft);
    color: var(--iv-tone);
    font-size: 11.5px;
    font-weight: 600;
}

.ivk-tally b { font-size: 13px; }
.ivk-hero-stats { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.ivk-hero-stats .iv-stat { background: var(--iv-tiles-bg); padding: 8px 10px; }
[data-bs-theme="dark"] .ivk-hero-stats .iv-stat { background: rgba(255, 255, 255, .04); }

@media (max-width: 991.98px) {
    .ivk-hero { grid-template-columns: auto minmax(0, 1fr); }
    .ivk-hero-stats { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 575.98px) {
    .ivk-hero { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
    .ivk-hero-copy { align-items: center; }
    .ivk-hero-stats { grid-template-columns: minmax(0, 1fr); width: 100%; text-align: left; }
}

/* ------------------------------------------------------------------ To-dos */

.ivk-tasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.ivk-tasks.is-compact { grid-template-columns: minmax(0, 1fr); gap: 8px; }

.ivk-task {
    position: relative;
    display: flex;
    gap: 12px;
    min-width: 0;
    padding: 12px 14px 12px 16px;
    overflow: hidden;
    border: 1px solid var(--iv-tile-border);
    border-radius: 16px;
    background: var(--ivk-task-bg);
    animation: ivk-rise .35s cubic-bezier(.2, .8, .2, 1) both;
}

.ivk-task::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: var(--iv-tone, var(--iv-tile-border)); }
.ivk-task.iv-tone-neutral::before { background: var(--iv-tile-border); }

.ivk-task-chip {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: var(--iv-tone-soft, var(--iv-neutral-soft));
    color: var(--iv-tone, var(--iv-muted));
    font-size: 13px;
}

.ivk-task-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto; }
.ivk-task-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ivk-task-priority { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--iv-muted); }
.ivk-task-priority.ivk-p1 { color: var(--iv-negative); }
.ivk-task-priority.ivk-p2 { color: var(--iv-caution); }
.ivk-task-category { font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--iv-light); }
.ivk-task-title { margin: 0; font-family: var(--tx-font); font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--iv-text); overflow-wrap: anywhere; }
.ivk-task-detail { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--iv-muted); }
.ivk-task-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ivk-btn { min-height: 30px; padding: 4px 11px; font-size: 12px; border-radius: 10px; }
.ivk-btn .tx-glyph { font-size: 10.5px; }
.ivk-tasks.is-compact .ivk-task { padding: 10px 12px 10px 14px; }
.ivk-tasks.is-compact .ivk-task-actions { margin-top: 4px; }

.ivk-clear { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--iv-callout); }
.ivk-clear-chip { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--iv-icon-bg); color: var(--iv-icon); font-size: 15px; flex: 0 0 auto; }
.ivk-clear-title { margin: 0; font-family: var(--tx-font); font-size: 14px; font-weight: 600; color: var(--iv-text); }
.ivk-clear-text { margin: 2px 0 0; font-size: 12.5px; color: var(--iv-muted); }

/* ------------------------------------------------------------------ Market radar table */

.ivk-radar-summary { display: flex; flex-direction: column; gap: 10px; }
.ivk-radar-callout .tx-glyph { color: var(--iv-tone, var(--iv-green)); }
.ivk-radar-stats { display: grid; gap: 10px; grid-template-columns: repeat(5, minmax(0, 1fr)); }

@media (max-width: 1199.98px) {
    .ivk-radar-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 575.98px) {
    .ivk-radar-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.ivk-radar { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--iv-tile-border); border-radius: 16px; overflow: hidden; }

.ivk-radar-head,
.ivk-radar-row {
    display: grid;
    grid-template-columns: minmax(170px, 1.6fr) 70px minmax(150px, 1.3fr) 76px 80px 64px 92px minmax(170px, 1.9fr);
    gap: 12px;
    align-items: center;
    padding: 9px 14px;
}

.ivk-radar-head {
    background: var(--ivk-head-bg);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--iv-muted);
}

.ivk-radar-row { border-top: 1px solid var(--ivk-row-line); font-size: 13px; color: var(--iv-text); transition: background-color .15s ease; }
.ivk-radar-row:hover { background: var(--iv-row-hover); }
.ivk-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ivk-radar-sec-cell { min-width: 0; }
.ivk-radar-sec { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.ivk-radar-sec:hover .ivk-radar-sym { color: var(--iv-green); }
.ivk-radar-id { display: flex; flex-direction: column; min-width: 0; }
.ivk-radar-sym { font-family: var(--tx-font); font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.ivk-radar-weight { margin-left: 4px; font-family: var(--tx-font-text); font-size: 11px; font-weight: 600; color: var(--iv-muted); }
.ivk-radar-name { font-size: 11.5px; color: var(--iv-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ivk-radar-range { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ivk-radar-range .iv-range-track { overflow: visible; }
.ivk-range-fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 3px; background: var(--ivk-range-fill); }
.ivk-range-ends { font-size: 10.5px; color: var(--iv-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ivk-radar-signals { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-width: 0; }
.ivk-quiet { font-size: 12px; }

.ivk-signal {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 8px;
    background: var(--iv-tone-soft, var(--iv-neutral-soft));
    color: var(--iv-tone, var(--iv-muted));
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.ivk-signal .tx-glyph { font-size: 9.5px; }
.ivk-signal-more { font-size: 11px; font-weight: 600; color: var(--iv-muted); }
.ivk-watch { width: 28px; height: 28px; margin-left: auto; font-size: 12px; border-radius: 9px; }

/* Narrow: each row becomes a card with labelled figures. */
@media (max-width: 1099.98px) {
    .ivk-radar { border: 0; border-radius: 0; gap: 10px; overflow: visible; }
    .ivk-radar-head { display: none; }

    .ivk-radar-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px 12px;
        padding: 12px 14px;
        border: 1px solid var(--iv-tile-border);
        border-radius: 16px;
        background: var(--ivk-task-bg);
    }

    .ivk-radar-sec-cell { grid-column: 1 / -1; }
    .ivk-radar-range, .ivk-radar-signals { grid-column: 1 / -1; }

    .ivk-radar-row > [data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 2px;
        font-size: 9.5px;
        font-weight: 700;
        letter-spacing: .05em;
        text-transform: uppercase;
        color: var(--iv-muted);
        text-align: left;
    }

    .ivk-radar-row > .ivk-num { text-align: left; }
    .ivk-radar-signals::before { width: 100%; }
}

@media (max-width: 479.98px) {
    .ivk-radar-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------------ Health and coverage */

.ivk-health-callout { margin: 0; }
.ivk-checks { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
button.ivo-check-action.ivk-link { padding: 0; border: 0; background: transparent; cursor: pointer; }

.ivk-coverage { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; align-items: start; }

@media (max-width: 991.98px) {
    .ivk-coverage { grid-template-columns: minmax(0, 1fr); }
}

.ivk-cover-card { display: flex; flex-direction: column; gap: 10px; }
.ivk-cover-head { display: flex; flex-direction: column; gap: 2px; }
.ivk-cover-head .iv-subhead { margin: 0; }
.ivk-cover-rows { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.ivk-cover-rows > li + li { border-top: 1px solid var(--ivk-row-line); }

.ivk-cover-row {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    padding: 9px 2px;
}

.ivk-cover-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--iv-tone, var(--iv-muted)); }
.ivk-cover-main { display: flex; flex-direction: column; min-width: 0; }
.ivk-cover-sym { font-family: var(--tx-font); font-size: 13.5px; font-weight: 700; color: var(--iv-text); }
.ivk-cover-names { font-size: 11.5px; color: var(--iv-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 575.98px) {
    .ivk-cover-row { grid-template-columns: 10px minmax(0, 1fr) auto; }
    .ivk-cover-row .ivk-btn { grid-column: 2 / -1; justify-self: start; }
}

.ivk-data-meter { display: flex; flex-direction: column; gap: 6px; }
.ivk-data-text { font-size: 12.5px; color: var(--iv-muted); }
.ivk-data-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ivk-mini-head { margin: 6px 0 0; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--iv-muted); }
.ivk-unmatched { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ivk-unmatched li { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.ivk-unmatched-name { color: var(--iv-text); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ivk-unmatched-reason { color: var(--iv-muted); white-space: nowrap; }

/* ------------------------------------------------------------------ Overview cards: Needs a look, Market radar */

.ivk-needs .iv-card-body { display: flex; flex-direction: column; gap: 10px; }
.ivk-needs-summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ivk-needs-summary .ivk-tally li { font-size: 11px; }
.ivk-needs-foot { display: flex; justify-content: flex-start; }

.ivk-radar-card .iv-card-body { display: flex; flex-direction: column; gap: 12px; container-type: inline-size; container-name: ivk-radar; }
.ivk-radar-kpis { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Four tiles need about 820px; in a half-width card they go two by two. */
@container ivk-radar (max-width: 820px) {
    .ivk-radar-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.ivk-radar-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.ivk-radar-list > li + li { border-top: 1px solid var(--ivk-row-line); }

.ivk-radar-item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px 4px;
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    transition: background-color .15s ease;
}

.ivk-radar-item:hover { background: var(--iv-row-hover); }
.ivk-radar-item-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ivk-radar-item-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; font-family: var(--tx-font); font-size: 13.5px; font-weight: 600; color: var(--iv-text); }
.ivk-radar-item-detail { font-size: 12px; line-height: 1.4; color: var(--iv-muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ------------------------------------------------------------------ Securities: market signals card */

.ivs-signals .iv-card-body { display: flex; flex-direction: column; gap: 14px; }
.ivs-signals-grid { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 767.98px) {
    .ivs-signals-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.ivs-signal-range { display: flex; flex-direction: column; gap: 6px; }
.ivs-signal-range .iv-range-track { height: 8px; overflow: visible; }
.ivs-range-labels { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--iv-muted); font-variant-numeric: tabular-nums; }
.ivs-range-labels b { color: var(--iv-text); font-weight: 600; }
.ivs-signal-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }

.ivs-signal-row {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--iv-tone-soft, var(--iv-neutral-soft));
}

.ivs-signal-chip { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--ivk-task-bg); color: var(--iv-tone, var(--iv-muted)); font-size: 12px; }
.ivs-signal-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ivs-signal-label { font-family: var(--tx-font); font-size: 13px; font-weight: 600; color: var(--iv-text); }
.ivs-signal-detail { font-size: 12px; line-height: 1.4; color: var(--iv-muted); }

@keyframes ivk-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .ivk-task { animation: none; }
    .ivk-radar-row, .ivk-radar-item { transition: none; }
}

/* ------------------------------------------------------------------ Investment Rules: watching your holdings */

.ivr-events-col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.ivr-coverage .iv-card-body { display: flex; flex-direction: column; gap: 6px; }
a.ivr-cover-link { color: var(--iv-text); text-decoration: none; }
a.ivr-cover-link:hover { color: var(--iv-green); text-decoration: underline; }
.ivr-coverage .ivk-cover-row { grid-template-columns: 10px minmax(0, 1fr) auto; }
