/* ============================================================
   ltv.css — Customer LTV Calculator (/ltv-viz/)

   The assets/ folder is shared by all three Dash apps, so EVERY rule here is
   scoped under #ltv-root and cannot reach the bond or equity tools.

   Covers the parts the handoff specifies that inline styles cannot express:
   slider track/thumb, chip hover + focus states, responsive collapse, and the
   screen-reader-only chart summary.
   ============================================================ */

#ltv-root ::selection {
    background: #3ddc84;
    color: #080b11;
}

/* ── Screen-reader-only text ──────────────────────────────── */

#ltv-root .ltv-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Focus rings (missing from the prototype) ─────────────── */

#ltv-root a:focus-visible,
#ltv-root button:focus-visible,
#ltv-root .rc-slider-handle:focus-visible {
    outline: 2px solid #3ddc84;
    outline-offset: 2px;
    border-radius: 8px;
}

/* ── Scenario preset chips ────────────────────────────────── */

#ltv-root .ltv-chip {
    font-family: 'Plus Jakarta Sans', 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 12px;
    font-weight: 500;
    padding: 7px 11px;
    border-radius: 8px;
    cursor: pointer;
    transition: all .12s;
    background: rgba(255, 255, 255, .04);
    color: #c3cad6;
    border: 1px solid rgba(255, 255, 255, .10);
}

#ltv-root .ltv-chip:hover {
    /* Called out as missing in the prototype. */
    background: rgba(255, 255, 255, .08);
}

#ltv-root .ltv-chip--active,
#ltv-root .ltv-chip--active:hover {
    background: #3ddc84;
    color: #08110b;
    border: 1px solid #3ddc84;
}

/* ── Sliders ──────────────────────────────────────────────────
   dcc.Slider renders rc-slider, whose rail/track split gives the
   handoff's gradient-fill effect natively — no inline gradient needed.
   ------------------------------------------------------------ */

#ltv-root .ltv-slider .rc-slider {
    height: 17px;
    padding: 6px 0;
}

#ltv-root .ltv-slider .rc-slider-rail {
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .10);
}

#ltv-root .ltv-slider .rc-slider-track {
    height: 5px;
    border-radius: 3px;
    background: #3ddc84;
}

#ltv-root .ltv-slider .rc-slider-handle {
    width: 17px;
    height: 17px;
    margin-top: -6px;
    opacity: 1;
    background: #f1f4fa;
    border: 2.5px solid #3ddc84;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .5);
    transition: transform .1s;
}

#ltv-root .ltv-slider .rc-slider-handle:hover,
#ltv-root .ltv-slider .rc-slider-handle-dragging {
    transform: scale(1.12);
    border-color: #3ddc84 !important;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .5) !important;
}

/* rc-slider ships a dot/mark layer we do not use */
#ltv-root .ltv-slider .rc-slider-dot,
#ltv-root .ltv-slider .rc-slider-mark {
    display: none;
}

/* ── Responsive ───────────────────────────────────────────────
   The prototype is desktop-only (fixed 355px + 1fr). Below 1024px
   the panel moves above the results and the dense grids unstack.
   ------------------------------------------------------------ */

@media (max-width: 1024px) {
    #ltv-root .ltv-page {
        padding: 28px 24px 40px !important;
    }
    #ltv-root .ltv-body {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    #ltv-root .ltv-hero-num {
        font-size: 40px !important;
    }
    #ltv-root .ltv-terms-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 720px) {
    #ltv-root .ltv-page {
        padding: 22px 16px 36px !important;
    }
    #ltv-root .ltv-h1 {
        font-size: 28px !important;
    }
    #ltv-root .ltv-hero-num {
        font-size: 34px !important;
    }
    #ltv-root .ltv-tiles-grid {
        grid-template-columns: 1fr !important;
    }
    #ltv-root .ltv-terms-grid {
        grid-template-columns: 1fr !important;
    }
    #ltv-root .ltv-panel {
        padding: 20px 18px !important;
    }
}

/* ── Info affordance ──────────────────────────────────────────
   Circled-i beside a label. Kept to 14px so it never disturbs the
   line box of the label it annotates.
   ------------------------------------------------------------ */

#ltv-root .ltv-info {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .22);
    background: transparent;
    color: #6b7488;
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 9.5px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color .12s, background .12s, color .12s;
}

#ltv-root .ltv-info:hover {
    border-color: rgba(122, 162, 255, .55);
    color: #9aa3b4;
}

#ltv-root .ltv-info--active,
#ltv-root .ltv-info--active:hover {
    border-color: #7aa2ff;
    background: rgba(122, 162, 255, .16);
    color: #7aa2ff;
}

/* ── Popover portal ───────────────────────────────────────────
   The layer is fixed and zero-sized at the document root, so a popover
   inside it overlays the page without reflowing anything and is immune
   to overflow / stacking contexts in the card grid.
   ------------------------------------------------------------ */

#ltv-root .ltv-popover-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    z-index: 1200;
}

#ltv-root .ltv-popover {
    position: fixed;
    /* Deliberately visible by default. ltv_popover.js repositions it from a
       MutationObserver callback, which runs before paint, so there is no flash
       on the normal path — and if that script ever fails to run, the popover
       degrades to mispositioned rather than invisible. */
    top: 96px;
    left: 24px;
    box-sizing: border-box;
    background: #070a10;
    border: 1px solid rgba(122, 162, 255, .30);
    border-radius: 9px;
    padding: 12px 14px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .62);
}

#ltv-root .ltv-popover:focus {
    outline: none;
}

#ltv-root .ltv-popover:focus-visible {
    outline: 2px solid #7aa2ff;
    outline-offset: 2px;
}

#ltv-root .ltv-popover-close {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    background: transparent;
    color: #6b7488;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    border-radius: 3px;
    transition: color .12s;
}

#ltv-root .ltv-popover-close:hover {
    color: #e7ebf2;
}

/* ── Sensitivity grid ─────────────────────────────────────────── */

#ltv-root .ltv-sens-cell {
    transition: filter .12s, transform .12s;
}

#ltv-root .ltv-sens-cell:hover {
    filter: brightness(1.35);
}

#ltv-root .ltv-sens-cell:active {
    transform: scale(0.97);
}
