/* Indeks referensi — semua kelas diawali ref- agar tidak menimpa Peta Kata. */

a.ref-back {
  color: var(--akcent);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}
a.ref-back:hover { text-decoration: underline; }

.toolbar input[type="search"] {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 8px;
  padding: 7px 10px;
  min-width: 250px;
}
.toolbar select:disabled { opacity: .45; cursor: not-allowed; }

.ref-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  padding: 20px 24px 48px;
  align-items: start;
}

.ref-list-wrap {
  min-width: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(70, 45, 15, .05);
  overflow: hidden;
}
.ref-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline;
}
.ref-head strong { font-size: 15px; }
.ref-head span { color: var(--muted); font-size: 12px; }

.ref-list { max-height: calc(100vh - 250px); overflow-y: auto; }

.ref-row {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #f0e9dc;
  background: transparent;
  padding: 12px 18px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.ref-row:hover { background: #fdf8ed; }
.ref-row.is-aktif { background: #fff2d8; box-shadow: inset 3px 0 0 var(--coklat); }

.ref-row-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.ref-ar {
  font-family: "Noto Naskh Arabic", "Amiri", "Times New Roman", serif;
  font-size: 25px;
  line-height: 1.35;
  direction: rtl;
  unicode-bidi: isolate;
}
.ref-ar.kecil { font-size: 20px; }
.ref-ar.besar { font-size: 30px; }
.ref-judul { font-weight: 600; font-size: 13px; }
.ref-meta { color: var(--muted); font-size: 11px; }
.ref-row-bawah {
  margin-top: 7px;
  display: flex; flex-wrap: wrap; gap: 5px;
  align-items: center;
}
.ref-chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  background: #f1eadc;
  color: #6d5b42;
  font-size: 10px;
  white-space: nowrap;
}
.ref-chip.disetujui { background: #dcf3df; color: #1d6b2a; }
.ref-chip.draf { background: #f6e8c8; color: #7a5400; }
.ref-chip.putih { background: white; border: 1px solid #ddd; }
.ref-chip.kuning { background: #fff3a8; }
.ref-chip.hijau { background: #d8ffdc; }
.ref-chip.merah { background: #ffd9d9; }
.ref-chip.coklat { background: #e8d2a8; }

.ref-kosakata {
  display: inline-flex; align-items: center; gap: 2px;
  direction: rtl; flex-wrap: wrap;
  padding: 2px 5px;
  border-radius: 6px;
  background: #fbf7ee;
}
.ref-token-wrap { display: inline-flex; margin: 1px; }
.ref-token-wrap .token { font-size: 19px; height: 32px; }
.ref-token-wrap .token.type-pill { font-size: 17px; height: 30px; padding: 0 5px; border-radius: 16px; }
.ref-token-wrap .token.has-border { border: 1px solid white; box-shadow: 0 0 0 .5px #c9bda8; }
.ref-token-wrap .token.type-text { padding: 0 1px; }

.ref-detail { position: sticky; top: 12px; max-height: calc(100vh - 90px); overflow-y: auto; }
.ref-detail h2 { margin: 0 0 4px; font-size: 16px; }
.ref-detail .ref-sub { color: var(--muted); font-size: 11px; margin-bottom: 10px; }
.ref-detail h3 {
  margin: 14px 0 6px; font-size: 11px; color: var(--akcent);
  text-transform: uppercase; letter-spacing: .4px;
}
.ref-detail p { font-size: 12px; line-height: 1.55; margin: 6px 0; }
.ref-detail ul { margin: 6px 0; padding-left: 18px; font-size: 12px; line-height: 1.6; }
.ref-detail .ref-kotak {
  padding: 9px 11px; border-radius: 8px; margin: 8px 0;
  background: #f7f2e7; font-size: 12px; line-height: 1.5;
}
.ref-detail .ref-kotak.standar { background: #e7f7ea; color: #1d5b29; }
.ref-detail .ref-kotak.diskusi { background: #fff3d6; color: #7a4b00; }

.ref-varian {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 11px;
  margin: 8px 0;
}
.ref-varian b { font-size: 12px; }
.ref-varian .ref-kapan { color: var(--muted); font-size: 11px; line-height: 1.5; margin: 4px 0; }

.ref-contoh {
  border-top: 1px solid var(--line);
  padding: 8px 0;
}
.ref-contoh:first-of-type { border-top: 0; }
.ref-contoh .ref-id {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10px; color: var(--muted);
}
.ref-contoh .ref-terjemah { font-size: 11px; color: var(--muted); margin-top: 3px; }
.ref-contoh a { font-size: 10px; }
.ref-link {
  color: #8c4a12;
  text-decoration: none;
  border-bottom: 1px dotted #8c4a12;
}
.ref-link:hover { background: #fff2d8; }

.ref-daftar-id { font-size: 10px; line-height: 1.7; color: var(--muted); word-break: break-all; }
.ref-kosong { color: var(--muted); font-size: 12px; padding: 20px; }

.ref-korpus .ref-kosakata { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.ref-korpus .ref-chip { border: 1px solid var(--line); background: #fff; }
.ref-korpus .ref-chip.ref-hit {
  background: #fff08a;
  border-color: #b57810;
  color: #5a3900;
  font-weight: 700;
  box-shadow: inset 0 -2px 0 rgba(181,120,16,.25);
}
.ref-korpus .ref-ar.kecil { font-size: 18px; line-height: 1.8; margin: 2px 0; }
.ref-more {
  display: inline-block;
  margin: 8px 0 4px;
  padding: 6px 10px;
  border: 1px solid #d9c9a5;
  border-radius: 8px;
  background: #fffaf0;
  cursor: pointer;
  font: inherit;
}
.ref-more:hover { background: #fff2d8; }

@media (max-width: 1080px) {
  .ref-main { grid-template-columns: 1fr; }
  .ref-detail { position: static; max-height: none; }
  .ref-list { max-height: none; }
}
