/* ── Monet Dashboard — style.css ── */
/* Impressionist Monet palette: indigos/violets/teals/rose on near-black */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #0d0d14;
  --bg2:          #12121e;
  --bg3:          #181828;
  --glass:        rgba(255,255,255,0.035);
  --glass-border: rgba(255,255,255,0.08);
  --text:         #e2e0f0;
  --text-dim:     #8884aa;
  --text-muted:   #55527a;
  --accent1:      #7c6ddb;  /* indigo */
  --accent2:      #4ec9b0;  /* teal */
  --accent3:      #c084fc;  /* violet */
  --accent4:      #f472b6;  /* rose */
  --accent5:      #60a5fa;  /* blue */
  --ok:           #34d399;
  --warn:         #fbbf24;
  --danger:       #f87171;
  --rail-w:       260px;
  --detail-w:     360px;
  --topbar-h:     58px;
  --statbar-h:    38px;
  --radius:       10px;
  --trans:        0.18s ease;

  /* kind colors */
  --k-fact:         #60a5fa;
  --k-decision:     #c084fc;
  --k-project:      #34d399;
  --k-architecture: #f59e0b;
  --k-feedback:     #f472b6;
  --k-reference:    #818cf8;
  --k-pattern:      #2dd4bf;
  --k-workstream:   #a78bfa;
  --k-issue:        #f87171;
  --k-insight:      #fbbf24;
  --k-user:         #6ee7b7;
  --k-procedure:    #a3e635;
  --k-gotcha:       #fb923c;
  --k-unknown:      #64748b;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
}

/* ── Scrollbars ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ── Layout shell ── */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ── Top bar ── */
#topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  background: var(--bg2);
  border-bottom: 1px solid var(--glass-border);
  z-index: 100;
}

#wordmark {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent1), var(--accent3), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

#subtitle {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

#circle-selector {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 2px 0;
}

.circle-btn {
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 11.5px;
  white-space: nowrap;
  transition: all var(--trans);
}
.circle-btn:hover { border-color: var(--accent1); color: var(--text); }
.circle-btn.active {
  background: rgba(124,109,219,0.2);
  border-color: var(--accent1);
  color: var(--accent1);
}

#search-wrap {
  flex: 1;
  max-width: 280px;
  position: relative;
}
#search-wrap svg {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.4;
  pointer-events: none;
}
#search-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 6px 10px 6px 30px;
  color: var(--text);
  font-size: 12.5px;
  outline: none;
  transition: border-color var(--trans);
}
#search-input:focus { border-color: var(--accent1); }
#search-input::placeholder { color: var(--text-muted); }

#refresh-btn {
  padding: 5px 12px;
  border-radius: 7px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all var(--trans);
  white-space: nowrap;
}
#refresh-btn:hover { border-color: var(--accent2); color: var(--accent2); }
#refresh-btn.spinning svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Stat bar ── */
#statbar {
  height: var(--statbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--glass-border);
  overflow-x: auto;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 5px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  white-space: nowrap;
  font-size: 11px;
}
.stat-chip .val {
  font-weight: 600;
  font-size: 12px;
  color: var(--text);
}
.stat-chip .lbl {
  color: var(--text-muted);
  font-size: 10.5px;
}
.stat-chip.warn .val { color: var(--warn); }
.stat-chip.danger .val { color: var(--danger); }
.stat-chip.ok .val { color: var(--ok); }
.stat-chip.accent .val { color: var(--accent3); }

/* ── Main body ── */
#body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ── Left rail ── */
#rail {
  width: var(--rail-w);
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#rail-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rail-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.kind-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.kind-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: var(--glass);
  cursor: pointer;
  font-size: 11px;
  transition: all var(--trans);
  opacity: 0.9;
}
.kind-chip .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kind-chip.off { opacity: 0.35; }
.kind-chip:hover { opacity: 1; border-color: var(--glass-border); }

.flag-chips {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.flag-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 5px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  cursor: pointer;
  font-size: 11.5px;
  color: var(--text-dim);
  transition: all var(--trans);
}
.flag-chip.active { border-color: var(--accent1); color: var(--text); background: rgba(124,109,219,0.12); }
.flag-chip:hover { border-color: rgba(255,255,255,0.15); }

.slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
}
.slider-row input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  height: 3px;
  border-radius: 3px;
  background: var(--bg3);
  outline: none;
  cursor: pointer;
}
.slider-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--accent1);
  cursor: pointer;
}
.slider-row .val-lbl {
  min-width: 28px;
  text-align: right;
  color: var(--text);
  font-size: 11px;
}

.edge-type-rows {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.edge-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 11.5px;
  color: var(--text-dim);
  transition: all var(--trans);
}
.edge-row.active { border-color: var(--glass-border); color: var(--text); background: var(--glass); }
.edge-row:hover { border-color: rgba(255,255,255,0.1); }
.edge-swatch {
  width: 18px; height: 3px;
  border-radius: 2px;
  flex-shrink: 0;
}
.edge-row.dashed .edge-swatch {
  background: repeating-linear-gradient(90deg, currentColor 0, currentColor 3px, transparent 3px, transparent 6px);
}
.edge-cnt { margin-left: auto; color: var(--text-muted); font-size: 10.5px; }

/* ── Center main ── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ── Tab bar ── */
#tabs {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 2px;
  background: var(--bg);
  border-bottom: 1px solid var(--glass-border);
  height: 42px;
}

.tab-btn {
  padding: 6px 14px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 12.5px;
  cursor: pointer;
  border-radius: 7px;
  transition: all var(--trans);
  position: relative;
}
.tab-btn:hover { color: var(--text); background: var(--glass); }
.tab-btn.active {
  color: var(--accent1);
  background: rgba(124,109,219,0.12);
}
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 10px; right: 10px;
  height: 2px;
  background: var(--accent1);
  border-radius: 2px 2px 0 0;
}

/* ── View containers ── */
#views {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.view {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
}
.view.active { display: flex; flex-direction: column; }

/* ── Graph view ── */
/* NOTE: no position/display override here — inherits position:absolute;inset:0 from .view
   and display:flex;flex-direction:column from .view.active. The #graph-overlay child is
   absolutely positioned within graph-view, which is itself position:absolute — a valid
   containing block, so the overlay still works correctly. */

#graph-canvas {
  flex: 1;
  display: block;
  cursor: grab;
  /* Fade-in reveal after headless pre-settle. JS sets opacity:0 before the fresh
     sim runs, then opacity:1 once settled — CSS handles the smooth transition.
     Frozen restores are unaffected: opacity starts at 1 and stays there. */
  transition: opacity 350ms ease;
}
#graph-canvas:active { cursor: grabbing; }

#graph-overlay {
  position: absolute;
  bottom: 12px;
  left: 12px;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(13,13,20,0.7);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  pointer-events: none;
}

#reset-layout-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(13,13,20,0.7);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all var(--trans);
  z-index: 10;
}
#reset-layout-btn:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.18);
  background: rgba(13,13,20,0.9);
}

#tooltip {
  position: fixed;
  display: none;
  background: var(--bg2);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 10px 14px;
  pointer-events: none;
  z-index: 500;
  max-width: 280px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
#tooltip .tt-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
#tooltip .tt-kind { font-size: 11px; margin-bottom: 3px; }
#tooltip .tt-meta { font-size: 11px; color: var(--text-dim); }
#tooltip .tt-conf-bar {
  height: 3px;
  background: var(--bg3);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
#tooltip .tt-conf-fill {
  height: 100%;
  background: var(--accent2);
  border-radius: 2px;
  transition: width 0.2s;
}

/* ── Concepts table view ── */
/* No display/flex-direction here — governed entirely by .view / .view.active */
#concepts-view {
  overflow: hidden;
}

.table-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}
thead th {
  position: sticky;
  top: 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--glass-border);
  padding: 9px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  z-index: 10;
}
thead th:hover { color: var(--text); }
thead th .sort-arrow { opacity: 0.4; margin-left: 4px; }
thead th.sorted .sort-arrow { opacity: 1; color: var(--accent1); }

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.03);
  cursor: pointer;
  transition: background var(--trans);
}
tbody tr:hover { background: var(--glass); }
tbody tr.selected { background: rgba(124,109,219,0.1); }

td {
  padding: 8px 12px;
  font-size: 12px;
  vertical-align: middle;
}

.td-title { font-weight: 500; max-width: 200px; }
.td-title-inner {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.kind-dot-inline {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  flex-shrink: 0;
}

.kind-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 500;
  background: rgba(255,255,255,0.05);
}

.conf-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 70px;
}
.conf-bar {
  flex: 1;
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
  min-width: 40px;
}
.conf-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  border-radius: 2px;
}
.conf-val { font-size: 10.5px; color: var(--text-dim); width: 28px; text-align: right; }

.badge-disputed {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  background: rgba(248,113,113,0.15);
  color: var(--danger);
  border: 1px solid rgba(248,113,113,0.3);
}
.badge-dirty {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  background: rgba(251,191,36,0.1);
  color: var(--warn);
  border: 1px solid rgba(251,191,36,0.3);
}

/* ── Entities view ── */
#entities-view {
  overflow: hidden;
}

/* ── Timeline view ── */
#timeline-view {
  overflow-y: auto;
  padding: 16px;
}

#timeline-canvas {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  background: var(--bg2);
}

#timeline-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tl-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  cursor: pointer;
  transition: all var(--trans);
}
.tl-item:hover { border-color: var(--accent1); background: rgba(124,109,219,0.08); }
.tl-date { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; padding-top: 2px; min-width: 80px; }
.tl-title { font-size: 12.5px; font-weight: 500; }
.tl-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ── Health view ── */
/* No display/flex-direction here — governed entirely by .view / .view.active */
#health-view {
  overflow-y: auto;
  padding: 16px;
  gap: 16px;
}

.health-section {
  background: var(--bg2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.health-section-hdr {
  padding: 12px 16px;
  border-bottom: 1px solid var(--glass-border);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.health-cnt {
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
}
.health-cnt.danger { background: rgba(248,113,113,0.15); color: var(--danger); }
.health-cnt.warn { background: rgba(251,191,36,0.1); color: var(--warn); }
.health-cnt.ok { background: rgba(52,211,153,0.1); color: var(--ok); }

.health-items {
  padding: 8px 0;
}
.health-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  cursor: pointer;
  transition: background var(--trans);
}
.health-item:last-child { border-bottom: none; }
.health-item:hover { background: var(--glass); }
.health-item .h-title { font-size: 12.5px; font-weight: 500; }
.health-item .h-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.health-item .h-icon { flex-shrink: 0; margin-top: 2px; }
.dup-pair {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  cursor: pointer;
  transition: background var(--trans);
}
.dup-pair:last-child { border-bottom: none; }
.dup-pair:hover { background: var(--glass); }
.dup-pair .dp-title { font-size: 12px; font-weight: 500; }
.dup-pair .dp-sep { color: var(--text-muted); font-size: 11px; }

/* ── Right detail panel ── */
#detail {
  width: 0;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg2);
  border-left: 1px solid var(--glass-border);
  transition: width 0.22s ease;
  display: flex;
  flex-direction: column;
}
#detail.open {
  width: var(--detail-w);
}

#detail-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

#detail-hdr {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
#detail-title {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}
#detail-close {
  flex-shrink: 0;
  width: 26px; height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: none;
  background: var(--glass);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  transition: all var(--trans);
  margin-top: 2px;
}
#detail-close:hover { background: rgba(248,113,113,0.15); color: var(--danger); }

.detail-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.detail-meta-item {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 7px;
  padding: 7px 10px;
}
.detail-meta-lbl {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.detail-meta-val {
  font-size: 12px;
  font-weight: 500;
}

.detail-section {
  margin-bottom: 16px;
}
.detail-section-title {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.detail-section-title .ds-cnt {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--glass);
  color: var(--text-dim);
}

/* Body markdown */
.body-render {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 12px 14px;
}
.body-render h1 { font-size: 15px; margin-bottom: 6px; }
.body-render h2 { font-size: 13.5px; margin-bottom: 5px; margin-top: 10px; }
.body-render h3 { font-size: 12.5px; margin-bottom: 4px; margin-top: 8px; color: var(--text-dim); }
.body-render p { margin-bottom: 8px; }
.body-render ul, .body-render ol { padding-left: 18px; margin-bottom: 8px; }
.body-render li { margin-bottom: 3px; }
.body-render code {
  background: rgba(255,255,255,0.07);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: "SF Mono", Menlo, Monaco, "Courier New", monospace;
  font-size: 11.5px;
  color: var(--accent2);
}
.body-render pre {
  background: rgba(0,0,0,0.3);
  border-radius: 6px;
  padding: 10px 12px;
  overflow-x: auto;
  margin-bottom: 8px;
}
.body-render pre code { background: none; padding: 0; }
.body-render strong { font-weight: 600; color: var(--text); }
.body-render em { font-style: italic; color: var(--text-dim); }
.body-render a { color: var(--accent1); text-decoration: underline; cursor: pointer; }

/* Obs items */
.obs-item {
  padding: 8px 10px;
  border-left: 2px solid var(--glass-border);
  margin-bottom: 8px;
  border-radius: 0 6px 6px 0;
  background: var(--glass);
}
.obs-item:last-child { margin-bottom: 0; }
.obs-content { font-size: 12px; line-height: 1.55; margin-bottom: 4px; }
.obs-meta { font-size: 10.5px; color: var(--text-muted); }

/* Entity chips */
.entity-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.entity-chip {
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  font-size: 11px;
  cursor: pointer;
  transition: border-color var(--trans);
}
.entity-chip:hover { border-color: var(--accent2); }
.ek-noun { color: var(--accent2); }
.ek-id { color: var(--accent5); }
.ek-path { color: var(--text-dim); }
.ek-err { color: var(--danger); }
.ek-lib { color: var(--accent3); }

/* Connected concept links */
.conn-group { margin-bottom: 10px; }
.conn-group-title { font-size: 10.5px; color: var(--text-muted); margin-bottom: 4px; display: flex; align-items: center; gap: 4px; }
.conn-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-dim);
  transition: all var(--trans);
}
.conn-link:hover { background: var(--glass); color: var(--text); }
.conn-link .wt { font-size: 10px; color: var(--text-muted); margin-left: auto; }

/* Contradiction items */
.contra-item {
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid rgba(248,113,113,0.25);
  background: rgba(248,113,113,0.05);
  margin-bottom: 6px;
}
.contra-item:last-child { margin-bottom: 0; }
.contra-status {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  margin-bottom: 4px;
  display: inline-block;
}
.contra-status.open { background: rgba(248,113,113,0.2); color: var(--danger); }
.contra-status.resolved { background: rgba(52,211,153,0.1); color: var(--ok); }
.contra-status.dismissed { background: var(--glass); color: var(--text-muted); }
.contra-detail { font-size: 11.5px; line-height: 1.5; }

/* Loading overlay */
#loading {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease;
}
#loading.hidden { opacity: 0; pointer-events: none; }
.loading-wordmark {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--accent1), var(--accent3), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
}
.loading-dots {
  display: flex;
  gap: 7px;
}
.loading-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent1);
  animation: pulse-dot 1.4s ease-in-out infinite;
}
.loading-dot:nth-child(2) { animation-delay: 0.2s; background: var(--accent3); }
.loading-dot:nth-child(3) { animation-delay: 0.4s; background: var(--accent2); }
@keyframes pulse-dot {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}
.loading-msg { margin-top: 14px; font-size: 12px; color: var(--text-muted); }

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Collapsible */
.collapsible-hdr {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  color: var(--text-dim);
  font-size: 12px;
  padding: 4px 0;
  transition: color var(--trans);
}
.collapsible-hdr:hover { color: var(--text); }
.collapsible-hdr .arr {
  transition: transform var(--trans);
  font-size: 10px;
}
.collapsible-hdr.open .arr { transform: rotate(90deg); }
.collapsible-body { display: none; margin-top: 6px; }
.collapsible-body.open { display: block; }

/* Divider */
hr.hr {
  border: none;
  border-top: 1px solid var(--glass-border);
  margin: 12px 0;
}
