/* TradingHub v424 — mobile semantic contrast pass.
   Scope: selected derivatives/live/calculator/research pages only, <=760px.
   Purpose: semantic states and signed values must not collapse into the same gray.
   Desktop is intentionally untouched. */
@media (max-width:760px){
  body.th-semantic-v424{
    --th-sem-live:color-mix(in srgb,var(--pulse) 78%,#dfffee);
    --th-sem-negative:color-mix(in srgb,var(--danger) 82%,#ffd9dc);
    --th-sem-warning:color-mix(in srgb,var(--signal) 82%,#fff1c7);
    --th-sem-neutral:#b7bec5;
    --th-sem-quiet:#818991;
  }

  /* Shared semantic tokens. Keep color meaningful rather than decorative. */
  body.th-semantic-v424 .is-up,
  body.th-semantic-v424 .pos{color:var(--th-sem-live)!important}
  body.th-semantic-v424 .is-down,
  body.th-semantic-v424 .neg{color:var(--th-sem-negative)!important}
  body.th-semantic-v424 .is-signal{color:var(--th-sem-warning)!important}

  /* Public live workspace status: color both dot and text. */
  body.th-semantic-v424 .deriv-status[data-state="live"]{
    color:var(--th-sem-live);
    border-color:color-mix(in srgb,var(--pulse) 30%,var(--line));
    background:color-mix(in srgb,var(--pulse) 5%,var(--void));
  }
  body.th-semantic-v424 .deriv-status[data-state="partial"],
  body.th-semantic-v424 .deriv-status[data-state="loading"]{
    color:var(--th-sem-warning);
    border-color:color-mix(in srgb,var(--signal) 28%,var(--line));
    background:color-mix(in srgb,var(--signal) 4%,var(--void));
  }
  body.th-semantic-v424 .deriv-status[data-state="error"]{
    color:var(--th-sem-negative);
    border-color:color-mix(in srgb,var(--danger) 30%,var(--line));
    background:color-mix(in srgb,var(--danger) 5%,var(--void));
  }

  /* v421 turns desktop tables into mobile metric grids. Restore semantic tones
     after that high-specificity transformation instead of letting every value
     inherit the generic ink color. */
  body.th-semantic-v424 .deriv-live[data-deriv-view] .deriv-table tbody td.is-up,
  body.th-semantic-v424 .deriv-live[data-deriv-view] .deriv-table tbody td.status-live{
    color:var(--th-sem-live)!important;
    font-weight:700;
  }
  body.th-semantic-v424 .deriv-live[data-deriv-view] .deriv-table tbody td.is-down{
    color:var(--th-sem-negative)!important;
    font-weight:700;
  }
  body.th-semantic-v424 .deriv-live[data-deriv-view] .deriv-table tbody td.status-stale,
  body.th-semantic-v424 .deriv-live[data-deriv-view] .deriv-table tbody td.status-loading{
    color:var(--th-sem-warning)!important;
    font-weight:650;
  }
  body.th-semantic-v424 .deriv-live[data-deriv-view] .deriv-table tbody td.status-unavailable{
    color:var(--th-sem-neutral)!important;
    font-weight:650;
  }
  body.th-semantic-v424 .deriv-live[data-deriv-view] .deriv-table tbody td.is-muted{
    color:var(--th-sem-quiet)!important;
  }
  body.th-semantic-v424 .deriv-live[data-deriv-view] .deriv-table tbody td::before{
    color:#747d85;
  }
  body.th-semantic-v424 .deriv-live[data-deriv-view="oi"] .deriv-table tbody td:first-child,
  body.th-semantic-v424 .deriv-live[data-deriv-view="funding"] .deriv-table tbody td:first-child{
    color:#e0e4e7!important;
  }

  /* Signed funding is semantic in the venue bars too. */
  body.th-semantic-v424 .deriv-bar.is-up .deriv-bar__row strong{color:var(--th-sem-live)}
  body.th-semantic-v424 .deriv-bar.is-down .deriv-bar__row strong{color:var(--th-sem-negative)}
  body.th-semantic-v424 .deriv-bar.is-up .deriv-bar__fill{background:var(--th-sem-live)}
  body.th-semantic-v424 .deriv-bar.is-down .deriv-bar__fill{background:var(--th-sem-negative)}
  body.th-semantic-v424 .deriv-summary strong.is-up{color:var(--th-sem-live)}
  body.th-semantic-v424 .deriv-summary strong.is-down{color:var(--th-sem-negative)}

  /* Liquidation direction remains readable in dense event rows. */
  body.th-semantic-v424 .deriv-live[data-deriv-view="liquidations"] .deriv-liq-side--long{
    color:var(--th-sem-negative)!important;
    font-weight:750;
  }
  body.th-semantic-v424 .deriv-live[data-deriv-view="liquidations"] .deriv-liq-side--short{
    color:var(--th-sem-live)!important;
    font-weight:750;
  }

  /* Feed health: do not rely on a 5px dot alone. */
  body.th-semantic-v424 .deriv-feed-pill[data-feed-state="connected"]{
    color:var(--th-sem-live);
    border-color:color-mix(in srgb,var(--pulse) 24%,var(--line-soft));
  }
  body.th-semantic-v424 .deriv-feed-pill[data-feed-state="connecting"]{
    color:var(--th-sem-warning);
    border-color:color-mix(in srgb,var(--signal) 24%,var(--line-soft));
  }
  body.th-semantic-v424 .deriv-feed-pill[data-feed-state="disconnected"]{
    color:var(--th-sem-negative);
    border-color:color-mix(in srgb,var(--danger) 24%,var(--line-soft));
  }

  /* Liquidation map status and modeled long/short zones. */
  body.th-semantic-v424 .liqmap-card[data-status="live"] #liqmap-status{color:var(--th-sem-live)}
  body.th-semantic-v424 .liqmap-card[data-status="partial"] #liqmap-status,
  body.th-semantic-v424 .liqmap-card[data-status="loading"] #liqmap-status,
  body.th-semantic-v424 .liqmap-card[data-status="initializing"] #liqmap-status,
  body.th-semantic-v424 .liqmap-card[data-status="reconnecting"] #liqmap-status{color:var(--th-sem-warning)}
  body.th-semantic-v424 .liqmap-card[data-status="error"] #liqmap-status,
  body.th-semantic-v424 .liqmap-card[data-status="unavailable"] #liqmap-status,
  body.th-semantic-v424 .liqmap-card[data-status="nodata"] #liqmap-status{color:var(--th-sem-negative)}
  body.th-semantic-v424 .liqmap-summary-zone--above strong{color:var(--th-sem-live)}
  body.th-semantic-v424 .liqmap-summary-zone--below strong{color:var(--th-sem-negative)}
  body.th-semantic-v424 #liqmap-stat-bias[data-bias="up"],
  body.th-semantic-v424 #liqmap-stat-bias[data-bias="long"]{color:var(--th-sem-live)}
  body.th-semantic-v424 #liqmap-stat-bias[data-bias="down"],
  body.th-semantic-v424 #liqmap-stat-bias[data-bias="short"]{color:var(--th-sem-negative)}
  body.th-semantic-v424 #liqmap-stat-bias[data-bias="flat"]{color:var(--th-sem-warning)}
  body.th-semantic-v424 .liqmap-validation{color:#aeb6be}
  body.th-semantic-v424 .liqmap-notice{color:var(--th-sem-warning)}

  /* Calculator output hierarchy. Values keep neutral ink unless the meaning is
     directional/risk-bearing; signed classes always take precedence. */
  body.th-semantic-v424.th-mobile-calculator .calc-result .rvalue,
  body.th-semantic-v424.th-mobile-calculator .growth-calculator .rvalue{
    color:#d8dde1;
    font-weight:600;
  }
  body.th-semantic-v424.th-mobile-calculator .calc-result .rvalue.big,
  body.th-semantic-v424.th-mobile-calculator .growth-calculator .rvalue.big{
    color:var(--th-sem-warning);
    font-weight:700;
  }
  body.th-semantic-v424.th-mobile-calculator .calc-result .rvalue.pos,
  body.th-semantic-v424.th-mobile-calculator .growth-calculator .rvalue.pos{color:var(--th-sem-live)!important}
  body.th-semantic-v424.th-mobile-calculator .calc-result .rvalue.neg,
  body.th-semantic-v424.th-mobile-calculator .growth-calculator .rvalue.neg{color:var(--th-sem-negative)!important}
  body.th-semantic-v424.th-mobile-calculator .calc-validation,
  body.th-semantic-v424.th-mobile-calculator .calc-hint.is-error{color:var(--th-sem-negative)!important}

  /* Page-specific calculator semantics where the value is not signed in code. */
  body.th-semantic-v424.th-page-position-size #size-out-risk{color:var(--th-sem-negative)}
  body.th-semantic-v424.th-page-position-size #size-out-units{color:var(--th-sem-warning)}
  body.th-semantic-v424.th-page-liquidation-price #liq-out-price{color:var(--th-sem-negative)}
  body.th-semantic-v424.th-page-liquidation-price #liq-out-dist{color:var(--th-sem-warning)}
  body.th-semantic-v424.th-page-liquidation-price #liq-out-dir{color:#d8dde1}
  body.th-semantic-v424.th-page-risk-reward [data-gc-output="risk"]{color:var(--th-sem-negative)}
  body.th-semantic-v424.th-page-risk-reward [data-gc-output="reward"],
  body.th-semantic-v424.th-page-risk-reward [data-gc-output="profit"]{color:var(--th-sem-live)}
  body.th-semantic-v424.th-page-risk-reward [data-gc-output="ratio"]{color:var(--th-sem-warning)}
  body.th-semantic-v424.th-page-effective-cost [data-gc-output="total"].neg,
  body.th-semantic-v424.th-page-effective-cost [data-gc-output="bps"].neg,
  body.th-semantic-v424.th-page-effective-cost [data-gc-output="fundingcost"].neg{color:var(--th-sem-negative)!important}
  body.th-semantic-v424.th-page-effective-cost [data-gc-output="total"].pos,
  body.th-semantic-v424.th-page-effective-cost [data-gc-output="bps"].pos,
  body.th-semantic-v424.th-page-effective-cost [data-gc-output="fundingcost"].pos{color:var(--th-sem-live)!important}

  /* Live badges and state lines. */
  body.th-semantic-v424 .seo-live-status[data-state="live"],
  body.th-semantic-v424 .etc-status.is-live{color:var(--th-sem-live)}
  body.th-semantic-v424 .seo-live-status[data-state="loading"],
  body.th-semantic-v424 .etc-status.is-loading,
  body.th-semantic-v424 .etc-status.is-partial{color:var(--th-sem-warning)}
  body.th-semantic-v424 .seo-live-status[data-state="unavailable"],
  body.th-semantic-v424 .seo-live-status[data-state="error"]{color:var(--th-sem-negative)}
  body.th-semantic-v424 #fc-live-tag[data-state="live"]{color:var(--th-sem-live)!important}
  body.th-semantic-v424 #fc-live-tag[data-state="loading"]{color:var(--th-sem-warning)!important}
  body.th-semantic-v424 #fc-live-tag[data-state="stale"]{color:var(--th-sem-warning)!important}

  /* Static hub/research metadata gets the same semantic vocabulary. */
  body.th-semantic-v424 .seo-card .meta[data-tone="live"]{color:var(--th-sem-live)}
  body.th-semantic-v424 .seo-card .meta[data-tone="modeled"]{color:var(--th-sem-warning)}
  body.th-semantic-v424 .seo-card .meta[data-tone="neutral"]{color:#858d95}

  /* Slight value/label separation improves scanning without adding borders. */
  body.th-semantic-v424 .deriv-table tbody td,
  body.th-semantic-v424 .result-row .rvalue,
  body.th-semantic-v424 .growth-calculator .rvalue{font-variant-numeric:tabular-nums}
  body.th-semantic-v424 .result-row .rlabel,
  body.th-semantic-v424 .growth-calculator .rlabel{color:#7d858d}
}
