/* Madnetwork browse (federation F2). Reuses the library's drill-down classes
   (.panel-row / .row-name / .track-row / .breadcrumb — app.css); this file
   adds only the page's own pieces: the sync-status strip, the artist filter,
   and the per-track versions expansion. */

/* ── Sync status strip ──────────────────────────────────────────────────────── */
.mn-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin: var(--space-4) var(--space-5) 0;
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.mn-status-main { color: var(--text); font-weight: 600; }
.mn-status a { color: var(--accent); text-decoration: none; }
.mn-status a:hover { text-decoration: underline; }
/* Fail-open banner: this node's inbound mesh path looks dead, so nothing is
   being hidden and the catalog shown is last-known rather than live. */
.mn-status-warn {
  flex-basis: 100%;
  color: var(--warning, #b26b00);
  font-weight: 600;
}

/* Bulk-materialize progress line (Materialize all) + the tracks-view button. */
.mn-bulk {
  margin: 0 0 var(--space-3);
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
}
.mn-bar-actions { flex-shrink: 0; }
.mn-bulk-btn { font-size: 0.82rem; padding: 0.3rem 0.8rem; white-space: nowrap; }

/* ── Discovery lanes (the landing view) ──────────────────────────────────────── */
/* A lane is a heading and eight ordinary track rows — the same rows the
   drill-down builds, so hearts, the ⋯ menu and the ⓘ panel work inside one with
   no second component. No card shelf: the merged catalog carries no cover art,
   and a row of artwork with no artwork is a row of grey squares. */

.mn-lane { margin-bottom: var(--space-5); }
.mn-lane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 0 var(--space-2) var(--space-2);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-1);
}
.mn-lane-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}
.mn-lane-more {
  flex-shrink: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.82rem;
  color: var(--accent);
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: var(--radius);
}
.mn-lane-more:hover { text-decoration: underline; }
/* "See all" is a link when it leaves the page (the local library's tail is the
   library page; the Nodes lane's is the directory) and a button when it opens the
   lane's own view. Same affordance either way. */
a.mn-lane-more { text-decoration: none; }
.mn-lane-nav {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  margin-top: var(--space-4);
}

/* The reason a row is in a lane, shown next to the row's own facts rather than
   hidden in a tooltip — every lane row has to be explainable. */
.mn-why {
  flex-shrink: 0;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  padding-right: var(--space-2);
}
@media (max-width: 640px) {
  .mn-why { display: none; } /* the row's own text wins the space on a phone */
}

/* ── Track-row extras: the source/versions info toggle ───────────────────────── */
/* The row itself (hearts, ⋯ menu, search) reuses the library's shared layout
   (app.css); Materialize lives in the ⋯ menu and the ⓘ panel. */

/* Source & versions — rare, so it stays faint until the row is hovered/focused
   or the panel is open (never fully hidden, so touch + keyboard can reach it). */
.mn-info {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 120ms ease, background 120ms ease, color 120ms ease;
}
.track-row:hover .mn-info,
.track-row:focus-within .mn-info,
.mn-track--open .mn-info { opacity: 1; }
.mn-info:hover { color: var(--text); background: var(--surface-hover); }
.mn-info:focus-visible { outline: 2px solid var(--accent); opacity: 1; }
.mn-track--open .mn-info { color: var(--accent); }

/* ── Source & versions panel (renditions / holders / per-version actions) ────── */

.mn-versions {
  margin: 0 var(--space-4) var(--space-2) var(--space-6);
  padding: var(--space-2) var(--space-4);
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.mn-version { display: flex; flex-direction: column; gap: var(--space-1); }
.mn-version-head { display: flex; align-items: center; gap: var(--space-2); }
.mn-version-label { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.mn-version-license,
.mn-version-guest {
  font-size: 0.72rem;
  padding: 0 0.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
}
.mn-version-guest { color: var(--success); border-color: var(--success); }
.mn-renditions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.mn-rendition-quality { font-size: 0.82rem; color: var(--text); font-variant-numeric: tabular-nums; }
.mn-holders { font-size: 0.8rem; color: var(--text-muted); }
.mn-holder { color: var(--text); }
.mn-holder--self { color: var(--accent); font-weight: 600; }
/* Holder seen too long ago to count as reachable — shown (fail-open view) but
   greyed so it reads as possibly-unavailable. */
.mn-holder--stale { color: var(--text-muted); text-decoration: line-through; }
/* Branch count beside a holder list, shown only when it is lower than the number
   of holders — several nodes, one voice (F7 item 10). */
.mn-voices { color: var(--text-muted); font-style: italic; }

/* ── F3 version actions (Play / Queue / Download) ──────────────────────────── */
.mn-actions { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-1); }
.mn-action { font-size: 0.8rem; padding: 0.25rem 0.7rem; }
.mn-action:disabled { opacity: 0.65; cursor: default; }

/* ── Nodes: the lane digest, the directory, and one node's card ─────────────── */
/* docs/ui/madnetwork-nodes.md. A node row is an anchor rather than a click
   handler: a node has an address now, so opening one in a tab and copying its
   link have to work. It reuses .panel-row/.artist-row so a library of nodes and
   a library of artists read as the same kind of list. */

.mn-node-row { text-decoration: none; color: inherit; }
.mn-node-row .row-name { display: inline-flex; align-items: baseline; gap: var(--space-2); }
/* The key beside the name, because beyond our own friends the name is what a
   node claims about itself and the key is the fact. */
.mn-node-key {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
}
.mn-node-row--self .row-name { color: var(--accent); }
/* Not seen within its freshness window: its exclusively-held tracks are hidden
   from the browse, so the row reads as dimmed rather than disappearing. */
.mn-node--stale { opacity: 0.55; }

.mn-node-card {
  margin: var(--space-4) var(--space-5) var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.mn-node-card--self { border-color: var(--accent); }
.mn-node-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
}
.mn-node-card-name { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.mn-node-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.mn-node-chip {
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.mn-node-keyline { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.mn-node-fullkey {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.mn-node-copy {
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: none;
  color: var(--text-muted);
  font: inherit;
  line-height: 1;
  padding: 0.15rem 0.4rem;
  cursor: pointer;
}
.mn-node-copy:hover { border-color: var(--accent); color: var(--accent); }
.mn-node-facts { font-size: 0.85rem; color: var(--text-muted); }
.mn-node-maplink { font-size: 0.82rem; color: var(--accent); text-decoration: none; align-self: flex-start; }
.mn-node-maplink:hover { text-decoration: underline; }
.mn-node-card--missing { border-style: dashed; }
