/* SPONSORTRACK_R25J1_ACCESS_HISTORY_EVENT_LOG_ALIGNMENT_FIX
   Mobile Access History Security Event Log alignment + typography refinement. */

@media (max-width:760px){

  body.st-page-access-history .r23l-access-log-card{
    min-width:0!important;
    overflow:hidden!important;
  }

  body.st-page-access-history .r23l-access-log-card .table-wrap{
    min-width:0!important;
    overflow:visible!important;
    padding:0!important;
  }

  body.st-page-access-history .r23k-audit-table,
  body.st-page-access-history .r23k-audit-table tbody{
    display:block!important;
    width:100%!important;
    min-width:0!important;
  }

  body.st-page-access-history .r23k-audit-table thead{
    display:none!important;
  }

  /* One event = one mobile card. */
  body.st-page-access-history .r23k-audit-table tbody > tr{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    margin:0 0 12px!important;
    padding:16px 14px!important;
    box-sizing:border-box!important;
    border:1px solid #d8e3ec!important;
    border-radius:14px!important;
    background:#fafdff!important;
    box-shadow:0 4px 12px rgba(11,47,80,.035)!important;
  }

  body.st-page-access-history .r23k-audit-table tbody > tr:last-child{
    margin-bottom:0!important;
  }

  /* Deterministic LABEL | VALUE layout for every audit field. */
  body.st-page-access-history .r23k-audit-table tbody > tr > td{
    display:grid!important;
    grid-template-columns:92px minmax(0,1fr)!important;
    grid-auto-rows:auto!important;
    column-gap:12px!important;
    row-gap:3px!important;
    align-items:start!important;
    align-content:start!important;

    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    min-height:34px!important;
    height:auto!important;

    margin:0!important;
    padding:7px 0!important;
    box-sizing:border-box!important;
    border:0!important;
    background:transparent!important;

    color:#254b6f!important;
    font-size:13px!important;
    line-height:1.38!important;
    text-align:left!important;
    text-indent:0!important;
    vertical-align:top!important;
    overflow:visible!important;
  }

  /* All labels use one size and one exact left edge. */
  body.st-page-access-history .r23k-audit-table tbody > tr > td::before{
    content:attr(data-label)!important;
    display:block!important;

    grid-column:1!important;
    grid-row:1 / span 5!important;
    justify-self:start!important;
    align-self:start!important;

    width:92px!important;
    min-width:92px!important;
    max-width:92px!important;

    margin:1px 0 0!important;
    padding:0!important;
    transform:none!important;
    translate:none!important;

    color:#75879a!important;
    font-family:inherit!important;
    font-size:9px!important;
    line-height:1.25!important;
    font-weight:900!important;
    letter-spacing:.075em!important;
    text-transform:uppercase!important;
    text-align:left!important;
    text-indent:0!important;
    white-space:normal!important;
  }

  /* Lock all actual field content to the same second column. */
  body.st-page-access-history .r23k-audit-table tbody > tr > td > *{
    grid-column:2!important;
    justify-self:start!important;
    min-width:0!important;
    max-width:100%!important;
    margin-left:0!important;
    margin-right:0!important;
    padding-left:0!important;
    text-indent:0!important;
    box-sizing:border-box!important;
  }

  /* Time: strong date/time + secondary PHT line. */
  body.st-page-access-history .r23k-audit-table td.r23k-time > strong{
    display:block!important;
    margin:0!important;
    color:#103b64!important;
    font-size:13px!important;
    line-height:1.35!important;
    font-weight:800!important;
    overflow-wrap:anywhere!important;
  }

  body.st-page-access-history .r23k-audit-table td.r23k-time > small{
    display:block!important;
    margin:3px 0 0!important;
    color:#7a8c9f!important;
    font-size:12px!important;
    line-height:1.4!important;
    font-weight:500!important;
  }

  /* Event badge aligned with ordinary values. */
  body.st-page-access-history .r23k-audit-table td[data-label="Event"] .r23k-event-badge{
    grid-column:2!important;
    justify-self:start!important;
    width:auto!important;
    max-width:100%!important;
    min-height:27px!important;
    margin:0!important;
    padding:5px 10px!important;
    box-sizing:border-box!important;
    font-size:10px!important;
    line-height:1.15!important;
    font-weight:800!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }

  /* Actor / Target / Detail / IP use a single, consistent value scale. */
  body.st-page-access-history .r23k-audit-table td[data-label="Actor"],
  body.st-page-access-history .r23k-audit-table td[data-label="Target"],
  body.st-page-access-history .r23k-audit-table td[data-label="Detail"],
  body.st-page-access-history .r23k-audit-table td[data-label="IP"]{
    color:#254b6f!important;
    font-family:inherit!important;
    font-size:13px!important;
    line-height:1.42!important;
    font-weight:500!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
  }

  body.st-page-access-history .r23k-audit-table td[data-label="Actor"],
  body.st-page-access-history .r23k-audit-table td[data-label="IP"]{
    color:#103b64!important;
    font-weight:700!important;
  }

  /* Detail often contains longer audit descriptions. */
  body.st-page-access-history .r23k-audit-table td[data-label="Detail"]{
    padding-top:9px!important;
    padding-bottom:9px!important;
  }

  /* Empty result row. */
  body.st-page-access-history .r23k-audit-table td[colspan]{
    display:block!important;
    width:100%!important;
    padding:24px 12px!important;
    min-height:0!important;
    text-align:center!important;
    font-size:13px!important;
  }

  body.st-page-access-history .r23k-audit-table td[colspan]::before{
    display:none!important;
    content:none!important;
  }

  /* Keep log header/export clean on mobile. */
  body.st-page-access-history .r23k-access-summary{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:10px!important;
    align-items:start!important;
  }

  body.st-page-access-history .r23k-access-summary > *{
    min-width:0!important;
  }

  body.st-page-access-history .r23k-access-summary .btn{
    width:100%!important;
    justify-content:center!important;
    text-align:center!important;
  }
}

@media (max-width:390px){
  body.st-page-access-history .r23k-audit-table tbody > tr{
    padding:14px 12px!important;
  }

  body.st-page-access-history .r23k-audit-table tbody > tr > td{
    grid-template-columns:82px minmax(0,1fr)!important;
    column-gap:10px!important;
    font-size:12.5px!important;
  }

  body.st-page-access-history .r23k-audit-table tbody > tr > td::before{
    width:82px!important;
    min-width:82px!important;
    max-width:82px!important;
    font-size:8.5px!important;
  }

  body.st-page-access-history .r23k-audit-table td.r23k-time > strong{
    font-size:12.5px!important;
  }

  body.st-page-access-history .r23k-audit-table td[data-label="Actor"],
  body.st-page-access-history .r23k-audit-table td[data-label="Target"],
  body.st-page-access-history .r23k-audit-table td[data-label="Detail"],
  body.st-page-access-history .r23k-audit-table td[data-label="IP"]{
    font-size:12.5px!important;
  }
}
