/*
 * The overview is a ranked ledger: one row per company, return columns aligned so the eye can
 * run down a scenario. Header and rows share one grid template; `.scenario-strip` uses
 * `display: contents` so its four return cells become columns of the row grid itself.
 */
.range-panel { margin-bottom: 22px; }
.company-grid { --ledger-columns: minmax(190px, 2fr) minmax(118px, 1fr) 104px repeat(4, minmax(72px, .8fr)); border-top: 2px solid var(--ink); }
.ledger-header, .card-open { display: grid; grid-template-columns: var(--ledger-columns); column-gap: 20px; align-items: center; }
.ledger-header { grid-template-rows: auto auto; padding: 10px 14px 9px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: var(--text-s); }
.ledger-header > span { grid-row: 2; }
.ledger-header > .ledger-header-group { grid-row: 1; grid-column: 4 / -1; text-align: right; padding: 0 8px 6px 0; margin-bottom: 6px; border-bottom: 1px solid var(--soft-line); color: var(--ink-2); font-weight: 550; }
.ledger-header > .ledger-header-price, .ledger-header > .ledger-header-return { text-align: right; }
.ledger-header > .ledger-header-return { padding-right: 8px; }
.ledger-header > .current { color: var(--ink); font-weight: 600; }
.company-card { min-width: 0; border-bottom: 1px solid var(--soft-line); }
.card-open { padding: 16px 14px; color: inherit; row-gap: 8px; transition: background 120ms ease; }
.card-open:hover, .card-open:focus-visible { color: inherit; background: var(--sunk); }
.card-open:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: var(--radius-control); }
.card-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.company-title { min-width: 0; }
.company-title h2 { margin: 0 0 3px; font-size: 15px; font-weight: 600; line-height: 1.25; color: var(--ink); }
.company-title > span { display: block; font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: .01em; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-quote { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.stock-price { display: block; font-size: var(--text-l); font-weight: 550; line-height: 1.15; }
.price-change { display: block; font-size: var(--text-s); font-weight: 500; }
.quote-warning { color: var(--warning); font-size: var(--text-s); }
.card-sparkline { color: var(--forest); }
.sparkline { display: block; width: 100px; height: 36px; }
/* The return figures are the page's one loud element: condensed, large and tabular. */
.scenario-strip { display: contents; }
.ledger-return { min-width: 0; text-align: right; display: flex; flex-direction: column; align-items: flex-end; padding: 6px 8px; border-radius: var(--radius-control); }
.ledger-return.current { background: var(--sunk); }
.card-open:hover .ledger-return.current, .card-open:focus-visible .ledger-return.current { background: #ebf0ec; }
.ledger-case { display: none; font-size: 11px; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
.ledger-return.current .ledger-case { color: var(--ink); font-weight: 600; }
.ledger-return strong { display: block; font-size: var(--text-2xl); font-weight: 450; font-stretch: 72%; line-height: 1.05; color: var(--ink-2); white-space: nowrap; }
.ledger-return.current strong { font-weight: 700; color: var(--ink); }
.ledger-return strong.meets-hurdle { color: var(--forest); }
.ledger-return strong.total-loss { font-size: var(--text-m); font-stretch: 100%; line-height: 1.3; min-height: 27.3px; display: inline-flex; align-items: center; }
.weighted-case { padding-left: 14px; border-left: 1px solid var(--soft-line); border-radius: 0 var(--radius-control) var(--radius-control) 0; }
.scenario-probability { display: inline-block; font-size: 11.5px; line-height: 1.35; font-weight: 500; color: var(--muted); }
.ledger-return .scenario-probability { display: block; margin-top: 4px; }
.ledger-return.current .scenario-probability { color: var(--ink-2); }
/* Keep Weighted (and any cell lacking a badge) on the exact same vertical baseline when siblings show probabilities. */
.scenario-strip:has(.scenario-probability) .ledger-return:not(:has(.scenario-probability))::after { content: '\00a0'; display: block; margin-top: 4px; font-size: 11.5px; line-height: 1.35; visibility: hidden; }
.return-case .scenario-probability { margin-left: 4px; }
.card-unavailable { grid-column: 4 / -1; color: var(--warning); font-size: var(--text-s); margin: 0; }
.ledger-note { margin: 12px 14px 0; color: var(--muted); font-size: var(--text-s); }
.news-panel { margin-top: 36px; border-top: 1px solid var(--line); }
.news-panel > summary { display: flex; align-items: center; gap: 10px; padding: 18px 0; font-size: var(--text-l); font-weight: 600; }
.news-panel > summary:hover { color: var(--forest); }
.news-panel > summary > span { color: var(--muted); font-size: 13px; font-weight: 500; }
.news-panel > summary > .icon { margin-left: auto; width: 15px; height: 15px; transform: rotate(90deg); color: var(--muted); }
.news-panel > summary::after { display: none; }
.news-panel[open] > summary > .icon { transform: rotate(-90deg); }
.news-context { font-size: var(--text-s); color: var(--muted); margin: 0 0 8px; }
.news-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 32px; }
.news-row { display: flex; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--soft-line); }
.news-title { font-size: 13px; line-height: 1.5; min-width: 0; }
.news-title small { display: block; margin-top: 4px; }
.news-row > .icon { width: 12px; height: 12px; color: var(--faint); margin-left: auto; }
.feed-errors { font-size: var(--text-s); color: var(--warning); margin: 15px 0; }
.feed-errors summary { display: flex; gap: 10px; }
.feed-errors p { font-size: var(--text-s); margin: 10px 0 0; }
@media (max-width: 1100px) {
  .company-grid { --ledger-columns: minmax(170px, 2fr) minmax(104px, 1fr) 84px repeat(4, minmax(60px, .8fr)); }
  .ledger-header, .card-open { column-gap: 14px; }
  .sparkline { width: 80px; }
  .ledger-return strong { font-size: var(--text-xl); }
  .ledger-return strong.total-loss { min-height: 22px; }
}
/* Narrow screens: the row stacks into identity + quote, then the four returns with their own labels. */
@media (max-width: 760px) {
  .ledger-header { display: none; }
  .company-grid { border-top-width: 1px; }
  .card-open { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 10px; row-gap: 14px; padding: 16px 4px; }
  .card-heading { grid-column: 1 / 3; }
  .card-sparkline { grid-column: 3; justify-self: end; }
  .card-quote { grid-column: 4; }
  .sparkline { width: 64px; height: 30px; }
  .ledger-return { padding: 5px; }
  .ledger-case { display: block; }
  .ledger-return strong { font-size: var(--text-xl); }
  .weighted-case { padding-left: 10px; }
  .card-unavailable { grid-column: 1 / -1; }
  .ledger-note { margin-left: 4px; margin-right: 4px; }
  .news-list { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .card-open { column-gap: 6px; }
  .card-heading { grid-column: 1 / 4; }
  .card-sparkline { display: none; }
  .ledger-return { padding: 4px 3px; }
  .ledger-return strong { font-size: 18px; }
  .ledger-return strong.total-loss { min-height: 19px; }
  .weighted-case { padding-left: 8px; }
}
@media (prefers-reduced-motion: reduce) { .card-open { transition: none; } }
