/* KOVLEON mobile registry cards. Only selected data registries are enhanced.
   Financial editors, KS forms, document previews and report tables remain tabular. */
@media screen and (max-width:768px){
  #mainApp .kv-mobile-registry-wrap{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow:visible!important;
    border:0!important;
    background:transparent!important;
  }
  #mainApp table.kv-mobile-registry{
    display:block!important;
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0!important;
    table-layout:auto!important;
    border:0!important;
    background:transparent!important;
    overflow:visible!important;
    white-space:normal!important;
  }
  #mainApp table.kv-mobile-registry > colgroup,
  #mainApp table.kv-mobile-registry > thead{display:none!important}
  #mainApp table.kv-mobile-registry > tbody{
    display:grid!important;
    grid-template-columns:minmax(0,1fr);
    gap:10px;
    width:100%;
    min-width:0;
  }
  #mainApp table.kv-mobile-registry > tbody > tr{
    display:grid!important;
    grid-template-columns:minmax(0,1fr);
    width:100%;
    min-width:0;
    box-sizing:border-box;
    padding:8px 13px;
    border:1px solid #dce4ed;
    border-radius:12px;
    background:#fff;
    box-shadow:0 2px 8px rgba(15,52,96,.05);
    overflow:visible;
  }
  #mainApp table.kv-mobile-registry > tbody > tr > td{
    display:grid!important;
    grid-template-columns:minmax(86px,34%) minmax(0,1fr);
    align-items:start!important;
    gap:10px;
    min-width:0!important;
    width:100%!important;
    height:auto!important;
    box-sizing:border-box;
    padding:10px 0!important;
    margin:0!important;
    border:0!important;
    border-bottom:1px solid #edf1f5!important;
    background:transparent!important;
    font-size:13px;
    line-height:1.45;
    text-align:left!important;
    vertical-align:top!important;
    overflow-wrap:anywhere;
    white-space:normal!important;
  }
  #mainApp table.kv-mobile-registry > tbody > tr > td:last-child{border-bottom:0!important}
  #mainApp table.kv-mobile-registry > tbody > tr > td::before{
    content:attr(data-kv-label);
    display:block;
    min-width:0;
    color:#667085;
    font-size:11px;
    line-height:1.4;
    font-weight:700;
    overflow-wrap:anywhere;
  }
  #mainApp table.kv-mobile-registry > tbody > tr > td > *{min-width:0;max-width:100%}
  #mainApp table.kv-mobile-registry > tbody > tr > td .btn,
  #mainApp table.kv-mobile-registry > tbody > tr > td .wh-row-action{max-width:100%;white-space:normal}
  #mainApp table.kv-mobile-registry > tbody > tr > td .kv-fast-edit{white-space:normal}
  #mainApp table.kv-mobile-registry > tbody > tr.kv-mobile-wide-row{
    display:block!important;
    padding:0;
    background:transparent;
    box-shadow:none;
    border:0;
  }
  #mainApp table.kv-mobile-registry > tbody > tr > td.kv-mobile-wide-cell{
    display:block!important;
    padding:12px!important;
    border:1px solid #dce4ed!important;
    border-radius:11px;
    background:#fff!important;
    text-align:left!important;
  }
  #mainApp table.kv-mobile-registry > tbody > tr > td.kv-mobile-wide-cell::before{display:none!important}
  #mainApp table.kv-mobile-registry > tbody > tr.loan-lender-detail-row:not(.show){display:none!important}
  #mainApp table.kv-mobile-registry > tbody > tr.loan-lender-detail-row.show{
    display:block!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  #mainApp table.kv-mobile-registry > tbody > tr.loan-lender-detail-row > td.kv-mobile-wide-cell{
    padding:0!important;
    border:0!important;
    background:transparent!important;
  }
  #mainApp .kv-mobile-registry .loan-lender-inner{
    min-width:0;
    width:100%;
    padding:7px 0 5px!important;
    overflow:visible!important;
  }
  #mainApp .kv-mobile-registry .loan-lender-inner table.kv-mobile-registry{min-width:0!important;border:0!important}
  #mainApp .kv-mobile-registry .kv-col-arrow{display:none!important}
  #mainApp .kv-mobile-registry .kv-col-select{grid-template-columns:minmax(86px,34%) minmax(0,1fr)!important}
  #mainApp .kv-mobile-registry tr.kv-record-row:focus-visible{
    outline:3px solid #84adff!important;
    outline-offset:2px!important;
  }
}


/* KOVLEON check history: tap anywhere on a record to open it;
   the report, official FNS extract and deletion actions stay independent. */
#counterpartyChecksCard .counterparty-check-open-row{cursor:pointer}
#counterpartyChecksCard .counterparty-check-open-row:hover > td{background:#f3f7fd}
#counterpartyChecksCard .counterparty-check-open-row:focus-visible{outline:3px solid #84adff;outline-offset:-3px}
#counterpartyChecksCard .counterparty-check-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
#counterpartyChecksCard .counterparty-check-actions .btn{margin:0;white-space:normal}
#counterpartyChecksCard .counterparty-check-open-hint{display:block;margin-top:5px;color:#667085;font-size:11px;line-height:1.35;font-weight:400}

@media screen and (max-width:768px){
  #mainApp #counterpartyChecksCard table.kv-mobile-registry > tbody > tr.counterparty-check-open-row > td.counterparty-check-actions-cell{
    display:block!important;
    grid-template-columns:none!important;
    width:100%!important;
    padding:12px 0 2px!important;
    border-top:1px solid #edf1f5!important;
    border-bottom:0!important;
  }
  #mainApp #counterpartyChecksCard table.kv-mobile-registry > tbody > tr.counterparty-check-open-row > td.counterparty-check-actions-cell::before{display:none!important}
  #mainApp #counterpartyChecksCard .counterparty-check-actions{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr));
    align-items:stretch;
    gap:8px;
    width:100%;
    min-width:0;
  }
  #mainApp #counterpartyChecksCard .counterparty-check-actions .btn{
    display:flex;
    align-items:center;
    justify-content:center;
    width:100%;
    min-width:0;
    max-width:100%;
    min-height:44px;
    padding:10px 8px;
    line-height:1.25;
    text-align:center;
    font-size:13px;
    overflow-wrap:anywhere;
    white-space:normal;
  }
  #mainApp #counterpartyChecksCard .counterparty-check-actions .btn-red{
    grid-column:1/-1;
    justify-self:end;
    width:min(130px,100%);
  }
  #mainApp #counterpartyChecksCard .counterparty-check-open-row:active{background:#f5f9ff}
  #mainApp #counterpartyChecksCard .counterparty-check-open-hint{color:#175cd3}
}


/* Keep the employee selection control in its own column, clear of multi-line names.
   These registry cards have a dedicated layout, not the generic labeled-row layout. */
@media screen and (max-width:768px){
  #mainApp .kv-registry-table-shell #employeesTable{
    display:block!important;
    box-sizing:border-box;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  #mainApp .kv-registry-table-shell #employeesTable > thead{display:none!important}
  #mainApp .kv-registry-table-shell #employeesTable > tbody{
    display:grid!important;
    grid-template-columns:minmax(0,1fr);
    gap:9px!important;
  }
  #mainApp #employeesTable > tbody > tr.kv-employee-record{
    display:grid!important;
    grid-template-columns:28px minmax(0,1fr) auto!important;
    grid-template-rows:auto auto auto!important;
    align-items:start!important;
    column-gap:12px!important;
    row-gap:4px!important;
    padding:13px 12px!important;
    min-width:0;
    box-sizing:border-box;
  }
  #mainApp #employeesTable > tbody > tr.kv-employee-record > td{
    display:block!important;
    min-width:0!important;
    width:auto!important;
    border:0!important;
    background:transparent!important;
    padding:0!important;
    text-align:left!important;
  }
  #mainApp #employeesTable > tbody > tr.kv-employee-record > td::before{
    content:none!important;
    display:none!important;
  }
  #mainApp #employeesTable > tbody > tr.kv-employee-record > td.kv-col-select{
    grid-column:1!important;
    grid-row:1/4!important;
    width:28px!important;
    min-width:28px!important;
    display:flex!important;
    align-items:flex-start!important;
    justify-content:center!important;
    padding-top:4px!important;
  }
  #mainApp #employeesTable .employee-row-check{
    box-sizing:border-box;
    display:block;
    flex:none;
    width:20px!important;
    height:20px!important;
    min-height:20px!important;
    margin:0!important;
    cursor:pointer;
  }
  #mainApp #employeesTable > tbody > tr.kv-employee-record > td.kv-col-primary{
    grid-column:2!important;
    grid-row:1!important;
    min-width:0!important;
  }
  #mainApp #employeesTable .kv-registry-name{
    display:block;
    min-width:0;
    white-space:normal;
    overflow-wrap:anywhere;
    line-height:1.35;
  }
  #mainApp #employeesTable > tbody > tr.kv-employee-record > td.kv-col-status{
    grid-column:3!important;
    grid-row:1!important;
    justify-self:end!important;
    align-self:start!important;
  }
  #mainApp #employeesTable > tbody > tr.kv-employee-record > td.kv-col-meta{
    grid-column:2/4!important;
    grid-row:2!important;
    color:#667085!important;
  }
  #mainApp #employeesTable > tbody > tr.kv-employee-record > td.kv-col-secondary{
    grid-column:2/4!important;
    grid-row:3!important;
    color:#667085!important;
  }
  #mainApp #employeesTable > tbody > tr.kv-employee-record > td.kv-col-arrow,
  #mainApp #employeesTable > tbody > tr.kv-employee-record > td.kv-col-org{
    display:none!important;
  }
}
