/* ════════════════════════════════════════════════════════════════════════
   desktop-virtual-lab / ui / related-panel.css
   ────────────────────────────────────────────────────────────────────────
   Related panel (M8 AI 工具联动) — the active scene's relationship table
   (CLAUDE.md §5.5). Floating-panel chrome (.panel-floating*) comes from
   style.css; this file only styles the body content (.rel-*).

   Uses ONLY existing design tokens (style.css §3.1 / v1 family) so it inherits
   light/dark and matches the ⌘K palette it shares a visual language with:
   --surface-1/2/3 · --ink-1/2-v1/3-v1 · --line-1/2 · --font-ui/mono.
   No new colors (DESIGN.md §3.5 monochrome).
   ════════════════════════════════════════════════════════════════════════ */

#panel-related { width: 332px; }
#rel-body { padding: 4px 0 10px; overflow-y: auto; }

/* ── section header (mirror .sp-group) ── */
.rel-group {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-3-v1);
  padding: 12px 14px 5px;
}
.rel-group .n { opacity: .7; }

/* ── product row (mirror .sp-row) ── */
.rel-row {
  display: flex; align-items: center; gap: 11px;
  padding: 7px 14px; position: relative;
}
.rel-glyph {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 6px;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--ink-2-v1);
  font-family: var(--font-mono); font-size: 13px;
}
.rel-main { flex: 1 1 auto; min-width: 0; }
.rel-title {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font-ui); font-size: 13.5px; color: var(--ink-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rel-sub {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-3-v1);
  margin-top: 2px; display: flex; gap: 7px; align-items: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rel-sub .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3-v1); opacity: .6; flex: 0 0 auto; }
.rel-sku { color: var(--ink-2-v1); flex: 0 0 auto; }
.rel-reason { overflow: hidden; text-overflow: ellipsis; }

/* role badge — monochrome; `fix` gets a hairline emphasis (it's the actionable one) */
.rel-badge {
  flex: 0 0 auto;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .03em;
  text-transform: uppercase; color: var(--ink-3-v1);
  background: var(--surface-2); border: 1px solid var(--line-1);
  border-radius: 4px; padding: 1px 5px;
}
.rel-badge[data-role="hero"] { color: var(--ink-1); border-color: var(--line-2); }
.rel-badge[data-role="fix"]  { color: var(--ink-1); border-color: var(--ink-1); }

/* row action — add button / on-bench tag */
.rel-act {
  flex: 0 0 auto; cursor: pointer;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-2-v1);
  background: var(--surface-1); border: 1px solid var(--line-2);
  border-radius: 5px; padding: 3px 9px;
}
.rel-act:hover { color: var(--ink-1); border-color: var(--ink-1); background: var(--surface-2); }
.rel-tag {
  flex: 0 0 auto;
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-3-v1);
}
.rel-row[data-supported="false"] .rel-glyph { opacity: .55; }
.rel-row[data-supported="false"] .rel-title { color: var(--ink-2-v1); }

/* ── calculator chips ── */
.rel-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 14px 4px; }
.rel-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-1);
  background: var(--surface-2); border: 1px solid var(--line-1);
  border-radius: 6px; padding: 3px 8px;
}
.rel-chip-glyph { color: var(--ink-3-v1); }
.rel-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-chip-cat { color: var(--ink-3-v1); opacity: .85; flex: 0 0 auto; }

/* ── datasheet rows (button → opens the in-app datasheet modal) ── */
.rel-ds {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  appearance: none; background: none; border: none; cursor: pointer;
  padding: 6px 14px; color: var(--ink-2-v1);
  font-family: var(--font-mono); font-size: 11.5px;
}
.rel-ds:hover { color: var(--ink-1); background: var(--surface-2); }
.rel-ds-arrow { color: var(--ink-3-v1); }
.rel-ds-sku { color: var(--ink-1); }
.rel-ds-host { color: var(--ink-3-v1); margin-left: auto; }

/* ── footnotes / empty / keyword footer ── */
.rel-note {
  font-family: var(--font-ui); font-size: 11px; color: var(--ink-3-v1);
  padding: 4px 14px 2px;
}
.rel-empty {
  padding: 26px 18px; text-align: center;
  font-family: var(--font-ui); font-size: 12.5px; color: var(--ink-3-v1);
  line-height: 1.5;
}
.rel-kw {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-top: 8px; padding: 9px 14px 2px; border-top: 1px solid var(--line-1);
}
.rel-kw span {
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-3-v1);
  background: var(--surface-2); border-radius: 4px; padding: 1px 6px;
}

/* (M8 self-check moved to the Experiments hub — ui/experiments-panel.{js,css}.) */
