/* sidebar.css — sidebar table finder, badges and Recent (stream B7, main §5.7, navigation.md #7).
   Loaded after app.css (which owns .sidebar's box, links and nested-list indent). The privilege marks of main §4.10
   (lock / half lock on a table the role cannot fully read) arrived with core-change request CCR-A4-3. */

.sidebar a.priv-lock, .sidebar a.priv-lock-half { opacity: .6; }
.sidebar a.priv-lock:hover, .sidebar a.priv-lock-half:hover { opacity: 1; }
.sidebar .priv-icon {
  display: inline-flex;
  align-items: center;
  margin-left: .35rem;
  vertical-align: -2px;
  color: var(--muted);
}
.sidebar .priv-icon .icon { width: 12px; height: 12px; }

/* The finder: an input with the "/" hint (hidden until sidebar.js runs). */
.sidebar .finder { position: relative; margin: 0 0 .6rem; }
.sidebar .finder input[type="search"] {
  width: 100%;
  box-sizing: border-box;
  padding: .4rem 1.8rem .4rem .6rem;
  font-size: 13px;
}
.sidebar .finder > kbd {
  position: absolute;
  right: .45rem;
  top: .45rem;
  padding: 0 .3rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11px;
  color: var(--muted);
  pointer-events: none;
}
.sidebar .finder-empty { margin: .4rem .25rem 0; font-size: 12.5px; color: var(--muted); }
/* An explicit foreground: inside the current link (accent background, accent-fg text) an inherited colour would sit
   on warn-soft at about 1:1 contrast. */
.sidebar mark { background: var(--warn-soft); color: var(--fg); border-radius: 2px; }

/* Recent */
.sidebar .recent { margin: 0 0 .5rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }

/* Relation names, kind badges and notes. A result link is a flex row, so a long name ellipsizes inside .rel-name
   and the badge and the §4.10 lock icon stay visible (app.css clips the whole block link otherwise). */
.sidebar .rel-list a, .sidebar .recent a { display: flex; align-items: center; }
.sidebar .rel-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .kind-badge, .sidebar .priv-icon { flex: none; }
.sidebar .kind-badge {
  display: inline-block;
  margin-left: .3rem;
  padding: 0 .35rem;
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: .02em;
  vertical-align: 1px;
}
.sidebar a.current .kind-badge { color: var(--accent-fg); border-color: currentColor; }
.sidebar .rel-note { display: block; margin: -.1rem 0 .15rem .55rem; font-size: 11.5px; color: var(--muted); }
.sidebar .rel-empty, .sidebar .rel-more { margin: .35rem .25rem .5rem .6rem; font-size: 12.5px; color: var(--muted); }
.sidebar .rel-more kbd { font-size: 11px; }
.sidebar .rel-more button { margin-top: .35rem; }

/* Partitions: the count in a <details> summary, after the parent link. */
.sidebar .rel-list details { margin: 0 0 .15rem .55rem; }
.sidebar .rel-list summary {
  cursor: pointer;
  padding: .1rem .3rem;
  font-size: 11.5px;
  color: var(--muted);
  border-radius: var(--radius-sm);
}
.sidebar .rel-list summary:hover { color: var(--accent); }
.sidebar .rel-list details > ul { margin-left: .1rem; }

/* ≤ 880 px the sidebar sits above main (app.css): bound it so 300 relations never push the page far down. */
@media (max-width: 880px) {
  .sidebar { max-height: 45vh; overflow-y: auto; }
}
