/* ============================================================
   Palinode — visual system
   Direction taken from the Khora search interface: an ambient
   dark field, filament-thin rules, glass surfaces, serif for
   thought and sans for interface, category colour carried by
   small luminous orbs rather than blocks of fill.
   ============================================================ */

:root {
  /* ground */
  --void:        #08070a;
  --ink:         rgba(255,255,255,0.95);
  --ink-2:       rgba(255,255,255,0.62);
  --ink-3:       rgba(255,255,255,0.38);
  --ink-4:       rgba(255,255,255,0.18);
  --hairline:    rgba(255,255,255,0.10);
  --hairline-2:  rgba(255,255,255,0.06);

  /* glass */
  --glass:       rgba(10,9,12,0.55);
  --glass-2:     rgba(255,255,255,0.035);
  --glass-3:     rgba(255,255,255,0.06);

  /* category hues — lifted from the Khora node palette */
  --resonance:   #F6A244;
  --tension:     #E5484D;
  --clarity:     #A78BFA;
  --stance:      #D8C25A;
  --lineage:     #5EC7C0;

  --serif: 'Lora', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --sans:  'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  --pill: 999px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;

  --nav: 78px;
  --bar: 64px;
  --rail-l: 268px;
  --rail-r: 380px;
  --ease: cubic-bezier(.22,.61,.36,1);

  /* DS aliases — non-breaking; see design/assets/tokens.css */
  --dur-fast:   .16s;
  --dur-quick:  .18s;
  --dur-base:   .2s;
  --dur-enter:  .22s;
  --dur-soft:   .25s;
  --dur-toast:  .28s;
  --dur-bar:    .6s;
  --dur-field:  1.2s;
  --dur-mood:   1.6s;

  --space-1:  3px;
  --space-2:  4px;
  --space-3:  5px;
  --space-4:  6px;
  --space-5:  7px;
  --space-6:  8px;
  --space-7:  9px;
  --space-8:  10px;
  --space-9:  11px;
  --space-10: 12px;
  --space-11: 14px;
  --space-12: 16px;
  --space-13: 18px;
  --space-14: 22px;
  --space-15: 24px;
  --space-16: 40px;

  --text-micro:  9px;
  --text-label:  9.5px;
  --text-caps:   10px;
  --text-meta:   11px;
  --text-meta-2: 11.5px;
  --text-sm:     12px;
  --text-sm-2:   12.5px;
  --text-body:   13px;
  --text-body-2: 13.5px;
  --text-ui:     14px;
  --text-quote:  14.5px;
  --text-prose:  17px;
  --text-h3:     19px;
  --text-h2:     22px;
  --text-title:  30px;
  --text-display: 32px;

  --shadow-tip:   0 12px 32px rgba(0,0,0,.5);
  --shadow-toast: 0 16px 46px rgba(0,0,0,.6);
  --shadow-modal: 0 30px 90px rgba(0,0,0,.7);
  --glow-orb:     0 0 11px color-mix(in srgb, var(--c, var(--resonance)) 42%, transparent);
  --glow-orb-lg:  0 0 28px color-mix(in srgb, var(--c, var(--resonance)) 55%, transparent);

  --z-field:    0;
  --z-vignette: 1;
  --z-panel:    20;
  --z-scrim:    40;
  --z-forget:   56;
  --z-toast:    60;
  --z-tip:      80;
  --z-fab:      90;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ---------- the ambient field ---------------------------------- */
@property --f1 { syntax: '<color>'; inherits: true; initial-value: #8a5a12; }
@property --f2 { syntax: '<color>'; inherits: true; initial-value: #123a5e; }
@property --f3 { syntax: '<color>'; inherits: true; initial-value: #5c1416; }
@property --f4 { syntax: '<color>'; inherits: true; initial-value: #2f1650; }
@property --f5 { syntax: '<color>'; inherits: true; initial-value: #6b5a10; }

#field {
  position: fixed;
  inset: -20vmax;
  z-index: 0;
  --f1: #8a5a12;
  --f2: #123a5e;
  --f3: #5c1416;
  --f4: #2f1650;
  --f5: #6b5a10;
  filter: blur(90px) saturate(115%);
  opacity: .85;
  pointer-events: none;
  transition: opacity 1.2s var(--ease), filter 1.6s var(--ease), --f1 1.6s var(--ease),
    --f2 1.6s var(--ease), --f3 1.6s var(--ease), --f4 1.6s var(--ease), --f5 1.6s var(--ease);
}
#field[data-mood="resonance"] { filter: blur(90px) saturate(128%); }
#field[data-mood="tension"]   { filter: blur(90px) saturate(132%); }
#field[data-mood="clarity"]   { filter: blur(90px) saturate(124%); }
#field[data-mood="stance"]    { filter: blur(90px) saturate(120%); }
#field[data-mood="lineage"]   { filter: blur(90px) saturate(122%); }
#field span {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  animation: drift var(--dur, 46s) ease-in-out infinite alternate;
}
#field span:nth-child(1){ width:46vmax; height:46vmax; left:-4%;  top:44%;  background: var(--f1); --dur:52s; }
#field span:nth-child(2){ width:52vmax; height:52vmax; left:34%;  top:-16%; background: var(--f2); --dur:61s; }
#field span:nth-child(3){ width:34vmax; height:34vmax; left:56%;  top:52%;  background: var(--f3); --dur:44s; }
#field span:nth-child(4){ width:30vmax; height:30vmax; left:70%;  top:6%;   background: var(--f4); --dur:57s; }
#field span:nth-child(5){ width:38vmax; height:38vmax; left:18%;  top:66%;  background: var(--f5); --dur:49s; }
@keyframes drift {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(8vmax,-6vmax,0) scale(1.2); }
}
#vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 30%, rgba(6,5,8,.72) 100%),
    linear-gradient(180deg, rgba(6,5,8,.55), transparent 22%, transparent 70%, rgba(6,5,8,.6));
}

/* ---------- shell ---------------------------------------------- */
#app {
  position: relative;
  /* No z-index: the phone FAB lives inside #app, while #graph is a
     sibling. A stacking context here would pin the FAB under Explore. */
  height: 100%;
  display: grid;
  grid-template-columns: var(--nav) minmax(0, 1fr);
}

/* micro action — the Khora uppercase letterspaced control */
.micro {
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-2); background: none; border: 0; cursor: pointer;
  padding: 7px 12px; border-radius: var(--pill);
  transition: color .18s var(--ease), background .18s var(--ease);
  font-family: var(--sans); font-weight: 600;
}
.micro:hover { color: var(--ink); background: var(--glass-2); }
.micro[disabled] { color: var(--ink-4); cursor: not-allowed; background: none; }

.ghost {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700;
  color: var(--ink-2); background: var(--glass-2);
  border: 1px solid var(--hairline); border-radius: var(--pill);
  padding: 7px 14px; cursor: pointer; font-family: var(--sans);
  transition: all .18s var(--ease);
}
.ghost:hover { color: var(--ink); border-color: rgba(255,255,255,.24); background: var(--glass-3); }
.ghost.solid { background: rgba(255,255,255,.92); color: #14121a; border-color: transparent; }
.ghost.solid:hover { background: #fff; }
.ghost[disabled] { opacity: .38; cursor: not-allowed; }

.note-back { display: none; }
.page-back { display: none; }

/* ---------- three-column body ---------------------------------- */
.body {
  display: grid;
  grid-template-columns: var(--rail-l) minmax(0,1fr) var(--rail-r);
  height: 100%;
  min-height: 0;
}
.body.rail-closed { grid-template-columns: 0 minmax(0,1fr) var(--rail-r); }
.body.insights-closed { grid-template-columns: var(--rail-l) minmax(0,1fr) 0; }
.body.rail-closed.insights-closed { grid-template-columns: 0 minmax(0,1fr) 0; }

/* ---------- left rail ------------------------------------------ */
aside.rail {
  border-right: 1px solid var(--hairline-2);
  display: flex; flex-direction: column; min-height: 0;
  background: linear-gradient(180deg, rgba(8,7,10,.42), rgba(8,7,10,.16));
  backdrop-filter: blur(12px);
  overflow: hidden;
}
.rail-head { padding: 12px 16px 10px; }
.rail-title {
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 12px;
}
.search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,.34); border: 1px solid var(--hairline);
  border-radius: var(--pill); padding: 8px 13px;
  transition: border-color .2s var(--ease);
}
.search:focus-within { border-color: rgba(255,255,255,.26); }
.search input {
  flex: 1; background: none; border: 0; outline: none;
  color: var(--ink); font-family: var(--sans); font-size: 12.5px;
}
.search input::placeholder { color: var(--ink-3); }

/* The daily prompt lives with the notes it starts, not above the editor. */
aside.rail .prompt-card {
  flex: none;
  margin: 16px 10px 4px;
  padding: 14px 14px 12px;
}
aside.rail .prompt-card::after {
  width: 120px; height: 120px; right: -40px; top: -50px;
}
aside.rail .prompt-kicker { margin-bottom: 8px; }
aside.rail .prompt-text {
  font-size: 14.5px; line-height: 1.45; margin: 0 0 8px; max-width: none;
}
aside.rail .prompt-source { font-size: 11px; margin-bottom: 12px; }
aside.rail .prompt-actions { gap: 8px; }
aside.rail .prompt-actions .ghost.solid {
  flex: 1 1 100%; text-align: center; justify-content: center;
}
aside.rail .skip-track { margin-left: 0; }

.note-list { flex: 1; overflow-y: auto; padding: 6px 10px 12px; }

.rail-new {
  flex: none;
  display: block; width: calc(100% - 20px); margin: 0 10px 10px;
  padding: 10px 14px;
  border: 1px solid var(--hairline); border-radius: var(--r-sm);
  background: rgba(255,255,255,.92); color: #14121a;
  font-family: var(--sans); font-size: 10px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  cursor: pointer;
  transition: background .18s var(--ease);
}
.rail-new:hover { background: #fff; }
.note-item {
  position: relative;
  padding: 11px 32px 11px 12px; border-radius: var(--r-md); cursor: pointer;
  border: 1px solid transparent; margin-bottom: 3px;
  transition: background .16s var(--ease), border-color .16s var(--ease);
}
.note-item .forget {
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(6,5,8,.82); color: var(--ink-2); font-size: 13px; line-height: 1;
  display: grid; place-items: center;
  opacity: 0; pointer-events: none;
  transition: opacity .16s var(--ease), background .16s var(--ease), color .16s var(--ease);
}
.note-item:hover .forget { opacity: 1; pointer-events: auto; }
.note-item .forget:hover { color: #fff; background: rgba(229,72,77,.85); }
@media (hover: none) {
  .note-item .forget { opacity: 1; pointer-events: auto; }
}
.note-item:hover { background: var(--glass-2); }
.note-item.active { background: var(--glass-3); border-color: var(--hairline); }
.note-item h4 {
  margin: 0 0 4px; font-family: var(--serif); font-weight: 500;
  font-size: 13.5px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.note-item p {
  margin: 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.note-item .meta {
  margin-top: 7px; display: flex; align-items: center; gap: 7px;
  font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-4);
}
.path-constel {
  cursor: inherit;
  pointer-events: none;
}
.path-constel:hover { border-color: var(--hairline-2); }
.path-constel::after { content: none; }
.path-constel::before {
  content: '';
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 28% 78%, color-mix(in srgb, var(--g1, var(--resonance)) 22%, transparent), transparent 52%),
    radial-gradient(circle at 78% 22%, color-mix(in srgb, var(--g2, var(--lineage)) 18%, transparent), transparent 48%);
  animation: preview-drift 16s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes preview-drift {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(8%,-6%,0) scale(1.08); }
}
#pathway-wrap .path-constel {
  width: 100%;
  height: 280px;
  margin: 0 0 18px;
  pointer-events: auto;
  cursor: pointer;
}
#pathway-wrap .path-constel::after { content: 'Explore'; }
#pathway-wrap .path-constel .node {
  font-size: 12px;
  padding: 4px 10px 4px 5px;
  gap: 6px;
}
.path-constel-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--ink-4); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
}
@media (prefers-reduced-motion: reduce) {
  #field span, .path-constel::before { animation: none; }
}
.dot-row { display: flex; gap: 3px; }
.mini-orb {
  width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 36% 30%,
    color-mix(in srgb, var(--mc, #fff) 22%, #ffffff) 0%, var(--mc, #fff) 62%,
    color-mix(in srgb, var(--mc, #fff) 70%, #05040a) 100%);
  box-shadow: inset 0 0 0 .5px color-mix(in srgb, #fff 40%, transparent);
}

.body.pathways-mode #prompt-card,
.body.pathways-mode #btn-new-list,
.body.pathways-mode .rail-head .search,
.body.pathways-mode #note-list,
.body.pathways-mode #quest-list,
.body.pathways-mode #quest-log-filters { display: none; }
.body.pathways-mode #path-list { display: block; }
.rail-lab-paths { display: none; }
.body.pathways-mode .rail-lab-notes { display: none; }
.body.pathways-mode .rail-lab-quests { display: none; }
.body.pathways-mode .rail-lab-paths { display: inline; }

.body.quests-mode #prompt-card,
.body.quests-mode #btn-new-list,
.body.quests-mode .rail-head .search,
.body.quests-mode #note-list,
.body.quests-mode #path-list { display: none; }
.body.quests-mode #quest-list { display: block; }
.body.quests-mode #quest-log-filters { display: grid; }
.rail-lab-quests { display: none; }
#quest-log-filters {
  display: none;
  box-sizing: border-box;
  width: 100%;
  margin: 10px 0 0;
  padding: 2px;
  gap: 2px;
}
#quest-log-filters .seg-btn {
  padding: 5px 2px;
  font-size: 8.5px;
  letter-spacing: .05em;
}
.body.quests-mode .rail-lab-notes { display: none; }
.body.quests-mode .rail-lab-paths { display: none; }
.body.quests-mode .rail-lab-quests { display: inline; }
.body.quests-mode aside.insights { display: none; }
.body.quests-mode { grid-template-columns: var(--rail-l) minmax(0,1fr) 0; }
.body.quests-mode.rail-closed { grid-template-columns: 0 minmax(0,1fr) 0; }

/* ---------- centre: prompt + editor ---------------------------- */
main.centre { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.centre-inner { width: 100%; max-width: 760px; margin: 0 auto; padding: 26px 40px 120px; }

/* daily prompt card */
.prompt-card {
  position: relative;
  border: 1px solid var(--hairline);
  background: linear-gradient(140deg, rgba(246,162,68,.10), rgba(10,9,12,.5) 46%);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  margin-bottom: 30px;
  backdrop-filter: blur(16px);
  overflow: hidden;
}
.prompt-card::after {
  content: ''; position: absolute; right: -60px; top: -70px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(246,162,68,.30), transparent 62%);
  pointer-events: none;
}
.prompt-kicker {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
  font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3);
}
.prompt-text {
  font-family: var(--serif); font-size: 19px; line-height: 1.55;
  color: var(--ink); margin: 0 0 14px; max-width: 60ch;
}
.prompt-source {
  font-size: 11.5px; color: var(--ink-3); margin-bottom: 16px; font-style: italic;
}
.prompt-card.engaged { border-color: rgba(246,162,68,.32); }
.prompt-card.engaged .prompt-text { color: var(--ink-2); }
.prompt-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.skip-track { display: flex; gap: 5px; margin-left: auto; align-items: center; }
.skip-pip {
  width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid rgba(246,162,68,.55);
  transition: background .25s var(--ease);
}
.skip-pip.used { background: rgba(246,162,68,.85); border-color: rgba(246,162,68,.85); }
.skip-label { font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-right: 4px; }

/* editor */
.title-input {
  width: 100%; background: none; border: 0; outline: none;
  font-family: var(--serif); font-size: 30px; font-weight: 500; line-height: 1.25;
  color: var(--ink); margin-bottom: 6px; padding: 0;
}
.title-input::placeholder { color: var(--ink-4); }

.doc-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 22px;
  font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-4);
  padding-bottom: 16px; border-bottom: 1px solid var(--hairline-2);
}
.doc-meta .live { display: flex; align-items: center; gap: 6px; }
.doc-meta .spacer { flex: 1; }
#btn-quest-submit {
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 9.5px;
}

#btn-note-insights { display: none; }
.pulse {
  width: 6px; height: 6px; border-radius: 50%; background: var(--resonance);
  box-shadow: 0 0 0 0 rgba(246,162,68,.6);
}
.pulse.on { animation: pulse 1.4s infinite; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(246,162,68,.55); }
  70%  { box-shadow: 0 0 0 7px rgba(246,162,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(246,162,68,0); }
}

/* the layered editor: highlight mirror under a transparent textarea */
.editor-stack { position: relative; }
.editor-stack .mirror,
.editor-stack textarea {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.85;
  letter-spacing: .002em;
  padding: 2px 0 40px;
  border: 0;
  width: 100%;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.editor-stack .mirror {
  position: absolute; inset: 0;
  color: transparent;
  pointer-events: none;
  user-select: none;
}
.editor-stack textarea {
  position: relative;
  background: transparent;
  color: var(--ink);
  outline: none;
  resize: none;
  min-height: 46vh;
  display: block;
  caret-color: var(--resonance);
}
.editor-stack textarea::placeholder { color: var(--ink-4); }

.mirror mark {
  background: none;
  color: transparent;
  border-bottom: 2px solid currentColor;
  border-radius: 1px;
  padding-bottom: 1px;
  transition: background .2s var(--ease);
}
.mirror mark.cat-resonance { color: var(--resonance); }
.mirror mark.cat-tension   { color: var(--tension); }
.mirror mark.cat-clarity   { color: var(--clarity); }
.mirror mark.cat-stance    { color: var(--stance); }
.mirror mark.cat-lineage   { color: var(--lineage); }
.mirror mark.focused { background: color-mix(in srgb, currentColor 22%, transparent); border-radius: 3px; }

/* empty state */
.empty-state {
  text-align: center; padding: 90px 20px; color: var(--ink-3);
}
.empty-state h2 { font-family: var(--serif); font-size: 22px; color: var(--ink-2); font-weight: 500; margin: 0 0 10px; }
.empty-state p { max-width: 44ch; margin: 0 auto 22px; line-height: 1.7; font-size: 13px; }

/* ---------- right rail: insights -------------------------------- */
aside.insights {
  border-left: 1px solid var(--hairline-2);
  display: flex; flex-direction: column; min-height: 0;
  background: linear-gradient(180deg, rgba(8,7,10,.5), rgba(8,7,10,.2));
  backdrop-filter: blur(14px);
  overflow: hidden;
  position: relative;
}
aside.insights.ref-open > .ins-head,
aside.insights.ref-open > .ins-list {
  display: none;
}
.ref-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
aside.insights.ref-open .ref-panel:not([hidden]) {
  display: flex;
}
.ref-panel-head {
  flex: none;
  padding: 16px 18px 10px;
  border-bottom: 1px solid var(--hairline-2);
}
.ref-back {
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .04em;
  cursor: pointer;
  padding: 0;
}
.ref-back:hover { color: var(--ink); }
.ref-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px 28px;
}
.ref-kicker {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin: 0 0 8px;
  font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-4);
}
.ref-title {
  font-family: var(--serif); font-size: 22px; font-weight: 500; line-height: 1.28;
  margin: 0 0 6px; color: var(--ink); overflow-wrap: anywhere;
}
.ref-author {
  font-family: var(--serif); font-style: italic; color: var(--ink-2);
  margin: 0 0 14px; font-size: 14px;
}
.ref-sec {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--hairline-2);
}
.ref-sec h4 {
  margin: 0 0 10px; font-size: 9px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink-4); font-weight: 700;
}
.ref-sec p {
  margin: 0 0 10px; font-size: 13px; line-height: 1.72; color: var(--ink-2);
}
.ref-sec p:last-child { margin-bottom: 0; }
.ref-question {
  font-family: var(--serif); font-size: 15px; line-height: 1.55; color: var(--ink);
  margin: 0; padding-left: 12px;
  border-left: 2px solid color-mix(in srgb, var(--resonance) 55%, transparent);
}
.ref-preview {
  display: block; width: 100%; max-height: 220px; object-fit: contain;
  background: #000; border-radius: var(--r-sm); margin: 10px 0 4px;
}
.ref-preview.audio { max-height: none; background: transparent; }
.ref-act {
  display: flex; flex-direction: column; gap: 7px; margin-top: 16px;
}
.ref-act > .ghost,
.ref-act > a.ghost {
  width: 100%; text-align: center; text-decoration: none; box-sizing: border-box;
}
.ref-kin { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ref-kin li {
  font-size: 13px; color: var(--ink-2); line-height: 1.45;
}
.ins-head { padding: 16px 18px 0; }
.ins-head .row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ins-head .row .spacer { flex: 1; }
.ins-head h3 {
  margin: 0; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); font-weight: 600;
}

/* score */
.score {
  display: flex; align-items: center; gap: 16px;
  padding: 4px 0 16px; border-bottom: 1px solid var(--hairline-2); margin-bottom: 12px;
}
.ring { position: relative; width: 62px; height: 62px; flex: none; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring .val {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--serif); font-size: 19px; color: var(--ink);
}
.bars { flex: 1; display: grid; gap: 6px; min-width: 0; }
.bar-row { display: grid; grid-template-columns: 66px 1fr; align-items: center; gap: 9px; cursor: help; }
.bar-row span { white-space: nowrap; }
.bar-row span {
  font-size: 9px; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3);
}
.bar { height: 3px; background: var(--glass-3); border-radius: var(--pill); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: var(--pill); background: rgba(255,255,255,.72); transition: width .6s var(--ease); }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 12px; }
.att, .saved-chip { cursor: pointer; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px 5px 8px; border-radius: var(--pill);
  border: 1px solid var(--hairline); background: rgba(0,0,0,.28);
  font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
  cursor: pointer; transition: all .18s var(--ease); font-weight: 600;
}
.chip:hover { border-color: rgba(255,255,255,.22); color: var(--ink-2); }
.chip.off { opacity: .34; }
.chip .n { color: var(--ink-4); font-size: 9px; }

/* Hover copy for the criteria bars and the lane chips. Fixed, because
   the Reading rail clips overflow and a native title waits too long. */
.read-tip {
  position: fixed; z-index: 80; width: 248px; max-width: calc(100vw - 20px);
  padding: 10px 12px 11px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: linear-gradient(165deg, rgba(14,12,17,.96), rgba(7,6,10,.98));
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
  pointer-events: none;
  opacity: 0; visibility: hidden;
  transition: opacity .16s var(--ease);
}
.read-tip.on { opacity: 1; visibility: visible; }
.read-tip-k {
  font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 700; margin-bottom: 6px;
}
.read-tip p {
  margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-2);
}

/* the orb — Khora's signature node */
/* ---------- glass-liquid orb -------------------------------------
   A frosted marble: pale core, deep liquid veins turning inside a
   luminous shell. The reference sits on cream, where the body can
   be nearly white; here it sits on near-black and the hue has to
   survive at 9px, so the balance is inverted — the colour carries
   the body and the pearl is reserved for the core and the rim.
------------------------------------------------------------------ */
.orb, .gx-orb {
  /* pearl core, luminous shell, and a vein tone that keeps its chroma —
     mixed in oklab so darkening does not drain the hue to grey */
  --pearl: color-mix(in srgb, var(--c) 16%, #ffffff);
  --shell: color-mix(in srgb, var(--c) 24%, #ffffff);
  --deep:  color-mix(in oklab, var(--c) 66%, #0a2430);

  position: relative;
  border-radius: 50%;
  flex: none;
  isolation: isolate;
  background:
    radial-gradient(circle at 38% 31%,
      var(--pearl) 0%,
      color-mix(in srgb, var(--c) 82%, #ffffff) 26%,
      var(--c) 62%,
      color-mix(in oklab, var(--c) 86%, #0a2430) 100%);
  box-shadow: 0 0 11px color-mix(in srgb, var(--c) 42%, transparent);
}

/* the liquid — saturated ribbons of the deeper tone, turning slowly */
.orb::before, .gx-orb::before {
  content: '';
  position: absolute; inset: -20%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse 40% 22% at 31% 34%, color-mix(in srgb, var(--deep) 70%, transparent), transparent 64%),
    radial-gradient(ellipse 24% 42% at 74% 58%, color-mix(in srgb, var(--deep) 62%, transparent), transparent 62%),
    radial-gradient(ellipse 54% 18% at 50% 85%, color-mix(in srgb, var(--deep) 52%, transparent), transparent 66%);
  z-index: -1;
}

/* the shell and the light, which do not turn with the liquid.
   The rim is the signature of the effect: brightest at the edge,
   feathering out rather than ending on a hard line. */
.orb::after, .gx-orb::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(ellipse 34% 26% at 34% 24%, rgba(255,255,255,.78), rgba(255,255,255,.10) 58%, transparent 74%),
    radial-gradient(ellipse 22% 14% at 69% 80%, rgba(255,255,255,.28), transparent 74%),
    radial-gradient(circle at 50% 50%,
      transparent 56%,
      color-mix(in srgb, var(--shell) 26%, transparent) 73%,
      color-mix(in srgb, var(--shell) 82%, transparent) 87%,
      color-mix(in srgb, var(--shell) 92%, transparent) 94%,
      color-mix(in srgb, var(--shell) 30%, transparent) 99%,
      transparent 100%);
}

/* the liquid only animates where it can actually be seen */
@keyframes orb-liquid {
  from { transform: rotate(0deg)   scale(1); }
  50%  {                           }
  to   { transform: rotate(360deg) scale(1.14); }
}
@media (prefers-reduced-motion: no-preference) {
  .orb.lg::before,
  .gx-node.labelled .gx-orb::before,
  .gx-node.sel .gx-orb::before {
    animation: orb-liquid 26s linear infinite alternate;
  }
  .gx-node.sel .gx-orb::before { animation-duration: 17s; }
}

.orb { width: 13px; height: 13px; }
.orb.sm { width: 9px; height: 9px; }
.orb.lg {
  width: 34px; height: 34px;
  box-shadow: 0 0 28px color-mix(in srgb, var(--c) 55%, transparent);
}
/* below about 10px the veins are noise — keep the shell, drop the liquid */
.orb.sm::before { opacity: .55; }

.ins-list { flex: 1; overflow-y: auto; padding: 4px 14px 40px; }

.insight {
  border: 1px solid var(--hairline);
  background: rgba(0,0,0,.3);
  border-radius: var(--r-md);
  padding: 13px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
}
.insight:hover { border-color: rgba(255,255,255,.2); background: rgba(0,0,0,.42); }
.insight.open { border-color: color-mix(in srgb, var(--c) 45%, transparent); background: rgba(0,0,0,.5); }
.insight .ihead { display: flex; align-items: flex-start; gap: 9px; }
.insight .ititle { flex: 1; min-width: 0; }
.insight h4 {
  margin: 0 0 3px; font-family: var(--serif); font-size: 14px; font-weight: 500;
  color: var(--ink); line-height: 1.35;
}
.insight .lineage-tag {
  font-size: 9px; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-4);
}
.insight .quote {
  margin: 10px 0 0; padding-left: 10px;
  border-left: 1px solid color-mix(in srgb, var(--c) 50%, transparent);
  font-family: var(--serif); font-size: 12.5px; font-style: italic;
  color: var(--ink-2); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.insight.open .quote { -webkit-line-clamp: unset; }
.insight .quote em {
  font-style: normal; color: var(--ink);
  border-bottom: 1px solid color-mix(in srgb, var(--c) 70%, transparent);
}

.ibody { display: none; margin-top: 12px; }
.insight.open .ibody { display: block; animation: fade .25s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

.ibody .reading { font-size: 12.5px; line-height: 1.72; color: var(--ink-2); margin: 0 0 14px; }
.ibody .turn {
  background: var(--glass-2); border: 1px solid var(--hairline-2);
  border-radius: var(--r-sm); padding: 11px 12px; margin-bottom: 14px;
}
.ibody .turn .lab {
  font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-4); display: block; margin-bottom: 5px;
}
.ibody .turn p { margin: 0; font-family: var(--serif); font-size: 13px; line-height: 1.6; color: var(--ink); }

.src-lab { font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 8px; }
.src {
  border-top: 1px solid var(--hairline-2); padding: 9px 0;
}
.src .w { font-family: var(--serif); font-size: 12.5px; color: var(--ink); line-height: 1.4; }
.src .a { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.src .n { font-size: 11px; color: var(--ink-3); margin-top: 5px; line-height: 1.55; font-style: italic; }

.kin { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.kin-chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--hairline); border-radius: var(--pill);
  padding: 4px 10px 4px 7px; font-size: 10.5px; color: var(--ink-2);
  background: rgba(0,0,0,.3); cursor: default;
}

.iactions { display: flex; gap: 6px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--hairline-2); }

/* ---------- constellation -------------------------------------- */
.constellation {
  position: relative; height: 168px; margin: 6px 0 14px;
  border: 1px solid var(--hairline-2); border-radius: var(--r-md);
  background: radial-gradient(120% 100% at 50% 120%, rgba(246,162,68,.08), transparent 60%), rgba(0,0,0,.24);
  overflow: hidden;
}
.constellation { cursor: pointer; transition: border-color .2s var(--ease); }
.constellation:hover { border-color: rgba(255,255,255,.2); }
.constellation::after {
  content: 'Explore'; position: absolute; right: 10px; bottom: 8px; z-index: 2;
  font-size: 8.5px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700;
  color: var(--ink-4); opacity: 0; transition: opacity .2s var(--ease); pointer-events: none;
}
.constellation:hover::after { opacity: 1; }
.constellation svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.constellation .node {
  position: absolute; transform: translate(-50%,-50%);
  display: flex; align-items: center; gap: 6px;
  background: rgba(10,9,12,.82); border: 1px solid var(--hairline);
  border-radius: var(--pill); padding: 3px 9px 3px 4px;
  font-size: 10px; color: var(--ink-2); white-space: nowrap;
  backdrop-filter: blur(4px);
  animation: rise .5s var(--ease) backwards;
}
@keyframes rise { from { opacity: 0; transform: translate(-50%,-46%) scale(.9); } }

/* ---------- modal ----------------------------------------------- */
.scrim {
  position: fixed; inset: 0; z-index: 40; display: none;
  background: rgba(4,3,6,.72); backdrop-filter: blur(8px);
  align-items: center; justify-content: center; padding: 24px;
}
.scrim.on { display: flex; animation: fade .22s var(--ease); }
.modal {
  width: min(520px, 100%);
  background: linear-gradient(160deg, rgba(20,18,24,.96), rgba(10,9,12,.97));
  border: 1px solid var(--hairline); border-radius: var(--r-lg);
  padding: 24px; box-shadow: 0 30px 90px rgba(0,0,0,.7);
}
.modal h3 { font-family: var(--serif); font-size: 19px; font-weight: 500; margin: 0 0 6px; }
.modal p.lede { color: var(--ink-3); font-size: 12.5px; line-height: 1.65; margin: 0 0 18px; }
.link-box {
  display: flex; gap: 8px; align-items: center;
  background: rgba(0,0,0,.45); border: 1px solid var(--hairline);
  border-radius: var(--pill); padding: 6px 6px 6px 15px; margin-bottom: 14px;
}
.link-box input {
  flex: 1; min-width: 0; background: none; border: 0; outline: none;
  color: var(--ink-2); font-family: var(--sans); font-size: 11.5px;
}
.opt {
  display: flex; align-items: center; gap: 9px; padding: 10px 0;
  border-top: 1px solid var(--hairline-2); font-size: 12.5px; color: var(--ink-2); cursor: pointer;
}
.opt input { accent-color: var(--resonance); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.ghost.danger { color: #f0b4b6; border-color: rgba(229,72,77,.35); }
.ghost.danger:hover { color: #fff; background: rgba(229,72,77,.85); border-color: transparent; }
#forget-scrim { z-index: 56; }

/* ---------- shared (read-only) view ----------------------------- */
.shared-wrap { max-width: 720px; margin: 0 auto; padding: 46px 40px 90px; }
.shared-badge {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 26px;
  border: 1px solid var(--hairline); border-radius: var(--pill);
  padding: 6px 14px; font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3);
  background: rgba(0,0,0,.3);
}
.shared-wrap h1 { font-family: var(--serif); font-size: 32px; font-weight: 500; margin: 0 0 10px; line-height: 1.25; }
.shared-body { font-family: var(--serif); font-size: 17px; line-height: 1.85; color: var(--ink); white-space: pre-wrap; }
.shared-prompt {
  border-left: 2px solid rgba(246,162,68,.5); padding: 4px 0 4px 16px; margin: 0 0 26px;
  font-family: var(--serif); font-style: italic; color: var(--ink-2); font-size: 14.5px; line-height: 1.6;
}

/* ---------- toast ----------------------------------------------- */
#toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(14px);
  z-index: 60; background: rgba(20,18,24,.96); border: 1px solid var(--hairline);
  border-radius: var(--pill); padding: 9px 18px; font-size: 11.5px; color: var(--ink-2);
  opacity: 0; pointer-events: none; transition: all .28s var(--ease);
  box-shadow: 0 16px 46px rgba(0,0,0,.6);
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- scrollbars ------------------------------------------ */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.09); border-radius: var(--pill); border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); background-clip: content-box; }

/* ---------- responsive ------------------------------------------ */
@media (max-width: 1180px) {
  :root { --rail-l: 232px; --rail-r: 336px; }
  .centre-inner { padding: 24px 28px 110px; }
}
#btn-nav-insights { display: none; }
@media (max-width: 900px) {
  #app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  nav.sidenav, .body {
    grid-column: 1; grid-row: 1;
  }

  .body,
  .body.rail-closed,
  .body.insights-closed,
  .body.rail-closed.insights-closed,
  .body.market-mode,
  .body.quests-mode,
  .body.market-mode.rail-closed,
  .body.quests-mode.rail-closed,
  .body.market-mode.insights-closed,
  .body.quests-mode.insights-closed,
  .body.market-mode.rail-closed.insights-closed,
  .body.quests-mode.rail-closed.insights-closed { grid-template-columns: 1fr; }
  .centre-inner { padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
  aside.rail, aside.insights { display: none; }
  .body.show-rail aside.rail {
    display: flex; position: absolute; inset: 0; width: 100%; z-index: 20;
  }
  .body.show-insights aside.insights {
    display: flex; position: absolute; inset: 0; width: 100%; z-index: 20;
  }
  html.nav-hidden .body.show-rail aside.rail,
  html.nav-hidden .body.show-insights aside.insights { inset: 0; }

  .page-back:not([hidden]) {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 25;
    flex: none;
    min-height: 48px;
    box-sizing: border-box;
    padding: 8px 14px;
    background: linear-gradient(180deg, rgba(8,7,10,.96), rgba(8,7,10,.88));
    border-bottom: 1px solid var(--hairline-2);
  }
  #btn-note-back,
  #btn-path-back {
    width: 36px; height: 36px; flex: none;
    display: grid; place-items: center;
    border: 1px solid var(--hairline); background: var(--glass-3);
    cursor: pointer; color: var(--ink-2);
    border-radius: var(--r-sm);
    padding: 0;
  }
  #btn-note-back svg,
  #btn-path-back svg { width: 18px; height: 18px; }
  #btn-note-back:hover,
  #btn-path-back:hover { color: var(--ink); background: rgba(255,255,255,.1); }
  #note-back-label,
  #path-back-label {
    flex: 1; min-width: 0;
    font-family: var(--sans);
    font-size: 13px; font-weight: 600;
    color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
}

/* ============================================================
   Readings panel + Reading Room
   ============================================================ */

/* segmented control — the Khora Content/Connections toggle */
/* Equal columns for however many buttons are inside, so adding a third
   tab widens the track instead of wrapping it onto a second row. */
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px;
  background: rgba(0,0,0,.4); border: 1px solid var(--hairline);
  border-radius: var(--pill); padding: 3px; margin-bottom: 14px;
}
.seg-btn {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 0; white-space: nowrap;
  border: 0; background: none; cursor: pointer; border-radius: var(--pill);
  padding: 7px 4px; font-family: var(--sans); font-weight: 700;
  font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); transition: all .2s var(--ease);
}
.seg-btn:hover { color: var(--ink-2); }
.seg-btn.on { background: rgba(255,255,255,.93); color: #14121a; }
.seg-n { font-size: 9px; opacity: .6; font-weight: 600; letter-spacing: .06em; }

/* the same control as a native picker, shown only on narrow screens */
.seg-select {
  display: none; width: 100%; margin-bottom: 14px;
  appearance: none; -webkit-appearance: none; color-scheme: dark;
  background: rgba(0,0,0,.4) no-repeat right 14px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='6' viewBox='0 0 9 6'%3E%3Cpath d='M1 1l3.5 3.5L8 1' fill='none' stroke='%23fff' stroke-opacity='.55' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  border: 1px solid var(--hairline); border-radius: var(--pill);
  padding: 11px 34px 11px 16px;
  font-family: var(--sans); font-weight: 700; font-size: 10px;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink); cursor: pointer;
}
.seg-select:focus-visible { outline: 1px solid rgba(255,255,255,.3); outline-offset: 2px; }

/* Narrow screens swap the three segments for the picker. This lives beside
   the component rather than in the responsive block near the top, because
   it has to come after the base display:none to win. */
@media (max-width: 900px) {
  #seg { display: none; }
  .seg-select { display: block; }
  #btn-note-insights {
    display: inline-flex; align-items: center; justify-content: center;
    margin: -8px 0 18px;
  }
  .body.show-insights aside.insights {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .body.show-insights .ins-list {
    flex: none;
    overflow: visible;
  }
  .body.show-insights.insights-closed aside.insights > * { visibility: visible; }
  .ins-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 8px;
    align-items: start;
  }
  .ins-head .row {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 16px;
    z-index: 4;
    margin: 0;
    padding: 0;
  }
  .ins-head .row h3,
  .ins-head .row .spacer,
  #engine-name { display: none; }
  .seg-select {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 16px;
    z-index: 3;
    margin-bottom: 14px;
    background-color: rgba(8,7,10,.94);
    box-shadow: 0 -16px 0 rgba(8,7,10,.94);
  }
  #score, #constellation, #filters {
    grid-column: 1 / -1;
  }
}

/* a work on the shelf */
.work {
  border: 1px solid var(--hairline); background: rgba(0,0,0,.3);
  border-radius: var(--r-md); padding: 13px 14px; margin-bottom: 8px;
  cursor: pointer; transition: border-color .18s var(--ease), background .18s var(--ease);
}
.work:hover { border-color: rgba(255,255,255,.22); background: rgba(0,0,0,.44); }
.work h4 {
  margin: 0 0 3px; font-family: var(--serif); font-size: 14px; font-weight: 500;
  color: var(--ink); line-height: 1.35;
}
.work .byline { font-size: 11.5px; color: var(--ink-3); margin-bottom: 9px; }
.work .why {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px;
}
.why-chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--hairline); border-radius: var(--pill);
  padding: 3px 9px 3px 6px; font-size: 10px; color: var(--ink-2);
  background: rgba(0,0,0,.32);
}
.work .foot {
  display: flex; align-items: center; gap: 8px;
  padding-top: 9px; border-top: 1px solid var(--hairline-2);
  font-size: 9px; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-4);
}
.work .foot .go { margin-left: auto; color: var(--ink-2); font-weight: 700; }
.work:hover .foot .go { color: var(--ink); }

.rights {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9px; letter-spacing: .14em; text-transform: uppercase;
}
.rights i { width: 5px; height: 5px; border-radius: 50%; display: block; }
.rights.open   { color: rgba(94,199,192,.9); }
.rights.open i { background: var(--lineage); }
.rights.restricted   { color: rgba(255,255,255,.34); }
.rights.restricted i { background: rgba(255,255,255,.3); }

/* a source row inside an insight card gains a read affordance */
.src { position: relative; }
.src .read-link {
  position: absolute; right: 0; top: 9px;
  font-size: 9px; letter-spacing: .15em; text-transform: uppercase; font-weight: 700;
  color: var(--ink-4); background: none; border: 0; cursor: pointer;
  font-family: var(--sans); padding: 2px 0;
}
.src .read-link:hover { color: var(--ink); }
.src .w { padding-right: 46px; }

/* ---------- the reading room ---------- */
#reading-room { animation: fade .3s var(--ease); }

.rr-back {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 26px;
  font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700;
  color: var(--ink-3); background: none; border: 0; cursor: pointer; font-family: var(--sans);
  padding: 0; transition: color .18s var(--ease);
}
.rr-back:hover { color: var(--ink); }

.rr-kicker {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
  font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-4);
}
.rr-title {
  font-family: var(--serif); font-size: 38px; font-weight: 500; line-height: 1.18;
  margin: 0 0 8px; color: var(--ink); letter-spacing: -.005em;
}
.rr-author { font-family: var(--serif); font-size: 17px; color: var(--ink-2); font-style: italic; margin: 0 0 4px; }
.rr-sections { font-size: 12px; color: var(--ink-3); margin: 0 0 30px; }
.rr-sections b { color: var(--ink-2); font-weight: 600; }

.rr-sec { margin-bottom: 30px; padding-top: 24px; border-top: 1px solid var(--hairline-2); }
.rr-sec > h3 {
  margin: 0 0 12px; font-size: 9.5px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink-4); font-weight: 700;
}
.rr-sec p {
  font-family: var(--serif); font-size: 16.5px; line-height: 1.8; color: var(--ink); margin: 0 0 14px;
  max-width: 66ch;
}
.rr-sec p.muted { color: var(--ink-2); font-size: 15.5px; }

.rr-raised { display: grid; gap: 8px; }
.rr-raised .r {
  display: flex; gap: 11px; align-items: flex-start;
  border: 1px solid var(--hairline); background: rgba(0,0,0,.28);
  border-radius: var(--r-md); padding: 12px 14px; cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.rr-raised .r:hover { border-color: rgba(255,255,255,.22); background: rgba(0,0,0,.42); }
.rr-raised .r h5 { margin: 0 0 3px; font-family: var(--serif); font-size: 14px; font-weight: 500; color: var(--ink); }
.rr-raised .r p { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-3); font-family: var(--sans); }

.rr-links { display: flex; flex-wrap: wrap; gap: 8px; }
.rr-links a {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  border: 1px solid var(--hairline); border-radius: var(--pill);
  padding: 9px 16px; font-size: 9.5px; letter-spacing: .15em;
  text-transform: uppercase; font-weight: 700; color: var(--ink-2);
  background: var(--glass-2); transition: all .18s var(--ease);
}
.rr-links a:hover { color: var(--ink); border-color: rgba(255,255,255,.26); background: var(--glass-3); }
.rr-links a.primary { background: rgba(255,255,255,.92); color: #14121a; border-color: transparent; }
.rr-links a.primary:hover { background: #fff; }

.rr-note {
  margin-top: 16px; font-size: 12px; line-height: 1.7; color: var(--ink-4);
  max-width: 62ch;
}

/* ============================================================
   Exploration graph
   ============================================================ */

body.exploring { overflow: hidden; }

#graph {
  position: fixed; inset: 0 0 0 var(--nav); z-index: 50;
  background: radial-gradient(130% 100% at 50% 50%, rgba(9,8,11,.965), rgba(4,3,6,.995));
  backdrop-filter: blur(14px);
  animation: fade .32s var(--ease);
}

#gx-canvas { position: absolute; inset: 0; cursor: grab; touch-action: none; overflow: hidden; }
#gx-canvas:active { cursor: grabbing; }
#gx-edges { position: absolute; inset: 0; pointer-events: none; }
#gx-nodes { position: absolute; inset: 0; }

/* --- nodes --- */
.gx-node {
  position: absolute; left: 0; top: 0; will-change: transform;
  display: flex; align-items: center; gap: 7px;
  cursor: pointer; white-space: nowrap;
  padding: 3px 3px 3px 3px; border-radius: var(--pill);
  border: 1px solid transparent;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.gx-node.labelled {
  background: rgba(10,9,13,.78);
  border-color: var(--hairline);
  padding-right: 11px;
  backdrop-filter: blur(5px);
}
.gx-node:hover { border-color: rgba(255,255,255,.26); background: rgba(14,12,17,.9); }
.gx-node.sel {
  border-color: color-mix(in srgb, var(--c) 65%, transparent);
  background: rgba(16,13,20,.95);
  box-shadow: 0 0 26px color-mix(in srgb, var(--c) 24%, transparent);
}

.gx-orb {
  width: var(--sz); height: var(--sz); display: block;
  box-shadow: 0 0 14px color-mix(in srgb, var(--c) 42%, transparent);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.gx-node:hover .gx-orb { transform: scale(1.22); }
.gx-node.sel .gx-orb { box-shadow: 0 0 30px color-mix(in srgb, var(--c) 85%, transparent); }

/* not yet reached — dim until you go there */
.gx-node:not(.in-note):not(.sel):not(.labelled) .gx-orb { opacity: .5; }
.gx-node:not(.in-note):not(.sel):not(.labelled):hover .gx-orb { opacity: 1; }

.gx-label {
  font-family: var(--serif); font-size: 12.5px; color: var(--ink-2);
  max-width: 190px; overflow: hidden; text-overflow: ellipsis;
}
.gx-node.in-note .gx-label { color: var(--ink); }
.gx-node.sel .gx-label { color: var(--ink); }
.gx-work .gx-label { font-style: italic; }
.gx-tradition .gx-label {
  font-family: var(--sans); font-size: 9.5px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink-3);
}
.gx-note .gx-label { font-size: 15px; color: var(--ink); max-width: 270px; }

/* a spectrum is a question, so it is drawn as an open ring rather than a
   filled world; dashed until an answer has placed you on it */
.gx-spectrum.gx-node.labelled {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--stance) 34%, transparent);
}
.gx-spectrum.leaning.gx-node.labelled {
  border-color: color-mix(in srgb, var(--stance) 58%, transparent);
}
.gx-spectrum .gx-label { font-size: 11.5px; color: var(--ink-3); }
.gx-spectrum.leaning .gx-label, .gx-spectrum.sel .gx-label { color: var(--ink); }
.gx-node.pinned::after {
  content: ''; position: absolute; top: -2px; right: -2px;
  width: 6px; height: 6px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 8px rgba(255,255,255,.8);
}

/* --- chrome --- */
#gx-chrome { position: absolute; inset: 0; pointer-events: none; }
#gx-chrome > * { pointer-events: auto; }
#gx-chrome > .gx-empty { pointer-events: none; }

.gx-top {
  position: absolute; top: 0; left: 0; right: var(--rail-r);
  display: flex; align-items: center; gap: 14px;
  padding: 16px 22px;
}
.gx-title { display: flex; align-items: center; gap: 9px; flex: none; }
.gx-top .search { flex: 1; min-width: 160px; max-width: 380px; }
.gx-top .search[hidden] { display: none; }
.gx-corpus-row {
  position: absolute; top: 58px; left: 22px; right: calc(var(--rail-r) + 22px);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.gx-corpus-row[hidden] { display: none; }
#gx-cat-wrap { display: none; }
#gx-trad-wrap { display: inline-flex; }
.gx-eq-filter {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 12px; border-radius: var(--pill);
  border: 1px solid var(--hairline); background: rgba(0,0,0,.34);
  font-family: var(--sans); font-size: 9.5px; letter-spacing: .12em;
  text-transform: uppercase; font-weight: 700; color: var(--ink-3);
  cursor: pointer; transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.gx-eq-filter .gx-tool-ico { display: none; }
.gx-eq-filter:hover { color: var(--ink-2); border-color: rgba(255,255,255,.22); }
.gx-eq-filter.on {
  color: var(--ink); border-color: color-mix(in srgb, var(--clarity) 45%, var(--hairline));
  background: color-mix(in srgb, var(--clarity) 16%, rgba(0,0,0,.34));
}
.gx-corpus-row .filters {
  padding: 0;
  align-items: center;
  flex: none;
}
.gx-corpus-row .chip {
  height: 28px;
  box-sizing: border-box;
}
#graph.corpus-mode .gx-trail-row { top: 140px; }
.gx-sort {
  display: inline-flex; align-items: center; gap: 7px; height: 28px;
  font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4);
}
.gx-sort select {
  height: 28px;
  background: rgba(0,0,0,.34); border: 1px solid var(--hairline); color: var(--ink-2);
  border-radius: var(--pill); padding: 0 10px; font-family: var(--sans); font-size: 11px;
  letter-spacing: 0; text-transform: none; line-height: 26px;
}
.gx-tool-ico { display: none; }
.gx-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  pointer-events: none;
}
.gx-empty[hidden] { display: none; }
.gx-load {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px 0 5px;
  background: #1B1B1D;
  border-radius: var(--pill);
  box-shadow: inset 0 0 0 1px rgba(244,241,234,.06);
}
.gx-load[hidden], .gx-empty-msg[hidden] { display: none; }
.gx-load-orbs { width: 28px; height: 28px; display: block; }
.gx-load-lab {
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  color: #F4F1EA; letter-spacing: .01em; line-height: 1;
}
.gx-empty-msg {
  margin: 0; color: var(--ink-3);
  font-family: var(--serif); font-size: 18px; font-weight: 500;
}
.gx-title b {
  font-family: var(--serif); font-weight: 500; font-size: 15px; color: var(--ink);
  letter-spacing: .04em;
}
.gx-hint {
  font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-4);
  padding-left: 12px; border-left: 1px solid var(--hairline);
}
.gx-conn {
  display: inline-flex; align-items: center; gap: 7px;
  flex: none; white-space: nowrap;
  font-size: 10.5px; letter-spacing: .02em; color: var(--ink-3);
  cursor: pointer;
}
.gx-conn[hidden] { display: none; }
#gx-close[hidden] { display: none; }
.gx-conn input { accent-color: var(--resonance); }
#gx-close[hidden] { display: none; }

.gx-trail-row {
  position: absolute; top: 54px; left: 22px; right: calc(var(--rail-r) + 22px);
  display: flex; align-items: center; gap: 10px;
}
.gx-trail {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  flex: 1; min-width: 0;
}
#gx-save-path { flex: none; align-self: flex-start; white-space: nowrap; }
.gx-crumb {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(10,9,13,.8); border: 1px solid var(--hairline);
  border-radius: var(--pill); padding: 4px 22px 4px 6px; cursor: pointer;
  font-family: var(--sans); font-size: 10.5px; color: var(--ink-3);
  transition: all .18s var(--ease); max-width: 190px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gx-crumb:hover { color: var(--ink); border-color: rgba(255,255,255,.24); }
.gx-crumb.on { color: var(--ink); border-color: rgba(255,255,255,.28); }
.gx-crumb.ahead { opacity: .55; }
.gx-crumb-sep { color: var(--ink-4); font-size: 10px; }
.gx-crumb-x {
  position: absolute; top: 50%; right: 3px; transform: translateY(-50%);
  width: 16px; height: 16px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(6,5,8,.82); color: var(--ink-2); font-size: 11px; line-height: 1;
  display: grid; place-items: center;
  opacity: 0; pointer-events: none;
  transition: opacity .16s var(--ease), background .16s var(--ease), color .16s var(--ease);
}
.gx-crumb:hover .gx-crumb-x { opacity: 1; pointer-events: auto; }
.gx-crumb-x:hover { color: #fff; background: rgba(229,72,77,.85); }
@media (hover: none) {
  .gx-crumb-x { opacity: 1; pointer-events: auto; }
}

.gx-zoom {
  position: absolute; bottom: 22px; left: 22px;
  display: flex; gap: 4px; background: rgba(10,9,13,.8);
  border: 1px solid var(--hairline); border-radius: var(--pill); padding: 3px;
}

/* --- detail panel --- */
.gx-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: var(--rail-r);
  max-width: 100%;
  background: linear-gradient(180deg, rgba(9,8,11,.94), rgba(6,5,8,.97));
  border-left: 1px solid var(--hairline);
  backdrop-filter: blur(20px);
  overflow-x: hidden; overflow-y: auto; padding: 24px 22px 40px;
}
.gx-panel-body,
.gx-sec,
.gx-more {
  min-width: 0;
  max-width: 100%;
}
.gx-panel[hidden] { display: none; }

/* Skeleton follows the loaded panel’s bands (kicker, title, quote,
   paragraph, pills, list) the way Perplexity holds the layout while
   an answer arrives. It sits over an empty body, then fades. */
.gx-panel-skel {
  position: absolute; inset: 0;
  padding: 24px 22px 40px;
  background: linear-gradient(180deg, rgba(9,8,11,.96), rgba(6,5,8,.98));
  z-index: 2;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .34s var(--ease), visibility .34s var(--ease);
}
.gx-panel.is-loading .gx-panel-skel {
  opacity: 1; visibility: visible;
}
.gx-skel-bone {
  position: relative; display: block; overflow: hidden;
  background: rgba(255,255,255,.055);
  border-radius: 8px;
}
.gx-skel-bone::after {
  content: ''; position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.09), transparent);
  animation: gx-skel-shimmer 1.15s ease-in-out infinite;
}
@keyframes gx-skel-shimmer {
  100% { transform: translateX(100%); }
}
.gx-skel-kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.gx-skel-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.gx-skel-kicker-lab { width: 72px; height: 10px; }
.gx-skel-title { width: 72%; height: 26px; margin-bottom: 14px; border-radius: 10px; }
.gx-skel-quote {
  margin: 4px 0 18px; padding-left: 14px;
  border-left: 2px solid color-mix(in srgb, var(--resonance) 40%, transparent);
  display: grid; gap: 8px;
}
.gx-skel-line { height: 11px; width: 100%; }
.gx-skel-label { width: 96px; height: 9px; margin-bottom: 12px; }
.gx-skel-sec { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--hairline-2); display: grid; gap: 9px; }
.gx-skel-acts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.gx-skel-pill { height: 34px; border-radius: var(--pill); }
.gx-skel-pill.w-a { width: 118px; }
.gx-skel-pill.w-b { width: 102px; }
.gx-skel-pill.w-c { width: 124px; }
.gx-skel-row {
  display: flex; align-items: center; gap: 9px;
  background: rgba(0,0,0,.28); border: 1px solid var(--hairline-2);
  border-radius: var(--r-sm); padding: 11px;
}
.gx-skel-row-t { height: 12px; flex: 1; }
.gx-skel-bone.w-92 { width: 92%; }
.gx-skel-bone.w-88 { width: 88%; }
.gx-skel-bone.w-84 { width: 84%; }
.gx-skel-bone.w-80 { width: 80%; }
.gx-skel-bone.w-76 { width: 76%; }
.gx-skel-bone.w-72 { width: 72%; }
.gx-skel-bone.w-70 { width: 70%; }
.gx-skel-bone.w-64 { width: 64%; }
.gx-skel-bone.w-62 { width: 62%; }

@media (prefers-reduced-motion: reduce) {
  .gx-skel-bone::after { animation: none; }
  .gx-panel-skel { transition: none; }
}
/* The panel reveals top to bottom. graph.js stamps each band with its place
   in the reading order as --i; the delay is derived from that, so the eye
   follows the content down instead of receiving all of it at once. */
@keyframes gx-band { from { opacity: 0; transform: translateY(-4px); } }

.gx-panel .gx-panel-body > *,
.gx-panel .gx-more-row {
  animation: gx-band .3s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 26ms);
}

/* Someone who has asked for less motion gets the content, not the cascade. */
@media (prefers-reduced-motion: reduce) {
  .gx-panel .gx-panel-body > *,
  .gx-panel .gx-more-row { animation: none; }
}

.gx-kicker {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
  font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-4);
}
.gx-tag {
  border: 1px solid rgba(246,162,68,.4); color: rgba(246,162,68,.9);
  border-radius: var(--pill); padding: 2px 8px; letter-spacing: .14em;
}
.gx-panel h3 {
  font-family: var(--serif); font-size: 23px; font-weight: 500; line-height: 1.28;
  margin: 0 0 6px; color: var(--ink);
  overflow-wrap: anywhere;
}
.gx-author { font-family: var(--serif); font-style: italic; color: var(--ink-2); margin: 0 0 14px; font-size: 14px; }
.gx-lede { font-size: 13px; line-height: 1.72; color: var(--ink-2); margin: 0 0 16px; }
.gx-question {
  font-family: var(--serif); font-size: 16px; line-height: 1.6; color: var(--ink);
  margin: 12px 0 18px; padding-left: 14px;
  border-left: 2px solid color-mix(in srgb, var(--resonance) 55%, transparent);
}

.gx-sec { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--hairline-2); }
.gx-sec h4 {
  margin: 0 0 11px; font-size: 9px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink-4); font-weight: 700;
}

.gx-act {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  margin-top: 4px;
}
.gx-act > .ghost,
.gx-act > button {
  width: 100%;
  text-align: center;
}
.gx-act-lenses {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline-2);
}
.gx-lens-back {
  align-self: flex-start;
  width: auto !important;
  margin: 0 0 12px;
  padding-left: 0;
  padding-right: 0;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-size: 12px;
  letter-spacing: .04em;
  text-align: left !important;
  cursor: pointer;
}
.gx-lens-back:hover { color: var(--ink); }
.gx-lens-block {
  margin: 0 0 14px;
}
.gx-lens-block:last-child { margin-bottom: 0; }
.gx-lens-block-title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}
.gx-fine { margin: 14px 0 0; font-size: 11px; line-height: 1.7; color: var(--ink-3); }

/* the continuum reads small inside the 3D card */
.gx-hud .spec-track { margin: 14px 4px 7px; }
.gx-hud .spec-poles { margin: 0 0 10px; font-size: 9.5px; }

.gx-more { display: grid; gap: 4px; }
.gx-more-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 9px;
  row-gap: 1px;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: left;
  background: rgba(0,0,0,.3); border: 1px solid var(--hairline-2);
  border-radius: var(--r-sm); padding: 8px 10px; cursor: pointer;
  font-family: var(--sans); transition: all .16s var(--ease);
}
.gx-more-row:hover { border-color: rgba(255,255,255,.2); background: rgba(0,0,0,.5); }
.gx-more-row > .orb {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
}
.gx-more-row .t {
  grid-column: 2;
  font-family: var(--serif); font-size: 13px; color: var(--ink);
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gx-more-row .s {
  grid-column: 2;
  font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-4);
  min-width: 0; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

@media (max-width: 900px) {
  .gx-panel { width: 100%; top: auto; height: 44%; border-left: 0; border-top: 1px solid var(--hairline); }
  .gx-top, .gx-trail-row, .gx-corpus-row { right: 0; }
}

/* ============================================================
   The note as a container — media, links, saved nodes
   ============================================================ */

.composer { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--hairline-2); }

.composer-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.composer-bar .spacer { flex: 1; }
.composer-lab {
  font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-4);
}

/* add-a-link form */
.link-form { display: flex; gap: 7px; margin-bottom: 14px; flex-wrap: wrap; }
.link-form[hidden] { display: none; }
.link-form input {
  flex: 1; min-width: 150px;
  background: rgba(0,0,0,.4); border: 1px solid var(--hairline);
  border-radius: var(--pill); padding: 9px 15px; outline: none;
  color: var(--ink); font-family: var(--sans); font-size: 12.5px;
}
.link-form input:focus { border-color: rgba(255,255,255,.26); }
.link-form input::placeholder { color: var(--ink-4); }

/* saved nodes, as chips on the note */
.saved-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.saved-strip[hidden] { display: none; }
.saved-chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--hairline); background: rgba(0,0,0,.3);
  border-radius: var(--pill); padding: 5px 6px 5px 9px;
  font-family: inherit; font-size: 11.5px; color: var(--ink-2); cursor: pointer;
  transition: all .16s var(--ease);
}
.saved-chip:hover { color: var(--ink); border-color: rgba(255,255,255,.24); }
.saved-chip .t { font-family: var(--serif); font-size: 12.5px; }
.saved-chip .x {
  color: var(--ink-4); font-size: 13px; line-height: 1; padding: 2px 5px; border-radius: 50%;
}
.saved-chip .x:hover { color: var(--tension); background: rgba(229,72,77,.12); }

/* attachment grid */
.attach-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px; margin-bottom: 12px;
}
.attach-grid:empty { display: none; }

.att {
  position: relative; border: 1px solid var(--hairline);
  background: rgba(0,0,0,.3); border-radius: var(--r-md); overflow: hidden;
  transition: border-color .18s var(--ease);
}
.att:hover { border-color: rgba(255,255,255,.2); }
.att .kill {
  position: absolute; top: 7px; right: 7px; z-index: 3;
  width: 22px; height: 22px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(6,5,8,.82); color: var(--ink-2); font-size: 13px; line-height: 1;
  display: grid; place-items: center; opacity: 0; transition: opacity .16s var(--ease);
  backdrop-filter: blur(4px);
}
.att:hover .kill { opacity: 1; }
.att .kill:hover { color: #fff; background: rgba(229,72,77,.85); }

.att img, .att video { display: block; width: 100%; height: 132px; object-fit: cover; background: #000; }
.att video { height: auto; max-height: 200px; object-fit: contain; }
.att audio { width: 100%; display: block; margin: 14px 0 6px; }

.att .meta { padding: 9px 11px; }
.att .name {
  font-size: 11.5px; color: var(--ink-2); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px;
}
.att .sub { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4); }

/* link card */
.att.link { display: block; text-decoration: none; }
.att.link .meta { padding: 13px 13px 12px; }
.att.link .name { font-family: var(--serif); font-size: 13.5px; color: var(--ink); white-space: normal; line-height: 1.4; }
.att.link .host {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-4);
}
.att.link .host::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--lineage);
}
.att.file .meta { padding: 20px 13px 16px; }

/* drop zone */
.dropzone {
  border: 1px dashed var(--hairline); border-radius: var(--r-md);
  padding: 20px; text-align: center;
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-4);
  transition: all .2s var(--ease);
}
.dropzone.hot {
  border-color: rgba(246,162,68,.55); color: rgba(246,162,68,.9);
  background: rgba(246,162,68,.06);
}

/* share sheet manifest */
.manifest {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--r-sm);
  background: rgba(0,0,0,.3); border: 1px solid var(--hairline-2);
  font-size: 11.5px; line-height: 1.7; color: var(--ink-3);
}
.manifest b { color: var(--ink-2); font-weight: 600; }
.manifest .warn { color: rgba(246,162,68,.85); }

/* shared view additions */
.shared-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 10px; margin-top: 14px; }
.shared-sec { margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--hairline-2); }

/* Below about 10px the veins and the shell are invisible anyway, so the
   unlabelled frontier orbs and the small chrome orbs drop the layered
   treatment and keep a single gradient with a rim. Cheaper, and identical
   to the eye at that size. */
/* media is excluded: the shorthand below resets background-size, which
   would drop `cover` and render a photograph as a top-left crop.
   Quests are excluded: they keep the caustic layers at every scale. */
.gx-node:not(.labelled):not(.sel):not(.gx-media):not(.gx-quest) .gx-orb::before,
.gx-node:not(.labelled):not(.sel):not(.gx-media):not(.gx-quest) .gx-orb::after,
.orb.sm::before, .orb.sm::after,
.mini-orb::before, .mini-orb::after { content: none; }

.gx-node:not(.labelled):not(.sel):not(.gx-media):not(.gx-quest) .gx-orb,
.orb.sm {
  background: radial-gradient(circle at 36% 29%,
    color-mix(in srgb, var(--c) 14%, #ffffff) 0%,
    var(--c) 58%,
    color-mix(in oklab, var(--c) 84%, #0a2430) 100%);
  box-shadow:
    inset 0 0 0 .5px color-mix(in srgb, var(--shell) 60%, transparent),
    0 0 9px color-mix(in srgb, var(--c) 38%, transparent);
}

/* ---------- media, links and other entries in the field ---------- */

/* a photograph sits inside the glass rather than behind an orb gradient */
.gx-media .gx-orb {
  background-size: cover;
  background-position: center;
  background-color: rgba(255,255,255,.06);
}
.gx-media .gx-orb::before { content: none; }
/* The glass sits at the rim only. A heavier shell turns a photograph into
   a flat disc, which defeats the point of putting it on the canvas. */
.gx-media .gx-orb::after {
  background:
    radial-gradient(ellipse 24% 17% at 29% 19%, rgba(255,255,255,.26), transparent 60%),
    radial-gradient(circle at 50% 50%,
      transparent 78%,
      rgba(255,255,255,.26) 90%,
      rgba(255,255,255,.52) 96%,
      rgba(255,255,255,.14) 99.5%,
      transparent 100%);
}
.gx-media .gx-orb {
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.16),
    0 2px 14px rgba(0,0,0,.55),
    0 0 16px rgba(246,162,68,.16);
}
.gx-media.sel .gx-orb { box-shadow: inset 0 0 0 1px rgba(255,255,255,.4), 0 0 26px rgba(246,162,68,.5); }

/* another entry in the journal — same amber, ringed so it reads as a note */
.gx-note-other .gx-orb {
  box-shadow:
    0 0 0 1px rgba(255,255,255,.22),
    0 0 0 4px rgba(246,162,68,.13),
    0 0 16px color-mix(in srgb, var(--c) 40%, transparent);
}
.gx-note-other .gx-label { font-size: 13px; color: var(--ink); }
.gx-note-other.gx-node.labelled { border-color: rgba(246,162,68,.26); }

.gx-link .gx-label { font-style: normal; font-family: var(--sans); font-size: 11px; }

/* previews in the detail panel */
.gx-preview {
  display: block; width: 100%; border-radius: var(--r-md);
  margin: 4px 0 8px; border: 1px solid var(--hairline);
  background: #000;
}
video.gx-preview { max-height: 260px; }

/* ---------- focus and arrival ----------
   Clicking a node centres it and recedes everything it does not touch, so
   the eye keeps hold of what it just opened while the field grows. */
.gx-node {
  transition: opacity .40s var(--ease);
}
.gx-node .gx-orb { transition: transform .34s var(--ease), box-shadow .2s var(--ease); }

.gx-node.dim { opacity: .2; }
.gx-node.dim.labelled { opacity: .3; }
.gx-node.dim:hover { opacity: .85; }

/* a node that has just arrived fades and swells into place rather than popping */
.gx-node.gx-enter { opacity: 0; }
.gx-node.gx-enter .gx-orb { transform: scale(.35); }

#gx-edges line { transition: stroke .38s var(--ease), stroke-width .38s var(--ease); }

/* ---------- 2D / 3D toggle and the WebGL stage ---------- */
.dim-seg {
  width: 108px; margin-bottom: 0; flex: none;
  background: rgba(0,0,0,.5);
}
.dim-seg .seg-btn { padding: 6px 0; letter-spacing: .14em; }

/* the stage occupies the space the panel leaves, so nothing composes
   underneath it */
#gx-3d { position: absolute; inset: 0 var(--rail-r) 0 0; }
#gx-3d[hidden] { display: none; }
#gx-3d canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
#gx-3d canvas:active { cursor: grabbing; }
#gx-3d canvas.over { cursor: pointer; }

/* in 3D the zoom buttons belong to the camera, not to a css transform */
body.dim3 .gx-zoom { display: none; }

/* ---------- 3D: the side sheet gives way to an in-context card ---------- */
body.dim3 .gx-panel { display: none; }
body.dim3 #gx-3d { inset: 0; }
body.dim3 .gx-top, body.dim3 .gx-trail-row { right: 0; }

/* ============================================================
   Pathways — tray + note-page feed
   ============================================================ */

#pathway-wrap[hidden], #path-empty[hidden], #path-list[hidden],
#quests-wrap[hidden], #quest-empty[hidden], #quest-list[hidden],
#quest-log-filters[hidden],
#profile-view[hidden],
#dashboard-wrap[hidden] { display: none; }
.walk-kicker {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 8px;
  font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: #fff;
}
#pathway-wrap .title-input {
  display: block;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hairline-2);
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  field-sizing: content;
  min-height: calc(30px * 1.25);
}
.path-empty { color: var(--ink-3); font-size: 12px; line-height: 1.6; padding: 22px 12px; }

.walk-feed { padding-bottom: 8px; }
.feed-item {
  padding: 4px 0 32px 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--hairline-2);
  border-left: 2px solid transparent;
  scroll-margin-top: 18px;
}
.feed-item:last-child { border-bottom: 0; margin-bottom: 0; }
.feed-item.on { border-left-color: var(--resonance); }
.feed-item .gx-kicker { margin-bottom: 12px; color: #fff; }
.feed-item h3 {
  font-family: var(--serif); font-size: 28px; font-weight: 500; line-height: 1.28;
  margin: 0 0 12px; color: var(--ink);
}
.feed-item .gx-question, .feed-item .gx-lede { margin: 0 0 16px; }
.feed-item .gx-act { margin: 0 0 8px; }
.feed-item .walk-media { max-width: 100%; border-radius: var(--r-md); margin: 8px 0 16px; display: block; }
.walk-notes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.walk-notes:empty { display: none; }
.walk-add { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.walk-link { margin-bottom: 12px; }
.walk-panel {
  border: 1px solid var(--hairline);
  background: rgba(0,0,0,.28);
  border-radius: var(--r-md);
  padding: 12px 14px 14px;
  margin-bottom: 12px;
}
.walk-panel[hidden], .walk-peek[hidden], .walk-picker[hidden] { display: none; }
.walk-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 10px;
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
}
.walk-panel .gx-lede { margin: 0 0 12px; }
.walk-peek {
  border: 1px solid var(--hairline);
  background: rgba(0,0,0,.35);
  border-radius: var(--r-md);
  padding: 14px 16px 16px;
  margin-bottom: 12px;
  max-height: 280px; overflow-y: auto;
}
.walk-peek-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.walk-peek-head .k {
  flex: 1;
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-4);
}
.walk-peek h3 {
  font-family: var(--serif); font-size: 20px; font-weight: 500;
  margin: 0 0 10px; color: var(--ink);
}
.walk-peek .gx-lede { margin: 0; }
.walk-peek .walk-media { max-width: 100%; border-radius: var(--r-md); margin: 4px 0 0; display: block; }
.walk-picker {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 200px; overflow-y: auto;
}
.walk-picker button {
  text-align: left; background: var(--glass-2); border: 1px solid var(--hairline);
  border-radius: var(--r-sm); padding: 8px 12px; color: var(--ink-2); cursor: pointer;
}
.walk-picker button:hover { color: var(--ink); background: var(--glass-3); }
.path-name {
  width: 100%; box-sizing: border-box;
  background: rgba(0,0,0,.45); border: 1px solid var(--hairline);
  border-radius: var(--r-sm); padding: 10px 12px; margin-bottom: 14px;
  color: var(--ink); font-family: var(--serif); font-size: 16px;
}
.path-pick-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; max-height: 280px; overflow-y: auto; }
.path-pick-list button {
  text-align: left; background: var(--glass-2); border: 1px solid var(--hairline);
  border-radius: var(--r-sm); padding: 10px 12px; color: var(--ink-2); cursor: pointer;
}
.path-pick-list button:hover { color: var(--ink); }
#path-save-scrim, #path-pick-scrim, #note-pick-scrim { z-index: 70; }

.gx-hud {
  position: absolute; left: 0; top: 0;
  width: 330px; max-width: 42vw;
  padding: 16px 18px 15px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: linear-gradient(165deg, rgba(14,12,17,.96), rgba(7,6,10,.98));
  box-shadow: 0 20px 60px rgba(0,0,0,.6),
              0 0 0 1px color-mix(in srgb, var(--c) 18%, transparent),
              0 0 34px color-mix(in srgb, var(--c) 12%, transparent);
  transition: opacity .3s var(--ease);
  pointer-events: auto;
  z-index: 4;
}
.gx-hud:empty { display: none; }

.hud-kicker {
  display: flex; align-items: center; gap: 8px; margin-bottom: 9px;
  font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-4);
  font-weight: 700;
}
.hud-title {
  font-family: var(--serif); font-size: 19px; font-weight: 500;
  line-height: 1.3; color: var(--ink);
}
.hud-sub { font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.hud-line {
  margin: 11px 0 0; font-size: 12.5px; line-height: 1.65; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.hud-line.q {
  font-family: var(--serif); font-size: 14.5px; line-height: 1.55; color: var(--ink);
  padding-left: 12px; border-left: 2px solid color-mix(in srgb, var(--c) 55%, transparent);
  -webkit-line-clamp: 5;
}
.hud-acts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.hud-acts a { text-decoration: none; display: inline-block; }

@media (max-width: 900px) { .gx-hud { width: 90vw; max-width: 90vw; } }

.gx-tip {
  position: absolute; left: 0; top: 0;
  width: 240px; max-width: min(240px, 58vw);
  padding: 10px 12px 11px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: linear-gradient(165deg, rgba(14,12,17,.96), rgba(7,6,10,.98));
  box-shadow: 0 12px 32px rgba(0,0,0,.5),
              0 0 0 1px color-mix(in srgb, var(--c) 20%, transparent);
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  visibility: hidden;
  transition: opacity .16s var(--ease);
}
.gx-tip.on { opacity: 1; visibility: visible; }
.gx-tip-title {
  font-family: var(--serif); font-size: 14px; font-weight: 500;
  line-height: 1.3; color: var(--ink);
}
.gx-tip-sub { font-family: var(--serif); font-style: italic; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.gx-tip-line {
  margin: 7px 0 0; font-size: 12px; line-height: 1.55; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.gx-tip-line.q {
  font-family: var(--serif); font-size: 13px; line-height: 1.5; color: var(--ink);
  padding-left: 10px; border-left: 2px solid color-mix(in srgb, var(--c) 55%, transparent);
}

/* ---------- belief spectra ---------------------------------------
   A spectrum bar reads left-pole to right-pole with two kinds of
   mark on it: a dashed tick for what THIS passage leans, and a
   filled tick for where answered items have placed the journal.
   The two must never be confusable — that distinction is the whole
   honesty of the feature.
------------------------------------------------------------------ */
.bel-cov {
  display: flex; align-items: baseline; gap: 8px;
  padding: 2px 0 14px; margin-bottom: 4px;
  border-bottom: 1px solid var(--hairline-2);
}
.bel-cov b { font-family: var(--serif); font-size: 17px; font-weight: 500; color: var(--ink); }
.bel-cov span { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4); }

.bel-sec {
  display: flex; align-items: center; gap: 8px;
  font-size: 9px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-4); margin: 18px 0 9px;
}
.bel-sec::after { content: ''; flex: 1; height: 1px; background: var(--hairline-2); }
.bel-sec:first-child { margin-top: 6px; }

.spec {
  border: 1px solid var(--hairline);
  background: rgba(0,0,0,.3);
  border-radius: var(--r-md);
  padding: 13px 14px 14px;
  margin-bottom: 8px;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.spec:hover { border-color: rgba(255,255,255,.2); background: rgba(0,0,0,.42); }
.spec.placed { border-color: color-mix(in srgb, var(--stance) 34%, transparent); }

.spec-head { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 12px; }
.spec-head h4 {
  margin: 0 0 3px; font-family: var(--serif); font-size: 13.5px; font-weight: 500;
  color: var(--ink); line-height: 1.35; flex: 1;
}
.spec-branch { font-size: 9px; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-4); }
.spec-state {
  flex: none; font-size: 8.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700;
  border: 1px solid var(--hairline); border-radius: var(--pill);
  padding: 3px 8px; color: var(--ink-3); white-space: nowrap;
}
.spec-state.tentative { color: var(--ink-4); border-style: dashed; }
.spec-state.on { color: #14121a; background: rgba(255,255,255,.86); border-color: transparent; }

/* the continuum */
.spec-track {
  position: relative; height: 3px; border-radius: var(--pill);
  background: var(--glass-3); margin: 16px 6px 8px;
}
.spec-track::before, .spec-track::after {
  content: ''; position: absolute; top: -3px; width: 1px; height: 9px;
  background: var(--hairline);
}
.spec-track::before { left: 0; }
.spec-track::after  { right: 0; }
/* the balanced band — "holding the tension" is a position, so it is drawn */
.spec-band {
  position: absolute; top: 0; bottom: 0; left: 40%; right: 40%;
  background: rgba(255,255,255,.07);
}

.spec-arg {
  position: absolute; top: -2px; width: 1px; height: 7px;
  background: var(--ink-4); transform: translateX(-.5px);
  cursor: help;
}
.spec-arg::after {
  content: attr(data-name); position: absolute; top: -15px; left: 50%;
  transform: translateX(-50%); white-space: nowrap;
  font-size: 8.5px; letter-spacing: .04em; color: var(--ink-4);
  opacity: 0; transition: opacity .16s var(--ease); pointer-events: none;
}
.spec-arg:hover { background: var(--ink-2); }
.spec-arg:hover::after { opacity: 1; }

.spec-mark { position: absolute; transform: translateX(-50%); }
.spec-mark.tentative {
  top: -5px; width: 13px; height: 13px; border-radius: 50%;
  border: 1px dashed rgba(255,255,255,.5); background: rgba(255,255,255,.06);
}
.spec-mark.placed {
  top: -4.5px; width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #fff 0%, rgba(255,255,255,.82) 60%, rgba(120,118,130,.9) 100%);
  box-shadow: 0 0 0 3px rgba(255,255,255,.08);
}

.spec-poles {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 10px; color: var(--ink-3); margin: 0 2px 11px;
}
.spec-poles i { font-style: normal; }
.spec-poles i.lean { color: var(--ink); }

.spec-line { margin: 0 0 9px; font-size: 12px; line-height: 1.6; color: var(--ink-2); }
.spec-line em { font-style: italic; color: var(--ink-3); }
.spec-quote {
  margin: 0 0 10px; padding-left: 10px;
  border-left: 1px solid color-mix(in srgb, var(--stance) 50%, transparent);
  font-family: var(--serif); font-size: 12px; font-style: italic;
  color: var(--ink-3); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.spec-against {
  background: var(--glass-2); border: 1px solid var(--hairline-2);
  border-radius: var(--r-sm); padding: 10px 11px; margin-bottom: 11px;
}
.spec-against .lab {
  font-size: 9px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-4); display: block; margin-bottom: 5px;
}
.spec-against .who { font-family: var(--serif); font-size: 12.5px; color: var(--ink); margin-bottom: 4px; }
.spec-against p { margin: 0; font-size: 11.5px; line-height: 1.6; color: var(--ink-3); }

/* the count reads as a caption over its own action, so the button can take
   the full width of the card and stay a single unmissable target */
.spec-actions { display: flex; flex-direction: column; gap: 9px; }
.spec-actions .n {
  font-size: 9px; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-4);
  text-align: center;
}
.spec-actions .ghost { width: 100%; text-align: center; }

/* ---------- place-yourself overlay ------------------------------ */
/* above the graph (z 50), below the toast, so an item can be answered
   from a spectrum world without leaving the exploration */
#place-scrim { z-index: 55; }
.place-modal { width: min(560px, 100%); }
.place-kicker {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-4);
}
.place-kicker b { color: var(--ink-2); font-weight: 700; }
.place-q {
  font-family: var(--serif); font-size: 17px; font-weight: 500; line-height: 1.5;
  color: var(--ink); margin: 0 0 18px;
}
.place-opts { display: grid; gap: 8px; margin-bottom: 18px; }
.place-opt {
  text-align: left; width: 100%;
  border: 1px solid var(--hairline); background: rgba(0,0,0,.3);
  border-radius: var(--r-md); padding: 12px 14px; cursor: pointer;
  font-family: var(--serif); font-size: 13.5px; line-height: 1.55; color: var(--ink-2);
  transition: all .16s var(--ease);
}
.place-opt:hover { border-color: rgba(255,255,255,.26); background: rgba(0,0,0,.46); color: var(--ink); }
.place-opt.chosen { border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.06); color: var(--ink); }
.place-result { animation: fade .25s var(--ease); }
.place-result .verdict {
  font-family: var(--serif); font-size: 15px; line-height: 1.5; color: var(--ink); margin: 0 0 6px;
}
.place-result .sub { font-size: 12px; line-height: 1.65; color: var(--ink-3); margin: 0 0 16px; }

/* ============================================================
   The side navigation

   Split by ownership, after Zillow's product nav: the rail holds
   what accumulates across the journal, and anything scoped to a
   single note stays with the note. That is what lets the active
   state mean something precise.
   ============================================================ */
nav.sidenav {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; padding: 14px 0 18px;
  border-right: 1px solid var(--hairline-2);
  background: linear-gradient(180deg, rgba(8,7,10,.6), rgba(8,7,10,.3));
  backdrop-filter: blur(12px);
  overflow: hidden;
}

/* FAB chrome is phone-only; desktop keeps the sidenav as-is. */
.nav-fab-toggle,
.nav-fab-scrim { display: none; }

.nav-brand { width: 40px; height: 47px; flex: none; display: block; }
.nav-brand img {
  width: 100%; height: 100%; display: block;
  object-fit: contain;
  mix-blend-mode: screen;
}

.nav-new {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--hairline); border-radius: var(--r-sm);
  background: var(--glass-2); color: var(--ink-2); cursor: pointer;
  transition: color .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}
.nav-new svg { width: 18px; height: 18px; }
.nav-new:hover {
  color: var(--ink); background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.24);
}

.nav-rule { width: 30px; height: 1px; background: var(--hairline); flex: none; }

/* 56 tall on a 72px pitch — gap 16 plus height 56 — after the reference.
   The target is as wide as its widest label rather than as its 40px pill,
   so 'Explore' is not left hanging outside the thing you can click. */
.nav-item {
  width: 56px; height: 56px; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; border: 0; background: none; cursor: pointer;
  border-radius: var(--r-sm); color: var(--ink-3);
  font-family: var(--sans); font-weight: 700;
  transition: color .18s var(--ease);
}
.nav-item svg { width: 24px; height: 24px; flex: none; }
/* .1em, not the .18em of .micro: 'Determinism'-length words overflow 78px */
.nav-item .nav-lab {
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  line-height: 1; white-space: nowrap;
}
.nav-lab-m { display: none; }
.nav-item:hover { color: var(--ink-2); }

/* the active pill sits behind the icon, not the whole target — so it is
   narrower than the target and has to be centred deliberately */
/* Same 40×40 square as .nav-new, not a shorter pill — the active fill
   was reading as a small oval behind the icon. */
.nav-item::before {
  content: ''; position: absolute; width: 40px; height: 40px;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  border-radius: var(--r-sm); background: transparent;
  transition: background .2s var(--ease);
}
.nav-item { position: relative; }
.nav-item.on { color: var(--ink); }
.nav-item.on::before { background: var(--glass-2); }
.nav-item.on svg { color: var(--stance); }
.nav-item > * { position: relative; }

/* Help sits at the foot of the rail, separated from destinations. */
.nav-help {
  margin-top: auto;
}
.nav-help.on::before { background: transparent; }
.nav-help.on { color: var(--ink-3); }
.nav-help.on svg { color: inherit; }
.nav-help:hover { color: var(--ink-2); }

/* the Reading rail keeps its own collapse control */
.ins-collapse {
  width: 24px; height: 24px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--hairline); background: var(--glass-3);
  cursor: pointer; color: var(--ink-2);
  border-radius: var(--r-sm);
  transition: color .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}
.ins-collapse svg { width: 15px; height: 15px; }
.ins-ico-close { display: none; }
.ins-collapse:hover { color: var(--ink); background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); }
.body.insights-closed .ins-collapse svg { transform: scaleX(-1); }

/* Collapsing takes the panel's column to zero width, which would clip away
   the one control that brings it back. Closed, the chevron hangs off the
   panel's edge while the rest of the panel stays hidden behind it. */
.body.insights-closed aside.insights { position: relative; overflow: visible; }
.body.insights-closed aside.insights > * { visibility: hidden; }
.body.insights-closed .ins-collapse {
  visibility: visible; position: absolute; top: 16px; right: 8px;
  color: var(--ink);
  background: rgba(10,9,12,.78);
  border-color: rgba(255,255,255,.2);
}

/* Phone: Pokémon GO–style FAB in the bottom-right. Desktop sidenav unchanged. */
@media (max-width: 900px) {
  nav.sidenav {
    position: fixed;
    inset: auto 14px calc(14px + env(safe-area-inset-bottom, 0px)) auto;
    z-index: 90;
    width: 64px;
    height: 64px;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    gap: 0;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: visible;
    pointer-events: none;
    transition: none;
  }
  html.nav-hidden nav.sidenav { transform: none; opacity: 0; pointer-events: none; }
  html.fab-open nav.sidenav {
    width: min(100vw - 24px, 300px);
    height: min(78vh, 360px);
  }

  .nav-brand, .nav-rule, #btn-nav-insights { display: none; }
  .nav-lab-d { display: none; }
  .nav-lab-m { display: inline; }
  .ins-ico-chevron { display: none; }
  .ins-ico-close { display: block; }
  .body.insights-closed .ins-collapse svg { transform: none; }
  .ins-collapse { width: 28px; height: 28px; }

  .nav-fab-toggle {
    pointer-events: auto;
    position: absolute;
    right: 0; bottom: 0;
    width: 64px; height: 64px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.22);
    background: linear-gradient(160deg, rgba(24,22,28,.96), rgba(10,9,12,.98));
    color: var(--ink);
    box-shadow: 0 10px 28px rgba(0,0,0,.45);
    display: grid; place-items: center;
    cursor: pointer;
    z-index: 3;
  }
  .nav-fab-toggle .nav-fab-menu,
  .nav-fab-toggle .nav-fab-close {
    grid-area: 1 / 1;
    display: grid; place-items: center;
    transition: opacity .18s var(--ease), transform .18s var(--ease);
  }
  .nav-fab-toggle .nav-fab-menu svg { width: 26px; height: 26px; }
  .nav-fab-toggle .nav-fab-close svg { width: 22px; height: 22px; }
  .nav-fab-toggle .nav-fab-close { opacity: 0; transform: rotate(-45deg) scale(.7); }
  html.fab-open .nav-fab-toggle .nav-fab-menu { opacity: 0; transform: rotate(45deg) scale(.7); }
  html.fab-open .nav-fab-toggle .nav-fab-close { opacity: 1; transform: none; }

  nav.sidenav .nav-new {
    pointer-events: auto;
    position: absolute;
    right: 10px;
    bottom: 76px;
    width: 44px; height: 44px;
    border-radius: 50%;
    z-index: 2;
  }

  nav.sidenav .nav-item {
    pointer-events: none;
    position: absolute;
    right: 4px; bottom: 4px;
    width: 64px; height: auto;
    min-height: 64px;
    flex: none;
    opacity: 0;
    transform: scale(.35);
    transition:
      opacity .2s var(--ease),
      transform .28s cubic-bezier(.2,.8,.2,1);
    z-index: 1;
  }
  nav.sidenav .nav-item::before {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: rgba(12,11,14,.92);
    border: 1px solid rgba(255,255,255,.16);
    box-shadow: 0 8px 20px rgba(0,0,0,.35);
  }
  nav.sidenav .nav-item.on::before { background: rgba(255,255,255,.12); }
  nav.sidenav .nav-item .nav-lab {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    letter-spacing: .12em;
    color: var(--ink);
    text-shadow: 0 1px 8px rgba(0,0,0,.8);
    white-space: nowrap;
  }

  /* Staggered 2–3–1 cluster above the FAB (matches the annotated layout).
     Keeps every orb on-screen with even gaps. */
  html.fab-open nav.sidenav .nav-item {
    opacity: 1;
    pointer-events: auto;
  }
  html.fab-open nav.sidenav .nav-new {
    opacity: 0;
    pointer-events: none;
  }

  /* Top row — Home + Explore */
  html.fab-open #btn-home {
    transform: translate(-176px, -248px) scale(1);
    transition-delay: .02s;
  }
  html.fab-open #btn-explore {
    transform: translate(-80px, -248px) scale(1);
    transition-delay: .05s;
  }

  /* Middle — Notes, Market, Pathways */
  html.fab-open #btn-rail {
    transform: translate(-224px, -156px) scale(1);
    transition-delay: .08s;
  }
  html.fab-open #btn-market {
    transform: translate(-128px, -156px) scale(1);
    transition-delay: .11s;
  }
  html.fab-open #btn-pathways {
    transform: translate(-32px, -156px) scale(1);
    transition-delay: .14s;
  }

  /* Lower — Quests + Profile */
  html.fab-open #btn-quests {
    transform: translate(-176px, -64px) scale(1);
    transition-delay: .17s;
  }
  html.fab-open #btn-profile {
    transform: translate(-80px, -64px) scale(1);
    transition-delay: .2s;
  }

  /* Help sits near the FAB */
  html.fab-open #btn-help {
    margin-top: 0;
    transform: translate(-32px, 8px) scale(1);
    transition-delay: .23s;
  }

  .nav-fab-scrim {
    display: block;
    position: fixed; inset: 0; z-index: 85;
    background: rgba(4,3,6,.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
  .nav-fab-scrim[hidden] { display: none; }

  #graph { inset: 0; }
  #dropzone { display: none; }
  .gx-trail-row {
    right: 12px; left: 12px;
    flex-wrap: nowrap;
  }
  .gx-trail {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .gx-crumb { max-width: 148px; flex: none; }
  #gx-save-path { font-size: 9px; padding: 4px 8px; }

  /* Bottom chrome stays in a band left of the FAB (64 + 14 inset + gap),
     sharing the FAB’s bottom edge. */
  #graph {
    --gx-fab-clear: calc(14px + 64px + 12px + env(safe-area-inset-right, 0px));
    --gx-fab-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  /* The top bar stretches so search and 2D/3D can dock to the bottom
     without leaving the chrome. Clicks pass through the empty middle. */
  #gx-chrome > .gx-top { pointer-events: none; }
  .gx-top {
    inset: 0;
    right: 0;
    align-items: flex-start;
    padding: 12px;
  }
  .gx-top > * { pointer-events: auto; }
  #gx-close { margin-left: auto; }
  .gx-top .search {
    position: absolute;
    left: 12px;
    right: var(--gx-fab-clear);
    width: auto;
    max-width: none;
    min-width: 0;
    flex: none;
    top: auto;
    bottom: var(--gx-fab-bottom);
  }
  .gx-top #gx-dim {
    position: absolute;
    top: auto;
    right: var(--gx-fab-clear);
    bottom: calc(var(--gx-fab-bottom) + 48px);
    width: 72px;
    min-width: 72px;
    height: 36px;
    box-sizing: border-box;
  }
  .gx-top #gx-dim .seg-btn {
    padding: 0;
    height: 100%;
    font-size: 9px;
    letter-spacing: .1em;
    display: grid;
    place-items: center;
  }
  .gx-zoom {
    left: 12px;
    right: auto;
    bottom: calc(var(--gx-fab-bottom) + 48px);
    gap: 2px;
    padding: 2px;
    height: 36px;
    box-sizing: border-box;
    align-items: stretch;
  }
  .gx-zoom .micro {
    padding: 0 7px;
    font-size: 9px;
    letter-spacing: .06em;
    height: 100%;
    display: grid;
    place-items: center;
  }
  /* Corpus: search on the FAB baseline; tools on a matching-height row above */
  #graph.corpus-mode .gx-top .search {
    bottom: var(--gx-fab-bottom);
  }
  #graph.corpus-mode .gx-zoom,
  #graph.corpus-mode .gx-top #gx-dim,
  #graph.corpus-mode .gx-corpus-row {
    bottom: calc(var(--gx-fab-bottom) + 48px);
    height: 36px;
    box-sizing: border-box;
  }
  body:not(.dim3) #graph:has(#gx-panel:not([hidden])) .gx-top .search {
    bottom: calc(44% + 8px);
  }
  body:not(.dim3) #graph:has(#gx-panel:not([hidden])) .gx-zoom,
  body:not(.dim3) #graph:has(#gx-panel:not([hidden])) .gx-top #gx-dim {
    bottom: calc(44% + 52px);
  }
  body:not(.dim3) #graph.corpus-mode:has(#gx-panel:not([hidden])) .gx-top .search {
    bottom: calc(44% + 8px);
  }
  body:not(.dim3) #graph.corpus-mode:has(#gx-panel:not([hidden])) .gx-zoom,
  body:not(.dim3) #graph.corpus-mode:has(#gx-panel:not([hidden])) .gx-top #gx-dim,
  body:not(.dim3) #graph.corpus-mode:has(#gx-panel:not([hidden])) .gx-corpus-row {
    bottom: calc(44% + 52px);
  }

  .gx-corpus-row {
    top: auto;
    /* Sit in the gap between compact zoom and 2D/3D, left of the FAB */
    left: 108px;
    right: calc(var(--gx-fab-clear) + 80px);
    transform: none;
    width: auto;
    max-width: none;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: stretch;
    gap: 0;
    background: rgba(10,9,13,.8);
    border: 1px solid var(--hairline);
    border-radius: var(--pill);
    padding: 3px;
  }
  #gx-cat-wrap, #gx-trad-wrap { display: grid; }
  .gx-cat-lab, .gx-corpus-row .gx-sort > span { display: none; }
  #gx-filters { display: none; }
  .gx-eq-filter { display: none; }
  .gx-corpus-row .gx-sort {
    position: relative;
    width: 34px; height: auto; min-width: 34px; min-height: 0;
    display: grid; place-items: center;
    overflow: hidden;
    align-self: stretch;
  }
  .gx-tool-ico {
    display: block;
    width: 16px; height: 16px;
    color: var(--ink-2);
    pointer-events: none;
  }
  .gx-corpus-row .gx-sort select {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    margin: 0; padding: 0;
    opacity: 0;
    cursor: pointer;
    border: 0; background: none;
    -webkit-appearance: none; appearance: none;
  }
  #gx-cat-wrap.on .gx-tool-ico,
  #gx-trad-wrap.on .gx-tool-ico { color: var(--stance); }
  #gx-cat-wrap.on::after,
  #gx-trad-wrap.on::after {
    content: '';
    position: absolute; top: 4px; right: 5px;
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--stance);
    pointer-events: none;
  }
  #graph.corpus-mode .gx-trail-row { top: 54px; }
}

/* ---------- the standing profile -------------------------------- */
.prof-head { margin-bottom: 18px; }
.prof-cov {
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 10px;
}
.prof-cov b { font-size: 22px; letter-spacing: 0; color: var(--ink); font-weight: 500; }
.prof-lede {
  margin: 0; font-size: 12.5px; line-height: 1.75; color: var(--ink-3); max-width: 56ch;
}

#prof-radar {
  display: flex; justify-content: center;
  margin: 4px 0 32px;
}
#prof-radar svg { width: min(100%, 440px); height: auto; overflow: visible; }
.prof-ring {
  fill: none; stroke: var(--hairline); stroke-width: 1;
}
.prof-spoke { stroke: var(--hairline-2); stroke-width: 1; }
.prof-poly {
  fill: color-mix(in srgb, var(--stance) 18%, transparent);
  stroke: var(--stance); stroke-width: 1.6; stroke-linejoin: round;
}
.prof-poly-line { stroke: var(--stance); stroke-width: 1.6; }
.prof-vertex { cursor: pointer; }
.prof-vertex circle:not(.prof-hit) {
  fill: #fff;
  stroke: var(--stance);
  stroke-width: 1.4;
}
.prof-vertex .prof-hit { fill: rgba(0,0,0,0); stroke: none; }
.prof-vertex text {
  font-family: var(--sans);
  font-size: 9.5px;
  fill: var(--ink-2);
}

.prof-branch { margin-bottom: 34px; }
.prof-branch-head {
  display: flex; align-items: baseline; gap: 12px;
  padding-bottom: 8px; margin-bottom: 14px;
  border-bottom: 1px solid var(--hairline-2);
}
.prof-branch-head h3 {
  margin: 0; font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-2); font-weight: 700;
}
.prof-branch-head .n { font-size: 10px; color: var(--ink-4); letter-spacing: .1em; }

.prof-axis {
  border: 1px solid var(--hairline-2); border-radius: var(--r-md);
  background: rgba(0,0,0,.26); padding: 14px 16px 12px; margin-bottom: 10px;
}
.prof-axis.unplaced { opacity: .62; }
.prof-axis.unplaced:hover { opacity: 1; }
.prof-axis-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.prof-axis-head h4 {
  margin: 0; font-family: var(--serif); font-size: 14.5px; font-weight: 500;
  color: var(--ink); flex: 1;
}
.prof-tag {
  font-size: 9px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--stance); border: 1px solid color-mix(in srgb, var(--stance) 40%, transparent);
  border-radius: var(--pill); padding: 2px 8px; white-space: nowrap;
}
.prof-line { margin: 8px 0 10px; font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }
.prof-axis-foot { display: flex; align-items: center; gap: 12px; }
.prof-axis-foot .n {
  flex: 1; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-4);
}

/* ---------- Marketplace --------------------------------------- */
.body.market-mode #prompt-card,
.body.market-mode #btn-new-list,
.body.market-mode .rail-head .search,
.body.market-mode #note-list,
.body.market-mode #path-list,
.body.market-mode #quest-list,
.body.market-mode #quest-log-filters { display: none; }
.body.market-mode aside.insights { display: none; }
.body.market-mode { grid-template-columns: var(--rail-l) minmax(0,1fr) 0; }
.body.market-mode.rail-closed { grid-template-columns: 0 minmax(0,1fr) 0; }

/* ---------- Home dashboard ------------------------------------ */
.body.dashboard-mode #prompt-rail-home,
.body.dashboard-mode #btn-new-list,
.body.dashboard-mode .rail-head .search,
.body.dashboard-mode #note-list,
.body.dashboard-mode #path-list,
.body.dashboard-mode #quest-list,
.body.dashboard-mode #quest-log-filters { display: none; }
/* Keep aside.rail in the grid (like Market) so centre lands in the 1fr
   column — display:none on both asides collapses centre into the 0 track. */
.body.dashboard-mode aside.insights { display: none; }
.body.dashboard-mode {
  grid-template-columns: var(--rail-l) minmax(0,1fr) 0;
}
.body.dashboard-mode.rail-closed { grid-template-columns: 0 minmax(0,1fr) 0; }
.body.dashboard-mode .centre-inner { max-width: 1120px; }

#dashboard-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 4px 8px 56px;
}
.dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 22px;
  padding: 18px 22px;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.05), transparent 42%),
    rgba(0,0,0,.22);
}
.dash-head-copy { max-width: 48ch; }
.dash-kicker {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.dash-title {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.dash-lede {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-3);
}
.dash-head-actions {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  flex: none;
}
.dash-head-actions .ghost:disabled { opacity: .4; cursor: default; }

/* GridStack layout (Ghost Writer–style freeform cards) */
.dash-grid.grid-stack {
  display: block;
  background: transparent;
  min-height: 200px;
}
.dash-grid .grid-stack-item-content {
  inset: 0;
  overflow: auto;
  border-radius: 18px;
}
.dash-grid .grid-stack-item > .ui-resizable-se {
  width: 14px; height: 14px;
  right: 6px; bottom: 6px;
  background: none;
  border-right: 2px solid rgba(255,255,255,.35);
  border-bottom: 2px solid rgba(255,255,255,.35);
  opacity: 0;
  transition: opacity .15s var(--ease);
}
.dash-grid .grid-stack-item:hover > .ui-resizable-se,
.dash-grid .grid-stack-item.ui-resizable-resizing > .ui-resizable-se { opacity: 1; }

.dash-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  box-sizing: border-box;
  padding: 14px 16px 14px;
  border: 1px solid var(--hairline-2);
  border-radius: 18px;
  background:
    linear-gradient(165deg, rgba(255,255,255,.05), rgba(255,255,255,.01)),
    rgba(0,0,0,.28);
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
  min-height: 0;
}
.dash-card-chrome {
  display: flex; align-items: center; gap: 8px;
  flex: none;
}
.dash-drag {
  appearance: none; border: 0; background: rgba(255,255,255,.06);
  color: var(--ink-3); width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; cursor: grab; flex: none;
  padding: 0;
}
.dash-drag:active { cursor: grabbing; }
.dash-drag:hover { color: var(--ink); background: rgba(255,255,255,.1); }
.dash-card-chrome .dash-card-kicker { flex: 1; min-width: 0; }
.dash-card-type {
  flex: 1; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4);
  font-weight: 700; font-size: 10px;
}
.dash-menu-btn {
  appearance: none; border: 0; background: transparent; color: var(--ink-3);
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
  font-size: 18px; line-height: 1; flex: none;
}
.dash-menu-btn:hover { background: rgba(255,255,255,.08); color: var(--ink); }

.dash-type-picker {
  position: fixed; z-index: 120;
  min-width: 160px; max-width: 220px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: rgba(16,14,18,.96);
  box-shadow: 0 16px 40px rgba(0,0,0,.45);
  display: flex; flex-direction: column; gap: 4px;
}
.dash-type-picker-title {
  margin: 0 4px 4px; color: var(--ink-4);
}
.dash-type-picker button {
  appearance: none; border: 0; background: transparent; color: var(--ink);
  text-align: left; padding: 8px 10px; border-radius: 8px;
  font: inherit; font-size: 13px; cursor: pointer;
}
.dash-type-picker button:hover:not(:disabled) { background: rgba(255,255,255,.08); }
.dash-type-picker button:disabled { opacity: .4; cursor: default; }

.dash-card--feature {
  background:
    linear-gradient(160deg, rgba(255,255,255,.07), transparent 55%),
    rgba(0,0,0,.3);
}
.dash-card--explore {
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--resonance) 22%, transparent), transparent 55%),
    linear-gradient(165deg, rgba(255,255,255,.06), rgba(255,255,255,.01)),
    rgba(0,0,0,.3);
}
.dash-card--rail,
.dash-card--list {
  background: rgba(0,0,0,.32);
}
.dash-card-kicker {
  display: flex; align-items: center; gap: 10px;
}
.dash-card-kicker h3 {
  margin: 0;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
}
.dash-card-body {
  flex: 1;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2);
  min-height: 0;
  overflow: auto;
}
.dash-card-body p { margin: 0 0 10px; }
.dash-card-body p:last-child { margin-bottom: 0; }
.dash-lead {
  font-family: var(--serif);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.35;
  color: var(--ink) !important;
  margin-bottom: 8px !important;
}
.dash-card-foot {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: auto;
  padding-top: 4px;
  flex: none;
}
.dash-card-foot .ghost.solid {
  min-width: 7.5rem;
}
.dash-card--feature .dash-card-foot .ghost.solid,
.dash-card--rail .dash-card-foot .ghost.solid,
.dash-card--list .dash-card-foot .ghost.solid,
.dash-card--profile .dash-card-foot .ghost.solid {
  flex: 1 1 auto;
  text-align: center;
}

.dash-constel-btn {
  appearance: none; border: 0; background: none; padding: 0;
  display: block; width: 100%; cursor: pointer; text-align: left;
  color: inherit;
}
.dash-card--explore .dash-constel,
.dash-card--explore .path-constel {
  position: relative;
  width: 100%;
  height: min(200px, 55%);
  min-height: 120px;
  margin: 0;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
  pointer-events: none;
  background: rgba(0,0,0,.22);
}
.dash-card--explore .path-constel .node {
  font-size: 11px;
  padding: 3px 8px 3px 4px;
  gap: 5px;
}
.dash-constel-lede {
  margin: 10px 0 0 !important;
  color: var(--ink-4);
}

.dash-card--prompt {
  padding: 14px 16px 14px;
}
.dash-card--prompt .dash-card-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.dash-card--prompt .dash-card-foot:empty { display: none; }
.dash-prompt-host {
  flex: 1;
  min-height: 0;
}
/* Prompt sits on the dash card surface — no nested card chrome. */
.dash-prompt-host .prompt-card {
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 0;
  background: none;
  border-radius: 0;
  padding: 0;
  backdrop-filter: none;
  overflow: visible;
}
.dash-prompt-host .prompt-card::after { display: none; }
.dash-prompt-host .prompt-text {
  flex: 1;
  font-size: 17px;
  margin-bottom: 10px;
}
.dash-prompt-host .prompt-source { margin-bottom: 12px; }

.dash-note-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: -4px -6px;
}
.dash-note-list .note-item {
  margin-bottom: 0;
  cursor: pointer;
}
.dash-card--library .dash-card-body {
  overflow: auto;
}

.dash-eyebrow {
  margin: 0 0 8px !important;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 700;
}
.dash-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.dash-list li {
  display: flex; flex-direction: column; gap: 2px;
  align-items: flex-start;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.05);
}
.dash-link {
  appearance: none; border: 0; background: none; padding: 0;
  font: inherit; font-weight: 600; color: var(--ink);
  cursor: pointer; text-align: left;
}
.dash-link:hover { color: var(--resonance); }
.dash-prompt {
  padding: 14px 14px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
}
.dash-prompt-text {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
}
.dash-prompt-src, .dash-prompt-skips { color: var(--ink-4); }
.dash-card--profile .dash-card-body {
  display: grid;
  grid-template-columns: minmax(96px, 120px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.dash-card--profile .dash-radar {
  width: 100%;
  margin: 0;
}
.dash-card--profile .dash-radar.empty { opacity: .55; }
.dash-radar {
  width: min(100%, 200px);
  margin: 0 auto 12px;
}
.dash-radar svg { width: 100%; height: auto; display: block; }
.dash-radar.empty { opacity: .55; }
.dash-analysis-line {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 8px !important;
}

@media (max-width: 767px) {
  .dash-grid.grid-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .dash-grid .grid-stack-item {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 220px;
  }
  .dash-grid .grid-stack-item-content {
    inset: auto !important;
    position: relative !important;
    height: auto;
    min-height: 220px;
  }
  .dash-drag, .dash-grid .grid-stack-item > .ui-resizable-se { display: none; }
  .dash-head { flex-direction: column; align-items: flex-start; }
  #dashboard-wrap { padding: 4px 2px 96px; }
  .dash-card--profile .dash-card-body { grid-template-columns: 1fr; }
}

/* ---------- Marketplace continued ----------------------------- */

#quests-wrap {
  max-width: 760px; margin: 0 auto;
}
#quests-wrap .mkt-title { margin-top: 0; }
.quest-detail-meta {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px;
}
.quest-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }

#market-wrap { max-width: 920px; }
.mkt-head { margin-bottom: 22px; }
.mkt-title {
  margin: 0 0 6px; font-family: var(--serif); font-size: 28px; font-weight: 500; color: var(--ink);
}
.mkt-lede { margin: 0 0 16px; font-size: 13px; line-height: 1.6; color: var(--ink-3); max-width: 52ch; }
.mkt-controls {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px;
}
.mkt-search { flex: 1; min-width: 180px; max-width: 320px; margin: 0; }
.mkt-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px; padding-bottom: 40px;
}
.mkt-card {
  display: flex; flex-direction: column; gap: 6px;
  background: rgba(0,0,0,.28); border: 1px solid var(--hairline-2);
  border-radius: var(--r-md); padding: 16px 16px 14px;
}
.mkt-card-top { display: flex; align-items: center; gap: 8px; }
.mkt-price { margin-left: auto; font-size: 12px; letter-spacing: .08em; color: var(--ink-2); }
.mkt-badge {
  font-size: 9px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--lineage); border: 1px solid color-mix(in srgb, var(--lineage) 40%, transparent);
  border-radius: var(--pill); padding: 2px 8px;
}
.mkt-card h3 {
  margin: 4px 0 0; font-family: var(--serif); font-size: 18px; font-weight: 500;
  line-height: 1.3; color: var(--ink);
}
.mkt-id-row {
  display: flex; align-items: center; gap: 12px; margin-top: 6px;
}
.mkt-id-row-lg { gap: 16px; margin: 4px 0 10px; }
.mkt-id-text { min-width: 0; flex: 1; }
.mkt-id-text h2, .mkt-id-text h3 { margin: 0; }
.mkt-id-text .mkt-edu { margin-top: 4px; }
.mkt-avatar {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  object-fit: cover; display: block;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
}
.mkt-avatar.lg { width: 72px; height: 72px; }
.mkt-avatar-fallback {
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 15px; color: var(--ink-2);
  letter-spacing: .04em;
}
.mkt-avatar-fallback.lg { font-size: 20px; }
.mkt-mentor { margin: 0; font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--ink-2); }
.mkt-edu { margin: 0; font-size: 11px; line-height: 1.45; color: var(--ink-4); }
.mkt-meta, .mkt-langs { margin: 0; font-size: 11px; color: var(--ink-3); }
.mkt-stars { color: var(--stance); letter-spacing: .04em; }
.mkt-desc { margin: 4px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-2); flex: 1; }
.mkt-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.mkt-tag {
  font-size: 9px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); border: 1px solid var(--hairline); border-radius: var(--pill); padding: 2px 8px;
}
.mkt-card-act { margin-top: 10px; }
.mkt-card-act .ghost { width: 100%; text-align: center; }
.mkt-empty { color: var(--ink-4); font-size: 13px; padding: 40px 0; }

.mkt-back { margin-bottom: 14px; }
.mkt-ov-kicker {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-4);
}
#mkt-overview-body h2, #mkt-learn-body h2 {
  margin: 0 0 6px; font-family: var(--serif); font-size: 28px; font-weight: 500; color: var(--ink);
}
.mkt-ov-mentor { margin: 0 0 4px; font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--ink-2); }
.mkt-ov-price { margin: 0 0 14px; font-size: 14px; letter-spacing: .08em; color: var(--ink); }
.mkt-ov-h {
  margin: 22px 0 10px; font-size: 9px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink-4); font-weight: 700;
}
.mkt-quests, .mkt-lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mkt-quest-row, .mkt-lesson-row {
  display: grid; grid-template-columns: 28px 1fr; gap: 4px 10px; width: 100%;
  text-align: left; background: rgba(0,0,0,.28); border: 1px solid var(--hairline-2);
  border-radius: var(--r-sm); padding: 10px 12px; color: inherit; font: inherit; cursor: pointer;
}
.mkt-quest-row.static, .mkt-lesson-row.static { cursor: default; }
.mkt-quest-row .n, .mkt-lesson-row .n {
  grid-row: 1 / span 2; align-self: start; font-size: 11px; color: var(--ink-4); padding-top: 2px;
}
.mkt-quest-row .t, .mkt-lesson-row .t { font-family: var(--serif); font-size: 14px; color: var(--ink); }
.mkt-quest-row .d, .mkt-lesson-row .d { grid-column: 2; font-size: 12px; line-height: 1.5; color: var(--ink-3); }
.mkt-ov-act { margin-top: 22px; max-width: 320px; }

.mkt-progress-lab { font-size: 11px; color: var(--ink-3); margin: 10px 0 6px; }
.mkt-progress {
  height: 4px; border-radius: var(--pill); background: rgba(255,255,255,.06); overflow: hidden;
  margin-bottom: 16px;
}
.mkt-progress i { display: block; height: 100%; background: var(--lineage); border-radius: var(--pill); }

.mkt-status {
  font-size: 9px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); border: 1px solid var(--hairline); border-radius: var(--pill); padding: 2px 7px;
  justify-self: start;
}
.mkt-status.completed { color: var(--lineage); border-color: color-mix(in srgb, var(--lineage) 40%, transparent); }
.mkt-status.submitted, .mkt-status.under-review { color: var(--stance); border-color: color-mix(in srgb, var(--stance) 40%, transparent); }
.mkt-status-line { font-size: 12px; color: var(--ink-3); }

.mkt-learn-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.mkt-learn-split {
  display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: 18px; margin-top: 8px;
}
.mkt-learn-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; align-content: start; }
.mkt-learn-nav-btn {
  display: grid; grid-template-columns: 22px 1fr; gap: 2px 8px; width: 100%; text-align: left;
  background: rgba(0,0,0,.28); border: 1px solid var(--hairline-2); border-radius: var(--r-sm);
  padding: 8px 10px; color: inherit; font: inherit; cursor: pointer;
}
.mkt-learn-nav-btn.on { border-color: rgba(255,255,255,.22); background: rgba(0,0,0,.45); }
.mkt-learn-nav-btn .n { color: var(--ink-4); font-size: 11px; }
.mkt-learn-nav-btn .t { font-size: 12.5px; color: var(--ink); }
.mkt-learn-nav-btn .mkt-status { grid-column: 2; }
.mkt-learn-detail h3 {
  margin: 0 0 6px; font-family: var(--serif); font-size: 20px; font-weight: 500;
}
.mkt-field { display: grid; gap: 6px; margin: 12px 0; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4); }
.mkt-field textarea, .mkt-field input {
  width: 100%; box-sizing: border-box; background: rgba(0,0,0,.4); border: 1px solid var(--hairline);
  border-radius: var(--r-sm); padding: 10px 12px; color: var(--ink); font-family: var(--sans);
  font-size: 13px; letter-spacing: 0; text-transform: none; outline: none;
}
.mkt-field textarea:focus, .mkt-field input:focus { border-color: rgba(255,255,255,.26); }

.mkt-checkout { max-width: 400px; }
.mkt-checkout-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mkt-checkout-form .gx-act { margin-top: 16px; }

.mkt-chat {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(360px, 100vw); z-index: 75;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(9,8,11,.97), rgba(6,5,8,.99));
  border-left: 1px solid var(--hairline); padding: 16px 16px 18px;
}
.mkt-chat[hidden] { display: none; }
.mkt-chat-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.mkt-chat-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.mkt-msg { max-width: 92%; padding: 8px 11px; border-radius: var(--r-sm); background: rgba(0,0,0,.35); border: 1px solid var(--hairline-2); }
.mkt-msg.me { align-self: flex-end; background: rgba(255,255,255,.06); }
.mkt-msg-who { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 4px; }
.mkt-msg p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.mkt-chat-compose { display: grid; gap: 8px; margin-top: 12px; }
.mkt-chat-compose textarea {
  width: 100%; box-sizing: border-box; background: rgba(0,0,0,.4); border: 1px solid var(--hairline);
  border-radius: var(--r-sm); padding: 10px 12px; color: var(--ink); font-family: var(--sans); font-size: 13px;
  resize: vertical; outline: none;
}

/* Epic + mentor nodes on the graph */
.gx-node.gx-epic .gx-orb {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--lineage) 55%, transparent),
    0 0 18px color-mix(in srgb, var(--lineage) 35%, transparent);
}

/* Quests: MetalForge-style caustic glass orb, remapped to category hues */
.gx-node.gx-quest .gx-orb {
  --pearl: color-mix(in srgb, var(--c) 10%, #ffffff);
  --shell: color-mix(in srgb, var(--c) 38%, #ffffff);
  --deep: color-mix(in oklab, var(--c) 48%, #08070a);
  --caustic-a: color-mix(in srgb, var(--clarity) 55%, transparent);
  --caustic-b: color-mix(in srgb, var(--resonance) 45%, transparent);
  --caustic-c: color-mix(in srgb, var(--lineage) 40%, transparent);
  isolation: isolate;
  overflow: visible;
  background:
    radial-gradient(circle at 34% 28%,
      rgba(255,255,255,.55) 0%,
      color-mix(in srgb, var(--c) 28%, #ffffff) 14%,
      color-mix(in oklab, var(--c) 42%, #120a22) 42%,
      color-mix(in oklab, var(--c) 28%, #08070a) 72%,
      #05040a 100%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--c) 70%, transparent),
    0 0 14px color-mix(in srgb, var(--c) 48%, transparent),
    0 0 28px color-mix(in srgb, var(--clarity) 22%, transparent),
    inset 0 0 10px color-mix(in srgb, var(--c) 18%, transparent);
}
.gx-node.gx-quest .gx-orb::before {
  content: '';
  position: absolute; inset: -28%;
  border-radius: 50%;
  z-index: -1;
  opacity: .92;
  background:
    conic-gradient(from 210deg at 50% 50%,
      transparent 0deg,
      var(--caustic-a) 48deg,
      transparent 86deg,
      var(--caustic-b) 128deg,
      transparent 168deg,
      var(--caustic-c) 210deg,
      transparent 255deg,
      color-mix(in srgb, var(--c) 50%, transparent) 300deg,
      transparent 340deg),
    radial-gradient(ellipse 42% 20% at 28% 36%, color-mix(in srgb, var(--c) 55%, transparent), transparent 70%),
    radial-gradient(ellipse 28% 48% at 72% 58%, color-mix(in srgb, var(--clarity) 40%, transparent), transparent 68%),
    radial-gradient(ellipse 50% 16% at 48% 82%, color-mix(in srgb, var(--resonance) 32%, transparent), transparent 72%);
  filter: blur(.35px);
}
.gx-node.gx-quest .gx-orb::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(ellipse 36% 28% at 34% 24%, rgba(255,255,255,.82), rgba(255,255,255,.12) 55%, transparent 72%),
    radial-gradient(ellipse 18% 12% at 68% 78%, rgba(255,255,255,.32), transparent 70%),
    radial-gradient(circle at 50% 50%,
      transparent 48%,
      color-mix(in srgb, var(--c) 18%, transparent) 62%,
      color-mix(in srgb, var(--shell) 70%, transparent) 78%,
      color-mix(in srgb, var(--c) 88%, transparent) 88%,
      color-mix(in srgb, var(--clarity) 55%, transparent) 94%,
      color-mix(in srgb, var(--c) 25%, transparent) 98%,
      transparent 100%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--shell) 45%, transparent);
}
.gx-node.gx-quest.sel .gx-orb {
  box-shadow:
    0 0 0 1.5px color-mix(in srgb, var(--c) 85%, transparent),
    0 0 22px color-mix(in srgb, var(--c) 62%, transparent),
    0 0 40px color-mix(in srgb, var(--clarity) 34%, transparent),
    inset 0 0 12px color-mix(in srgb, var(--c) 24%, transparent);
}
@keyframes quest-caustic {
  from { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) scale(1.12); }
  to   { transform: rotate(360deg) scale(1); }
}
@media (prefers-reduced-motion: no-preference) {
  .gx-node.gx-quest.labelled .gx-orb::before,
  .gx-node.gx-quest.sel .gx-orb::before,
  .gx-node.gx-quest.gx-mercurial .gx-orb::before {
    animation: quest-caustic 14s linear infinite;
  }
  .gx-node.gx-quest.sel .gx-orb::before { animation-duration: 9s; }
  .gx-node.gx-quest.gx-mercurial .gx-orb::before { animation-duration: 11s; }
}

.gx-node.gx-mentor .gx-orb {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--stance) 55%, transparent),
    0 0 18px color-mix(in srgb, var(--stance) 30%, transparent);
}
.mkt-session-rate {
  margin: 18px 0 10px; font-size: 12px; color: var(--ink-3); letter-spacing: .04em;
}
.mkt-checkout-form select {
  width: 100%; box-sizing: border-box; background: rgba(0,0,0,.4); border: 1px solid var(--hairline);
  border-radius: var(--r-sm); padding: 10px 12px; color: var(--ink); font-family: var(--sans); font-size: 13px;
  outline: none;
}
.mkt-activity {
  margin: 0 0 18px; padding-left: 1.1em; color: var(--ink-2); font-size: 12.5px; line-height: 1.55;
}
.mkt-activity li { margin-bottom: 4px; }
.mkt-link {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.28);
}
.mkt-link:hover { color: var(--ink); text-decoration-color: rgba(255,255,255,.5); }
.gx-hover-acts {
  position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%);
  display: none; gap: 4px; z-index: 5; white-space: nowrap;
}
.gx-node:hover .gx-hover-acts, .gx-node.sel .gx-hover-acts { display: flex; }
.gx-hover-acts button {
  font-size: 9px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700;
  color: var(--ink-2); background: rgba(10,9,13,.92); border: 1px solid var(--hairline);
  border-radius: var(--pill); padding: 5px 9px; cursor: pointer; font-family: var(--sans);
}
.gx-hover-acts button:hover { color: var(--ink); border-color: rgba(255,255,255,.24); }

.gx-node.gx-mercurial .gx-orb {
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--c) 78%, transparent),
    0 0 18px color-mix(in srgb, var(--c) 52%, transparent),
    0 0 32px color-mix(in srgb, var(--clarity) 30%, transparent),
    inset 0 0 10px color-mix(in srgb, var(--c) 20%, transparent);
}
.gx-node.gx-quest.gx-mercurial .gx-orb {
  /* caustic motion carries the “alive” cue; no extra scale pulse */
  animation: none;
}

.quest-overview .quest-ov-kicker {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.quest-overview .quest-ov-access {
  font-size: 11px; letter-spacing: .06em; color: var(--ink-3); text-transform: uppercase;
}
.quest-objectives {
  margin: 0 0 14px; padding-left: 1.15em; color: var(--ink-2);
  font-size: 13px; line-height: 1.55;
}
.quest-constel-block { margin: 0 0 22px; }
.quest-constel-block .mkt-ov-h { margin-bottom: 8px; }
#quests-wrap .quest-constel {
  width: 100%;
  height: 220px;
  margin: 0;
  pointer-events: auto;
  cursor: pointer;
}
#quests-wrap .quest-constel::after { content: 'Explore'; }
#quests-wrap .quest-constel .node {
  font-size: 12px;
  padding: 4px 10px 4px 5px;
  gap: 6px;
}
.quest-node-feed {
  display: grid; gap: 14px; margin: 0 0 22px;
}
.quest-node-card {
  position: relative;
  padding: 14px 14px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  border-left: 3px solid color-mix(in srgb, var(--quest-node-c, var(--clarity)) 70%, transparent);
  overflow: hidden;
}
.quest-node-card.visited,
.quest-node-card.done {
  border-color: color-mix(in srgb, var(--quest-node-c, var(--clarity)) 28%, transparent);
  border-left-color: var(--quest-node-c, var(--clarity));
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--quest-node-c, var(--clarity)) 10%, transparent),
      transparent 42%),
    rgba(255,255,255,.03);
}
.quest-node-card.current {
  border-color: color-mix(in srgb, var(--quest-node-c, var(--clarity)) 40%, transparent);
}
.quest-node-card.locked {
  min-height: 160px;
}
.quest-node-lock {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center;
  padding: 18px;
  background: color-mix(in srgb, rgba(8,7,10,.72) 82%, transparent);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.quest-node-lock-inner {
  text-align: center; color: var(--ink-2);
  max-width: 16rem;
}
.quest-lock-icon {
  display: block; margin: 0 auto 10px; color: var(--ink-3);
}
.quest-node-lock-inner p {
  margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-2);
}
.quest-node-card-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.quest-node-orb {
  flex: 0 0 auto;
  width: 12px; height: 12px;
}
.quest-node-card-head .mkt-ov-h {
  margin: 0; flex: 1; min-width: 0;
  text-transform: none; letter-spacing: 0;
  font-size: 15px; color: var(--ink);
}
.quest-node-visited {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--quest-node-c, var(--clarity));
}
.quest-step-reading {
  margin: 0 0 12px; color: var(--ink-2);
  font-size: 13.5px; line-height: 1.55;
}
.quest-step-prompt {
  margin: 0 0 14px; color: var(--ink);
  font-size: 13.5px; line-height: 1.5;
}
.quest-step-prompt span {
  display: block; margin-bottom: 4px;
  font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-4);
}
.quest-step-actions { margin-top: 0; flex-wrap: wrap; }
.quest-learn-sheet {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100vw); z-index: 76;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(9,8,11,.97), rgba(6,5,8,.99));
  border-left: 1px solid var(--hairline); padding: 16px 16px 18px;
  box-shadow: -18px 0 48px rgba(0,0,0,.45);
}
.quest-learn-sheet[hidden] { display: none; }
.quest-learn-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.quest-learn-head strong {
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
}
.quest-learn-body { flex: 1; overflow-y: auto; padding-right: 4px; }
.quest-learn-kicker {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px; font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-4);
}
.quest-learn-h {
  font-family: var(--serif); font-size: 22px; font-weight: 500;
  margin: 0 0 12px; color: var(--ink); line-height: 1.25;
}
.quest-learn-reading {
  margin: 0 0 16px; color: var(--ink-2);
  font-size: 13.5px; line-height: 1.6;
}
.quest-learn-sources {
  margin: 0 0 16px; padding-left: 1.1em;
  color: var(--ink-2); font-size: 13px; line-height: 1.5;
}
.quest-learn-sources li { margin-bottom: 8px; }
.quest-learn-sources span {
  display: block; color: var(--ink-4); font-size: 12px; margin-top: 2px;
}
.quest-learn-kin-row {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px;
}
.quest-learn-kin {
  appearance: none; font: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 6px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.28); color: var(--ink-2); font-size: 12px;
}
.quest-learn-actions { margin-top: 8px; }
@media (max-width: 900px) {
  .quest-learn-sheet { width: 100%; }
}
.quest-response-card {
  margin: 0 0 22px; padding: 16px 16px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
}
.quest-response-card .mkt-ov-h { margin-top: 0; }
.quest-response-prompt { margin-bottom: 14px; }
.quest-submit-modes {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 0 14px;
}
.quest-mode-btn {
  appearance: none; font: inherit; cursor: pointer;
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: transparent; color: var(--ink-3);
}
.quest-mode-btn.on {
  border-color: rgba(255,255,255,.28);
  background: rgba(255,255,255,.08);
  color: var(--ink);
}
.quest-note-field textarea {
  width: 100%; margin-top: 6px;
  padding: 10px 12px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.35); color: var(--ink);
  font: inherit; line-height: 1.45; resize: vertical;
  min-height: 7rem;
}
.quest-submit { margin-bottom: 18px; }
.quest-note-field select {
  width: 100%; margin-top: 6px;
  padding: 10px 12px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.35); color: var(--ink);
  font: inherit;
}
.quest-note-preview {
  margin: 10px 0 0; padding: 10px 12px;
  border-radius: 8px; background: rgba(0,0,0,.25);
  color: var(--ink-2); font-size: 13px; line-height: 1.45;
}
.quest-note-preview strong {
  display: block; margin-bottom: 4px; color: var(--ink);
}
.quest-accept-choice { flex-wrap: wrap; }
.quest-accept-choice .ghost.solid { min-width: 8.5rem; }
.mkt-quest-log { margin-top: 8px; }
.quest-log-filters { margin-bottom: 14px; }
.quest-log-grid { margin-top: 4px; }
#quest-overview-scrim { z-index: 70; }

@media (max-width: 900px) {
  .body.market-mode,
  .body.quests-mode,
  .body.dashboard-mode,
  .body.market-mode.rail-closed,
  .body.quests-mode.rail-closed,
  .body.dashboard-mode.rail-closed,
  .body.market-mode.insights-closed,
  .body.quests-mode.insights-closed,
  .body.dashboard-mode.insights-closed,
  .body.market-mode.rail-closed.insights-closed,
  .body.quests-mode.rail-closed.insights-closed,
  .body.dashboard-mode.rail-closed.insights-closed { grid-template-columns: 1fr; }
  .mkt-learn-split { grid-template-columns: 1fr; }
  .mkt-chat { width: 100%; }
  #mkt-tabs { flex-wrap: wrap; }
}

/* ---------- coach marks (Figma-style, Khora colors) ---------- */
#coach-scrim {
  position: fixed; inset: 0; z-index: 110;
  pointer-events: none;
}
#coach-scrim:not([hidden]) { display: block; }
#coach-spot {
  position: absolute;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(4, 3, 6, 0.58);
  transition: top .2s var(--ease), left .2s var(--ease), width .2s var(--ease), height .2s var(--ease);
  pointer-events: none;
}
#coach-tip {
  position: fixed;
  z-index: 112;
  width: min(280px, calc(100vw - 24px));
  padding: 14px 14px 12px;
  background: rgba(255, 255, 255, 0.96);
  color: #14121a;
  border: 1px solid rgba(20, 18, 26, 0.08);
  border-radius: 10px;
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.45);
  font-family: var(--sans);
  pointer-events: auto;
}
#coach-tip[hidden] { display: none !important; }
#coach-tip .coach-close {
  position: absolute; top: 8px; right: 8px;
  width: 24px; height: 24px; border: 0; background: none;
  color: rgba(20, 18, 26, 0.45); font-size: 18px; line-height: 1;
  cursor: pointer; border-radius: 6px;
}
#coach-tip .coach-close:hover { color: #14121a; background: rgba(0, 0, 0, 0.06); }
#coach-tip .coach-body {
  margin: 0 22px 14px 0;
  font-size: 13px; line-height: 1.45; font-weight: 600;
  color: #14121a;
}
#coach-tip .coach-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
#coach-tip .coach-progress {
  font-size: 11px; font-weight: 600;
  color: rgba(20, 18, 26, 0.45); letter-spacing: 0.02em;
}
#coach-tip .coach-next {
  appearance: none; cursor: pointer;
  font-family: var(--sans); font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: #14121a; background: transparent;
  border: 1px solid rgba(20, 18, 26, 0.28);
  border-radius: 8px; padding: 6px 12px;
  transition: background .18s var(--ease), border-color .18s var(--ease);
}
#coach-tip .coach-next:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(20, 18, 26, 0.45);
}
#coach-tip .coach-arrow {
  position: absolute; width: 12px; height: 12px;
  background: rgba(255, 255, 255, 0.96);
  transform: rotate(45deg);
  pointer-events: none;
}
#coach-tip[data-place="bottom"] .coach-arrow {
  top: -6px; left: var(--arrow-x, 50%); margin-left: -6px;
  border-top: 1px solid rgba(20, 18, 26, 0.08);
  border-left: 1px solid rgba(20, 18, 26, 0.08);
}
#coach-tip[data-place="top"] .coach-arrow {
  bottom: -6px; left: var(--arrow-x, 50%); margin-left: -6px;
  border-bottom: 1px solid rgba(20, 18, 26, 0.08);
  border-right: 1px solid rgba(20, 18, 26, 0.08);
}
#coach-tip[data-place="left"] .coach-arrow {
  right: -6px; top: var(--arrow-y, 50%); margin-top: -6px;
  border-top: 1px solid rgba(20, 18, 26, 0.08);
  border-right: 1px solid rgba(20, 18, 26, 0.08);
}
#coach-tip[data-place="right"] .coach-arrow {
  left: -6px; top: var(--arrow-y, 50%); margin-top: -6px;
  border-bottom: 1px solid rgba(20, 18, 26, 0.08);
  border-left: 1px solid rgba(20, 18, 26, 0.08);
}
@media (prefers-reduced-motion: reduce) {
  #coach-spot { transition: none; }
}
