/* ============================================================================
   RRGI viewer — shared "cold-storage instrument" theme for the proto pages.
   One stylesheet behind all three navigation skins (lens / zoom / drill) so the
   only thing that differs across pages is the navigation chrome + wiring, never
   the rendering. Extends the live viewer's theme with: bundle/narrative super-
   nodes, overlay halos, the breadcrumb + lens switch, a canonical-source block
   in the inspector, and the narrative reading view.
   ========================================================================== */

:root {
  --ink:      #090b0c;
  --ink-1:    #0e1316;
  --ink-2:    #141b1f;
  --raise:    #1b2429;
  --line:     rgba(130, 155, 165, 0.10);
  --line-2:   rgba(130, 155, 165, 0.20);
  --text:     #e9e7dd;
  --dim:      #818d93;
  --dimmer:   #525d62;

  /* node types */
  --claim:     #ecc049;
  --evidence:  #54d6a0;
  --question:  #5cb1e6;
  --source:    #cd8a5b;
  --issue:     #b18cf2;

  /* relations */
  --supports:  #46c98a;
  --opposes:   #e76a5b;
  --addresses: #5cb1e6;
  --informs:   #4ec9c9;
  --versionof: #b18cf2;
  --equivalentto: #d8c596;

  /* super-nodes (bundle layer) */
  --bundle:    #9db2bd;   /* steel — a named set */
  --narrative: #c9b27e;   /* parchment — a set WITH prose (the paper) */
  --derived:   rgba(157, 178, 189, 0.45); /* analytic, not a published relation */

  /* overlay comparison halos (2–3 at a time, never the node-type palette) */
  --halo-a: #ff7a59;
  --halo-b: #5cc8ff;
  --halo-c: #b388ff;

  --ok:   #46c98a;
  --bad:  #e76a5b;
  --warn: #ecc049;
  --seal: #7fd1e8;  /* glacial blue — archival / cold-storage seal */

  /* computed STANDING (the curation lens — status, not node type) */
  --credible:  #46c98a;   /* confident green — vouched-for, uncontested */
  --contested: #e8943c;   /* amber-orange — pulls two ways */
  --weakened:  #b06a5e;   /* muted brick — withdrawn or outweighed */

  --select:    #e8d9a8;   /* warm parchment — a node picked into a bundle (Step 4) */

  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.9);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; height: 100%;
  background: var(--ink); color: var(--text);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 14px; overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
body {
  display: flex; flex-direction: column;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px; background-position: center;
}

.grain {
  position: fixed; inset: 0; z-index: 9; pointer-events: none; opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 30%, transparent 55%, rgba(0,0,0,0.55) 100%);
}

/* --------------------------------------------------------------- masthead */
.masthead {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.2rem; padding: 0.7rem 1.3rem;
  border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(14,19,22,0.92), rgba(9,11,12,0.55));
  backdrop-filter: blur(6px);
}
.mark { display: flex; align-items: center; gap: 0.8rem; flex: none; }
.mark-glyph {
  width: 28px; height: 28px; flex: none; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, var(--claim) 0 18%, transparent 19%),
    conic-gradient(from 0deg, var(--supports), var(--informs), var(--opposes), var(--supports));
  box-shadow: 0 0 0 1px var(--line-2), 0 0 18px -2px rgba(236,192,73,0.5);
  animation: spin 22s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.mark-text h1 {
  margin: 0; font-family: "Fraunces", serif; font-weight: 500;
  font-size: 1.3rem; letter-spacing: 0.06em; line-height: 1;
}
.mark-text p {
  margin: 0.22rem 0 0; color: var(--dim); font-size: 0.62rem;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.mark-text p .skin { color: var(--claim); }

/* center area of the masthead — nav chrome lives here (lens switch, etc.) */
.nav-chrome { flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.8rem; min-width: 0; }

.readout { display: flex; align-items: center; gap: 1.3rem; flex: none; }
.stat { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.stat b {
  font-family: "Fraunces", serif; font-size: 1.35rem; font-weight: 500;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.stat span { font-size: 0.56rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dimmer); }
.pulse { display: flex; align-items: center; gap: 0.45rem; padding-left: 1rem; border-left: 1px solid var(--line-2); }
.pulse .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 rgba(70,201,138,0.7); animation: ping 2.6s ease-out infinite;
}
.pulse-label { font-size: 0.58rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(70,201,138,0.55); } 70%,100% { box-shadow: 0 0 0 9px rgba(70,201,138,0); } }

/* ------------------------------------------ masthead: auth (sign in / out) */
.auth { display: flex; align-items: center; flex: none; padding-left: 1rem; border-left: 1px solid var(--line-2); }
.auth[data-state="out"] .auth-id { display: none; }
.auth[data-state="in"]  .auth-form { display: none; }

.auth-form { display: flex; align-items: center; gap: 0.4rem; }
.auth-form input {
  width: 13rem; max-width: 32vw;
  background: rgba(9,11,12,0.6); border: 1px solid var(--line-2); border-radius: 4px;
  color: var(--text); font: inherit; font-size: 0.74rem; letter-spacing: 0.02em;
  padding: 0.36rem 0.55rem; outline: none;
}
.auth-form input::placeholder { color: var(--dimmer); }
.auth-form input:focus { border-color: var(--question); box-shadow: 0 0 0 1px rgba(92,177,230,0.35); }
.auth-form input.nudge { border-color: var(--warn); animation: nudge 0.3s ease 2; }
@keyframes nudge { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

.auth-btn {
  background: rgba(92,177,230,0.12); border: 1px solid var(--line-2); border-radius: 4px;
  color: var(--question); cursor: pointer;
  font: inherit; font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 0.4rem 0.7rem; white-space: nowrap; transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.auth-btn:hover { background: rgba(92,177,230,0.2); border-color: var(--question); }
.auth-btn:disabled { opacity: 0.5; cursor: default; }
.auth-btn.signout { color: var(--dim); background: rgba(130,141,147,0.08); }
.auth-btn.signout:hover { color: var(--bad); border-color: var(--bad); background: rgba(231,106,91,0.12); }

.auth-id { display: flex; align-items: center; gap: 0.7rem; }
.auth-who { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; min-width: 0; }
.auth-handle { font-family: "Fraunces", serif; font-weight: 500; font-size: 0.92rem; color: var(--text); }
.auth-did {
  max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 0.56rem; letter-spacing: 0.04em; color: var(--dimmer);
}

/* --------------------------------------------- nav chrome: lens switch */
.lens-switch { display: inline-flex; border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; background: rgba(9,11,12,0.5); }
.lens-switch button {
  background: none; border: none; cursor: pointer; color: var(--dim);
  font-family: inherit; font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.4rem 0.85rem; border-right: 1px solid var(--line-2); transition: background 0.18s, color 0.18s;
}
.lens-switch button:last-child { border-right: none; }
.lens-switch button:hover { color: var(--text); }
.lens-switch button.active { background: var(--raise); color: var(--text); box-shadow: inset 0 -2px 0 var(--claim); }
.lens-switch button:disabled { opacity: 0.4; cursor: not-allowed; }

/* --------------------------------------------- nav chrome: breadcrumb */
.breadcrumb { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.7rem; color: var(--dim); }
.breadcrumb .crumb { cursor: pointer; color: var(--dim); border-bottom: 1px dotted transparent; }
.breadcrumb .crumb:hover { color: var(--text); border-bottom-color: var(--dim); }
.breadcrumb .crumb.here { color: var(--text); cursor: default; }
.breadcrumb .sep { color: var(--dimmer); }

/* --------------------------------------------- nav chrome: toggle (drill skin) */
.toggle {
  display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: 4px; padding: 0.38rem 0.75rem;
  font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim);
}
.toggle:hover { color: var(--text); }
.toggle.on { color: var(--text); border-color: var(--halo-a); box-shadow: inset 0 0 0 1px rgba(255,122,89,0.3); }
.toggle .box { width: 11px; height: 11px; border: 1px solid currentColor; border-radius: 2px; display: inline-grid; place-items: center; }
.toggle.on .box { background: var(--halo-a); border-color: var(--halo-a); }

/* ------------------------------------------------------------------- main */
main { position: relative; flex: 1; min-height: 0; z-index: 2; }
#graph { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
#graph.dragging { cursor: grabbing; }

/* edges */
.edge { fill: none; stroke-width: 1.6; opacity: 0.7; pointer-events: none; transition: opacity 0.2s, stroke-width 0.2s; }
.edge.supports  { stroke: var(--supports); }
.edge.opposes   { stroke: var(--opposes); stroke-dasharray: 6 4; }
.edge.addresses { stroke: var(--addresses); }
.edge.informs   { stroke: var(--informs); stroke-dasharray: 2 4; }
.edge.versionof { stroke: var(--versionof); stroke-dasharray: 8 3 2 3; }
.edge.equivalentto { stroke: var(--equivalentto); stroke-dasharray: 3 3; }
.edge.over      { stroke: var(--narrative); stroke-width: 1.4; opacity: 0.6; stroke-dasharray: 1 5; }
.edge.derived   { stroke: var(--derived); stroke-width: 1.2; opacity: 0.5; stroke-dasharray: 2 6; }
.edge.faded { opacity: 0.07; }
.edge.lit { opacity: 1; stroke-width: 2.6; filter: drop-shadow(0 0 6px currentColor); }
.edge-hit { fill: none; stroke: transparent; stroke-width: 14px; pointer-events: stroke; cursor: pointer; }
.edge-seal { fill: var(--ink); stroke: var(--dimmer); stroke-width: 1.1; opacity: 0.5; cursor: pointer; transition: opacity 0.2s; }
.edge-seal.archived { fill: var(--seal); stroke: var(--seal); opacity: 1; filter: drop-shadow(0 0 2.5px var(--seal)); }
.edge-seal.faded { opacity: 0.05; }
marker.arrow path { fill: context-stroke; }
#arrow-supports path  { fill: var(--supports); }
#arrow-opposes path   { fill: var(--opposes); }
#arrow-addresses path { fill: var(--addresses); }
#arrow-informs path   { fill: var(--informs); }
#arrow-versionof path { fill: var(--versionof); }
#arrow-equivalentto path { fill: var(--equivalentto); }
#arrow-over path      { fill: var(--narrative); }

/* a small "backed vs naked" badge on bundle-level relation edges */
.edge-badge { font-size: 7px; letter-spacing: 0.06em; text-transform: uppercase; paint-order: stroke; stroke: var(--ink); stroke-width: 3px; pointer-events: none; }
.edge-badge.backed { fill: var(--ok); }
.edge-badge.naked  { fill: var(--warn); }

/* nodes (granular dots) */
.node { cursor: pointer; }
.node circle.halo { fill: none; stroke: currentColor; opacity: 0; transition: opacity 0.2s; }
.node.lit circle.halo { opacity: 0.35; }
.node circle.body { stroke: rgba(0,0,0,0.55); stroke-width: 1.2; filter: drop-shadow(0 0 7px currentColor); transition: r 0.2s; }
.node.faded { opacity: 0.12; transition: opacity 0.2s; }
.node text { fill: var(--text); font-size: 9px; letter-spacing: 0.02em; text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: var(--ink); stroke-width: 3px; stroke-linejoin: round; }
.node .seal { fill: var(--ink); stroke-width: 1.2; }
.node.archived .seal { fill: var(--seal); stroke: var(--seal); filter: drop-shadow(0 0 3px var(--seal)); }
.node:not(.archived) .seal { fill: none; stroke: var(--dimmer); }
.node[data-type="claim"]    { color: var(--claim); }
.node[data-type="evidence"] { color: var(--evidence); }
.node[data-type="question"] { color: var(--question); }
.node[data-type="source"]   { color: var(--source); }
.node[data-type="issue"]    { color: var(--issue); }

/* a "merged from N" ring on a canonical source that actually merged records */
.node .merge-ring { fill: none; stroke: var(--source); stroke-width: 1.1; stroke-dasharray: 2 2; opacity: 0.8; }

/* overlay halos (1–3 colored rings around a member) */
.node .ohalo { fill: none; stroke-width: 2.4; opacity: 0; transition: opacity 0.2s; }
.node .ohalo.on { opacity: 0.9; }
.ohalo.a { stroke: var(--halo-a); } .ohalo.b { stroke: var(--halo-b); } .ohalo.c { stroke: var(--halo-c); }

/* super-nodes (bundle / narrative) — rounded boxes, not dots */
.snode { cursor: pointer; }
.snode rect.sbody { stroke-width: 1.4; rx: 7; transition: opacity 0.2s; }
.snode[data-kind="bundle"]    rect.sbody { fill: rgba(157,178,189,0.10); stroke: var(--bundle); }
.snode[data-kind="narrative"] rect.sbody { fill: rgba(201,178,126,0.12); stroke: var(--narrative); }
.snode .stitle { fill: var(--text); font-family: "Fraunces", serif; font-size: 12px; text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: var(--ink); stroke-width: 3.5px; stroke-linejoin: round; }
.snode .smeta  { fill: var(--dim); font-size: 7.5px; letter-spacing: 0.12em; text-transform: uppercase; text-anchor: middle; pointer-events: none; }
.snode .skind  { font-size: 7px; letter-spacing: 0.18em; text-transform: uppercase; text-anchor: middle; pointer-events: none; }
.snode[data-kind="bundle"]    .skind { fill: var(--bundle); }
.snode[data-kind="narrative"] .skind { fill: var(--narrative); }
.snode .sseal { } /* archival seal dot, reuse .seal styling via class */
.snode.archived .sseal { fill: var(--seal); stroke: var(--seal); filter: drop-shadow(0 0 3px var(--seal)); }
.snode:not(.archived) .sseal { fill: none; stroke: var(--dimmer); }
.snode.faded { opacity: 0.15; }
.snode.lit rect.sbody { filter: drop-shadow(0 0 10px currentColor); }
.snode[data-kind="bundle"].lit    { color: var(--bundle); }
.snode[data-kind="narrative"].lit { color: var(--narrative); }

/* -------------------------------------------------------------- inspector */
.inspector {
  position: absolute; top: 1rem; right: 1rem; bottom: 1rem; width: min(400px, 86vw);
  z-index: 6; background: linear-gradient(180deg, var(--ink-1), var(--ink));
  border: 1px solid var(--line-2); border-radius: 4px; box-shadow: var(--shadow);
  padding: 1.4rem 1.4rem 1.2rem; overflow-y: auto;
  transform: translateX(calc(100% + 1.5rem)); opacity: 0;
  transition: transform 0.42s cubic-bezier(0.16,1,0.3,1), opacity 0.3s;
}
.inspector[data-open="true"] { transform: none; opacity: 1; }
.inspector-close {
  position: absolute; top: 0.9rem; right: 0.9rem; background: none; cursor: pointer;
  border: 1px solid var(--line-2); color: var(--dim); border-radius: 3px;
  font-family: inherit; font-size: 0.62rem; letter-spacing: 0.1em; padding: 0.2rem 0.45rem;
}
.inspector-close:hover { color: var(--text); border-color: var(--dim); }
.insp-kind { display: inline-block; font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; padding: 0.25rem 0.6rem; border-radius: 2px; border: 1px solid currentColor; margin-bottom: 1rem; }
.insp-title { font-family: "Fraunces", serif; font-weight: 400; font-size: 1.3rem; line-height: 1.3; margin: 0 0 1.1rem; color: var(--text); }
.insp-title em { color: var(--dim); font-style: italic; }
.field { margin: 0 0 0.95rem; }
.field > label { display: block; font-size: 0.58rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dimmer); margin-bottom: 0.3rem; }
.field .val { font-size: 0.82rem; color: var(--text); word-break: break-word; line-height: 1.5; }
.cid { display: flex; align-items: center; gap: 0.5rem; font-size: 0.72rem; color: var(--dim); word-break: break-all; background: var(--ink-2); border: 1px solid var(--line); padding: 0.45rem 0.55rem; border-radius: 3px; }
.cid .seal-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.seal-ok  { background: var(--ok);  box-shadow: 0 0 8px var(--ok); }
.seal-bad { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.seal-off { background: transparent; border: 1px solid var(--dimmer); }
.seals { display: grid; grid-template-columns: 1fr; gap: 0.5rem; }
.seal-row { display: flex; align-items: center; gap: 0.6rem; border: 1px solid var(--line); border-radius: 3px; padding: 0.5rem 0.6rem; background: var(--ink-1); }
.seal-row .glyph { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font-size: 0.7rem; }
.seal-row.on  .glyph { color: var(--seal);  border: 1px solid var(--seal); box-shadow: 0 0 10px -2px var(--seal); }
.seal-row.off .glyph { color: var(--dimmer); border: 1px solid var(--dimmer); }
.seal-row .meta b { display: block; font-size: 0.74rem; font-weight: 500; color: var(--text); }
.seal-row .meta span { font-size: 0.6rem; letter-spacing: 0.06em; color: var(--dim); }
.insp-edges { margin-top: 0.4rem; }
.insp-edges .e { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.4rem 0; border-top: 1px solid var(--line); font-size: 0.74rem; }
.insp-edges .e .rel { font-size: 0.58rem; letter-spacing: 0.12em; text-transform: uppercase; flex: none; width: 78px; }
.insp-edges .e .rel.supports { color: var(--supports); }
.insp-edges .e .rel.opposes { color: var(--opposes); }
.insp-edges .e .rel.addresses { color: var(--addresses); }
.insp-edges .e .rel.informs { color: var(--informs); }
.insp-edges .e .rel.versionof { color: var(--versionof); }
.insp-edges .e .rel.equivalentto { color: var(--equivalentto); }
.insp-edges .e .to { color: var(--dim); cursor: pointer; }
.insp-edges .e .to:hover { color: var(--text); }
.dual { display: grid; gap: 0.4rem; margin-top: 0.3rem; }
.dual .end { display: flex; align-items: center; gap: 0.45rem; font-size: 0.64rem; }
.dual .end .seal-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.dual .end .end-k { color: var(--dimmer); text-transform: uppercase; letter-spacing: 0.1em; width: 46px; flex: none; }
.dual .end .to { color: var(--dim); cursor: pointer; flex: 1; }
.dual .end .to:hover { color: var(--text); }
.dual .end .end-cid { color: var(--dim); font-size: 0.55rem; letter-spacing: 0.08em; }
.val-prose { white-space: pre-wrap; line-height: 1.55; max-height: 40vh; overflow-y: auto; font-size: 0.72rem; color: var(--text); }

/* inspector buttons (drill in, open reading, …) */
.insp-action {
  display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; margin-top: 0.2rem;
  background: var(--raise); border: 1px solid var(--line-2); border-radius: 3px; color: var(--text);
  font-family: inherit; font-size: 0.68rem; letter-spacing: 0.1em; padding: 0.5rem 0.8rem;
}
.insp-action:hover { border-color: var(--claim); }
.insp-action.read { border-color: var(--narrative); }

/* cold-storage proof (ROADMAP Step 7) — "prove it from IPFS, with the PDS off."
   Rendered in the glacial-blue --seal cold-storage language; chain links echo the
   seal-row styling. The whole affordance is read-only (no auth, authors nothing). */
.field.coldverify > label { color: var(--seal); }
.coldverify-btn { border-color: rgba(127, 209, 232, 0.4); color: var(--seal); }
.coldverify-btn:hover:not(:disabled) { border-color: var(--seal); background: rgba(127, 209, 232, 0.1); box-shadow: 0 0 14px -4px var(--seal); }
.coldverify-btn:disabled { opacity: 0.55; cursor: default; }
.coldverify-result { margin-top: 0.6rem; display: grid; gap: 0.55rem; }
.coldverify-result:empty { display: none; }
.cv-running { font-size: 0.66rem; letter-spacing: 0.03em; color: var(--dim); line-height: 1.5; display: flex; align-items: center; gap: 0.55rem; }
.cv-running .spin { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line-2); border-top-color: var(--seal); animation: spin 0.9s linear infinite; }
.cv-verdict { font-family: "Fraunces", serif; font-size: 0.95rem; padding: 0.55rem 0.7rem; border-radius: 3px; line-height: 1.3; }
.cv-verdict.ok  { color: var(--seal); background: rgba(127, 209, 232, 0.08); border: 1px solid rgba(127, 209, 232, 0.35); box-shadow: 0 0 16px -6px var(--seal); }
.cv-verdict.bad { color: var(--bad); background: rgba(231, 106, 91, 0.08); border: 1px solid rgba(231, 106, 91, 0.35); }
.cv-chain { display: grid; gap: 0.4rem; }
.cv-link { display: flex; align-items: flex-start; gap: 0.55rem; border: 1px solid var(--line); border-radius: 3px; padding: 0.45rem 0.55rem; background: var(--ink-1); }
.cv-link .glyph { flex: none; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; font-size: 0.66rem; margin-top: 0.05rem; }
.cv-link.ok  .glyph { color: var(--seal); border: 1px solid var(--seal); box-shadow: 0 0 10px -2px var(--seal); }
.cv-link.bad .glyph { color: var(--bad); border: 1px solid var(--bad); }
.cv-link .cv-meta b { display: block; font-size: 0.72rem; font-weight: 500; color: var(--text); }
.cv-link .cv-meta span { font-size: 0.58rem; letter-spacing: 0.02em; color: var(--dim); line-height: 1.45; word-break: break-word; }
.cv-did { font-size: 0.64rem; color: var(--dim); }
.cv-did b { color: var(--text); font-weight: 500; }
.cv-mono { font-family: "IBM Plex Mono", monospace; font-size: 0.6rem; color: var(--dimmer); word-break: break-all; }
.cv-framing { font-size: 0.62rem; color: var(--dim); line-height: 1.5; border-left: 2px solid var(--seal); padding-left: 0.6rem; }
.cv-framing b { color: var(--seal); }

/* canonical-source block */
.canon { border: 1px solid var(--line); border-radius: 3px; background: var(--ink-1); padding: 0.6rem 0.65rem; }
.canon .usage { font-family: "Fraunces", serif; font-size: 1.5rem; color: var(--source); line-height: 1; }
.canon .usage small { font-family: "IBM Plex Mono", monospace; font-size: 0.56rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dimmer); margin-left: 0.4rem; }
.canon .split { margin-top: 0.5rem; display: grid; gap: 0.25rem; }
.canon .split .row { display: flex; justify-content: space-between; font-size: 0.66rem; color: var(--dim); }
.canon .split .row b { color: var(--text); font-weight: 500; }
.canon .merged { margin-top: 0.55rem; font-size: 0.62rem; color: var(--source); letter-spacing: 0.04em; }
.canon .members { margin-top: 0.35rem; display: grid; gap: 0.3rem; }
.canon .members .m { font-size: 0.6rem; color: var(--dim); border-top: 1px solid var(--line); padding-top: 0.3rem; }
.canon .members .m .who { color: var(--dimmer); }

/* member-type breakdown bar (bundle inspector) */
.typebar { display: flex; height: 10px; border-radius: 2px; overflow: hidden; border: 1px solid var(--line); }
.typebar i { display: block; height: 100%; }
.typebar i.claim { background: var(--claim); } .typebar i.evidence { background: var(--evidence); }
.typebar i.question { background: var(--question); } .typebar i.source { background: var(--source); }
.typebar i.issue { background: var(--issue); } .typebar i.edge { background: var(--dimmer); }
.typelegend { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; margin-top: 0.45rem; font-size: 0.6rem; color: var(--dim); }
.typelegend span i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 0.3rem; vertical-align: baseline; }

/* ------------------------------------------------- narrative reading view */
.reader {
  position: absolute; inset: 0; z-index: 8; overflow-y: auto;
  background: linear-gradient(180deg, #0c0f11, #090b0c);
  opacity: 0; pointer-events: none; transition: opacity 0.4s;
}
.reader[data-open="true"] { opacity: 1; pointer-events: auto; }
.reader-bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.7rem 1.3rem; border-bottom: 1px solid var(--line-2);
  background: rgba(9,11,12,0.85); backdrop-filter: blur(6px);
}
.reader-bar .rb-kind { font-size: 0.6rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--narrative); }
.reader-close { background: none; border: 1px solid var(--line-2); color: var(--dim); border-radius: 3px; cursor: pointer; font-family: inherit; font-size: 0.62rem; letter-spacing: 0.1em; padding: 0.25rem 0.55rem; }
.reader-close:hover { color: var(--text); border-color: var(--dim); }
.prose {
  max-width: 720px; margin: 2.4rem auto 6rem; padding: 0 1.6rem;
  font-family: "Fraunces", Georgia, serif; font-size: 1.04rem; line-height: 1.72; color: #dde0d8;
}
.prose h1 { font-size: 2rem; font-weight: 500; line-height: 1.18; margin: 2.2rem 0 0.4rem; letter-spacing: 0.01em; }
.prose h2 { font-size: 1.5rem; font-weight: 500; margin: 2.2rem 0 0.6rem; }
.prose h3 { font-size: 1.18rem; font-weight: 500; color: #eef0e8; margin: 1.8rem 0 0.5rem; }
.prose h4, .prose h5, .prose h6 { font-size: 1rem; font-weight: 600; color: var(--dim); margin: 1.4rem 0 0.4rem; letter-spacing: 0.02em; }
.prose p { margin: 0 0 1.05rem; }
.prose strong { color: #fff; font-weight: 600; }
.prose em { font-style: italic; }
.prose ul, .prose ol { margin: 0 0 1.1rem; padding-left: 1.5rem; }
.prose li { margin: 0.3rem 0; }
.prose hr { border: none; border-top: 1px solid var(--line-2); margin: 2rem 0; }
.prose figure { margin: 1.8rem 0; text-align: center; }
.prose figure img { max-width: 100%; background: #f5f3ec; border: 1px solid var(--line-2); border-radius: 4px; padding: 0.8rem; }
.prose figcaption { font-family: "IBM Plex Mono", monospace; font-size: 0.68rem; color: var(--dim); margin-top: 0.6rem; line-height: 1.5; }
/* numbered citations — superscript, click → into the graph */
.prose .cite { font-family: "IBM Plex Mono", monospace; font-size: 0.62rem; color: var(--claim); cursor: pointer; vertical-align: super; line-height: 0; padding: 0 0.05em; }
.prose .cite:hover { text-decoration: underline; }
.prose .cite.bad { color: var(--bad); }
/* reference section */
.refs { max-width: 720px; margin: 0 auto 6rem; padding: 1.6rem; border-top: 1px solid var(--line-2); font-family: "IBM Plex Mono", monospace; }
.refs h3 { font-family: "Fraunces", serif; font-weight: 500; font-size: 1.1rem; color: var(--text); margin: 0 0 0.9rem; }
.refs ol { margin: 0; padding-left: 2.2rem; }
.refs li { font-size: 0.74rem; color: var(--dim); line-height: 1.5; margin: 0.4rem 0; }
.refs li .rkey { color: var(--claim); cursor: pointer; }
.refs li .rkey:hover { text-decoration: underline; }
.refs li .seal-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 0.4rem; vertical-align: baseline; }
.reader-loading { max-width: 720px; margin: 4rem auto; padding: 0 1.6rem; color: var(--dim); letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.7rem; }

/* ------------------------------------------------- opportunities lens (Step 5) */
.lens-switch button.lens-fund { color: var(--claim); }
.lens-switch button.lens-fund.active { box-shadow: inset 0 -2px 0 var(--claim); }
.opportunities {
  position: absolute; inset: 0; z-index: 8; overflow-y: auto;
  background: linear-gradient(180deg, #0c0f11, #090b0c);
  opacity: 0; pointer-events: none; transition: opacity 0.4s;
}
.opportunities[data-open="true"] { opacity: 1; pointer-events: auto; }
.opp-bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.7rem 1.3rem; border-bottom: 1px solid var(--line-2);
  background: rgba(9,11,12,0.85); backdrop-filter: blur(6px);
}
.opp-bar .rb-kind { font-size: 0.6rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--claim); }
#opportunities-body { max-width: 860px; margin: 0 auto; padding: 1.8rem 1.6rem 6rem; }
.opp-intro { font-family: "Fraunces", Georgia, serif; font-size: 1.02rem; line-height: 1.6; color: #dde0d8; margin: 0.4rem 0 2rem; }
.opp-intro b { color: #fff; font-weight: 600; }
.opp-intro code { font-family: "IBM Plex Mono", monospace; font-size: 0.82em; color: var(--claim); }
.opp-section { margin: 0 0 2.2rem; }
.opp-head h3 { font-family: "Fraunces", serif; font-weight: 500; font-size: 1.2rem; color: var(--text); margin: 0 0 0.15rem; display: flex; align-items: baseline; gap: 0.6rem; }
.opp-head .opp-count { font-family: "IBM Plex Mono", monospace; font-size: 0.85rem; color: var(--dim); font-weight: 400; }
.opp-head p { margin: 0 0 0.8rem; font-size: 0.72rem; letter-spacing: 0.04em; color: var(--dimmer); }
.opp-list { display: flex; flex-direction: column; gap: 0.4rem; }
.opp-item {
  display: flex; align-items: center; gap: 0.8rem; cursor: pointer;
  background: var(--ink-1); border: 1px solid var(--line); border-radius: 4px;
  padding: 0.6rem 0.75rem; transition: border-color 0.16s, background 0.16s;
}
.opp-item:hover { border-color: var(--line-2); background: var(--ink-2); }
.opp-badge {
  flex: none; font-family: "IBM Plex Mono", monospace; font-size: 0.6rem; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 0.22rem 0.5rem; border-radius: 3px; min-width: 5.8rem; text-align: center;
}
.opp-badge.open { color: var(--question); background: rgba(92,177,230,0.12); border: 1px solid rgba(92,177,230,0.3); }
.opp-badge.thin { color: var(--dim); background: rgba(130,141,147,0.1); border: 1px solid var(--line-2); }
.opp-badge.issue { color: var(--issue); background: rgba(177,140,242,0.12); border: 1px solid rgba(177,140,242,0.3); }
.opp-badge.contested { color: var(--contested); background: rgba(232,148,60,0.12); border: 1px solid rgba(232,148,60,0.3); }
.opp-text { flex: 1; min-width: 0; font-size: 0.86rem; color: var(--text); line-height: 1.4; }
.opp-go { flex: none; color: var(--dimmer); font-size: 0.9rem; }
.opp-item:hover .opp-go { color: var(--text); }
.opp-empty { font-size: 0.78rem; color: var(--dim); font-style: italic; padding: 0.5rem 0 0.5rem 0.8rem; border-left: 2px solid var(--line-2); }

/* ---------------------------------------------------------------- legend */
.legend { position: absolute; left: 1rem; bottom: 1rem; z-index: 4; display: flex; flex-direction: column; gap: 0.5rem; background: rgba(9,11,12,0.6); border: 1px solid var(--line); padding: 0.65rem 0.8rem; border-radius: 4px; backdrop-filter: blur(4px); max-width: 44vw; }
.legend-group { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.legend-title { font-size: 0.54rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dimmer); width: 54px; }
.chip { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.62rem; color: var(--dim); }
.chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chip[data-type="claim"] i    { background: var(--claim); }
.chip[data-type="evidence"] i { background: var(--evidence); }
.chip[data-type="question"] i { background: var(--question); }
.chip[data-type="source"] i   { background: var(--source); }
.chip[data-type="issue"] i    { background: var(--issue); }
.chip.rel i { border-radius: 1px; height: 3px; width: 16px; }
.chip[data-rel="supports"] i  { background: var(--supports); }
.chip[data-rel="opposes"] i   { background: var(--opposes); }
.chip[data-rel="addresses"] i { background: var(--addresses); }
.chip[data-rel="informs"] i   { background: var(--informs); }
.chip.box i { border-radius: 2px; width: 12px; height: 9px; border: 1px solid; }
.chip[data-box="bundle"] i { background: rgba(157,178,189,0.15); border-color: var(--bundle); }
.chip[data-box="narrative"] i { background: rgba(201,178,126,0.15); border-color: var(--narrative); }
.chip.seal i { background: var(--seal); box-shadow: 0 0 6px var(--seal); }

.hint { position: absolute; bottom: 1.1rem; left: 50%; transform: translateX(-50%); z-index: 3; font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dimmer); pointer-events: none; transition: opacity 0.5s; text-align: center; }

.loader { position: absolute; inset: 0; z-index: 7; display: grid; place-content: center; justify-items: center; gap: 1rem; color: var(--dim); letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.7rem; background: var(--ink); transition: opacity 0.6s; }
.loader span { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--line-2); border-top-color: var(--claim); animation: spin 0.9s linear infinite; }
.loader.gone { opacity: 0; pointer-events: none; }

/* -------------------------------------------------------------- colophon */
.colophon { position: relative; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 0.45rem 1.3rem; border-top: 1px solid var(--line-2); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dimmer); background: rgba(9,11,12,0.7); }
.colophon .src { color: var(--dim); }
.colophon a { color: var(--dim); text-decoration: none; border-bottom: 1px dotted var(--line-2); }
.colophon a:hover { color: var(--text); }

.node, .snode { animation: rise 0.5s cubic-bezier(0.16,1,0.3,1) backwards; }
@keyframes rise { from { opacity: 0; transform: scale(0.4); } }

/* overlay bundle-picker (overlay lens / drill toggle) */
.picker { position: absolute; top: 1rem; left: 1rem; z-index: 5; width: 250px; max-width: 80vw; background: rgba(9,11,12,0.82); border: 1px solid var(--line-2); border-radius: 4px; backdrop-filter: blur(6px); padding: 0.7rem 0.8rem; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.picker[data-open="true"] { opacity: 1; pointer-events: auto; }
.picker h4 { margin: 0 0 0.5rem; font-size: 0.58rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dimmer); }
.picker .pb { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.3rem; cursor: pointer; border-radius: 3px; font-size: 0.7rem; color: var(--dim); }
.picker .pb:hover { background: var(--ink-2); color: var(--text); }
.picker .pb .swatch { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--dimmer); flex: none; }
.picker .pb.sel { color: var(--text); }
.picker .pb.sel.a .swatch { background: var(--halo-a); border-color: var(--halo-a); }
.picker .pb.sel.b .swatch { background: var(--halo-b); border-color: var(--halo-b); }
.picker .pb.sel.c .swatch { background: var(--halo-c); border-color: var(--halo-c); }
.picker .pb .pcount { margin-left: auto; font-size: 0.56rem; color: var(--dimmer); letter-spacing: 0.08em; }
.picker .note { margin-top: 0.5rem; font-size: 0.56rem; color: var(--dimmer); line-height: 1.5; }

@media (max-width: 760px) {
  .readout .stat { display: none; }
  .legend { display: none; }
  .mark-text p { display: none; }
  .nav-chrome { justify-content: flex-start; }
}

/* ============================================================================
   AUTHORING (ROADMAP Step 2) — the "+ New" control, create-and-connect moves,
   the node-creation form, the draw-relation banner, and the optimistic
   "pending" -> cold-storage "pinned" seal transition. Source-ordered last so
   `.pending` overrides the base seal rules (equal specificity).
   ========================================================================== */

/* masthead "+ New" (auth-gated: app.js toggles [hidden] on sign-in/out) */
.compose-new {
  flex: none; margin-left: 0.2rem;
  background: rgba(236,192,73,0.14); border: 1px solid var(--line-2); border-radius: 4px;
  color: var(--claim); cursor: pointer; font: inherit; font-size: 0.66rem;
  letter-spacing: 0.14em; text-transform: uppercase; padding: 0.4rem 0.7rem; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.compose-new:hover { background: rgba(236,192,73,0.24); border-color: var(--claim); }
.compose-new[hidden] { display: none; }

/* create-and-connect move buttons + the connect-two relation picker */
.moves { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.35rem; }
.move-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; text-align: left;
  background: var(--ink-1); border: 1px solid var(--line-2); border-radius: 4px; color: var(--text);
  cursor: pointer; font: inherit; font-size: 0.74rem; padding: 0.5rem 0.6rem; transition: border-color 0.15s, background 0.15s;
}
.move-btn:hover { border-color: var(--claim); background: var(--raise); }
.move-btn .mv-label { line-height: 1.35; }
.move-btn .mv-rel {
  flex: none; font-size: 0.54rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.12rem 0.4rem; border-radius: 2px; border: 1px solid currentColor;
}
.mv-rel.supports { color: var(--supports); } .mv-rel.opposes { color: var(--opposes); }
.mv-rel.addresses { color: var(--addresses); } .mv-rel.informs { color: var(--informs); }
.moves.type-pick .move-btn { text-transform: capitalize; }
.moves.type-pick .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.moves.type-pick .dot.claim { background: var(--claim); } .moves.type-pick .dot.evidence { background: var(--evidence); }
.moves.type-pick .dot.question { background: var(--question); } .moves.type-pick .dot.source { background: var(--source); }
.field.authoring { border-top: 1px solid var(--line-2); padding-top: 0.85rem; }
.insp-action.draw { margin-top: 0.6rem; border-color: var(--line-2); color: var(--dim); }
.insp-action.draw:hover { border-color: var(--addresses); color: var(--text); }

/* ---------- standing (curation lens) + endorse controls (Step 3) ---------- */
/* read-only standing panel */
.standing-box { border: 1px solid var(--line); border-radius: 3px; background: var(--ink-1); padding: 0.55rem 0.6rem; }
.standing-class {
  display: inline-block; font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase;
  padding: 0.2rem 0.55rem; border-radius: 2px; border: 1px solid currentColor;
}
.standing-class.credible  { color: var(--credible); }
.standing-class.contested { color: var(--contested); }
.standing-class.weakened  { color: var(--weakened); }
.standing-class.neutral   { color: var(--dim); }
.standing-note { font-size: 0.62rem; color: var(--dimmer); margin-top: 0.4rem; letter-spacing: 0.04em; }
.standing-box .split { margin-top: 0.5rem; display: grid; gap: 0.25rem; }
.standing-box .split .row { display: flex; justify-content: space-between; font-size: 0.66rem; color: var(--dim); gap: 0.6rem; }
.standing-box .split .row b { font-weight: 500; text-transform: capitalize; }
.standing-box .split .row b.believe, .standing-box .split .row b.verified, .standing-box .split .row b.qualified { color: var(--credible); }
.standing-box .split .row b.disbelieve, .standing-box .split .row b.failedToVerify { color: var(--weakened); }
/* redesigned standing panel: head + your-stance + per-type tally + details toggle */
.standing-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.standing-count { font-size: 0.6rem; color: var(--dimmer); letter-spacing: 0.04em; }
/* PLACEHOLDER attribution (see TODO.md): the verdict is "according to the default lens",
   never the truth; the swap affordance is intentionally disabled until the algorithm
   registry is built. */
.standing-attrib { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 0.4rem; font-size: 0.6rem; color: var(--dimmer); letter-spacing: 0.03em; }
.standing-attrib b { color: var(--dim); font-weight: 500; }
.lens-swap { background: none; border: 1px dashed var(--line-2); border-radius: 3px; color: var(--dimmer); font: inherit; font-size: 0.56rem; letter-spacing: 0.04em; padding: 0.16rem 0.4rem; cursor: not-allowed; white-space: nowrap; }
.standing-you { margin-top: 0.5rem; font-size: 0.66rem; color: var(--dim); }
.standing-you b { text-transform: capitalize; }
.standing-you b.believe, .standing-you b.verified, .standing-you b.qualified { color: var(--credible); }
.standing-you b.disbelieve, .standing-you b.failedToVerify { color: var(--weakened); }
.standing-you .none { color: var(--dimmer); }
/* PER-AXIS verdicts: two independent badges (credence + verification) + a qualified chip */
.axis-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: stretch; }
.axis-badge { display: grid; gap: 0.05rem; flex: 1 1 0; min-width: 0; border: 1px solid currentColor; border-radius: 3px; padding: 0.28rem 0.45rem; color: var(--dim); }
.axis-badge .axis-name { font-size: 0.52rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.8; }
.axis-badge .axis-verdict { font-size: 0.74rem; letter-spacing: 0.02em; text-transform: uppercase; font-weight: 600; }
.axis-badge .axis-counts { font-size: 0.56rem; opacity: 0.7; font-variant-numeric: tabular-nums; }
.axis-badge.believed, .axis-badge.verified { color: var(--credible); }
.axis-badge.contested { color: var(--contested); }
.axis-badge.disputed, .axis-badge.failed { color: var(--weakened); }
.axis-badge.unrated, .axis-badge.unchecked { color: var(--dimmer); }
.qual-chip { align-self: center; font-size: 0.58rem; letter-spacing: 0.04em; color: var(--qualified, var(--credible)); border: 1px dashed currentColor; border-radius: 3px; padding: 0.16rem 0.4rem; white-space: nowrap; }
/* per-endorser stance badges on the endorsements page */
.endorse-list-scroll .dstances { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.endorse-list-scroll .dstances b { font-weight: 500; text-transform: capitalize; }
.endorse-list-scroll .dstances b.believe, .endorse-list-scroll .dstances b.verified, .endorse-list-scroll .dstances b.qualified { color: var(--credible); }
.endorse-list-scroll .dstances b.disbelieve, .endorse-list-scroll .dstances b.failedToVerify { color: var(--weakened); }
/* a stance you already hold: "current ✓", disabled */
.endorse-btn:disabled { cursor: default; }
.standing-box .tally { margin-top: 0.5rem; display: grid; gap: 0.18rem; }
.standing-box .tally .trow { display: flex; justify-content: space-between; font-size: 0.66rem; color: var(--text); gap: 0.6rem; }
.standing-box .tally .trow.zero { color: var(--dimmer); }
.standing-box .tally .trow b { font-weight: 600; font-variant-numeric: tabular-nums; }
.standing-box .tally .tname { text-transform: capitalize; }
.standing-box .tally .tname.believe, .standing-box .tally .tname.verified, .standing-box .tally .tname.qualified { color: var(--credible); }
.standing-box .tally .trow.zero .tname { color: inherit; }
.standing-box .tally .tname.disbelieve, .standing-box .tally .tname.failedToVerify { color: var(--weakened); }
.standing-toggle {
  margin-top: 0.55rem; cursor: pointer; background: none; border: none; padding: 0;
  color: var(--claim); font: inherit; font-size: 0.62rem; letter-spacing: 0.06em;
}
.standing-toggle:hover { text-decoration: underline; }
/* the dedicated endorsements PAGE: a scrollable list (a node may have many endorsers) */
.endorse-list-scroll { margin-top: 0.35rem; display: grid; gap: 0.4rem; max-height: 46vh; overflow-y: auto; padding-right: 0.2rem; }
.endorse-list-scroll .drow { display: grid; gap: 0.12rem; }
.endorse-list-scroll .dtop { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; font-size: 0.66rem; }
.endorse-list-scroll .dwho { color: var(--text); }
.endorse-list-scroll .dtop b { font-weight: 500; text-transform: capitalize; }
.endorse-list-scroll .dtop b.believe, .endorse-list-scroll .dtop b.verified, .endorse-list-scroll .dtop b.qualified { color: var(--credible); }
.endorse-list-scroll .dtop b.disbelieve, .endorse-list-scroll .dtop b.failedToVerify { color: var(--weakened); }
.endorse-list-scroll .dmeta { font-size: 0.6rem; color: var(--dimmer); }
.endorse-list-scroll .drow.neutralized, .endorse-list-scroll .drow.excluded { opacity: 0.7; }
/* endorse buttons — a stance grid; the user's current stance is outlined */
.field.endorse .endorse-btns { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; }
.endorse-btn {
  cursor: pointer; background: var(--raise); border: 1px solid var(--line-2); border-radius: 3px;
  color: var(--text); font: inherit; font-size: 0.64rem; letter-spacing: 0.04em; padding: 0.32rem 0.55rem;
}
.endorse-btn:hover { border-color: var(--credible); }
.endorse-btn.believe:hover, .endorse-btn.verified:hover, .endorse-btn.qualified:hover { border-color: var(--credible); color: var(--credible); }
.endorse-btn.disbelieve:hover, .endorse-btn.failedToVerify:hover { border-color: var(--weakened); color: var(--weakened); }
.endorse-btn.mine { border-color: var(--credible); color: var(--credible); box-shadow: inset 0 0 0 1px var(--credible); }
.endorse-btn.picked { border-color: var(--claim); color: var(--claim); box-shadow: inset 0 0 0 1px var(--claim); }
.move-btn.picked { border-color: var(--claim); color: var(--claim); box-shadow: inset 0 0 0 1px var(--claim); }
.insp-action.endorse-submit, .insp-action.withdraw-submit { width: 100%; margin-top: 0.5rem; }
.insp-action.endorse-submit:disabled, .insp-action.withdraw-submit:disabled { opacity: 0.5; cursor: default; }
.endorse-qual {
  width: 100%; margin-top: 0.45rem; background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 4px;
  color: var(--text); font: inherit; font-size: 0.72rem; padding: 0.4rem 0.5rem; outline: none;
}
.endorse-qual:focus { border-color: var(--claim); }
.endorse-you { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 0.55rem; font-size: 0.68rem; color: var(--dim); }
.endorse-you b { text-transform: capitalize; }
.insp-action.withdraw { margin-top: 0; border-color: var(--line-2); color: var(--dim); font-size: 0.62rem; padding: 0.3rem 0.6rem; }
.insp-action.withdraw:hover { border-color: var(--warn); color: var(--warn); }

/* the create-node + create-bundle forms (shared field styling) */
form[data-nodeform] textarea, form[data-nodeform] input[type="text"], form[data-nodeform] select,
form[data-bundleform] textarea, form[data-bundleform] input[type="text"], form[data-bundleform] select {
  width: 100%; background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 4px;
  color: var(--text); font: inherit; font-size: 0.8rem; padding: 0.45rem 0.55rem; outline: none; resize: vertical;
}
form[data-nodeform] textarea:focus, form[data-nodeform] input:focus, form[data-nodeform] select:focus,
form[data-bundleform] textarea:focus, form[data-bundleform] input:focus, form[data-bundleform] select:focus {
  border-color: var(--question); box-shadow: 0 0 0 1px rgba(92,177,230,0.3);
}
form[data-nodeform] .nudge, form[data-bundleform] .nudge { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn); }
form[data-nodeform] label .req, form[data-bundleform] label .req { color: var(--bad); font-style: normal; }
form[data-nodeform] .fhint { font-size: 0.58rem; color: var(--dimmer); margin-top: 0.25rem; letter-spacing: 0.04em; }
.form-actions { display: flex; gap: 0.5rem; margin-top: 0.4rem; }
.insp-action.publish { border-color: var(--claim); color: var(--claim); }
.insp-action.publish:hover { background: rgba(236,192,73,0.14); }
.insp-action.publish:disabled { opacity: 0.55; cursor: default; }
.insp-action.cancel { color: var(--dim); }

/* draw-relation mode banner (top-center) */
.compose-banner {
  position: absolute; top: 1rem; left: 50%; transform: translateX(-50%) translateY(-12px);
  z-index: 7; background: rgba(20,27,31,0.92); border: 1px solid var(--addresses); border-radius: 4px;
  color: var(--text); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.5rem 0.9rem; box-shadow: var(--shadow); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.compose-banner[data-open="true"] { opacity: 1; transform: translateX(-50%) translateY(0); }

/* optimistic "pending" seal (amber, pulsing) -> flips to the glacial "pinned"
   seal (.archived) once the AppView confirms index + cold-storage archive. */
@keyframes pulse-seal { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.node.pending .seal { fill: var(--warn); stroke: var(--warn); filter: drop-shadow(0 0 3px var(--warn)); animation: pulse-seal 1.1s ease-in-out infinite; }
.node.pending circle.body { stroke: var(--warn); stroke-dasharray: 2.5 2.5; }
.node.stalled .seal { fill: var(--bad); stroke: var(--bad); animation: none; }
.edge-seal.pending { fill: var(--warn); stroke: var(--warn); opacity: 1; animation: pulse-seal 1.1s ease-in-out infinite; }
.edge-seal.stalled { fill: var(--bad); stroke: var(--bad); opacity: 1; animation: none; }

/* ============================================================================
   BUNDLE + NARRATIVE AUTHORING (ROADMAP Step 4) — the "⊟ select" toggle, the
   multi-select action bar, the create-bundle member preview, and the narrative
   composer (a Markdown editor with [@rkey] citation insertion).
   ========================================================================== */

/* masthead select toggle reuses the "+ New" pill, tinted steel (bundle color) */
.compose-new.select-toggle { background: rgba(157,178,189,0.12); color: var(--bundle); }
.compose-new.select-toggle:hover { background: rgba(157,178,189,0.22); border-color: var(--bundle); }
.compose-new.select-toggle.active { background: rgba(157,178,189,0.28); border-color: var(--bundle); color: var(--text); }

/* the create-bundle member preview (reuses .members/.m/.who from the canon block) */
.members { margin-top: 0.4rem; display: grid; gap: 0.32rem; max-height: 11rem; overflow-y: auto; }
.members .m { font-size: 0.66rem; color: var(--dim); border-top: 1px solid var(--line); padding-top: 0.3rem; line-height: 1.4; }
.members .m .who { font-size: 0.54rem; letter-spacing: 0.1em; text-transform: uppercase; margin-right: 0.4rem; color: var(--dimmer); }
.members .m .who.claim { color: var(--claim); } .members .m .who.evidence { color: var(--evidence); }
.members .m .who.question { color: var(--question); } .members .m .who.source { color: var(--source); }
.insp-action.narrate { border-color: var(--narrative); color: var(--narrative); margin-top: 0.55rem; }
.insp-action.narrate:hover { background: rgba(201,178,126,0.12); }

/* multi-select → bundle: the floating action bar (bottom-center) */
.select-bar {
  position: absolute; bottom: 2.4rem; left: 50%; transform: translateX(-50%) translateY(14px);
  z-index: 7; display: flex; align-items: center; gap: 0.7rem;
  background: rgba(20,27,31,0.94); border: 1px solid var(--bundle); border-radius: 6px;
  padding: 0.5rem 0.7rem; box-shadow: var(--shadow); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.select-bar[data-open="true"] { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.select-bar .sb-label { font-size: 0.58rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--bundle); }
.select-bar .sb-stat { font-size: 0.72rem; color: var(--dim); }
.select-bar .sb-stat b { color: var(--text); font-weight: 600; }
.sb-btn {
  cursor: pointer; background: var(--raise); border: 1px solid var(--line-2); border-radius: 3px;
  color: var(--text); font: inherit; font-size: 0.64rem; letter-spacing: 0.06em; padding: 0.32rem 0.6rem;
  transition: border-color 0.15s, background 0.15s;
}
.sb-btn:hover { border-color: var(--bundle); }
.sb-btn.primary { border-color: var(--narrative); color: var(--narrative); }
.sb-btn.primary:hover { background: rgba(201,178,126,0.14); }
.sb-btn.primary:disabled { opacity: 0.45; cursor: default; border-color: var(--line-2); color: var(--dim); }

/* the narrative composer (full overlay, like the reading view) */
.composer {
  position: absolute; inset: 0; z-index: 9; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0c0f11, #090b0c);
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.composer[data-open="true"] { opacity: 1; pointer-events: auto; }
.composer-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem 1.3rem; border-bottom: 1px solid var(--line-2); background: rgba(9,11,12,0.85); backdrop-filter: blur(6px);
}
.composer-bar .cb-left { display: flex; align-items: baseline; gap: 0.8rem; min-width: 0; }
.composer-bar .rb-kind { font-size: 0.6rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--narrative); }
.composer-bar .cb-over { font-size: 0.7rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer-bar .cb-over b { color: var(--text); font-weight: 500; }
.composer-body { flex: 1; overflow-y: auto; max-width: 820px; width: 100%; margin: 0 auto; padding: 1.4rem 1.6rem 4rem; }
.composer-title {
  width: 100%; background: none; border: none; border-bottom: 1px solid var(--line-2);
  color: var(--text); font-family: "Fraunces", Georgia, serif; font-size: 1.6rem; font-weight: 500;
  padding: 0.3rem 0; outline: none; margin-bottom: 1rem;
}
.composer-title:focus { border-color: var(--narrative); }
.composer-title.nudge { border-color: var(--warn); }
.composer-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-bottom: 0.7rem; }
.composer-member {
  background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 3px; color: var(--text);
  font: inherit; font-size: 0.66rem; padding: 0.32rem 0.5rem; max-width: 22rem; outline: none;
}
.composer-member:focus { border-color: var(--narrative); }
.composer .figbtn { display: inline-flex; align-items: center; }
.composer-hint { font-size: 0.58rem; color: var(--dimmer); letter-spacing: 0.04em; }
.composer-hint code { color: var(--narrative); }
.composer-prose {
  width: 100%; min-height: 46vh; background: var(--ink-1); border: 1px solid var(--line-2); border-radius: 5px;
  color: #dde0d8; font-family: "IBM Plex Mono", monospace; font-size: 0.82rem; line-height: 1.6;
  padding: 0.9rem 1rem; outline: none; resize: vertical;
}
.composer-prose:focus { border-color: var(--narrative); box-shadow: 0 0 0 1px rgba(201,178,126,0.25); }
.composer-prose.nudge { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn); }
.composer-figs, .composer-refs { margin-top: 0.8rem; display: grid; gap: 0.3rem; }
.composer-refs .cr-head { font-size: 0.62rem; letter-spacing: 0.06em; color: var(--dim); margin-bottom: 0.15rem; }
.composer-refs .cr-empty { font-size: 0.64rem; color: var(--dimmer); letter-spacing: 0.03em; }
.cr { display: flex; align-items: baseline; gap: 0.5rem; font-size: 0.66rem; color: var(--dim); }
.cr.bad .crl { color: var(--bad); }
.cr .crn { color: var(--narrative); flex: none; width: 1.8rem; }
.cr .crk { color: var(--claim); font-family: "IBM Plex Mono", monospace; flex: none; }
.cr .crl { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-actions { display: flex; gap: 0.5rem; margin-top: 1.2rem; }
