/*
 * Cosmo KG demo UI -- "night observatory": deep ink field, a single amber signal colour,
 * star-chart dot grid behind the graph. Built for a projector: 16px base, high contrast.
 */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("vendor/fonts/bricolage-grotesque-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("vendor/fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("vendor/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("vendor/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("vendor/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("vendor/fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --ink-0: #070a10;
  --ink-1: #0b0f17;
  --ink-2: #111725;
  --ink-3: #182033;
  --ink-4: #222c42;
  --line: #263049;
  --line-soft: #1b2336;
  --text: #edf1f7;
  --text-2: #b9c3d3;
  --text-3: #8591a6;
  --signal: #ffb547;
  --signal-hi: #ffd38a;
  --signal-glow: rgba(255, 181, 71, 0.22);
  --ok: #38e08f;
  --warn: #ffb02e;
  --bad: #ff4d5e;
  --info: #5cc8ff;
  --radius: 10px;
  --font-display: "Bricolage Grotesque", "Atkinson Hyperlegible", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --topbar-h: 76px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--ink-1);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow: hidden;
}

code,
kbd {
  font-family: var(--font-mono);
  font-size: 0.86em;
}
code {
  color: var(--text-2);
  background: var(--ink-3);
  padding: 1px 6px;
  border-radius: 5px;
  word-break: break-all;
}
kbd {
  opacity: 0.7;
  margin-left: 6px;
}

button {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

.muted {
  color: var(--text-3);
}

/* ------------------------------------------------------------------ boot */

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: radial-gradient(ellipse at 50% 40%, #142037 0%, var(--ink-0) 70%);
  transition: opacity 0.6s ease;
}
body.ready .boot {
  opacity: 0;
  pointer-events: none;
}
.boot p {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--text-2);
  margin: 0;
}
.boot.boot-error p {
  color: var(--bad);
}
.boot-mark,
.brand-mark {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px dashed var(--signal);
  animation: spin 14s linear infinite;
}
.boot-mark span,
.brand-mark span {
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 30px var(--signal);
}
.boot-mark span {
  animation: breathe 1.6s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes breathe {
  50% {
    transform: scale(0.75);
    opacity: 0.6;
  }
}

/* ------------------------------------------------------------------ top bar */

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--ink-2), var(--ink-1));
  position: relative;
  z-index: 5;
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--signal) 20%, transparent 60%);
  opacity: 0.6;
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand-mark {
  width: 40px;
  height: 40px;
}
.brand-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
}
.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.75rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 28px;
}
.meta-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.meta-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.meta-value {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.05rem;
}

.conn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.conn-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--text-3);
}
.conn[data-state="live"] {
  color: var(--ok);
  border-color: rgba(56, 224, 143, 0.35);
}
.conn[data-state="live"] .conn-dot {
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(56, 224, 143, 0.6);
  animation: live 2s infinite;
}
.conn[data-state="degraded"] {
  color: var(--warn);
}
.conn[data-state="degraded"] .conn-dot {
  background: var(--warn);
}
.conn[data-state="offline"] {
  color: var(--bad);
  border-color: rgba(255, 77, 94, 0.4);
}
.conn[data-state="offline"] .conn-dot {
  background: var(--bad);
}
@keyframes live {
  70% {
    box-shadow: 0 0 0 9px rgba(56, 224, 143, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(56, 224, 143, 0);
  }
}
.user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-2);
  font-size: 0.95rem;
}

/* ------------------------------------------------------------------ buttons / toggles */

.btn,
.btn-ghost {
  cursor: pointer;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn {
  background: var(--ink-3);
  border: 1px solid var(--line);
}
.btn:hover {
  border-color: var(--signal);
}
.btn.active {
  background: var(--signal);
  color: var(--ink-0);
  border-color: var(--signal);
}
.btn-primary {
  background: var(--signal);
  color: var(--ink-0);
  border-color: var(--signal);
}
.btn-primary:hover {
  background: var(--signal-hi);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: progress;
}
.btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-2);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--line);
}
button:focus-visible,
textarea:focus-visible,
input:focus-visible + .toggle-ui {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-2);
  user-select: none;
}
.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle-ui {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--ink-4);
  border: 1px solid var(--line);
  position: relative;
  transition: background 0.2s;
}
.toggle-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-3);
  transition: transform 0.2s, background 0.2s;
}
.toggle input:checked + .toggle-ui {
  background: rgba(255, 181, 71, 0.25);
  border-color: var(--signal);
}
.toggle input:checked + .toggle-ui::after {
  transform: translateX(16px);
  background: var(--signal);
}
.toggle:has(input:checked) {
  color: var(--text);
}

/* ------------------------------------------------------------------ layout */

.layout {
  display: grid;
  grid-template-columns: 65fr 35fr;
  height: calc(100vh - var(--topbar-h));
}

.graph-pane {
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 181, 71, 0.06), transparent 55%),
    radial-gradient(rgba(140, 160, 200, 0.13) 1px, transparent 1.4px) 0 0 / 28px 28px,
    var(--ink-0);
}
.graph-pane::before {
  /* concentric "orbit" rings behind the centred Team node */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-radial-gradient(circle at 50% 52%, transparent 0 179px, rgba(255, 181, 71, 0.05) 180px 181px);
}
.cy {
  position: absolute;
  inset: 0;
}
.graph-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-3);
  pointer-events: none;
}

.graph-toolbar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 8px 14px;
  width: max-content;
  max-width: calc(100% - 28px);
  background: rgba(17, 23, 37, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.toolbar-sep {
  width: 1px;
  height: 24px;
  background: var(--line);
}

/* legend */
.legend {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, auto));
  gap: 2px 8px;
  padding: 12px 14px;
  background: rgba(17, 23, 37, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.legend-title {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 4px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 3px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 0.95rem;
  text-align: left;
}
.legend-item:hover {
  background: var(--ink-3);
}
.legend-item.off {
  opacity: 0.35;
  text-decoration: line-through;
}
.legend-item.zero .legend-count {
  opacity: 0.4;
}
.legend-swatch {
  width: 15px;
  height: 15px;
  flex: none;
  background: var(--c);
  border-radius: 50%;
}
.legend-swatch.shape-hexagon {
  clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0 50%);
  border-radius: 0;
}
.legend-swatch.shape-diamond,
.legend-swatch.shape-round-diamond {
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  border-radius: 0;
}
.legend-swatch.shape-round-rectangle {
  border-radius: 4px;
}
.legend-swatch.shape-rectangle {
  border-radius: 0;
}
.legend-swatch.shape-round-triangle {
  clip-path: polygon(50% 5%, 100% 95%, 0 95%);
  border-radius: 0;
}
.legend-swatch.shape-round-tag {
  clip-path: polygon(0 0, 70% 0, 100% 50%, 70% 100%, 0 100%);
  border-radius: 2px;
}
.legend-swatch.shape-round-pentagon {
  clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%);
  border-radius: 0;
}
.legend-swatch.shape-round-octagon {
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  border-radius: 0;
}
.legend-swatch.shape-star {
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  border-radius: 0;
}
.legend-name {
  flex: 1;
}
.legend-count {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-3);
}
.legend-keys {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.8rem;
  color: var(--text-2);
}
.key::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: -1px;
}
.key-discussing::before {
  border: 2px dashed #ffd166;
}
.key-disputed::before {
  border: 3px double #ff5252;
}
.key-historic::before {
  border: 2px dashed #8a93a4;
  background: #3a4252;
}

/* toasts */
.toasts {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 440px;
}
.toast {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-left: 5px solid var(--info);
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  font-size: 1rem;
  animation: toast-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  transition: opacity 0.5s, transform 0.5s;
}
.toast.out {
  opacity: 0;
  transform: translateX(30px);
}
.toast.sev-warning {
  border-left-color: var(--warn);
}
.toast.sev-critical {
  border-left-color: var(--bad);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
}

/* before/after card */
.diff-card {
  position: absolute;
  top: 74px;
  right: 14px;
  z-index: 3;
  width: 380px;
  max-height: calc(100% - 100px);
  overflow: auto;
  padding: 16px 18px;
  background: rgba(17, 23, 37, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-top: 3px solid var(--signal);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.35s ease;
}
.diff-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.diff-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
}
.diff-span {
  display: flex;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-2);
  margin: 4px 0 14px;
}
.diff-counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.dc {
  background: var(--ink-3);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}
.dc b {
  font-family: var(--font-mono);
  font-size: 1.15rem;
}
.dc span {
  font-size: 0.78rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.dc-added b {
  color: var(--ok);
}
.dc-changed b {
  color: var(--warn);
}
.dc-removed b {
  color: var(--bad);
}
.diff-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.diff-list li {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}
.diff-list .sym {
  font-family: var(--font-mono);
  font-weight: 600;
  width: 14px;
}
.d-added .sym {
  color: var(--ok);
}
.d-changed .sym {
  color: var(--warn);
}
.d-removed .sym,
.d-removed span {
  color: var(--bad);
}
.d-status {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-3);
}
.linkish {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px dotted var(--text-3);
}
.linkish:hover {
  color: var(--signal-hi);
}

/* ------------------------------------------------------------------ side pane */

.side-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--ink-1);
}
.tabs {
  display: flex;
  gap: 2px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--ink-2);
}
.tab {
  position: relative;
  flex: 1;
  padding: 16px 6px 14px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-3);
  transition: color 0.15s;
}
.tab:hover {
  color: var(--text);
}
.tab.active {
  color: var(--text);
}
.tab.active::after {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--signal);
  box-shadow: 0 0 14px var(--signal);
}
.badge {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--signal);
  color: var(--ink-0);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: 2px;
  animation: pop 0.4s ease;
}
@keyframes pop {
  50% {
    transform: scale(1.35);
  }
}

.tab-panel {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px 40px;
  scrollbar-color: var(--ink-4) transparent;
}
.tab-panel.active {
  display: block;
  animation: fade-up 0.25s ease;
}
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.panel-head {
  margin-bottom: 16px;
}
.panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
}
.panel-sub {
  font-size: 0.9rem;
  color: var(--text-3);
}

.empty-state {
  text-align: center;
  color: var(--text-2);
  padding: 60px 20px;
}
.empty-state.small {
  padding: 24px;
  color: var(--text-3);
}
.empty-state h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  margin: 18px 0 6px;
  color: var(--text);
}
.empty-glyph {
  width: 84px;
  height: 84px;
  margin: 0 auto;
  border-radius: 50%;
  border: 2px dashed var(--line);
  position: relative;
}
.empty-glyph::after {
  content: "";
  position: absolute;
  inset: 32px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 22px var(--signal);
}

.loading,
.thinking {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-2);
  padding: 14px 0;
}
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--ink-4);
  border-top-color: var(--signal);
  animation: spin 0.8s linear infinite;
  flex: none;
}
.spinner.sm {
  width: 13px;
  height: 13px;
  display: inline-block;
  vertical-align: -2px;
  margin-right: 6px;
}
.error-box {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: rgba(255, 77, 94, 0.1);
  border: 1px solid rgba(255, 77, 94, 0.4);
  color: #ffc2c8;
  margin: 10px 0;
}

/* pills & chips */
.type-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 11px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
}
.type-pill {
  background: color-mix(in srgb, var(--c) 16%, transparent);
  color: var(--c);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
}
.type-pill i,
.nb i,
.chip.ent i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c);
  flex: none;
}
.status-pill {
  background: var(--ink-3);
  border: 1px solid var(--line);
  color: var(--text-2);
  text-transform: lowercase;
}
.st-agreed,
.st-active,
.st-open {
  color: var(--ok);
  border-color: rgba(56, 224, 143, 0.4);
}
.st-under_discussion {
  color: #ffd166;
  border: 1px dashed #ffd166;
}
.st-disputed {
  color: #ff7b85;
  border-color: #ff5252;
}
.st-superseded,
.st-closed,
.st-done {
  color: var(--text-3);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 14px 0;
}
.chips-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  margin-right: 2px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--ink-3);
  font-size: 0.92rem;
  line-height: 1.35;
}
button.chip {
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
button.chip:hover,
button.chip.on {
  border-color: var(--signal);
  background: rgba(255, 181, 71, 0.12);
}

/* source badges */
.src-badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 24px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-0);
  background: var(--text-3);
}
.src-badge.sm {
  width: 26px;
  height: 19px;
  font-size: 0.66rem;
}
.src-email {
  background: #7fb2ff;
}
.src-slack {
  background: #e7a4ff;
}
.src-sharepoint {
  background: #4fd1c5;
}
.src-salesforce {
  background: #5cc8ff;
}
.src-meetings {
  background: #ffb547;
}

/* ------------------------------------------------------------------ entity panel */

.entity-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.back {
  margin-right: 4px;
  padding: 4px 10px;
}
.entity-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 12px 0 6px;
}
.entity-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--text-3);
  font-size: 0.9rem;
}
.dot-sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-3);
}
.entity-summary {
  font-size: 1.12rem;
  line-height: 1.6;
  margin: 16px 0;
  padding: 14px 16px;
  border-left: 3px solid var(--signal);
  background: linear-gradient(90deg, rgba(255, 181, 71, 0.07), transparent);
  border-radius: 0 8px 8px 0;
}

.section {
  margin-top: 22px;
}
.section-title {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 0 0 10px;
}
.count {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--ink-4);
  font-size: 0.75rem;
  color: var(--text-2);
}
details.history summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
details.history summary::before {
  content: "▸";
  color: var(--signal);
  margin-right: 6px;
  transition: transform 0.2s;
}
details.history[open] summary::before {
  transform: rotate(90deg);
}
.timeline {
  list-style: none;
  margin: 10px 0 0;
  padding: 0 0 0 16px;
  border-left: 2px dashed var(--line);
}
.timeline li {
  position: relative;
  margin-bottom: 14px;
  color: var(--text-2);
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink-1);
  border: 2px solid var(--text-3);
}
.tl-when {
  display: flex;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-3);
}
.tl-text {
  text-decoration: line-through;
  text-decoration-color: rgba(133, 145, 166, 0.45);
}

.prov {
  padding: 12px 14px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-2);
}
.prov-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.prov-title {
  flex: 1;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prov-when {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-3);
  white-space: nowrap;
}
blockquote {
  margin: 10px 0;
  padding: 2px 0 2px 14px;
  border-left: 2px solid var(--line);
  color: var(--text-2);
  font-style: italic;
}
.prov-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}
.link {
  color: var(--signal);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.link:hover {
  color: var(--signal-hi);
  text-decoration: underline;
}

.nb-rel {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-3);
  margin: 12px 0 6px;
}
.nb-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nb {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--ink-2);
  cursor: pointer;
  text-align: left;
}
.nb:hover {
  border-color: var(--c);
}
.nb-name {
  flex: 1;
  font-weight: 700;
}
.nb-type {
  font-size: 0.8rem;
  color: var(--text-3);
}

/* ------------------------------------------------------------------ activity feed */

.feed,
.notes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feed-row {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ok);
  border-radius: var(--radius);
  background: var(--ink-2);
}
.feed-row.fresh,
.note.fresh {
  animation: arrive 1.8s ease;
}
@keyframes arrive {
  0% {
    transform: translateX(16px);
    opacity: 0;
    box-shadow: 0 0 0 2px var(--signal), 0 0 30px var(--signal-glow);
  }
  20% {
    transform: none;
    opacity: 1;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}
.feed-row.failed {
  border-left-color: var(--bad);
  background: linear-gradient(90deg, rgba(255, 77, 94, 0.12), var(--ink-2) 60%);
}
.feed-row.sensitive {
  border-left-color: #c58bff;
}
.feed-row.ignored,
.feed-row.query {
  border-left-color: var(--text-3);
}
.feed-row.processing {
  border-left-color: var(--signal);
}
.row-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.row-key {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-time {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-3);
}
.tag {
  font-size: 0.75rem;
  padding: 1px 8px;
  border-radius: 999px;
  font-weight: 700;
}
.tag-delete {
  background: rgba(255, 77, 94, 0.15);
  color: #ff9aa4;
}
.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin-top: 8px;
  font-size: 1rem;
  color: var(--text-2);
}
.flow b {
  color: var(--text);
}
.flow .arrow {
  color: var(--signal);
  font-weight: 700;
}
.route {
  font-family: var(--font-mono);
}
.route-ingest {
  color: var(--info) !important;
}
.route-purge_request {
  color: var(--bad) !important;
}
.route-query {
  color: #e7a4ff !important;
}
.route-ignore {
  color: var(--text-3) !important;
}
.outcome {
  font-weight: 700;
}
.outcome.applied {
  color: var(--ok);
}
.outcome.failed {
  color: var(--bad);
}
.outcome.sensitive {
  color: #c58bff;
}
.outcome.ignored,
.outcome.query {
  color: var(--text-3);
}
.outcome.processing {
  color: var(--signal);
}
.stages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.stage {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--ink-3);
  color: var(--text-2);
}
.stage em {
  font-style: normal;
  color: var(--signal-hi);
  margin-left: 6px;
}
.row-error,
.row-conflict,
.row-notice {
  margin-top: 8px;
  font-size: 0.92rem;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--ink-3);
}
.row-error {
  color: #ffc2c8;
  background: rgba(255, 77, 94, 0.12);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  white-space: pre-wrap;
}
.row-conflict b {
  color: var(--warn);
}
.row-notice b {
  color: var(--info);
  text-transform: uppercase;
  font-size: 0.75rem;
}
.row-notice.sev-warning b {
  color: var(--warn);
}
.row-notice.sev-critical b {
  color: var(--bad);
}

/* ------------------------------------------------------------------ notifications */

.note {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-left: 5px solid var(--info);
}
.note.sev-warning {
  border-left-color: var(--warn);
  background: linear-gradient(90deg, rgba(255, 176, 46, 0.08), var(--ink-2) 50%);
}
.note.sev-critical {
  border-left-color: var(--bad);
  background: linear-gradient(90deg, rgba(255, 77, 94, 0.12), var(--ink-2) 50%);
}
.note-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sev {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--info);
}
.sev-warning .sev {
  color: var(--warn);
}
.sev-critical .sev {
  color: var(--bad);
}
.note-time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-3);
}
.note-text {
  margin: 6px 0 8px;
  font-size: 1.08rem;
  line-height: 1.5;
}
.note-src {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

/* ------------------------------------------------------------------ ask */

.ask-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 84px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--ink-2);
  color: var(--text);
  font: inherit;
  font-size: 1.1rem;
}
.ask-form textarea:focus {
  border-color: var(--signal);
  outline: none;
  box-shadow: 0 0 0 3px var(--signal-glow);
}
.ask-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-top: 10px;
}
.ask-row .btn-primary {
  flex: none;
  white-space: nowrap;
}
.ask-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip.suggest {
  font-size: 0.85rem;
  color: var(--text-2);
}
.ask-result {
  margin-top: 22px;
}
.ask-q {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 12px;
}
.q-mark,
.a-mark {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--ink-4);
  color: var(--text-2);
}
.a-mark {
  background: var(--signal);
  color: var(--ink-0);
}
.answer {
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--signal);
}
.answer-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
}
.answer-text {
  font-size: 1.1rem;
  line-height: 1.6;
}
.answer-text p {
  margin: 10px 0;
}
.answer-text ul {
  margin: 8px 0;
  padding-left: 22px;
}
.answer-text strong {
  color: var(--signal-hi);
}
.conf {
  font-family: var(--font-mono);
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.conf-high {
  color: var(--ok);
}
.conf-medium {
  color: var(--warn);
}
.conf-low {
  color: var(--bad);
}
.cite-n {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--signal);
}
.cite-quote {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--ink-2);
  border: 1px dashed var(--signal);
  animation: fade-up 0.2s ease;
}
.cq-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.chip.ent {
  border-color: color-mix(in srgb, var(--c) 45%, transparent);
}
.not-found {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 20px;
  border-radius: var(--radius);
  border: 2px dashed var(--line);
  background: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(255, 255, 255, 0.015) 10px 20px);
}
.not-found h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--signal-hi);
}
.not-found p {
  margin: 0;
  color: var(--text-2);
}
.nf-glyph {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px dashed var(--text-3);
  position: relative;
}
.nf-glyph::after {
  content: "?";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--text-3);
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: 60vh auto;
  }
  body {
    overflow: auto;
  }
  .meta-block {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
