/* Shared trade logs only. Important-layer rules beat old embedded 10px rules,
   regardless of selector specificity. Option chains, Greeks and Rule List stay scoped out. */
@layer ckTradeLogReadability {
  :root{--trade-value-size:22px;--trade-detail-size:14px;--trade-header-size:14px}
  :where(.pnl-table,.detailed-paper-table,.compact-paper-table,.nifty-spot-trade-table,.sic-position-table,.analysis-pnl table,[data-managed-trades] table,[data-repeat-target-log] table,[data-replay-pnl-movement] table,#marketLogTable table,table:has(>tbody:is(#managedRows,#positionRows,#orderRows,#historyRows,#analysisPaperTrades))){
    width:max-content!important;min-width:100%!important;max-width:none!important;table-layout:auto!important;
  }
  :where(.pnl-table,.detailed-paper-table,.compact-paper-table,.nifty-spot-trade-table,.sic-position-table,.analysis-pnl table,[data-managed-trades] table,[data-repeat-target-log] table,[data-replay-pnl-movement] table,#marketLogTable table,table:has(>tbody:is(#managedRows,#positionRows,#orderRows,#historyRows,#analysisPaperTrades))) :is(td,td *){
    font-size:var(--trade-value-size)!important;font-weight:700!important;line-height:1.35!important;font-variant-numeric:tabular-nums!important;
  }
  :where(.pnl-table,.detailed-paper-table,.compact-paper-table,.nifty-spot-trade-table,.sic-position-table,.analysis-pnl table,[data-managed-trades] table,[data-repeat-target-log] table,[data-replay-pnl-movement] table,#marketLogTable table,table:has(>tbody:is(#managedRows,#positionRows,#orderRows,#historyRows,#analysisPaperTrades))) :is(th,td){
    height:auto!important;min-width:96px!important;padding:8px 12px!important;vertical-align:middle!important;white-space:nowrap!important;word-break:normal!important;overflow:visible!important;text-overflow:clip!important;
  }
  :where(.pnl-table,.detailed-paper-table,.compact-paper-table,.nifty-spot-trade-table,.sic-position-table,.analysis-pnl table,[data-managed-trades] table,[data-repeat-target-log] table,[data-replay-pnl-movement] table,#marketLogTable table,table:has(>tbody:is(#managedRows,#positionRows,#orderRows,#historyRows,#analysisPaperTrades))) :is(th,th *){
    font-size:var(--trade-header-size)!important;line-height:1.3!important;font-weight:700!important;
  }
  :where(.pnl-table,.detailed-paper-table,.compact-paper-table,.nifty-spot-trade-table,.sic-position-table,.analysis-pnl table,[data-managed-trades] table,[data-repeat-target-log] table,[data-replay-pnl-movement] table,#marketLogTable table,table:has(>tbody:is(#managedRows,#positionRows,#orderRows,#historyRows,#analysisPaperTrades))) :is(small,small *,button,button *){
    font-size:var(--trade-detail-size)!important;line-height:1.4!important;font-weight:400!important;
  }
  :where(.pnl-table,.detailed-paper-table,.compact-paper-table,.nifty-spot-trade-table,.sic-position-table,.analysis-pnl table,[data-managed-trades] table,[data-repeat-target-log] table,[data-replay-pnl-movement] table,#marketLogTable table) small{
    display:block!important;min-width:0!important;max-width:360px!important;white-space:normal!important;overflow-wrap:anywhere!important;
  }
  :where(.pnl-table,.detailed-paper-table,.compact-paper-table,.nifty-spot-trade-table,.sic-position-table,.analysis-pnl table,[data-managed-trades] table,[data-repeat-target-log] table,[data-replay-pnl-movement] table,#marketLogTable table) :is(input,select){font-size:18px!important;min-width:100px!important;min-height:36px!important}
  :is(.paper-reason,.paper-calculation,.paper-exit-reason,.compact-exit-detail,#analysisPaperTrades td:nth-child(5),#analysisPaperTrades td:nth-child(10),#homeAnalysisPaperBody td:nth-child(4),#homeAnalysisPaperBody td:nth-child(5),#autoDhanOrderBody td:last-child,[data-replay-pnl-movement] td:last-child){
    font-size:var(--trade-detail-size)!important;font-weight:400!important;white-space:normal!important;min-width:240px!important;max-width:420px!important;overflow-wrap:anywhere!important;
  }
  :where(.pnl-table,.detailed-paper-table,.compact-paper-table) :is(.trade-state,.trade-result,.setup-badge){font-size:16px!important;line-height:1.4!important}
  :is(#viewerRule1Log li,#logRows .log){font-size:16px!important;line-height:1.5!important}
  :is([data-movement-summary],#totalPnl,#compactOpenPnl,#sicPositionTotal,#sicBookedTotal,.replay-total strong,.replay-pnl-actions strong){font-size:24px!important;line-height:1.35!important}
}
