/* Notes editor — links to index entries (js/note-index-link.js) */
.editor a.note-index-link {
  /* The linked text keeps its own colours (error marks, highlights…): only a
     dotted underline shows it is a link — the badge in the margin opens it. */
  display: inline;
  color: inherit;
  background: none;
  border: 0;
  border-bottom: 2px dotted rgba(125, 211, 252, .75);
  border-radius: 0;
  padding: 0;
  text-decoration: none;
  cursor: text;
  font-weight: inherit;
  transition: background .15s;
}
.editor:not([contenteditable="true"]) a.note-index-link { cursor: pointer; }
.editor a.note-index-link.nil-hover,
.editor:not([contenteditable="true"]) a.note-index-link:hover { background: rgba(125, 211, 252, .14); }

/* Margin rail with one badge per link (right edge of the sheet) */
.nil-rail { position: absolute; top: 0; right: 10px; width: 34px; height: 0; z-index: 20; }
.nil-badge {
  position: absolute; right: 0;
  display: inline-flex; align-items: center; gap: 6px; flex-direction: row-reverse;
  height: 26px; min-width: 30px; padding: 0 6px; border-radius: 13px;
  background: #1c2128; border: 1px solid rgba(125, 211, 252, .55); color: #7dd3fc;
  font-size: .78rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  transition: border-color .15s, background .15s;
}
.nil-badge-ic { font-size: .95rem; line-height: 1; }
.nil-badge-tx { display: none; }
.nil-badge:hover { background: #163042; border-color: #7dd3fc; }
.nil-badge:hover .nil-badge-tx { display: inline; }
@media (max-width: 700px) {
  .nil-rail { right: -4px; width: 24px; }
  .nil-badge { height: 22px; min-width: 22px; padding: 0 3px; }
}
@media print { .nil-rail { display: none; } }

.nil-overlay {
  position: fixed; inset: 0; z-index: 9500;
  background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.nil-overlay.open { display: flex; }
.nil-modal {
  width: 100%; max-width: 520px; max-height: 80vh;
  display: flex; flex-direction: column; gap: 10px;
  background: #161b22; border: 1px solid #30363d; border-radius: 12px;
  padding: 16px 18px; color: #e6edf3;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}
.nil-head { display: flex; align-items: center; justify-content: space-between; }
.nil-head h3 { font-size: 1rem; font-weight: 700; color: #e6edf3; }
.nil-x { background: none; border: none; color: #adbac7; font-size: 1rem; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.nil-x:hover { color: #fff; background: #1c2128; }
.nil-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.nil-tab {
  background: #1c2128; border: 1px solid #30363d; color: #adbac7;
  font-size: .8rem; padding: 6px 10px; border-radius: 7px; cursor: pointer;
}
.nil-tab:hover { color: #fff; }
.nil-tab.active { color: #7dd3fc; border-color: #7dd3fc; background: rgba(125, 211, 252, .1); }
.nil-search {
  width: 100%; background: #0d1117; border: 1px solid #30363d; border-radius: 8px;
  color: #e6edf3; padding: 8px 10px; font-size: .9rem; outline: none;
}
.nil-search:focus { border-color: #7dd3fc; }
.nil-list { overflow-y: auto; min-height: 120px; max-height: 50vh; display: flex; flex-direction: column; gap: 2px; }
.nil-row {
  text-align: left; background: none; border: 1px solid transparent; color: #e6edf3;
  font-size: .92rem; padding: 8px 10px; border-radius: 7px; cursor: pointer;
}
.nil-row:hover { background: #1c2128; border-color: #30363d; color: #7dd3fc; }
.nil-empty { color: #adbac7; font-size: .88rem; padding: 12px 4px; }
.nil-foot { color: #adbac7; font-size: .78rem; }
