@media screen {
  #custody-box { min-width:0; border:1px solid #38516d; border-radius:14px; padding:18px; background:#15253a; color:#eef4fb; margin:20px 0; }
  #custody-box legend { background:#132238; border:1px solid #668432; color:#c2ff51; font-size:18px; font-weight:700; border-radius:9px; padding:6px 20px; }
  #custody-box .muted { color:#c0ccda; line-height:1.9; }
  #custody-box .custody-heading { display:flex; gap:12px; align-items:center; justify-content:space-between; flex-wrap:wrap; }
  #custody-box .custody-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
  #custody-box label { display:flex; flex-direction:column; gap:5px; color:#edf4fa; }
  #custody-box input,#custody-box select { width:100%; box-sizing:border-box; background:#0c1b2c!important; border:1px solid #57708a!important; color:#fff!important; color-scheme:dark; padding:10px; border-radius:7px; min-width:0; font:inherit; }
  #custody-box input:focus,#custody-box select:focus { outline:2px solid #c2ff51; outline-offset:1px; }
  #custody-box .custody-scroll { overflow-x:auto; margin-top:15px; }
  #custody-box table { width:100%; min-width:930px; font-size:12px; border-collapse:collapse; }
  #custody-box th { background:#0b1829!important; color:#c2ff51!important; }
  #custody-box td { background:#192e45!important; color:#fff!important; overflow-wrap:anywhere; max-width:190px; }
  #custody-box th,#custody-box td { border:1px solid #3c5570; padding:9px; text-align:start; }
  #custody-box .custody-status { display:inline-block; border-radius:6px; padding:4px 7px; font-weight:700; white-space:nowrap; }
  #custody-box .custody-status.active { background:#c2ff51; color:#152207; }
  #custody-box .custody-status.returned { background:#29496a; color:#e8f5ff; }
  #custody-box .custody-message { color:#c2ff51; }
  #custody-box .error { background:#ffe5e5; color:#8b1010; padding:8px; border-radius:6px; }
  #custody-box [hidden] { display:none!important; }
  @media(max-width:700px) { #custody-box{padding:12px} #custody-box .custody-grid{grid-template-columns:1fr 1fr} }
  @media(max-width:440px) { #custody-box .custody-grid{grid-template-columns:1fr} }
}
/* Existing form themes use important colors. Keep this panel self-contained. */
@media screen {
  #ov #eform #custody-box { background:#15253a!important; color:#eef4fb!important; border:1px solid #38516d!important; }
  #ov #eform #custody-box legend { background:#132238!important; color:#c2ff51!important; border-color:#668432!important; }
  #ov #eform #custody-box label,#ov #eform #custody-box strong { color:#eef4fb!important; }
  #ov #eform #custody-box .muted { color:#c0ccda!important; }
  #ov #eform #custody-box input,#ov #eform #custody-box select { color:#fff!important; -webkit-text-fill-color:#fff!important; background:#0c1b2c!important; }
  #ov #eform #custody-box .custody-message { color:#c2ff51!important; }
  #ov #eform #custody-box .error { color:#8b1010!important; }
}
@media screen {
  #ov #eform #custody-box .dmy-ov { color:#f3f8ff!important; -webkit-text-fill-color:#f3f8ff!important; }
  #ov #eform #custody-box input[type="date"].dmy-in { color:transparent!important; -webkit-text-fill-color:transparent!important; }
  #custody-box table { min-width:0; table-layout:fixed; font-size:11px; }
  #custody-box th,#custody-box td { padding:7px 4px; }
  #custody-box th:nth-child(1) { width:12%; }
  #custody-box th:nth-child(2) { width:7%; }
  #custody-box th:nth-child(3) { width:5%; }
  #custody-box th:nth-child(4) { width:12%; }
  #custody-box th:nth-child(5) { width:13%; }
  #custody-box th:nth-child(6),#custody-box th:nth-child(7) { width:11%; }
  #custody-box th:nth-child(8) { width:13%; }
  #custody-box th:nth-child(9) { width:16%; }
  #custody-box .custody-status { white-space:normal; }
  #custody-box td .btn { margin:3px 0!important; min-width:0!important; max-width:100%; padding:5px 8px!important; font-size:11px!important; white-space:normal; }
  @media(max-width:700px) { #custody-box table { min-width:850px; } }
}
