/* panel-citations.css — the citation graph (D50, panel-citations.js).
   Built from the parts the panel already has, and nothing new where one exists:
   Search's shell, box, notes and rows (.search-view, .find-box, .find-note,
   .find-row/.find-name/.find-why/.find-meta), Connections' canvas, details card,
   loader and skeleton rows (panel-memory-graph.css), .px-btn for every button and
   the panel's own menu for choosing a bibliography. What is here is layout, and the
   two things only this view has: the kind glyph and the year ramp. Tokens only. */

.main.px-cite-open > :not(#citeView) { visibility: hidden; }
/* The column scrolls (PX_EDGE_SCROLLERS fades its edges); every block in it
   sits on the column's 16px side margin, as Memory's do. */
.cite-col { overflow-y: auto; padding-bottom: var(--scroll-pad, 12px); }
.cite-col > :not(.search-view-head) { margin-inline: 16px; }

/* The paper itself, in the rail's row type (a chat's name reads the same), its
   byline in the reading face, and the count line, cap stated, as a list's note. */
.cite-seed { flex-shrink: 0; margin-block: 4px 12px; }
.cite-seed[hidden] { display: none; }
.cite-seed-title { font: 400 var(--fs-xl)/1.3 var(--serif); color: var(--t-primary); overflow-wrap: anywhere; }
.cite-seed-by { margin-top: 4px; font: 400 var(--fs-md)/1.4 var(--sans); color: var(--t-secondary); }
.find-note.cite-seed-count { padding: 6px 0 0; }

/* Every state that is not a map: Connections' note type, at most one control. */
.cite-status { flex-shrink: 0; margin-block: 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.cite-status[hidden] { display: none; }
.cite-status-text { margin: 0; max-width: 52ch; font: 400 var(--fs-md)/1.5 var(--sans); color: var(--t-secondary); }
.cite-status.is-busy { align-items: stretch; }
.cite-loader { display: flex; justify-content: center; padding: 28px 0 6px; }
.cite-status.is-busy .cite-status-text { align-self: center; text-align: center; color: var(--t-meta); }
.cite-skel { padding-top: 6px; }

.cite-ask { flex-shrink: 0; display: flex; gap: 8px; align-items: center; margin-block: 0 12px; }
.cite-ask[hidden] { display: none; }
.cite-ask .find-box { flex: 1; min-width: 0; margin: 0; }

/* The map, on Connections' canvas: a hairline card on the warm ground. */
.cite-map-wrap { flex-shrink: 0; position: relative; }
.cite-map-wrap[hidden] { display: none; }
.cite-canvas {
  position: relative; width: 100%; min-width: 0; height: clamp(320px, 62vh, 640px); overflow: hidden;
  border: 1px solid var(--hair); border-radius: var(--r-card); background: rgba(var(--warm-rgb), .03);
}
.cite-canvas:focus-visible { outline: 1px solid var(--rim); outline-offset: 1px; }
/* The stage holds the canvas and what is drawn over it: which side is which,
   which way time runs, and the zoom. Labels never take a click. */
.cite-stage { position: relative; }
.cite-side-label {
  position: absolute; top: 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; max-width: 46%;
  pointer-events: none; font: 400 var(--fs-2xs)/1.3 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--t-secondary);
}
.cite-side-label small { flex-basis: 100%; font: 400 var(--fs-sm)/1.3 var(--sans); letter-spacing: 0; text-transform: none; color: var(--t-meta); }
.cite-side-label--left { left: 12px; }
.cite-side-label--right { right: 12px; justify-content: flex-end; text-align: right; }
.cite-time-label { position: absolute; bottom: 10px; left: 12px; pointer-events: none; font: 400 var(--fs-2xs)/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--t-meta); }
.cite-zoom { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 4px; }
/* Square .px-btn: the button's height, glass and focus; only the width and the glyph are its own. */
.px-btn.cite-zoom-btn { width: var(--ctl-h); padding: 0; letter-spacing: 0; }
.cite-zoom-btn svg { width: 14px; height: 14px; stroke: currentColor; pointer-events: none; }

/* All | References | Cited by: .px-btn with its pressed state. */
.cite-sides { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cite-hint { margin: 8px 0 0; font: 400 var(--fs-md)/1.45 var(--sans); color: var(--t-secondary); }
.cite-hint[hidden] { display: none; }
.cite-back { margin-bottom: 8px; }
.find-note.cite-seed-label { padding: 0 0 4px; }
.cite-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 8px; font: 400 var(--fs-sm)/1.4 var(--sans); color: var(--t-meta); }
.cite-key { display: inline-flex; align-items: center; gap: 6px; }
.cite-kind--key { color: var(--t-secondary); }
/* Size: two dots, small and large, in the map's colour. */
.cite-size-key { display: inline-flex; align-items: center; gap: 3px; }
.cite-size-key::before, .cite-size-key::after { content: ""; display: block; border-radius: 50%; background: var(--t-faint); }
.cite-size-key::before { width: 5px; height: 5px; }
.cite-size-key::after { width: 10px; height: 10px; }
/* Colour is year: the canvas's own ramp, faint (oldest) to rim (newest). */
.cite-ramp { flex: none; width: 48px; height: 6px; border-radius: var(--r-xs); background: linear-gradient(90deg, var(--t-faint), var(--rim)); }

/* A chosen paper: Connections' details card, under the map so nothing is covered. */
.cite-card { margin-top: 10px; padding: 10px; border: 1px solid var(--hair); border-radius: var(--r-card); min-width: 0; }
.cite-card[hidden] { display: none; }
.cite-card .set-mgraph-dates { overflow-wrap: anywhere; }

/* The list: Search's rows. Each glyph is the paper's shape on the map, by
   shape and never by colour alone: a rounded square it cites, a circle citing it. */
.cite-list-wrap { margin-top: 14px; }
.cite-list-wrap[hidden] { display: none; }
.cite-list-wrap .find-box { margin: 0 0 6px; }
.cite-list { padding-inline: 0; }
.find-note.cite-group { padding: 12px 8px 6px; }
.cite-kind { display: block; width: 8px; height: 8px; border: 1.5px solid currentColor; box-sizing: border-box; }
.cite-kind[data-role="reference"] { border-radius: 2px; }
.cite-kind[data-role="citing"] { border-radius: 50%; }
.cite-row .find-name { font-size: var(--fs-base); line-height: 1.35; }
.cite-row .find-why { -webkit-line-clamp: 1; }
.cite-row[aria-selected="true"] { background: var(--s-inter); color: var(--t-primary); }
.cite-row[aria-selected="true"] .find-glyph { color: var(--rim); }

/* The source, named: a list's note, its link in the same register. */
.cite-foot { flex-shrink: 0; margin-top: 16px; font: 400 var(--fs-sm)/1.5 var(--sans); color: var(--t-meta); }
.cite-foot a { color: var(--t-secondary); text-decoration: underline; text-decoration-color: var(--hair); text-underline-offset: 2px; }
.cite-foot a:hover { color: var(--t-primary); }
.cite-foot a:focus-visible { outline: 1px solid var(--rim); outline-offset: 2px; border-radius: var(--r-xs); }

/* Finding a paper: results are Search's rows; the help is a note and two lines. */
.cite-results:empty { display: none; }
.cite-results { flex: none; min-height: 0; overflow: visible; margin-block: 0 10px; padding-inline: 0; }
.cite-result .find-name { font-size: var(--fs-base); line-height: 1.35; }
.cite-result .find-why { -webkit-line-clamp: 1; }
.cite-results-note { padding: 2px 0; }
.cite-results-note.is-busy { color: var(--t-meta); }
.cite-help { margin-top: 6px; }
.cite-help[hidden] { display: none; }
.cite-help .find-note { padding: 0 0 4px; }
.cite-help p { margin: 0 0 6px; max-width: 56ch; font: 400 var(--fs-md)/1.5 var(--sans); color: var(--t-meta); }
