/* Compact valuation view; charts start alongside the left-column title. */
#us-stock-grid:has(>.liquidity-card)>.earnings-card{display:flex;flex-direction:column;min-height:254px;padding:12px 12px 9px}
.earnings-heading,.earnings-title-line{display:flex;align-items:center;gap:4px;min-width:0}
.earnings-heading{margin-bottom:2px}
.earnings-heading h3{font-size:10px;line-height:1.5;margin:0;white-space:nowrap}
.earnings-heading .yield-info-button{width:12px;height:12px;font-size:8px;flex-shrink:0}
.earnings-heading .instrument-switch{gap:3px}
.earnings-heading .equity-switch-hint{width:12px;height:12px;font-size:10px}
.valuation-card .quote-heading{display:flex;align-items:center;gap:5px}
.earnings-body{display:grid;grid-template-columns:136px minmax(0,1fr);gap:8px;flex:1;min-height:0}
.earnings-readings{position:relative;display:flex;flex-direction:column;gap:4px;min-width:0;border-right:1px solid var(--line);padding-right:8px}
.earnings-metric{background:#f6f8fc;border-radius:4px;padding:4px 6px;display:flex;flex-direction:column;gap:2px;cursor:help}
.earnings-metric-head,.earnings-metric-values,.earnings-metric-foot{display:flex;align-items:center;justify-content:space-between;gap:3px}
.earnings-metric-head strong{font-size:8px;font-weight:600;white-space:nowrap}
.earnings-metric-head strong small{font-size:6px;font-weight:400;color:var(--muted);margin-left:2px}
.earnings-metric-head>span{font-size:7px;color:var(--muted);white-space:nowrap}
.earnings-value{font-family:var(--numeric);font-size:18px;line-height:1.15;letter-spacing:-.45px;white-space:nowrap;color:var(--ink)}
.earnings-value small{font-size:10px;margin-right:1px;letter-spacing:0;font-weight:400}
.earnings-percentile{font-family:var(--numeric);font-size:9px;font-weight:600;white-space:nowrap}
.earnings-change{font-family:var(--numeric);font-size:8px;white-space:nowrap}
.earnings-change small{font-size:7px;color:var(--muted);margin-left:2px}
.earnings-metric-values{column-gap:6px}
.earnings-value,.earnings-percentile{flex-shrink:0}
.earnings-readings .quote-bottom{margin-top:auto;padding-top:2px}
.earnings-readings .quote-update{gap:3px;flex-wrap:wrap;font-size:7px}
.earnings-readings .data-status{font-size:7px;padding:2px 3px}
.earnings-readings .source-trigger{font-size:8px;margin-top:4px;padding-top:4px}
.earnings-readings .chart-tooltip{font-size:8px!important;padding:4px 5px!important;line-height:1.4!important}
.earnings-readings .chart-tooltip .rate-label{font-size:7px}
.earnings-readings .chart-tooltip .rate-value{font-size:9px}
.earnings-chart-block{align-self:stretch;justify-content:flex-start;display:flex;flex-direction:column;min-width:0;min-height:0;gap:3px}
.earnings-attribution-heading{display:flex;justify-content:center;align-items:center;gap:5px;flex-wrap:wrap;text-align:center;font-size:9px}
.earnings-attribution-heading strong{font-weight:600}
.earnings-attribution-heading time{font-size:7px;color:var(--muted)}
.earnings-attribution-heading strong span{color:var(--muted-strong);font-size:8px}
.earnings-attribution{display:grid;grid-template-columns:1fr 1fr .9fr 8px 1.55fr;gap:2px;align-items:start;margin-bottom:2px}
.earnings-factor{min-width:0;text-align:center;display:flex;flex-direction:column;gap:1px}
.earnings-factor-plot{height:28px;position:relative}
.earnings-factor-baseline{position:absolute;left:0;right:0;border-top:1px solid #dde6f2}
.earnings-factor-connector{position:absolute;left:85%;width:calc(30% + 2px);border-top:1px solid #cbd7e8;z-index:1}
.earnings-factor-value{display:block;color:var(--factor-color);font-family:var(--numeric);font-size:11px;line-height:1.3;padding-top:1px;white-space:nowrap}
.earnings-factor-bar{position:absolute;left:15%;right:15%;background:var(--factor-color)}
.earnings-factor-label{font-size:6px;font-weight:500;white-space:nowrap;color:var(--muted-strong);line-height:1.4}
.earnings-equals{font-size:12px;color:var(--muted-strong);align-self:center}
.earnings-legend{font-size:7px;gap:3px 7px;margin:0;padding-top:4px;border-top:1px solid var(--line);min-height:0;flex-wrap:wrap}
.earnings-legend i{width:10px}
.earnings-legend small{font-size:7px;color:var(--muted)}
.earnings-chart-block .chart-quote{flex:1;min-height:85px;height:0}
.earnings-chart-block .chart-quote>svg{position:absolute;inset:0}
#us-stock-grid .earnings-card .chart-range-controls{min-height:0;flex-shrink:0}
.earnings-card .chart-range-toolbar{gap:2px}
.earnings-card .chart-range-presets{gap:0}
.earnings-card .chart-range-presets button{padding:2px}
.earnings-card .chart-range-dates{font-size:6px}
@media(min-width:1680px){#us-stock-grid:has(>.liquidity-card){grid-template-columns:minmax(0,1.1fr) minmax(0,1.15fr) 405.6px var(--us-compact-width) var(--country-side-width)}}
@media(max-width:640px){.earnings-body{grid-template-columns:128px minmax(0,1fr)}.earnings-heading h3{font-size:10px}.earnings-chart-block .chart-quote{min-height:105px}}
@media(max-width:374px){
  .earnings-body{grid-template-columns:116px minmax(0,1fr);gap:6px}
  .earnings-readings{padding-right:5px}
  .earnings-heading h3{font-size:9px}
  .earnings-title-line{gap:2px}
  .earnings-value{font-size:16px}
  .earnings-percentile{font-size:8px}
  .earnings-factor-value{font-size:10px}
  .earnings-factor-label{white-space:normal;overflow-wrap:anywhere}
  .earnings-card .chart-range-toolbar{flex-wrap:wrap}
  .earnings-card .chart-range-dates{width:100%;margin-left:0;text-align:right}
}

/* A fixed reading order keeps dates and ranks together at every card width. */
#us-stock-grid:has(>.liquidity-card)>.valuation-card{display:flex;flex-direction:column;min-height:286px;padding:12px 12px 9px}
#sp500-forward-pe-card .quote-information{flex:1;gap:8px;min-width:0}
#sp500-forward-pe-card .quote-heading{display:flex;flex-direction:column;align-items:flex-start;gap:3px}
#sp500-forward-pe-card .quote-heading h3{margin:0}
#sp500-forward-pe-card .valuation-proxy-label{font-size:8px;line-height:1.4;margin:0;white-space:normal}
.valuation-quadrants{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:8px;flex:1;min-height:0}
.valuation-quadrants>.valuation-metric{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;min-width:0;margin:0;padding:8px;background:#f4f7fc;border:1px solid var(--line);border-radius:4px;cursor:help}
.valuation-absolute{display:flex;flex-direction:column;gap:3px;min-width:0}
.valuation-quadrants .valuation-metric-name{font-size:10px;line-height:1.4;overflow-wrap:anywhere}
.valuation-quadrants strong.valuation-metric-value{font-size:22px;line-height:1.2;text-align:left;letter-spacing:-.5px}
.valuation-quadrants .valuation-observation{font-size:8px;line-height:1.4;color:var(--muted)}
.valuation-rank{display:flex;flex-direction:column;align-items:flex-end;justify-content:center;gap:5px;min-width:0;padding-left:8px;border-left:1px solid #e0e7f2}
.valuation-quadrants .valuation-percentile-label{font-size:8px;line-height:1.4;color:var(--muted-strong);white-space:nowrap}
.valuation-quadrants strong.valuation-percentile{font-size:22px;line-height:1.2;letter-spacing:-.4px;text-align:right;color:var(--muted-strong)}
.valuation-quadrants strong.valuation-risk{color:#b96d73}
#sp500-forward-pe-card .quote-bottom{margin-top:0}
@media(max-width:374px){
  .valuation-quadrants>.valuation-metric{padding:7px 6px;gap:5px}
  .valuation-rank{padding-left:5px}
  .valuation-quadrants strong.valuation-metric-value,.valuation-quadrants strong.valuation-percentile{font-size:20px}
  .valuation-quadrants .valuation-percentile-label{font-size:7px}
}
/* Keep both valuation views equally tall when they occupy separate mobile rows. */
@media(max-width:640px){
  #us-stock-grid:has(>.liquidity-card)>:is(.earnings-card,.valuation-card){min-height:278px}
}
@media(max-width:374px){
  #us-stock-grid:has(>.liquidity-card)>:is(.earnings-card,.valuation-card){min-height:310px}
}

/* Keep the proxy disclosure and observation dates readable in the narrow metric column. */
.earnings-heading{flex-direction:column;align-items:flex-start}
.earnings-title-line{width:100%}
.earnings-heading h3{white-space:normal;flex:1;min-width:0}
.earnings-heading .valuation-proxy-label{font-size:8px;margin-top:0;white-space:nowrap}
.earnings-metric-foot{flex-wrap:wrap}
.earnings-observation{font-size:7px;margin-left:auto}

.earnings-metric-foot>.percentile-position-bar{flex-basis:100%;margin:4px 0}
.valuation-quadrants>.valuation-metric{row-gap:4px;grid-template-rows:1fr auto}
.valuation-metric>.percentile-position-bar{grid-column:1/-1;margin:4px 0}

/* Stretch to the shared row height, including after disclosure rows are removed. */
#us-stock-grid:has(>.liquidity-card)>.earnings-card{align-self:stretch}
.earnings-readings .source-date-trigger{font-size:7px}
