/* =========================================================
   BROWSE BY SUBJECT — SEARCH + ARROWS SAME LINE
   ========================================================= */
#browse-subject .subject-search-control-row{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:18px !important;
  width:100% !important;
  margin:0 0 14px !important;
}

#browse-subject .subject-search-wrap{
  width:min(520px,calc(100% - 110px)) !important;
  margin:0 !important;
  min-width:260px;
}

#browse-subject .subject-search-box{
  position:relative;
  display:flex;
  align-items:center;
  width:100%;
  height:42px;
  background:#fff;
  border:1px solid #d8e0e9;
  border-radius:11px;
  box-shadow:0 6px 18px rgba(15,30,74,.06);
  transition:.2s ease;
}
#browse-subject .subject-search-box:focus-within{
  border-color:#e58a00;
  box-shadow:0 0 0 3px rgba(229,138,0,.10),0 6px 18px rgba(15,30,74,.06);
}
#browse-subject .subject-search-box > i{
  margin-left:15px;
  color:#e58a00;
  font-size:14px;
}
#browse-subject #subjectSearchInput{
  flex:1;
  min-width:0;
  height:100%;
  border:0;
  outline:0;
  background:transparent;
  padding:0 42px 0 11px;
  color:#0f1e4a;
  font-size:14px;
  font-weight:600;
}
#browse-subject #subjectSearchInput::placeholder{
  color:#8a96a7;
  font-weight:500;
}
#browse-subject #subjectSearchClear{
  position:absolute;
  right:6px;
  top:50%;
  transform:translateY(-50%);
  width:30px;
  height:30px;
  border:0;
  border-radius:50%;
  background:#f2f4f8;
  color:#0f1e4a;
  display:none;
  place-items:center;
  cursor:pointer;
}
#browse-subject #subjectSearchClear:hover{
  background:#0f1e4a;
  color:#fff;
}
#browse-subject .subject-search-status{
  position:absolute;
  margin-top:4px;
  font-size:11px;
  color:#6f7c90;
}

/* Arrow buttons remain on the same line at right */
#browse-subject .subject-search-control-row .subject-carousel-side-controls{
  position:static !important;
  width:auto !important;
  margin:0 !important;
  padding:0 !important;
  display:flex !important;
  gap:8px !important;
  justify-content:flex-end !important;
  flex:0 0 auto !important;
}

/* Search does NOT rearrange cards. It highlights the match in-place. */
#browse-subject .subject-visual-card.subject-search-match{
  position:relative;
  border:2px solid #e58a00 !important;
  background:#fff8ed !important;
  box-shadow:0 10px 28px rgba(229,138,0,.18) !important;
  transform:translateY(-2px);
}
#browse-subject .subject-visual-card.subject-search-match .subject-icon-wrap{
  background:#fff1d7 !important;
  color:#e58a00 !important;
  border-color:#f0c36f !important;
}
#browse-subject .subject-visual-card.subject-search-match .subject-name{
  color:#0f1e4a !important;
  font-weight:900 !important;
}
#browse-subject .subject-visual-card.subject-search-match .subject-arrow{
  background:#e58a00 !important;
  color:#fff !important;
}

/* Actual matching text highlight */
#browse-subject .subject-name mark.subject-match-mark{
  padding:1px 3px;
  border-radius:4px;
  background:#ffe0a6;
  color:#0f1e4a;
  font-weight:900;
}

/* Dim non-matches slightly so the found item is obvious */
#browse-subject.subject-searching .subject-visual-card:not(.subject-search-match){
  opacity:.40;
  filter:saturate(.65);
  transition:opacity .2s ease,filter .2s ease;
}

@media(max-width:650px){
  #browse-subject .subject-search-control-row{
    gap:10px !important;
  }
  #browse-subject .subject-search-wrap{
    width:calc(100% - 88px) !important;
    min-width:0;
  }
  #browse-subject .subject-search-box{
    height:38px;
  }
  #browse-subject .subject-search-control-row .subject-carousel-btn{
    width:38px !important;
    height:38px !important;
    flex-basis:38px !important;
  }
}
