/* Shared additions for the home journey and standalone markets route. */
[hidden] { display: none !important; }
.browse-market-price small { display: block; margin-bottom: 3px; color: #ccc; font-size: 14px; font-weight: 400; }
.browse-market-price strong { display: block; font-size: inherit; white-space: normal; }
.capped-product .ticket-tabs { gap: 12px; }
.capped-product .ticket-tabs > span { font-size: 14px; text-align: right; }
.capped-product .ticket-stats { grid-template-columns: 1fr; }
.capped-product .ticket-stats > div { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.capped-product .ticket-stats strong { text-align: right; font-size: 16px; }
.capped-product .ticket-stats span { font-size: 14px; }
.capped-product #ticketMaxProfit { color: #b2dca5; }
.capped-product #productNote, .capped-product #tradeDisclosure, .capped-product #ticketPricingStatus,
.capped-product #multiplierHint, .capped-chart-legend, .capped-payoff p { font-size: 14px; line-height: 1.6; color: #ccc; }
.capped-product #productNote { text-transform: none; }
.capped-product #ticketPricingStatus { color: #fbbf24; }
.capped-product #statusText.warning { padding: 12px 16px; border: 1px solid #70572e; border-radius: 8px; background: #302819; color: #f5d49b; font-size: 14px; line-height: 1.6; }
.capped-product .live-price-dot.price-delayed { animation: none; box-shadow: none; opacity: .6; }
.capped-product .market-retry-button { margin: 8px 0; padding: 10px 16px; border: 1px solid #70572e; border-radius: 8px; background: #302819; color: #f5d49b; font: inherit; font-size: 14px; cursor: pointer; }
.capped-product .market-retry-button:hover { border-color: #f5d49b; }
.capped-product .market-retry-button:focus-visible { outline: 2px solid #f5d49b; outline-offset: 3px; }
.capped-product .market-retry-button:disabled { opacity: .65; cursor: wait; }
.capped-chart-legend { margin: 10px 0 22px; }
.capped-product #priceCanvas { touch-action: pan-y; cursor: crosshair; }
.capped-product #priceCanvas:focus-visible { outline: 2px solid #7dd3fc; outline-offset: 3px; border-radius: 4px; }
.price-chart-hint { margin: 10px 0; color: #ccc; font-size: 14px; line-height: 1.5; }
.price-chart-loading { color: #ccc; font-size: 14px; line-height: 1.6; margin: 10px 0; }
.price-chart-loading.chart-loading-overlay { position: absolute; inset: 0; margin: 0; display: flex; align-items: center; justify-content: center; padding: 28px; text-align: center; background: #121212; }
.price-chart-loading.error { color: #ffad82; }
.price-chart-loading[hidden] { display: none; }
.price-chart-inspector { margin: 12px 0 0; padding: 14px; border: 1px solid #555; border-radius: 8px; background: #202020; color: #eee; font-size: 14px; }
.price-chart-inspector p { margin: 0; line-height: 1.6; color: #ccc; }
.price-chart-inspector .price-chart-observation { color: #eee; margin-bottom: 8px; }
.price-chart-inspector strong { display: block; font-size: 14px; color: #7dd3fc; }
.price-chart-inspector dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.price-chart-inspector dt { color: #ccc; font-size: 14px; }
.price-chart-inspector dd { margin: 5px 0 0; font-size: 15px; overflow-wrap: anywhere; }
.capped-payoff { margin: 24px 0; border: 1px solid #343434; border-radius: 8px; padding: 18px; background: #171717; }
.capped-payoff h2 { margin: 0 0 14px; font-size: 17px; color: #eee; }
.capped-payoff svg { width: 100%; max-height: 230px; overflow: visible; }
.capped-payoff svg text { font-size: 12px; fill: #ccc; }
.payoff-axis { stroke: #555; }
.payoff-line { fill: none; stroke: #fb923c; stroke-width: 3; stroke-linejoin: round; }
.payoff-premium { stroke: #38bdf8; stroke-dasharray: 5 4; }
.payoff-breakeven { fill: #38bdf8; }
#cappedPayoffPlot { display: block; cursor: crosshair; touch-action: pan-y; }
#cappedPayoffPlot:focus-visible { outline: 2px solid #7dd3fc; outline-offset: 3px; border-radius: 5px; }
.payoff-inspection-marker { pointer-events: none; }
.payoff-inspection-marker line { stroke: #ddd; stroke-width: .7; stroke-dasharray: 2 3; }
.payoff-inspection-marker circle { fill: #fff; stroke: #fb923c; stroke-width: 1.5; }
.payoff-inspection-readout { margin: 12px 0 18px; padding: 14px; border: 1px solid #4d4d4d; border-radius: 8px; background: #202020; }
.payoff-inspection-readout > strong { color: #7dd3fc; font-size: 14px; }
.payoff-inspection-readout dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 12px 0; }
.payoff-inspection-readout dt { color: #ccc; font-size: 14px; }
.payoff-inspection-readout dd { margin: 5px 0 0; color: #eee; font-size: 15px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.payoff-inspection-readout p { margin: 0; }
@media (max-width: 600px) {
  .payoff-inspection-readout dl { grid-template-columns: 1fr; gap: 10px; }
  .payoff-inspection-readout dl > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .payoff-inspection-readout dd { margin: 0; text-align: right; }
}
.capped-table-wrap { overflow-x: auto; }
.capped-scenarios { width: 100%; border-collapse: collapse; font-size: 14px; color: #ddd; }
.capped-scenarios th, .capped-scenarios td { padding: 10px 8px; border-bottom: 1px solid #333; text-align: right; white-space: nowrap; }
.capped-scenarios th:first-child, .capped-scenarios td:first-child { text-align: left; }
.capped-scenarios th { color: #ccc; font-weight: 500; }
.capped-product .portfolio-sheet { width: min(980px, 95vw); }
.capped-product .portfolio-table td { vertical-align: top; }
.capped-product .portfolio-table small { display: block; max-width: 320px; margin-top: 7px; color: #ccc; font-size: 14px; line-height: 1.6; white-space: normal; }
.capped-product .portfolio-table button, .capped-review button { border: 1px solid #555; border-radius: 6px; padding: 10px 14px; color: #eee; background: #262626; cursor: pointer; font: inherit; font-size: 14px; }
.capped-review { width: min(570px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); margin: auto; box-sizing: border-box; overflow: auto; border: 1px solid #555; border-radius: 12px; padding: 24px; background: #171717; color: #eee; box-shadow: 0 20px 70px #0009; }
.capped-review::backdrop { background: #000b; }
.capped-review-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.capped-review h2 { margin: 0; font-size: 24px; }
.capped-review p { font-size: 14px; line-height: 1.55; color: #ccc; }
.capped-review .capped-mode { color: #fbbf24; }
.capped-review dl { margin: 22px 0; }
.capped-review dl > div { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid #333; font-size: 14px; }
.capped-review dt { color: #ccc; }
.capped-review dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.capped-review .capped-review-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 28px 0 18px; }
.capped-review .capped-review-summary > div { display: block; min-width: 0; padding: 20px 16px; border: 1px solid #484848; border-radius: 10px; background: #242424; }
.capped-review .capped-review-summary dt { color: #dedede; font-size: 15px; line-height: 1.4; }
.capped-review .capped-review-summary dd { margin-top: 12px; color: #fff; font-size: clamp(22px, 5vw, 30px); font-weight: 800; line-height: 1.2; text-align: left; font-variant-numeric: tabular-nums; }
.capped-review .capped-review-summary > div:last-child { border-color: #4c7252; background: #1b2b20; }
.capped-review .capped-review-summary > div:last-child dd { color: #a6efb7; }
.capped-review .capped-review-note { margin: 0 0 22px; color: #d0d0d0; font-size: 14px; line-height: 1.65; }
.capped-review-actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.capped-review #cappedReviewAccept { width: 100%; min-height: 52px; padding: 14px 18px; background: #e66b15; color: #fff; border-color: #e66b15; font-size: 16px; font-weight: 700; }
.capped-review #cappedReviewStatus { color: #fbbf24; }
.capped-review button:disabled { opacity: .5; cursor: default; }
.capped-review button:focus-visible, .capped-product button:focus-visible { outline: 2px solid #7dd3fc; outline-offset: 3px; }
/* The standalone route shares the same purchase and portfolio controls. */
.capped-product:not(.journey-body) .amount-picker { padding: 0; margin: 20px 0; border: 0; }
.capped-product:not(.journey-body) .amount-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.capped-product:not(.journey-body) .amount-presets button, .capped-product:not(.journey-body) .custom-multiplier { padding: 8px 4px; border: 1px solid #444; border-radius: 6px; background: #222; font-size: 14px; color: #eee; }
.capped-product:not(.journey-body) .amount-presets .active { border-color: #fb923c; }
.capped-product:not(.journey-body) .custom-multiplier input { width: 100%; min-width: 0; padding: 4px; font-size: 14px; }
.capped-product:not(.journey-body) .payout-guide { margin: 20px 0; font-size: 14px; line-height: 1.6; }
.capped-product:not(.journey-body) .payout-guide > div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid #333; }
.capped-product:not(.journey-body) .yes-no-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; overflow: visible; border-radius: 0; background: transparent; padding: 0; }
.capped-product:not(.journey-body) .yes-no-row button { min-width: 0; height: auto; align-items: stretch; justify-content: flex-start; border: 1px solid #d6d3d1; border-radius: 10px; padding: 16px 10px; }
.capped-product:not(.journey-body) .choice-image { width: 45px; height: 45px; object-fit: contain; }
.capped-product:not(.journey-body) .choice-copy, .capped-product:not(.journey-body) .choice-heading { display: grid; min-width: 0; gap: 7px; }
.capped-product:not(.journey-body) .portfolio-drawer { position: fixed; inset: 0; z-index: 20; }
.capped-product:not(.journey-body) .drawer-backdrop { position: absolute; inset: 0; width: 100%; background: #0009; border: 0; }
.capped-product:not(.journey-body) .portfolio-sheet { position: absolute; right: 0; top: 0; bottom: 0; padding: 24px; background: #171717; overflow: auto; }
.capped-product:not(.journey-body) .portfolio-head, .capped-product:not(.journey-body) .portfolio-value-row { display: flex; justify-content: space-between; margin-bottom: 24px; }
.capped-product:not(.journey-body) .portfolio-table-wrap { overflow-x: auto; }
.capped-product:not(.journey-body) .portfolio-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.capped-product:not(.journey-body) .portfolio-table td, .capped-product:not(.journey-body) .portfolio-table th { padding: 12px 8px; text-align: left; border-bottom: 1px solid #333; }
/* Keep the standalone light page readable while its shared sheets stay dark. */
.capped-product:not(.journey-body) #productNote,
.capped-product:not(.journey-body) #tradeDisclosure,
.capped-product:not(.journey-body) #multiplierHint,
.capped-product:not(.journey-body) .multiplier-hint,
.capped-product:not(.journey-body) .capped-chart-legend,
.capped-product:not(.journey-body) .price-chart-hint { color: #575757; font-size: 14px; }
.capped-product:not(.journey-body) #ticketMaxProfit { color: #237b3c; }
.capped-product:not(.journey-body) .portfolio-sheet { color: #eee; }
.capped-product:not(.journey-body) .portfolio-sheet button { color: #eee; background: #262626; border-color: #555; }
.capped-product:not(.journey-body) .portfolio-table th { color: #ccc; font-size: 14px; }
.capped-product:not(.journey-body) .portfolio-value-row { color: #ccc; }
.capped-product:not(.journey-body) .portfolio-value-row strong { color: #fff; }
.capped-trade-success { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 6px 16px; margin: 24px 0; padding: 22px; border: 1px solid #659270; border-radius: 12px; background: linear-gradient(125deg, #203d29, #18261d); color: #f3fff5; box-shadow: 0 8px 28px #0003; animation: capped-trade-arrive 500ms ease-out both; }
.capped-trade-success-icon { grid-column: 1; grid-row: 1; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #a6efb7; color: #16311e; font-size: 30px; font-weight: 800; animation: capped-trade-check 650ms ease-out both; }
.capped-trade-success-title { margin: 0; color: #f3fff5; font-size: 24px; line-height: 1.2; }
.capped-trade-success > div { min-width: 0; }
.capped-trade-success-detail { margin: 7px 0 0; color: #d1e7d6; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.capped-product .portfolio-table .capped-new-position > td { background: #1c3224; border-bottom-color: #60926d; color: #ecfff0; }
.capped-product .portfolio-table .capped-new-position > td:first-child { box-shadow: inset 3px 0 #a6efb7; }
.capped-product .portfolio-table .capped-new-position small { color: #cde5d3; }
@keyframes capped-trade-arrive {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes capped-trade-check {
  0% { transform: scale(.65) rotate(-12deg); }
  65% { transform: scale(1.12) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
  .capped-trade-success, .capped-trade-success-icon { animation: none; }
}
@media (max-width: 600px) {
  .capped-payoff { padding: 12px; }
  .capped-review { padding: 18px; }
  .capped-review h2 { font-size: 19px; }
  .capped-review-actions { flex-direction: column; }
  .capped-review-actions button { width: 100%; }
  .capped-review .capped-review-summary { grid-template-columns: 1fr; gap: 12px; margin-top: 22px; }
  .capped-review .capped-review-summary > div { padding: 18px; }
  .capped-trade-success { grid-template-columns: 44px minmax(0, 1fr); gap: 8px 12px; padding: 18px; }
  .capped-trade-success-icon { width: 44px; height: 44px; font-size: 26px; }
  .capped-trade-success-title { font-size: 21px; }
}
.capped-account-signin { margin-bottom: 18px; padding: 14px; border: 1px solid #555; border-radius: 6px; }
.capped-account-signin label { display: block; font-size: 14px; margin-bottom: 8px; }
.capped-account-signin input { box-sizing: border-box; width: 100%; padding: 10px; }
.capped-account-signin p { color: #ccc; font-size: 14px; line-height: 1.5; }
.capped-account-signin button { margin-top: 10px; padding: 10px; border: 1px solid #555; background: #333; color: #eee; border-radius: 6px; }
.capped-auth-actions { display: flex; align-items: center; gap: 8px; }
.capped-auth-actions .capped-otp-mode { max-width: 130px; color: #fbbf24; font-size: 14px; line-height: 1.4; }
.capped-auth-actions .capped-otp-mode[hidden] { display: none; }
.capped-phone-dialog .capped-simulated-otp { padding: 12px; border: 1px solid #8c641a; border-radius: 8px; background: #332711; color: #fde68a; font-weight: 600; font-variant-numeric: tabular-nums; }
.capped-auth-actions[hidden], .capped-phone-dialog [hidden] { display: none !important; }
.capped-auth-actions button, .capped-phone-dialog button { cursor: pointer; border: 1px solid #555; border-radius: 8px; padding: 10px 14px; background: #262626; color: #eee; font: inherit; font-size: 14px; }
.capped-phone-dialog { box-sizing: border-box; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); margin: auto; overflow: auto; border: 1px solid #555; border-radius: 16px; padding: 28px; color: #eee; background: #171717; box-shadow: 0 20px 70px #0009; font-family: inherit; }
.capped-phone-dialog::backdrop { background: #000b; }
.capped-phone-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.capped-phone-head h2 { margin: 0; font-size: 24px; }
.capped-phone-head button { padding: 7px 10px; }
.capped-phone-dialog p { font-size: 14px; line-height: 1.6; color: #b8b8b8; }
.capped-phone-dialog > p { margin-top: 12px; }
.capped-phone-dialog strong { color: #eee; }
.capped-phone-dialog label { display: block; margin: 24px 0 8px; font-size: 14px; }
.capped-phone-dialog input { box-sizing: border-box; width: 100%; padding: 13px 12px; border: 1px solid #606060; border-radius: 8px; color: #fff; background: #242424; font: inherit; font-size: 18px; }
.capped-phone-dialog #cappedOtpCode { letter-spacing: .25em; }
.capped-phone-dialog .capped-phone-note { margin: 8px 0; font-size: 14px; }
.capped-phone-dialog form > button { width: 100%; margin-top: 12px; padding: 13px; background: #e66b15; color: white; border-color: #e66b15; font-weight: 700; }
.capped-phone-secondary { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.capped-phone-secondary button { font-size: 14px; }
.capped-phone-dialog #cappedPhoneStatus { color: #fbbf24; min-height: 1.6em; margin-bottom: 0; }
.capped-phone-dialog :disabled, .capped-auth-actions :disabled { opacity: .5; cursor: default; }
.capped-phone-dialog :focus-visible { outline: 2px solid #7dd3fc; outline-offset: 3px; }
.capped-positions-only .journey-screen,
.capped-positions-only .journey-toolbar [data-go-screen],
.capped-positions-only [data-close-portfolio] { display: none !important; }
.capped-positions-intro { margin: 24px auto; max-width: 980px; color: #ddd; line-height: 1.6; }
.capped-positions-intro h1 { font-size: 28px; }
.capped-positions-intro a { color: #fb923c; }
.capped-positions-intro #cappedPositionsMode { color: #fbbf24; }
.capped-positions-only .portfolio-drawer { position: static; }
.capped-positions-only .portfolio-sheet { position: static; width: 100%; max-width: 980px; max-height: none; margin: 24px auto; transform: none; box-shadow: none; }

/* Market children become flex items on mobile; keep the narrative in order. */
.capped-product .capped-payoff { min-width: 0; max-width: 100%; box-sizing: border-box; }
.capped-table-wrap { min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.capped-scenarios { table-layout: auto; }
.capped-table-hint { display: none; }
@media (max-width: 720px) {
  .capped-product .journey-app .detail-layout .market-header { order: 1; }
  .capped-product .journey-app .detail-layout .market-context { order: 2; }
  .capped-product .journey-app .detail-layout .ticket { order: 3; }
  .capped-product .journey-app .detail-layout .price-chart-section { order: 4; }
  .capped-product .journey-app .detail-layout .capped-chart-legend { order: 5; margin: -8px 0 0; }
  .capped-product .journey-app .detail-layout .capped-payoff { order: 6; margin: 0; }
  .capped-product .journey-app .detail-layout .company-overview { order: 7; }
  .capped-scenarios { min-width: 440px; }
  .capped-table-hint { display: block; }
}
