/* App-style card stories (templates usmarket/_card_story.html + _learn_story_*.html, js/usmarket_learn_story.js): two on
   /learn/us-stock-fcn-guide and the quote flow on the signed-out /fcn/quote.
   Big rounded cards, big numbers, tinted colour blocks and spring motion; colours are the site's design tokens, so the
   light and dark themes both work. */
.usm-learn-stories {
    --usm-spring: cubic-bezier(.22, 1.25, .36, 1);
    --usm-story-shadow: 0 22px 44px -24px rgba(var(--ds-shadow-color), .38), 0 2px 8px rgba(var(--ds-shadow-color), .06);
    display: grid;
    gap: 28px;
    margin: 8px 0 32px;
}

.usm-story {
    padding: 28px;
    border: 1px solid var(--ds-border);
    border-radius: 28px;
    background: var(--ds-surface);
}

.usm-story__head {
    max-width: 760px;
}

.usm-story__kicker {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: var(--ds-radius-full);
    background: var(--ds-interactive-soft);
    color: var(--ds-interactive);
    font-size: 13px;
    font-weight: 700;
}

.usm-story__head h3 {
    margin: 12px 0 0;
    color: var(--ds-on-surface);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.usm-story__head p {
    margin: 8px 0 0;
    color: var(--ds-muted);
    font-size: 15px;
    line-height: 1.65;
}

.usm-story__body {
    display: grid;
    grid-template-columns: 208px minmax(0, 1fr);
    gap: 22px;
    margin-top: 22px;
}

/* ---- step rail ---- */
.usm-story__steps {
    display: grid;
    align-content: start;
    gap: 6px;
    margin: 0;
    padding: 6px 0 0;
    list-style: none;
}

.usm-story__steps button {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--ds-muted);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background-color .25s ease, color .25s ease, transform .5s var(--usm-spring);
}

.usm-story__steps button b {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--ds-surface-2);
    color: var(--ds-on-surface);
    font-size: 13px;
    font-weight: 800;
    transition: background-color .25s ease, color .25s ease;
}

.usm-story__steps li.is-current button {
    background: var(--ds-interactive-soft);
    color: var(--ds-on-surface);
    transform: translateX(4px);
}

.usm-story__steps li.is-current button b {
    background: var(--ds-primary);
    color: var(--ds-on-primary);
}

.usm-story__steps li.is-done button b {
    background: color-mix(in srgb, var(--ds-risk-low) 18%, var(--ds-surface));
    color: var(--ds-risk-low);
}

.usm-story__steps button:focus-visible,
.usm-story__switch button:focus-visible,
.usm-story__replay:focus-visible {
    box-shadow: var(--ds-focus-ring);
    outline: none;
}

/* ---- the stage: progress bar, card deck, controls ---- */
.usm-story__stage {
    position: relative;
    min-width: 0;
    padding: 18px 18px 14px;
    border-radius: 24px;
    background: color-mix(in srgb, var(--ds-surface-2) 70%, var(--ds-surface));
}

.usm-story__bar {
    display: flex;
    gap: 6px;
}

.usm-story__bar i {
    flex: 1;
    height: 5px;
    overflow: hidden;
    border-radius: var(--ds-radius-full);
    background: color-mix(in srgb, var(--ds-border) 80%, transparent);
}

.usm-story__bar b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--ds-primary);
    transform: scaleX(0);
    transform-origin: left center;
}

.usm-story__deck {
    position: relative;
    height: 392px;
    margin-top: 30px;
}

/* the stack: the current card in front, the one before peeking out above it, later ones waiting below */
.usm-card {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 22px 24px;
    overflow: hidden;
    border-radius: 22px;
    background: var(--ds-surface);
    box-shadow: var(--usm-story-shadow);
    opacity: 0;
    pointer-events: none;
    transform: translate3d(0, 48px, 0) scale(.95);
    transform-origin: top center;
    transition: transform .8s var(--usm-spring), opacity .4s ease;
}

.usm-card.is-current {
    z-index: 3;
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.usm-card.is-past {
    z-index: 2;
    opacity: .55;
    transform: translate3d(0, -13px, 0) scale(.95);
}

.usm-card.is-past2 {
    z-index: 1;
    opacity: .25;
    transform: translate3d(0, -24px, 0) scale(.9);
}

.usm-story.is-jumping *,
.usm-story.is-jumping *::before,
.usm-story.is-jumping *::after {
    transition: none !important;
}

.usm-card__eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--ds-interactive);
    font-size: 13px;
    font-weight: 800;
}

.usm-card__eyebrow span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.usm-card__eyebrow span[hidden] {
    display: none;
}

.usm-card__eyebrow b {
    padding: 2px 8px;
    border-radius: var(--ds-radius-full);
    background: var(--ds-interactive-soft);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.usm-card__title {
    margin: 4px 0 0;
    color: var(--ds-on-surface);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.usm-card__foot {
    margin: auto 0 0;
    padding-top: 12px;
    color: var(--ds-muted);
    font-size: 14px;
    line-height: 1.55;
}

.usm-card__foot strong {
    color: var(--ds-on-surface);
}

/* staged reveals inside a card */
.usm-card [data-on] {
    opacity: 0;
    transform: translate3d(0, 12px, 0) scale(.97);
    transition: transform .6s var(--usm-spring), opacity .35s ease, background-color .3s ease, border-color .3s ease;
}

.usm-card [data-on].is-on {
    opacity: 1;
    transform: none;
}

/* ---- story 1: the basket ---- */
.usm-basket {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    min-height: 0;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.usm-basket__stock {
    --stock: var(--ds-primary);
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px 12px;
    padding: 18px;
    border-radius: 18px;
    background: color-mix(in srgb, var(--stock) 9%, var(--ds-surface));
}

.usm-basket__stock.is-b {
    --stock: var(--ds-interactive);
}

.usm-basket__stock.is-c {
    --stock: var(--ds-risk-low);
}

.usm-basket__stock b {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--stock);
    color: var(--ds-surface);
    font-size: 20px;
    font-weight: 800;
}

.usm-basket__stock span {
    display: grid;
    color: var(--ds-on-surface);
    font-size: 17px;
    font-weight: 800;
}

.usm-basket__stock span small {
    color: var(--ds-muted);
    font-size: 12px;
    font-weight: 600;
}

.usm-basket__spark {
    grid-column: 1 / -1;
    align-self: stretch;
    width: 100%;
    height: 100%;
    min-height: 54px;
}

.usm-basket__spark path,
.usm-chart svg path {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.usm-basket__spark path {
    stroke: var(--stock);
    stroke-width: 3px;
}

/* ---- story 1: the chart ---- */
.usm-chart {
    position: relative;
    flex: 1;
    min-height: 0;
    margin-top: 12px;
}

.usm-chart svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.usm-chart__zone {
    opacity: 0;
    transition: opacity .6s ease;
}

.usm-chart__zone.is-ko {
    fill: color-mix(in srgb, var(--ds-risk-low) 14%, transparent);
}

.usm-chart__zone.is-ki {
    fill: color-mix(in srgb, var(--ds-risk-high) 13%, transparent);
}

.usm-chart__strike {
    stroke: var(--ds-muted);
    stroke-dasharray: 6 6;
    stroke-width: 1.5px;
    vector-effect: non-scaling-stroke;
    opacity: 0;
    transition: opacity .6s ease;
}

.usm-story[data-step="2"] .usm-chart__zone,
.usm-story[data-step="2"] .usm-chart__strike,
.usm-story[data-step="3"] .usm-chart__zone,
.usm-story[data-step="3"] .usm-chart__strike {
    opacity: 1;
}

.usm-chart__stock {
    stroke-width: 2.2px;
    opacity: .5;
}

.usm-chart__stock.is-a { stroke: var(--ds-primary); }
.usm-chart__stock.is-b { stroke: var(--ds-interactive); }
.usm-chart__stock.is-c { stroke: var(--ds-risk-low); }

.usm-chart__worst {
    stroke: var(--ds-primary);
    stroke-width: 5px;
}

.usm-chart__worst.is-after {
    stroke: var(--ds-risk-high);
}

.usm-chart__label {
    position: absolute;
    left: 6px;
    padding: 3px 9px;
    border-radius: var(--ds-radius-full);
    background: var(--ds-surface);
    font-size: 12px;
    font-weight: 800;
    pointer-events: none;
}

.usm-chart__label.is-ko {
    top: 4%;
    color: var(--ds-risk-low);
}

.usm-chart__label.is-strike {
    top: 55%;
    color: var(--ds-muted);
    translate: 0 -50%;
}

.usm-chart__label.is-ki {
    bottom: 2%;
    color: var(--ds-risk-high);
}

.usm-chip,
.usm-chart__dot {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    translate: -50% -50%;
    scale: .6;
    transition: opacity .25s ease, scale .45s var(--usm-spring), background-color .3s ease;
}

.usm-chip.is-on,
.usm-chart__dot.is-on {
    opacity: 1;
    scale: 1;
}

.usm-chip {
    z-index: 2;
    padding: 5px 11px;
    border-radius: var(--ds-radius-full);
    background: var(--ds-primary);
    color: var(--ds-on-primary);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 8px 18px -8px rgba(var(--ds-shadow-color), .5);
}

.usm-chip.is-ki,
.usm-chip.is-event {
    background: var(--ds-risk-high);
    color: #fff;
}

.usm-chip.is-event.is-exit {
    background: var(--ds-risk-low);
}

.usm-chip.is-event {
    padding: 7px 13px;
    font-size: 14px;
}

.usm-chart__dot {
    z-index: 1;
    width: 16px;
    height: 16px;
    border: 4px solid var(--ds-primary);
    border-radius: 50%;
    background: var(--ds-surface);
}

.usm-chart__dot.is-ki {
    border-color: var(--ds-risk-high);
}

.usm-coupons {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.usm-coupons li {
    display: grid;
    justify-items: center;
    gap: 4px;
}

.usm-coupons i {
    width: 100%;
    max-width: 64px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 2px dashed var(--ds-border);
    border-radius: 12px;
    color: transparent;
    font-size: 14px;
    font-style: normal;
    font-weight: 800;
    transition: background-color .3s ease, border-color .3s ease, color .3s ease, scale .5s var(--usm-spring);
}

.usm-coupons li.is-paid i {
    border-style: solid;
    border-color: color-mix(in srgb, var(--ds-accent) 55%, transparent);
    background: var(--ds-accent-soft);
    color: var(--ds-on-accent-soft);
    scale: 1.04;
}

.usm-coupons li.is-void {
    opacity: .4;
}

.usm-coupons span {
    color: var(--ds-muted);
    font-size: 12px;
    font-weight: 600;
}

/* ---- story 1: the result ---- */
.usm-result {
    display: grid;
    justify-items: center;
    align-content: center;
    flex: 1;
    gap: 8px;
    text-align: center;
}

.usm-result[hidden] {
    display: none;
}

.usm-result__tag {
    padding: 6px 14px;
    border-radius: var(--ds-radius-full);
    background: var(--ds-risk-high-soft);
    color: var(--ds-risk-high);
    font-size: 14px;
    font-weight: 800;
}

.usm-result.is-exit .usm-result__tag {
    background: var(--ds-risk-low-soft);
    color: var(--ds-risk-low);
}

.usm-result__label {
    margin: 4px 0 0;
    color: var(--ds-muted);
    font-size: 14px;
    font-weight: 600;
}

.usm-result__big {
    color: var(--ds-risk-high);
    font-size: 76px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}

.usm-result.is-exit .usm-result__big {
    color: var(--ds-risk-low);
}

.usm-result__big small {
    margin-left: 2px;
    font-size: 36px;
}

.usm-result__parts {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.usm-result__parts div {
    display: grid;
    min-width: 120px;
    padding: 10px 16px;
    border-radius: 16px;
    background: var(--ds-surface-2);
}

.usm-result__parts span,
.usm-result__parts small {
    color: var(--ds-muted);
    font-size: 12px;
    font-weight: 600;
}

.usm-result__parts b {
    color: var(--ds-on-surface);
    font-size: 24px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.usm-result__parts > i {
    color: var(--ds-muted);
    font-size: 22px;
    font-style: normal;
    font-weight: 800;
}

.usm-result__stocks {
    display: flex;
    gap: 8px;
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
}

.usm-result__stocks li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 4px;
    border-radius: var(--ds-radius-full);
    background: var(--ds-surface-2);
    color: var(--ds-on-surface);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.usm-result__stocks b {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--ds-primary);
    color: var(--ds-surface);
    font-size: 12px;
}

.usm-result__stocks li.is-b b { background: var(--ds-interactive); }
.usm-result__stocks li.is-c b { background: var(--ds-risk-low); }

.usm-result__note {
    margin: 4px 0 0;
    color: var(--ds-muted);
    font-size: 14px;
}

/* ---- story 2 ---- */
.usm-etfs {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.usm-etfs li {
    --move: var(--ds-market-up);
    display: grid;
    grid-template-columns: 1fr auto;
    align-content: center;
    align-items: end;
    gap: 2px 10px;
    padding: 16px 18px;
    border-radius: 18px;
    background: color-mix(in srgb, var(--move) 10%, var(--ds-surface));
}

.usm-etfs li.is-down {
    --move: var(--ds-market-down);
}

.usm-etfs span {
    color: var(--ds-on-surface);
    font-size: 24px;
    font-weight: 800;
}

.usm-etfs small {
    grid-row: 2;
    color: var(--ds-muted);
    font-size: 12px;
    font-weight: 600;
}

.usm-etfs b {
    grid-row: 1 / 3;
    grid-column: 2;
    align-self: center;
    color: var(--move);
    font-size: 34px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

/* a small treemap: the biggest moves get the biggest blocks (科技 tall, 能源 wide) */
.usm-heat {
    flex: 1;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
    min-height: 0;
    margin-top: 16px;
}

.usm-heat__cell {
    --heat: var(--ds-market-up);
    --mix: 30%;
    display: grid;
    align-content: end;
    gap: 2px;
    padding: 12px 14px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--heat) var(--mix), var(--ds-surface));
    color: var(--ds-on-surface);
}

.usm-heat__cell:first-child {
    grid-row: 1 / 3;
}

.usm-heat__cell:last-child {
    grid-column: 3 / 5;
}

.usm-heat__cell.is-up3 { --mix: 100%; color: var(--ds-surface); }
.usm-heat__cell.is-up2 { --mix: 42%; }
.usm-heat__cell.is-up1 { --mix: 20%; }
.usm-heat__cell.is-down1 { --heat: var(--ds-market-down); --mix: 20%; }
.usm-heat__cell.is-down2 { --heat: var(--ds-market-down); --mix: 42%; }
.usm-heat__cell.is-down3 { --heat: var(--ds-market-down); --mix: 100%; color: var(--ds-surface); }

.usm-heat__cell span {
    font-size: 14px;
    font-weight: 700;
}

.usm-heat__cell b {
    font-size: 22px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.usm-heat__cell:first-child b {
    font-size: 40px;
}

.usm-news {
    flex: 1;
    display: grid;
    grid-auto-rows: minmax(0, 1fr);
    gap: 10px;
    min-height: 0;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.usm-news li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid transparent;
    border-radius: 16px;
    background: var(--ds-surface-2);
}

.usm-news li.is-focus {
    border-color: var(--ds-primary);
    background: var(--ds-interactive-soft);
}

.usm-news__tag {
    padding: 3px 10px;
    border-radius: var(--ds-radius-full);
    background: var(--ds-surface);
    color: var(--ds-muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.usm-news li.is-focus .usm-news__tag {
    background: var(--ds-primary);
    color: var(--ds-on-primary);
}

.usm-news b {
    color: var(--ds-on-surface);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
}

.usm-news small {
    color: var(--ds-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.usm-stock {
    flex: 1;
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    align-items: center;
    gap: 22px;
    margin-top: 12px;
}

.usm-stock__score {
    position: relative;
    display: grid;
    place-items: center;
}

.usm-stock__score svg {
    width: 150px;
    height: 150px;
    rotate: -90deg;
}

.usm-ring__track,
.usm-ring__fill {
    fill: none;
    stroke-width: 12px;
}

.usm-ring__track {
    stroke: var(--ds-surface-2);
}

.usm-ring__fill {
    stroke: var(--ds-interactive);
    stroke-linecap: round;
}

.usm-stock__score strong {
    position: absolute;
    top: 50%;
    left: 50%;
    translate: -50% -60%;
    color: var(--ds-on-surface);
    font-size: 44px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.usm-stock__score small {
    position: absolute;
    top: 50%;
    left: 50%;
    translate: -50% 90%;
    color: var(--ds-muted);
    font-size: 12px;
    font-weight: 700;
}

.usm-stock__facts {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.usm-stock__facts li {
    display: grid;
    grid-template-columns: 64px 1fr;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 14px;
    background: var(--ds-surface-2);
}

.usm-stock__facts span {
    color: var(--ds-muted);
    font-size: 12px;
    font-weight: 800;
}

.usm-stock__facts b {
    color: var(--ds-on-surface);
    font-size: 15px;
    font-weight: 700;
}

.usm-stock__facts b.is-warn {
    color: var(--ds-risk-medium);
}

.usm-checks {
    display: grid;
    gap: 10px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.usm-checks li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--ds-surface-2);
    color: var(--ds-on-surface);
    font-size: 16px;
    font-weight: 700;
}

.usm-checks i {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--ds-risk-low-soft);
}

.usm-checks svg {
    width: 20px;
    height: 20px;
}

.usm-checks path {
    fill: none;
    stroke: var(--ds-risk-low);
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3px;
    transition: stroke-dashoffset .45s ease .15s;
}

.usm-checks li.is-on path {
    stroke-dashoffset: 0;
}

.usm-card__alert {
    margin: auto 0 0;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--ds-risk-high-soft);
    color: var(--ds-risk-high);
    font-size: 15px;
    font-weight: 800;
}

/* ---- the quote story (signed-out /fcn/quote) ---- */
.usm-quote-stories {
    margin: 0 0 18px;
}

.usm-story.is-quote .usm-story__deck {
    height: 424px;
}

/* card 1: the ticker fields */
.usm-tickets {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.usm-ticket {
    display: grid;
    align-content: start;
    gap: 6px;
    min-height: 92px;
    padding: 12px 14px;
    border: 1.5px solid var(--ds-border);
    border-radius: 16px;
    background: var(--ds-surface);
    transition: transform .6s var(--usm-spring), opacity .35s ease, border-color .25s ease, box-shadow .25s ease;
}

.usm-ticket small {
    color: var(--ds-muted);
    font-size: 12px;
    font-weight: 700;
}

.usm-ticket b {
    min-height: 34px;
    color: var(--ds-on-surface);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: .02em;
    line-height: 34px;
    transition: color .25s ease;
}

.usm-ticket b.is-typing::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: .9em;
    margin-left: 3px;
    background: var(--ds-interactive);
    vertical-align: -.08em;
    animation: usm-caret .8s steps(1) infinite;
}

.usm-ticket:has(b.is-typing) {
    border-color: var(--ds-interactive);
    box-shadow: 0 0 0 4px var(--ds-interactive-soft);
}

.usm-ticket em {
    justify-self: start;
    padding: 3px 8px;
    border-radius: var(--ds-radius-full);
    background: var(--ds-risk-high-soft);
    color: var(--ds-risk-high);
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}

.usm-ticket.is-dup:has(em.is-on) {
    border-color: color-mix(in srgb, var(--ds-risk-high) 45%, var(--ds-border));
}

.usm-ticket.is-dup:has(em.is-on) b {
    color: var(--ds-muted);
    text-decoration: line-through 2px;
}

.usm-ticket.is-empty {
    border-style: dashed;
}

.usm-ticket.is-empty b {
    color: var(--ds-muted);
    font-size: 15px;
}

@keyframes usm-caret {
    50% { opacity: 0; }
}

.usm-ticket-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.usm-ticket-checks li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ds-on-surface);
    font-size: 14px;
    font-weight: 700;
}

.usm-ticket-checks i {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--ds-risk-low-soft);
}

.usm-ticket-checks svg {
    width: 16px;
    height: 16px;
}

.usm-ticket-checks path {
    fill: none;
    stroke: var(--ds-risk-low);
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3px;
    transition: stroke-dashoffset .4s ease .1s;
}

.usm-ticket-checks li.is-on path {
    stroke-dashoffset: 0;
}

.usm-quote-basket {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    gap: 4px 14px;
    margin-top: auto;
    padding: 16px 20px;
    border-radius: 18px;
    background: var(--ds-primary);
    color: var(--ds-on-primary);
}

.usm-quote-basket > span {
    font-size: 13px;
    font-weight: 700;
    opacity: .8;
}

.usm-quote-basket > b {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: .01em;
}

.usm-quote-basket > small {
    grid-column: 1 / -1;
    font-size: 14px;
    font-weight: 600;
    opacity: .85;
}

/* card 2: the price ladder and the tenor */
.usm-terms {
    flex: 1;
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 20px;
    min-height: 0;
    margin-top: 14px;
}

.usm-ladder {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: var(--ds-surface-2);
}

.usm-card .usm-ladder [data-on] {
    transform: none;
}

.usm-ladder__zone {
    position: absolute;
    right: 0;
    left: 0;
}

.usm-ladder__zone span {
    position: absolute;
    left: 12px;
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}

.usm-ladder__zone.is-ko {
    top: 0;
    height: calc(var(--ko) * 100%);
    background: color-mix(in srgb, var(--ds-interactive) 13%, transparent);
    color: var(--ds-interactive);
}

.usm-ladder__zone.is-ko span {
    top: 10px;
}

.usm-ladder__zone.is-ki {
    top: calc(var(--ki) * 100%);
    bottom: 0;
    background: var(--ds-risk-high-soft);
    color: var(--ds-risk-high);
}

.usm-ladder__zone.is-ki span {
    bottom: 10px;
}

.usm-ladder__line {
    position: absolute;
    top: calc(var(--at) * 100%);
    right: 0;
    left: 0;
    height: 0;
    border-top: 3px solid var(--line);
}

.usm-card .usm-ladder__line[data-on] {
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .7s cubic-bezier(.2, .8, .2, 1), opacity .2s ease;
}

.usm-card .usm-ladder__line[data-on].is-on {
    transform: none;
}

.usm-ladder__line.is-ko { --line: var(--ds-interactive); }
.usm-ladder__line.is-strike { --line: var(--ds-on-surface); border-top-style: dashed; }
.usm-ladder__line.is-ki { --line: var(--ds-risk-high); }

.usm-ladder__line b {
    position: absolute;
    top: -14px;
    right: 10px;
    padding: 3px 10px;
    border-radius: var(--ds-radius-full);
    background: var(--ds-surface);
    color: var(--line);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(var(--ds-shadow-color), .12);
}

.usm-ladder__start {
    position: absolute;
    top: calc(var(--ko) * 100% + 10px);
    left: 12px;
    color: var(--ds-muted);
    font-size: 12px;
    font-weight: 700;
}

.usm-terms__list {
    display: grid;
    align-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.usm-terms__list li {
    display: grid;
    gap: 2px;
    padding: 10px 14px;
    border-left: 4px solid var(--line);
    border-radius: 12px;
    background: var(--ds-surface-2);
}

.usm-terms__list li.is-ko { --line: var(--ds-interactive); }
.usm-terms__list li.is-strike { --line: var(--ds-on-surface); }
.usm-terms__list li.is-ki { --line: var(--ds-risk-high); }

.usm-terms__list b {
    color: var(--line);
    font-size: 15px;
    font-weight: 800;
}

.usm-terms__list span {
    color: var(--ds-on-surface);
    font-size: 14px;
    line-height: 1.5;
}

.usm-tenor {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-top: 14px;
}

.usm-tenor > span {
    color: var(--ds-muted);
    font-size: 13px;
    font-weight: 800;
}

.usm-tenor__seg {
    position: relative;
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    padding: 4px;
    border-radius: var(--ds-radius-full);
    background: color-mix(in srgb, var(--ds-border) 55%, transparent);
}

.usm-tenor__seg i {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(50% - 4px);
    border-radius: var(--ds-radius-full);
    background: var(--ds-surface);
    box-shadow: 0 2px 8px rgba(var(--ds-shadow-color), .14);
}

.usm-card .usm-tenor__seg i[data-on] {
    opacity: 1;
    transform: none;
    transition: transform .6s var(--usm-spring);
}

.usm-card .usm-tenor__seg i[data-on].is-on {
    transform: translateX(100%);
}

.usm-tenor__seg b {
    position: relative;
    min-width: 84px;
    padding: 6px 14px;
    color: var(--ds-muted);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    transition: color .3s ease;
}

.usm-tenor__seg i:not(.is-on) + b,
.usm-tenor__seg i.is-on + b + b {
    color: var(--ds-on-surface);
}

.usm-tenor small {
    padding: 4px 10px;
    border-radius: var(--ds-radius-full);
    background: var(--ds-interactive-soft);
    color: var(--ds-interactive);
    font-size: 12px;
    font-weight: 800;
}

/* card 3: volatility and correlation */
.usm-vols {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    align-items: center;
    gap: 18px;
    margin-top: 12px;
}

.usm-vols__list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.usm-vols__list li {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 11px 14px;
    border-radius: 16px;
    background: var(--ds-surface-2);
}

.usm-vols__list li.is-top {
    background: color-mix(in srgb, var(--ds-risk-medium) 12%, var(--ds-surface));
}

.usm-vols__name {
    display: grid;
    justify-items: start;
    gap: 2px;
}

.usm-vols__name b {
    color: var(--ds-on-surface);
    font-size: 20px;
    font-weight: 800;
}

.usm-vols__name small {
    color: var(--ds-muted);
    font-size: 12px;
    font-weight: 700;
}

.usm-vols__name em {
    margin-top: 2px;
    padding: 2px 8px;
    border-radius: var(--ds-radius-full);
    background: var(--ds-risk-medium-soft);
    color: var(--ds-risk-medium);
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
}

.usm-vols__bars {
    display: grid;
    gap: 6px;
}

.usm-vols__bars > span {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 58px;
    align-items: center;
    gap: 8px;
}

.usm-vols__bars small {
    color: var(--ds-muted);
    font-size: 11px;
    font-weight: 800;
}

.usm-vols__bars i,
.usm-summary__events i {
    display: block;
    height: 10px;
    overflow: hidden;
    border-radius: var(--ds-radius-full);
    background: color-mix(in srgb, var(--ds-border) 60%, transparent);
}

.usm-vols__bars i b,
.usm-summary__events i b,
.usm-outcomes__bar b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--ds-interactive);
    transform: scaleX(0);
    transform-origin: left center;
}

.usm-vols__bars .is-hv i b {
    background: color-mix(in srgb, var(--ds-interactive) 42%, var(--ds-surface-2));
}

.usm-vols__bars strong {
    color: var(--ds-on-surface);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    text-align: right;
}

.usm-vols__corr {
    position: relative;
    display: grid;
    place-items: center;
}

.usm-vols__corr svg {
    width: 140px;
    height: 140px;
    rotate: -90deg;
}

.usm-vols__corr strong {
    position: absolute;
    top: 50%;
    left: 50%;
    translate: -50% -62%;
    color: var(--ds-on-surface);
    font-size: 34px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.usm-vols__corr small {
    position: absolute;
    top: 50%;
    left: 50%;
    translate: -50% 85%;
    color: var(--ds-muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* card 4: the quote summary */
.usm-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 12px;
    margin-top: 12px;
}

.usm-summary__yield {
    display: grid;
    align-content: center;
    gap: 2px;
    padding: 14px 18px;
    border-radius: 18px;
    background: var(--ds-primary);
    color: var(--ds-on-primary);
}

.usm-summary__yield > small,
.usm-summary__yield > span {
    font-size: 13px;
    font-weight: 700;
    opacity: .82;
}

.usm-summary__yield strong {
    font-size: 50px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.05;
}

.usm-summary__yield > .usm-summary__note {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
    opacity: .78;
}

.usm-summary__yield em {
    margin-left: 2px;
    font-size: 26px;
    font-style: normal;
}

.usm-summary__events {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-content: start;
    gap: 8px 10px;
}

.usm-summary__events div {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--ds-surface-2);
}

.usm-summary__events small {
    color: var(--ds-muted);
    font-size: 12px;
    font-weight: 800;
}

.usm-summary__events strong {
    font-size: 24px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.usm-summary__events .is-ki strong { color: var(--ds-risk-medium); }
.usm-summary__events .is-ki i b { background: var(--ds-risk-medium); }
.usm-summary__events .is-ko strong { color: var(--ds-interactive); }

.usm-summary__events i {
    height: 6px;
}

.usm-summary__events p {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--ds-muted);
    font-size: 12.5px;
    line-height: 1.5;
}

.usm-outcomes {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding: 14px 16px;
    border: 1px solid var(--ds-border);
    border-radius: 18px;
}

.usm-outcomes__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.usm-outcomes__head b {
    color: var(--ds-on-surface);
    font-size: 15px;
    font-weight: 800;
}

.usm-outcomes__head span {
    padding: 3px 10px;
    border-radius: var(--ds-radius-full);
    background: var(--ds-risk-low-soft);
    color: var(--ds-risk-low);
    font-size: 12px;
    font-weight: 800;
}

.usm-outcomes__bar {
    display: flex;
    height: 18px;
    overflow: hidden;
    border-radius: var(--ds-radius-full);
    background: color-mix(in srgb, var(--ds-border) 50%, transparent);
}

.usm-outcomes__bar i {
    flex: 0 0 auto;
    min-width: 8px;
}

.usm-outcomes__bar i + i {
    border-left: 2px solid var(--ds-surface);
}

.usm-outcomes__bar b {
    border-radius: 0;
}

.usm-outcomes .is-early { --o: var(--ds-interactive); }
.usm-outcomes .is-conversion { --o: var(--ds-risk-high); }
.usm-outcomes .is-principal { --o: var(--ds-risk-low); }

.usm-outcomes__bar i b {
    background: var(--o);
}

.usm-outcomes__legend {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.usm-outcomes__legend li {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    align-content: start;
    align-items: center;
    gap: 0 8px;
}

.usm-outcomes__legend i {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--o);
}

.usm-outcomes__legend span {
    color: var(--ds-on-surface);
    font-size: 13px;
    font-weight: 800;
}

.usm-outcomes__legend b,
.usm-outcomes__legend small {
    grid-column: 2;
}

.usm-outcomes__legend b {
    color: var(--o);
    font-size: 20px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.usm-outcomes__legend small {
    color: var(--ds-muted);
    font-size: 12px;
    line-height: 1.45;
}

/* ---- controls, takeaway ---- */
.usm-story__controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.usm-story__switch {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: var(--ds-radius-full);
    background: color-mix(in srgb, var(--ds-border) 55%, transparent);
}

.usm-story__switch button,
.usm-story__replay {
    min-height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: var(--ds-radius-full);
    background: transparent;
    color: var(--ds-muted);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.usm-story__switch button[aria-pressed="true"] {
    background: var(--ds-surface);
    color: var(--ds-on-surface);
    box-shadow: 0 2px 8px rgba(var(--ds-shadow-color), .12);
}

.usm-story__terms {
    flex: 1;
    margin: 0;
    color: var(--ds-muted);
    font-size: 12px;
    line-height: 1.5;
}

.usm-story__replay {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ds-surface);
    color: var(--ds-on-surface);
    box-shadow: 0 2px 8px rgba(var(--ds-shadow-color), .1);
}

.usm-story__takeaway {
    margin: 20px 0 0;
    padding: 14px 18px;
    border-radius: 16px;
    background: var(--ds-interactive-soft);
    color: var(--ds-on-surface);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.6;
}

.usm-story__caption {
    margin: 10px 0 0;
    color: var(--ds-muted);
    font-size: 13px;
    line-height: 1.6;
}

@media (pointer: coarse) {
    .usm-story__switch button,
    .usm-story__replay {
        min-height: 44px;
    }
}

/* ---- phones: the rail gives way to the progress bar, the cards get taller ---- */
@media (max-width: 760px) {
    .usm-story {
        padding: 18px 14px;
        border-radius: 22px;
    }

    .usm-story__head h3 {
        font-size: 21px;
    }

    .usm-story__body {
        grid-template-columns: minmax(0, 1fr);
        margin-top: 16px;
    }

    .usm-story__steps {
        display: none;
    }

    .usm-story__stage {
        margin-inline: -4px;
        padding: 14px 12px 12px;
        border-radius: 20px;
    }

    .usm-story__deck {
        height: 452px;
        margin-top: 26px;
    }

    .usm-card {
        padding: 18px 16px;
        border-radius: 20px;
    }

    .usm-card__title {
        font-size: 19px;
    }

    .usm-basket {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .usm-basket__stock {
        grid-template-columns: auto auto 1fr;
        grid-template-rows: auto;
        padding: 10px 12px;
    }

    .usm-basket__stock b {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .usm-basket__spark {
        grid-column: auto;
        align-self: center;
        height: 44px;
        min-height: 0;
    }

    .usm-coupons {
        gap: 5px;
    }

    .usm-coupons i {
        height: 30px;
        font-size: 12px;
    }

    .usm-result__big {
        font-size: 64px;
    }

    .usm-result__parts div {
        min-width: 0;
        padding: 8px 12px;
    }

    .usm-result__parts b {
        font-size: 20px;
    }

    .usm-etfs li {
        grid-template-columns: minmax(0, 1fr);
        padding: 12px 14px;
    }

    .usm-etfs small {
        grid-row: auto;
    }

    .usm-etfs b {
        grid-row: auto;
        grid-column: auto;
        font-size: 22px;
    }

    .usm-heat {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1.4fr 1fr 1fr 1.2fr;
    }

    .usm-heat__cell:first-child,
    .usm-heat__cell:last-child {
        grid-row: auto;
        grid-column: 1 / -1;
    }

    .usm-heat__cell {
        padding: 10px 12px;
    }

    .usm-heat__cell span {
        font-size: 12px;
    }

    .usm-heat__cell b {
        font-size: 18px;
    }

    .usm-heat__cell:first-child b {
        font-size: 30px;
    }

    .usm-news li {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px 10px;
        padding: 12px;
    }

    .usm-news__tag {
        justify-self: start;
    }

    .usm-news b {
        grid-column: 1 / -1;
        font-size: 15px;
    }

    .usm-news small {
        grid-row: 1;
        grid-column: 2;
    }

    .usm-stock {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        gap: 12px;
    }

    .usm-stock__score svg {
        width: 112px;
        height: 112px;
    }

    .usm-stock__score strong {
        font-size: 34px;
    }

    .usm-stock__facts {
        width: 100%;
    }

    .usm-stock__facts li {
        padding: 8px 12px;
    }

    .usm-checks li {
        padding: 12px;
        font-size: 15px;
    }

    .usm-story__controls {
        flex-wrap: wrap;
    }

    .usm-story__terms {
        flex-basis: 100%;
        order: 3;
    }
}

/* ---- the quote story on phones ---- */
@media (max-width: 760px) {
    .usm-story.is-quote .usm-story__deck {
        height: 600px;
    }

    .usm-tickets {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .usm-ticket {
        min-height: 78px;
        padding: 10px 12px;
    }

    .usm-ticket b {
        font-size: 22px;
    }

    .usm-ticket.is-dup {
        grid-column: span 2;
    }

    .usm-quote-basket {
        grid-template-columns: minmax(0, 1fr);
        padding: 14px 16px;
    }

    .usm-quote-basket > b {
        font-size: 24px;
    }

    .usm-terms {
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 10px;
    }

    .usm-ladder__zone span {
        left: 8px;
        font-size: 11px;
    }

    .usm-ladder__line b {
        right: 6px;
        padding: 2px 8px;
        font-size: 11px;
    }

    .usm-ladder__start {
        left: 8px;
        font-size: 11px;
    }

    .usm-terms__list li {
        padding: 8px 10px;
    }

    .usm-terms__list b {
        font-size: 14px;
    }

    .usm-terms__list span {
        font-size: 13px;
    }

    .usm-vols {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        gap: 12px;
    }

    .usm-vols__list {
        width: 100%;
    }

    .usm-vols__list li {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 10px;
        padding: 10px 12px;
    }

    .usm-vols__corr svg {
        width: 120px;
        height: 120px;
    }

    .usm-vols__corr strong {
        font-size: 26px;
    }

    .usm-vols__corr small {
        translate: -50% 75%;
        font-size: 11px;
    }

    .usm-summary {
        grid-template-columns: minmax(0, 1fr);
    }

    .usm-summary__yield strong {
        font-size: 42px;
    }

    .usm-summary__events div {
        padding: 10px 12px;
    }

    .usm-summary__events strong {
        font-size: 21px;
    }

    .usm-outcomes {
        padding: 12px;
    }

    .usm-outcomes__legend {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }

    .usm-outcomes__legend li {
        grid-template-columns: 10px auto minmax(0, 1fr);
    }

    .usm-outcomes__legend b {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        font-size: 17px;
    }

    .usm-outcomes__legend small {
        grid-column: 2 / -1;
        font-size: 11.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .usm-learn-stories *,
    .usm-learn-stories *::before,
    .usm-learn-stories *::after {
        transition: none !important;
    }
}
