:root {
  --lore-setting: #b9ffd9;
  --lore-civilization: #ffd070;
  --lore-technology: #74dfd2;
  --lore-species: #7de9b7;
  --lore-place: #83b8ff;
  --lore-person: #d7b8ff;
  --lore-threat: #ff8c78;
}

.lore-page {
  background:
    radial-gradient(circle at 50% -14%, rgba(62, 174, 133, 0.18), transparent 38rem),
    radial-gradient(circle at 90% 30%, rgba(91, 107, 181, 0.1), transparent 30rem),
    linear-gradient(180deg, #07120f 0, #040807 58rem);
}

.lore-shell {
  width: min(1360px, 100%);
}

.lore-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.58fr);
  align-items: end;
  gap: 40px;
  margin-bottom: 14px;
  padding: 26px 28px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background:
    linear-gradient(112deg, rgba(12, 29, 24, 0.97), rgba(8, 21, 18, 0.91)),
    radial-gradient(circle at 80% 50%, rgba(111, 240, 180, 0.12), transparent 35%);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.2), inset 0 1px rgba(255, 255, 255, 0.025);
}

.lore-hero::after {
  position: absolute;
  top: -145px;
  right: 8%;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(111, 240, 180, 0.09);
  border-radius: 50%;
  content: "";
  box-shadow:
    0 0 0 54px rgba(111, 240, 180, 0.025),
    0 0 0 108px rgba(111, 240, 180, 0.014);
  pointer-events: none;
}

.lore-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.lore-hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 4rem);
  font-weight: 590;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.lore-hero h1 em {
  color: var(--signal-bright);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

.lore-hero-copy > p:last-child {
  max-width: 690px;
  margin: 13px 0 0;
  color: var(--muted-2);
  font-size: 0.86rem;
}

.atlas-status {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
}

.atlas-status > div {
  min-width: 0;
  padding: 12px;
  background: rgba(7, 19, 16, 0.96);
}

.atlas-status span {
  display: block;
  color: var(--muted);
  font-size: 0.59rem;
  font-weight: 790;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.atlas-status strong {
  display: block;
  margin-top: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.atlas-status > p {
  grid-column: 1 / -1;
  margin: 0;
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(7, 19, 16, 0.96);
  font-size: 0.67rem;
}

.lore-workspace {
  display: grid;
  grid-template-columns: 210px minmax(520px, 1fr) 300px;
  align-items: start;
  gap: 12px;
}

.lore-controls,
.lore-map-panel,
.lore-inspector,
.browse-panel {
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(9, 21, 18, 0.88);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.02);
}

.lore-controls,
.lore-inspector {
  position: sticky;
  top: 8px;
}

.lore-controls {
  display: grid;
  gap: 18px;
  padding: 16px;
}

.control-heading,
.browse-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.control-heading h2,
.map-toolbar h2,
.browse-heading h2 {
  font-size: 0.98rem;
}

.text-action {
  padding: 0;
  border: 0;
  color: var(--signal);
  background: transparent;
  font-size: 0.65rem;
  font-weight: 760;
  cursor: pointer;
}

.lore-search {
  display: grid;
  gap: 6px;
}

.lore-search > span,
.control-label {
  color: var(--muted);
  font-size: 0.59rem;
  font-weight: 810;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lore-search input {
  width: 100%;
  min-width: 0;
  min-height: 39px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: rgba(237, 255, 246, 0.04);
  font-size: 0.72rem;
}

.lore-search input::placeholder {
  color: rgba(142, 163, 154, 0.68);
}

.type-filter-group,
.evidence-key {
  display: grid;
  gap: 8px;
}

.type-filters {
  display: grid;
  gap: 5px;
}

.type-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 33px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted-2);
  background: rgba(237, 255, 246, 0.025);
  font-size: 0.67rem;
  font-weight: 720;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.type-filter::before {
  width: 6px;
  height: 6px;
  margin-right: auto;
  border-radius: 50%;
  background: var(--type-color);
  box-shadow: 0 0 10px color-mix(in srgb, var(--type-color) 55%, transparent);
  content: "";
}

.type-filter span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.62rem;
}

.type-filter[aria-pressed="false"] {
  color: rgba(142, 163, 154, 0.52);
  background: transparent;
  opacity: 0.62;
}

.type-filter[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--type-color) 32%, transparent);
}

.evidence-key {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.evidence-key p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 0.63rem;
}

.evidence-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--signal);
}

.evidence-dot.belief {
  background: var(--violet);
}

.evidence-dot.uncertain {
  border: 1px solid var(--amber);
  background: transparent;
}

.source-card-link {
  display: grid;
  gap: 3px;
  padding: 11px;
  border: 1px solid rgba(111, 240, 180, 0.13);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(111, 240, 180, 0.04);
  text-decoration: none;
}

.source-card-link span,
.source-card-link small {
  color: var(--muted);
  font-size: 0.6rem;
}

.source-card-link strong {
  font-size: 0.72rem;
}

.lore-map-panel {
  min-width: 0;
  overflow: hidden;
}

.map-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 15px 12px;
  border-bottom: 1px solid var(--line);
}

.map-toolbar p:last-child {
  max-width: 520px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.67rem;
}

.map-actions {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(237, 255, 246, 0.025);
}

.map-actions button {
  min-width: 31px;
  min-height: 29px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  color: var(--muted-2);
  background: transparent;
  font-size: 0.68rem;
  font-weight: 780;
  cursor: pointer;
}

.map-actions button:hover {
  color: var(--ink);
  background: rgba(237, 255, 246, 0.07);
}

.graph-viewport {
  position: relative;
  height: 610px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  background:
    radial-gradient(circle at 50% 45%, rgba(111, 240, 180, 0.095), transparent 28%),
    radial-gradient(circle, rgba(218, 255, 236, 0.22) 0 0.7px, transparent 1px),
    linear-gradient(rgba(193, 236, 215, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(193, 236, 215, 0.025) 1px, transparent 1px),
    #06100d;
  background-size: auto, 71px 79px, 64px 64px, 64px 64px, auto;
}

.graph-viewport.dragging {
  cursor: grabbing;
}

.graph-scene {
  position: absolute;
  inset: 0;
  min-width: 0;
  transform: translate3d(var(--pan-x, 0px), var(--pan-y, 0px), 0) scale(var(--map-scale, 1));
  transform-origin: 50% 50%;
  transition: transform 170ms ease;
}

.graph-viewport.dragging .graph-scene {
  transition: none;
}

.graph-scene::before,
.graph-scene::after {
  position: absolute;
  top: 45%;
  left: 50%;
  border: 1px solid rgba(111, 240, 180, 0.055);
  border-radius: 50%;
  content: "";
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.graph-scene::before {
  width: 380px;
  height: 380px;
}

.graph-scene::after {
  width: 560px;
  height: 560px;
  border-style: dashed;
}

#graphCanvas,
.graph-nodes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#graphCanvas {
  pointer-events: none;
}

.lore-node {
  position: absolute;
  z-index: 2;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 138px;
  min-height: 30px;
  padding: 4px 8px 4px 5px;
  border: 1px solid color-mix(in srgb, var(--node-color) 30%, transparent);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(7, 18, 15, 0.92);
  box-shadow: 0 7px 22px rgba(0, 0, 0, 0.28), inset 0 1px rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: opacity 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.lore-node:hover,
.lore-node:focus-visible {
  z-index: 5;
  border-color: color-mix(in srgb, var(--node-color) 72%, transparent);
  background: rgba(13, 31, 26, 0.98);
  box-shadow: 0 9px 28px rgba(0, 0, 0, 0.34), 0 0 20px color-mix(in srgb, var(--node-color) 16%, transparent);
  transform: translate(-50%, -50%) scale(1.04);
}

.node-core {
  position: relative;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--node-color) 72%, white 8%);
  border-radius: 50%;
  background: color-mix(in srgb, var(--node-color) 50%, #07110f 50%);
  box-shadow: 0 0 12px color-mix(in srgb, var(--node-color) 35%, transparent);
}

.node-core::after {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--node-color);
  content: "";
}

.node-copy {
  display: grid;
  min-width: 0;
  text-align: left;
}

.node-copy strong {
  overflow: hidden;
  font-size: 0.66rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-copy small {
  color: var(--muted);
  font-size: 0.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lore-node.featured {
  min-height: 35px;
  padding-right: 10px;
  border-color: color-mix(in srgb, var(--node-color) 44%, transparent);
}

.lore-node.featured .node-core {
  width: 17px;
  height: 17px;
}

.lore-node.selected {
  z-index: 7;
  border-color: var(--node-color);
  background: color-mix(in srgb, var(--node-color) 13%, rgba(7, 18, 15, 0.96));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--node-color) 10%, transparent), 0 10px 35px rgba(0, 0, 0, 0.38);
}

.lore-node.neighbor {
  opacity: 1;
}

.graph-nodes.has-selection .lore-node:not(.selected):not(.neighbor) {
  opacity: 0.18;
}

.lore-node.filtered {
  display: none;
}

.lore-node[data-canon="belief"] {
  border-style: dashed;
}

.lore-node[data-canon="uncertain"] {
  border-style: dotted;
}

.graph-empty {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 4px;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}

.graph-empty strong {
  color: var(--ink);
}

.map-footnote {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.61rem;
}

.lore-inspector {
  min-height: 360px;
  max-height: calc(100vh - 16px);
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(111, 240, 180, 0.26) transparent;
  scrollbar-width: thin;
}

.inspector-placeholder {
  display: grid;
  min-height: 326px;
  place-content: center;
  text-align: center;
}

.inspector-placeholder h2 {
  margin: 3px 0 7px;
  font-size: 1rem;
}

.inspector-placeholder > p:last-child {
  max-width: 230px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.72rem;
}

.inspector-orbit {
  position: relative;
  width: 56px;
  height: 56px;
  margin: 0 auto 17px;
  border: 1px solid rgba(111, 240, 180, 0.18);
  border-radius: 50%;
}

.inspector-orbit::before,
.inspector-orbit::after {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.inspector-orbit::before {
  inset: 17px;
  background: var(--signal);
  box-shadow: 0 0 20px rgba(111, 240, 180, 0.4);
}

.inspector-orbit::after {
  top: 20px;
  left: -5px;
  width: 64px;
  height: 18px;
  border: 1px solid rgba(111, 240, 180, 0.4);
  transform: rotate(-22deg);
}

.inspector-content {
  display: grid;
  gap: 16px;
}

.inspector-kicker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.entity-type,
.canon-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 7px;
  border: 1px solid color-mix(in srgb, var(--entity-color) 36%, transparent);
  border-radius: 999px;
  color: var(--entity-color);
  background: color-mix(in srgb, var(--entity-color) 7%, transparent);
  font-size: 0.55rem;
  font-weight: 820;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.canon-badge {
  border-color: var(--line);
  color: var(--muted-2);
  background: rgba(237, 255, 246, 0.025);
}

.canon-badge.belief {
  color: var(--violet);
}

.canon-badge.uncertain {
  color: var(--amber);
}

.inspector-content h2 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.entity-kicker {
  margin: -3px 0 0;
  color: var(--muted);
  font-size: 0.68rem;
}

.entity-summary {
  margin: 0;
  color: var(--muted-2);
  font-size: 0.76rem;
}

.inspector-section {
  display: grid;
  gap: 8px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.inspector-section > h3 {
  color: var(--muted);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.connection-list,
.source-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.connection-button,
.source-list a {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: rgba(237, 255, 246, 0.025);
  font-size: 0.68rem;
  text-align: left;
  text-decoration: none;
}

.connection-button {
  cursor: pointer;
}

.connection-button span,
.source-list a span {
  color: var(--muted);
  font-size: 0.58rem;
}

.connection-button:hover,
.source-list a:hover {
  border-color: rgba(111, 240, 180, 0.28);
  background: rgba(111, 240, 180, 0.04);
}

.contribution-section {
  gap: 10px;
}

.community-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.community-heading h3 {
  color: var(--muted);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.community-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.6rem;
  line-height: 1.45;
}

.community-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 25px;
  min-height: 25px;
  flex: 0 0 auto;
  padding: 0 7px;
  border: 1px solid rgba(111, 240, 180, 0.18);
  border-radius: 999px;
  color: var(--signal-bright);
  background: rgba(111, 240, 180, 0.055);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.58rem;
  font-variant-numeric: tabular-nums;
}

.community-state {
  margin: 0;
  padding: 9px 10px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(237, 255, 246, 0.018);
  font-size: 0.62rem;
}

.community-state-error {
  border-color: rgba(255, 140, 120, 0.2);
  color: var(--muted-2);
}

.community-state button {
  padding: 0;
  border: 0;
  color: var(--signal);
  background: transparent;
  font-size: inherit;
  font-weight: 790;
  cursor: pointer;
}

.community-note-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.community-note {
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-left-color: rgba(111, 240, 180, 0.42);
  border-radius: 9px;
  background: rgba(237, 255, 246, 0.022);
}

.community-note header,
.community-note footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.54rem;
}

.community-note header > span:first-child {
  color: var(--signal);
  font-weight: 810;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.community-note p {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted-2);
  font-size: 0.65rem;
  white-space: pre-wrap;
}

.community-note footer > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-source {
  flex: 0 0 auto;
  color: var(--signal);
  font-weight: 720;
  text-decoration: none;
}

.community-source:hover {
  color: var(--signal-bright);
  text-decoration: underline;
}

.community-more {
  margin-top: 6px;
}

.community-more > summary {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 730;
  cursor: pointer;
}

.community-more[open] > summary {
  margin-bottom: 6px;
}

.contribution-disclosure {
  overflow: hidden;
  border: 1px solid rgba(111, 240, 180, 0.16);
  border-radius: 11px;
  background:
    linear-gradient(120deg, rgba(111, 240, 180, 0.055), rgba(237, 255, 246, 0.018)),
    rgba(5, 14, 11, 0.5);
}

.contribution-disclosure > summary {
  position: relative;
  display: grid;
  gap: 1px;
  padding: 10px 34px 10px 11px;
  list-style: none;
  cursor: pointer;
}

.contribution-disclosure > summary::-webkit-details-marker {
  display: none;
}

.contribution-disclosure > summary::after {
  position: absolute;
  top: 50%;
  right: 11px;
  color: var(--signal);
  font-size: 1rem;
  line-height: 1;
  content: "+";
  transform: translateY(-50%);
}

.contribution-disclosure[open] > summary::after {
  content: "−";
}

.contribution-disclosure > summary span {
  color: var(--muted);
  font-size: 0.55rem;
}

.contribution-disclosure > summary strong {
  color: var(--ink);
  font-size: 0.68rem;
}

.contribution-disclosure > summary:hover strong {
  color: var(--signal-bright);
}

.contribution-form-wrap {
  padding: 11px;
  border-top: 1px solid rgba(111, 240, 180, 0.12);
}

.contribution-intro {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.62rem;
}

.contribution-form {
  position: relative;
  display: grid;
  gap: 11px;
}

.contribution-type-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.contribution-type-fieldset legend,
.contribution-field > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted-2);
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 750;
}

.contribution-field > span i {
  margin-left: 3px;
  color: var(--muted);
  font-size: 0.5rem;
  font-style: normal;
  font-weight: 630;
}

.contribution-types {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.contribution-types label {
  min-width: 0;
  cursor: pointer;
}

.contribution-types input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.contribution-types span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(237, 255, 246, 0.02);
  font-size: 0.54rem;
  font-weight: 730;
  text-align: center;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.contribution-types input:checked + span {
  border-color: rgba(111, 240, 180, 0.42);
  color: var(--signal-bright);
  background: rgba(111, 240, 180, 0.09);
}

.contribution-types input:focus-visible + span {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

.contribution-field {
  display: grid;
  min-width: 0;
}

.contribution-field input,
.contribution-field textarea {
  width: 100%;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(237, 255, 246, 0.035);
  font: inherit;
  font-size: 0.65rem;
}

.contribution-field textarea {
  min-height: 104px;
  resize: vertical;
}

.contribution-field input::placeholder,
.contribution-field textarea::placeholder {
  color: rgba(142, 163, 154, 0.58);
}

.contribution-field input:focus-visible,
.contribution-field textarea:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

.contribution-field input[aria-invalid="true"],
.contribution-field textarea[aria-invalid="true"] {
  border-color: rgba(255, 140, 120, 0.64);
}

.contribution-field small,
.contribution-review-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.53rem;
  line-height: 1.45;
}

.field-error {
  color: var(--coral) !important;
}

.contribution-trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.contribution-status {
  min-height: 0;
  margin: 0;
  color: var(--muted-2);
  font-size: 0.6rem;
}

.contribution-status:empty {
  display: none;
}

.contribution-status.success {
  padding: 8px 9px;
  border: 1px solid rgba(111, 240, 180, 0.2);
  border-radius: 8px;
  color: var(--signal-bright);
  background: rgba(111, 240, 180, 0.06);
}

.contribution-status.error {
  color: var(--coral);
}

.contribution-submit {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(111, 240, 180, 0.36);
  border-radius: 8px;
  color: #03100a;
  background: var(--signal);
  font-size: 0.63rem;
  font-weight: 850;
  cursor: pointer;
  transition: filter 140ms ease, transform 140ms ease;
}

.contribution-submit:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.contribution-submit:disabled {
  cursor: wait;
  opacity: 0.64;
}

.contribution-review-note {
  margin: -4px 0 0;
  text-align: center;
}

.browse-panel {
  margin-top: 12px;
  padding: 16px;
}

.browse-heading {
  align-items: end;
  margin-bottom: 12px;
}

.lore-index {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.index-entry {
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(237, 255, 246, 0.02);
  text-align: left;
  cursor: pointer;
}

.index-entry:hover,
.index-entry.active {
  border-color: color-mix(in srgb, var(--entry-color) 45%, transparent);
  background: color-mix(in srgb, var(--entry-color) 6%, transparent);
}

.index-entry strong {
  overflow: hidden;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.index-entry span {
  color: var(--muted);
  font-size: 0.56rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@media (max-width: 1180px) {
  .lore-workspace {
    grid-template-columns: 200px minmax(480px, 1fr);
  }

  .lore-inspector {
    position: static;
    grid-column: 1 / -1;
    min-height: 0;
    max-height: none;
    overflow: visible;
    overscroll-behavior: auto;
  }

  .inspector-placeholder {
    min-height: 190px;
  }

  .inspector-content {
    grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }

  .inspector-heading-block {
    display: grid;
    gap: 10px;
  }

  .inspector-section {
    padding-top: 0;
    padding-left: 14px;
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .contribution-section {
    grid-column: 1 / -1;
    padding-top: 15px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .lore-index {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .lore-hero {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .lore-workspace {
    grid-template-columns: 1fr;
  }

  .lore-controls {
    position: static;
    grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.3fr);
    align-items: start;
  }

  .control-heading,
  .source-card-link {
    grid-column: 1;
  }

  .lore-search,
  .type-filter-group {
    grid-column: 2;
  }

  .evidence-key {
    grid-column: 1;
  }

  .type-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .graph-viewport {
    height: 560px;
  }

  .lore-inspector {
    grid-column: auto;
  }

  .inspector-content {
    grid-template-columns: 1fr;
  }

  .inspector-section {
    padding-top: 13px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .lore-index {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 639px) {
  .lore-hero {
    gap: 15px;
    padding: 18px;
    border-radius: 17px;
  }

  .lore-hero h1 {
    font-size: 2.35rem;
  }

  .lore-hero-copy > p:last-child {
    font-size: 0.78rem;
  }

  .atlas-status > div {
    padding: 9px;
  }

  .atlas-status span {
    font-size: 0.51rem;
  }

  .lore-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .control-heading,
  .lore-search,
  .type-filter-group,
  .evidence-key,
  .source-card-link {
    grid-column: 1;
  }

  .type-filters {
    display: flex;
    gap: 5px;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .type-filters::-webkit-scrollbar {
    display: none;
  }

  .type-filter {
    flex: 0 0 auto;
  }

  .evidence-key,
  .source-card-link {
    display: none;
  }

  .map-toolbar {
    gap: 10px;
    padding: 12px;
  }

  .map-toolbar p:last-child {
    display: none;
  }

  .graph-viewport {
    height: 500px;
  }

  .graph-scene::before {
    width: 250px;
    height: 250px;
  }

  .graph-scene::after {
    width: 360px;
    height: 360px;
  }

  .lore-node {
    width: 31px;
    min-width: 31px;
    max-width: 31px;
    min-height: 31px;
    padding: 0;
    justify-content: center;
  }

  .lore-node .node-copy {
    position: absolute;
    top: 35px;
    left: 50%;
    display: none;
    width: max-content;
    max-width: 118px;
    padding: 4px 6px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(5, 14, 11, 0.96);
    transform: translateX(-50%);
  }

  .lore-node.selected,
  .lore-node.neighbor {
    z-index: 5;
  }

  .lore-node.selected .node-copy,
  .lore-node.neighbor .node-copy {
    display: grid;
  }

  .lore-node.featured {
    min-height: 34px;
    padding: 0;
  }

  .map-footnote span:last-child {
    display: none;
  }

  .lore-index {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .graph-scene,
  .lore-node {
    transition: none;
  }
}
