/* Shared mobile shell clearance and Profit & Earnings density correction. */
@media(max-width:780px){
  :root{--mobile-sticky-header-height:0px;--mobile-content-start-gap:12px}
  .workspace{scroll-padding-top:calc(var(--mobile-sticky-header-height) + env(safe-area-inset-top) + var(--mobile-content-start-gap))}
  .workspace-header{
    top:env(safe-area-inset-top)!important;
    isolation:isolate;
    margin-bottom:0!important;
  }
  .workspace-header+.view.active{
    position:relative;
    z-index:0;
    padding-top:var(--mobile-content-start-gap)!important;
    scroll-margin-top:calc(var(--mobile-sticky-header-height) + env(safe-area-inset-top) + var(--mobile-content-start-gap));
  }
  .workspace-header+.view.active>*:first-child{margin-top:0!important}

  #earningsView .profit-detail-list{gap:12px}
  #earningsView .profit-month-card{
    overflow:hidden;
    padding:14px!important;
    background:var(--card-bg)!important;
    color:var(--text-primary)!important;
    border-color:var(--border-default)!important;
  }
  #earningsView .profit-month-head{padding-bottom:11px;border-color:var(--border-subtle)!important}
  #earningsView .profit-month-result{gap:2px}
  #earningsView .profit-month-result span{color:var(--text-secondary)!important;font-size:12px}
  #earningsView .profit-month-result strong{font-size:24px;line-height:1.12}
  #earningsView .profit-formula-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:7px!important;
    margin:12px 0 9px!important;
  }
  #earningsView .profit-formula-grid>div{
    min-width:0;
    min-height:76px;
    padding:9px!important;
    border:1px solid var(--border-subtle);
    border-radius:10px;
    background:var(--metric-bg)!important;
    color:var(--text-primary)!important;
  }
  #earningsView .profit-formula-grid span{
    min-height:2.6em;
    color:var(--text-secondary)!important;
    font-size:10px;
    line-height:1.3;
  }
  #earningsView .profit-formula-grid strong{
    margin-top:5px;
    color:var(--text-primary)!important;
    font-size:13px;
    line-height:1.2;
    white-space:nowrap;
  }
  #earningsView .profit-equation{padding:9px 10px;font-size:11px;line-height:1.45}
  #earningsView .profit-detail-columns{gap:14px;margin-top:14px}
  #earningsView .profit-detail-section{gap:0}
  #earningsView .profit-detail-note{margin:5px 0 8px;line-height:1.4}
  #earningsView .profit-detail-row{
    align-items:baseline;
    gap:12px;
    padding:8px 0;
    border-bottom:1px solid var(--border-subtle)!important;
    background:transparent!important;
    color:var(--text-primary)!important;
  }
  #earningsView .profit-detail-row:last-child{border-bottom:0!important}
  #earningsView .profit-detail-row span{min-width:0;color:var(--text-secondary)!important;line-height:1.35}
  #earningsView .profit-detail-row strong{flex:0 0 auto;color:var(--text-primary)!important;font-size:12px;white-space:nowrap}
  #earningsView .profit-capital-note{border-color:var(--border-subtle)!important}
}

@media(max-width:360px){
  #earningsView .profit-formula-grid{gap:5px!important}
  #earningsView .profit-formula-grid>div{padding:8px 6px!important}
  #earningsView .profit-formula-grid strong{font-size:12px}
}
