#favModal, #favModal * {
  font-family: ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial !important;
}
#favModal .fav-note {
  margin-top: 8px;
  font-size: 11px;
  color: #94a3b8;
  text-align: right;
  font-style: italic;
}
.fav-link{
  font-size: 12px;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 4px 6px;
  text-decoration: none;
  cursor: pointer;
  margin-left: 0 !important;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.fav-link[data-alt="1"]{
  background: #eaf2fe; border-color: #c7d7f5;
}
.fav-link[data-alt="1"]:hover{ background:#dceafe; border-color:#b0c7ef; }
.fav-link[data-alt="2"]{
  background: #e8f6f0; border-color: #c4e3d3;
}
.fav-link[data-alt="2"]:hover{ background:#d7efe5; border-color:#a8d7c2; }
.fav-link:hover{ color:#084a8f; }
.fav-modal{
  position:fixed; inset:0; background:rgba(0,0,0,.38);
  display:none; align-items:center; justify-content:center; z-index:1000;
}
.fav-modal.show{ display:flex; }
.fav-card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  width:min(1200px, 98vw);
  max-height:82vh;
  overflow:auto;
  box-shadow:0 8px 24px rgba(0,0,0,.12);
  -webkit-overflow-scrolling: touch;
}
.fav-card header{
  position:sticky; top:0; z-index:2; background:#fff;
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 14px; border-bottom:1px solid #e5e7eb; font-weight:700; font-size:14px;
}
.fav-close{ appearance:none; background:none; border:none; font-size:20px; line-height:1; cursor:pointer; border-radius:6px; }
.fav-close:hover{ background:#f3f4f6; }
.fav-list{ display:block; }

.fav-block {
  border: none;
  border-radius: 0;
  padding: 0;
  background: none;
}
#favModal .fav-grid{
  display:grid;
  grid-template-columns: repeat(6, 1fr);
  gap:2px;
  padding-left:4px;
  padding-right:4px;
}
#favModal .fav-leg{
  position: relative;
  padding: 28px 2px 6px;
  min-width: 0;
}
#favModal .fav-leg-title{
  position:absolute; left:0; top:0; height:24px;
  margin:0; padding:0 10px;
  display:flex; align-items:center;
  background:#7fb58a; color:#fff;
  font-weight:700; font-size:11.5px;
  border-radius:4px 0 0 0;
  max-width:60%;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
#favModal .fav-leg .fav-agf {
  position: relative !important;
  display: block !important;
  z-index: 1;
  margin-top: 4px;
  padding: 4px 4px;
  border-top: 1px dashed #e1e5ea;
  background: transparent;
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#favModal .fav-leg::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 24px; bottom: 0;
  background: #eff3f6;
  border: 1px solid #e1e5ea;
  border-top: none;
  border-radius: 0 0 4px 4px;
  z-index: 0;
}
#favModal .fav-line {
  position: relative;
  z-index: 1;
  padding: 0;
  font-size: 11.5px;
  line-height: 1.28;
  color: #111;
  border-bottom: 1px dashed #eff1f4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#favModal .fav-line:last-child{ border-bottom:0; }
#favModal .fav-badge,
#favModal .fav-no,
#favModal .fav-name{
  margin:0;
  font-size:10px;
  padding:0;
  font:inherit;
  color:inherit;
  background:none;
  border:none;
}

#favModal .fav-line .fav-no {
  margin-right: 4px;
}
#favModal .fav-line .fav-badge {
  margin-right: 4px;
  padding: 0 6px;
}
#favModal .fav-line .fav-name {
  display:inline-block;
  font-weight:400;
  font-size:10px;
  color:#0f172a;
}
#favModal .fav-line .fav-scr{
  display:inline-block; margin-left:2px; font-size:10px;
  color:#b91c1c; background:rgba(239,68,68,.12);
  padding:1px 2px;
}

.fav-close:focus { outline: none; }
.fav-close:focus-visible {
  outline: 2px solid #94a3b8;
  outline-offset: 2px;
}

@media (max-width:768px){
  #favModal .fav-grid{ grid-template-columns:repeat(2, 1fr); }
}