@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Share+Tech+Mono&display=swap");

:root {
  --bg: #020604;
  --bg-elev: #06110c;
  --surface: #0a1a12;
  --ink: #c8ffd4;
  --muted: #5f8f6e;
  --line: rgba(0, 255, 156, 0.14);
  --gold: #00ff9c;
  --gold-soft: rgba(0, 255, 156, 0.12);
  --blue: #5eead4;
  --red: #ff5c7a;
  --green: #39ff88;
  --purple: #b8ff57;
  --gray: #7aa88a;
  --danger: #ff5c7a;
  --amber: #ffe14a;
  --sidebar: 236px;
  --radius: 4px;
  --shadow: 0 0 0 1px rgba(0, 255, 156, 0.08), 0 18px 48px rgba(0, 0, 0, 0.55);
  --font: "IBM Plex Mono", "Cascadia Mono", "Consolas", monospace;
  --display: "Share Tech Mono", "IBM Plex Mono", monospace;
  --glow: 0 0 12px rgba(0, 255, 156, 0.35);
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) #03140c;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: #03140c;
  border: 1px solid var(--line);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.45);
}
*::-webkit-scrollbar-thumb {
  background:
    linear-gradient(180deg, rgba(0, 255, 156, 0.95), rgba(10, 74, 50, 0.95));
  border: 1px solid var(--gold);
  border-radius: 2px;
  box-shadow: var(--glow);
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}
*::-webkit-scrollbar-thumb:active {
  background: #b8ffd6;
}
*::-webkit-scrollbar-corner {
  background: #020604;
  border: 1px solid var(--line);
}
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background:
    linear-gradient(rgba(2, 6, 4, 0.72), rgba(2, 6, 4, 0.88)),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 255, 156, 0.015) 2px, rgba(0, 255, 156, 0.015) 4px),
    radial-gradient(900px 420px at 92% -8%, rgba(0, 255, 156, 0.08), transparent 50%),
    radial-gradient(700px 380px at -10% 110%, rgba(94, 234, 212, 0.06), transparent 46%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.55;
}
body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.08),
    rgba(0, 0, 0, 0.08) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}
body::after {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 81;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.45);
}

a { color: var(--gold); text-decoration: none; text-shadow: var(--glow); }
a:hover { text-decoration: underline; filter: brightness(1.15); }
:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar);
  background: rgba(2, 8, 5, 0.92);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--line);
  padding: 22px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--gold);
  margin: 0 8px 18px;
  display: block;
  letter-spacing: 0.08em;
  text-shadow: var(--glow);
}
.brand:hover { text-decoration: none; color: #b8ffd6; }
.brand small {
  display: block;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 4px;
  text-shadow: none;
}
.brand small::before { content: "> "; color: var(--gold); }
.nav-section {
  margin: 16px 10px 6px;
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-link {
  display: block;
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 2px;
  font-size: 0.88rem;
  border-left: 2px solid transparent;
}
.nav-link.active, .nav-link:hover {
  background: var(--gold-soft);
  text-decoration: none;
  color: var(--gold);
  border-left-color: var(--gold);
  text-shadow: var(--glow);
}
.nav-group .nav-sub { display: none; margin: 0 0 6px 10px; }
.nav-group.is-open .nav-sub { display: block; }
.sidebar button.nav-toggle {
  width: 100%;
  text-align: left;
  border: none;
  border-left: 2px solid transparent;
  border-radius: 2px;
  padding: 8px 12px;
  box-shadow: none;
}
.sidebar button.nav-toggle::after {
  content: "+";
  float: right;
  color: var(--muted);
}
.nav-group.is-open .nav-toggle::after { content: "−"; }
.nav-sub .nav-link { padding: 6px 12px; font-size: 0.8rem; color: var(--muted); }
.nav-search {
  margin: 4px 8px 10px;
}
.nav-search input {
  width: 100%;
  background: rgba(6, 17, 12, 0.9);
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  padding: 7px 10px;
  border-radius: 2px;
}
.nav-search input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: var(--glow);
}
.sidebar-foot { margin-top: auto; padding: 16px 4px 0; }
.user-chip {
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 10px;
  padding: 6px 8px;
  border: 1px dashed var(--line);
  font-family: var(--display);
}
.user-chip::before { content: "session@"; color: var(--gold); }
.sidebar button, .btn {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 8px 13px;
  cursor: pointer;
  font: inherit;
  letter-spacing: 0.02em;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, color 0.15s;
}
.btn:hover {
  border-color: var(--gold);
  text-decoration: none;
  box-shadow: var(--glow);
  color: var(--gold);
}
.btn.primary {
  background: #03210f;
  color: var(--gold);
  border-color: var(--gold);
  font-weight: 600;
  box-shadow: var(--glow);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
}
.btn.primary:hover { filter: brightness(1.12); background: #053018; }
.btn.ghost { color: var(--muted); }
.btn.danger { color: var(--danger); border-color: rgba(255, 92, 122, 0.45); }
.btn:disabled { opacity: 0.5; cursor: wait; }
.main { flex: 1; padding: 36px 44px 72px; min-width: 0; }
.main.graph-main { padding: 16px 16px 28px; display: flex; flex-direction: column; height: auto; min-height: 100vh; overflow: auto; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
h1 { margin: 0 0 8px; text-shadow: var(--glow); }
.lede { color: var(--muted); margin: 0; max-width: 68ch; }
.eyebrow {
  color: var(--gold);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.eyebrow::before { content: "// "; }
.page-head, .graph-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 22px;
}
.graph-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.graph-actions > form,
.graph-actions > a.btn,
.graph-actions > .more-menu { display: inline-flex; align-items: center; }
.case-title-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-shadow: inherit;
  cursor: pointer;
  text-align: left;
}
.case-title-btn:hover,
.case-title-btn:focus-visible { color: var(--gold); }
.kpi, .pill {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 3px 9px;
  font-size: 0.74rem;
  color: var(--muted);
  font-family: var(--display);
}
.flash { padding: 10px 12px; border-radius: 2px; margin-bottom: 16px; border: 1px solid var(--line); }
.flash.error { background: rgba(255, 92, 122, 0.1); color: #ffb3c0; border-color: rgba(255, 92, 122, 0.35); }
.flash.ok { background: rgba(0, 255, 156, 0.08); color: #b6ffd4; }
.action-status {
  position: sticky;
  top: 0;
  z-index: 25;
  padding: 8px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 0.82rem;
  font-family: var(--display);
  letter-spacing: 0.04em;
}
.action-status[hidden] { display: none; }
.action-status.is-loading {
  color: var(--gold);
  background: rgba(0, 255, 156, 0.06);
  border-color: var(--gold);
  box-shadow: var(--glow);
}
.action-status.is-loading::before,
.action-status.is-ok::before { content: "> "; }
.action-status.is-ok {
  color: #b6ffd4;
  background: rgba(0, 255, 156, 0.08);
}
.action-status.is-error {
  color: #ffb3c0;
  background: rgba(255, 92, 122, 0.1);
  border-color: rgba(255, 92, 122, 0.35);
}
.action-status .status-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  vertical-align: 2px;
}
.action-status .status-dots i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  opacity: 0.25;
  animation: status-dot 1s ease-in-out infinite;
}
.action-status .status-dots i:nth-child(2) { animation-delay: 0.16s; }
.action-status .status-dots i:nth-child(3) { animation-delay: 0.32s; }
@keyframes status-dot {
  0%, 70%, 100% { opacity: 0.22; transform: translateY(0) scale(0.85); }
  35% { opacity: 1; transform: translateY(-3px) scale(1); }
}
form.is-busy { opacity: 0.72; pointer-events: none; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-auto-rows: 1fr;
  gap: 16px;
}
.case-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  min-width: 0;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.case-card:hover {
  border-color: var(--gold);
  text-decoration: none;
  box-shadow: var(--glow);
}
.case-card.is-removing {
  opacity: 0.4;
  pointer-events: none;
}
.case-card > a {
  color: inherit;
  text-decoration: none;
  text-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.case-card a { color: inherit; text-decoration: none; text-shadow: none; }
.case-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
  flex: 0 0 auto;
}
.case-card .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 88px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 4px;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}
.case-card .pill.is-current {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(0, 255, 156, 0.06);
}
.case-hypo {
  margin: 0;
  min-height: 2.7em;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.35;
}
.page-toolbar {
  align-items: center;
}
.page-toolbar .btn,
.page-toolbar .field-inline input {
  box-sizing: border-box;
  min-height: 38px;
  height: 38px;
}
.page-toolbar .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
}
.field-inline {
  display: flex;
  margin: 0;
  color: inherit;
}
.field-inline input {
  width: 220px;
  padding: 0 13px;
  font-size: 0.86rem;
}
.case-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
  margin-top: auto;
}
.case-actions form {
  margin: 0;
  min-width: 0;
}
.case-actions .btn {
  width: 100%;
  min-height: 36px;
  height: 36px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-size: 0.78rem;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin: 18px 0 22px;
}
.tool-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 14px;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 96px;
}
.tool-card:hover, .tool-card.is-active {
  border-color: var(--gold);
  text-decoration: none;
  background: var(--gold-soft);
  box-shadow: var(--glow);
}
.tool-search-bar { max-width: none; margin-bottom: 8px; }
.mass-part { border-top: 1px dashed var(--line); padding: 16px 0; }
.mass-part h3 { margin: 4px 0 8px; font-size: 1.05rem; }
.tools-wrap { max-width: 920px; }
.case-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.case-top strong {
  min-width: 0;
  flex: 1;
  line-height: 1.3;
}
.kpis { display: flex; gap: 10px; color: var(--muted); font-size: 0.82rem; }
.empty {
  background: var(--bg-elev);
  border: 1px dashed var(--line);
  border-radius: 2px;
  padding: 40px;
}

.stack { display: flex; flex-direction: column; gap: 14px; max-width: 820px; }
label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 0.86rem; }
input, textarea, select {
  background: #03140c;
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 2px;
  padding: 11px 13px;
  font: inherit;
  caret-color: var(--gold);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--gold);
  box-shadow: var(--glow);
  outline: none;
}
select {
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2300ff9c' d='M1.2 1.2 6 6l4.8-4.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}
select option {
  background: #03140c;
  color: var(--ink);
}
input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  min-width: 12px;
  min-height: 12px;
  padding: 0;
  margin: 1px 0 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #03140c;
  box-shadow: none;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  color: var(--muted);
  flex: 0 0 12px;
  accent-color: var(--muted);
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:hover,
input[type="radio"]:hover {
  border-color: rgba(148, 163, 156, 0.4);
}
input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background: rgba(148, 163, 156, 0.16);
  border-color: rgba(148, 163, 156, 0.38);
  box-shadow: none;
}
input[type="checkbox"]:checked::after {
  content: "";
  width: 6px;
  height: 3px;
  margin-top: -1px;
  border-left: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
}
input[type="radio"]:checked::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
}
input[type="checkbox"]:focus,
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus,
input[type="radio"]:focus-visible {
  border-color: rgba(148, 163, 156, 0.5);
  box-shadow: none;
  outline: none;
}
input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
  opacity: 0.35;
  cursor: default;
}
label:has(> input[type="checkbox"]):not(.media-tile-pick),
label:has(> input[type="radio"]):not(.mode-chip) {
  flex-direction: row;
  align-items: center;
}
fieldset { border: 1px solid var(--line); border-radius: 2px; padding: 16px; }
.seed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seed-grid > .lede { grid-column: 1 / -1; font-size: 0.8rem; }
.inline-plate { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-plate input { width: 148px; padding: 8px 10px; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }

.consult-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 22px 36px;
  max-width: 1180px;
  margin: 0;
  align-items: start;
}
.consult-shell .mesa-tabs { grid-column: 1 / -1; }
.consult-main { min-width: 0; max-width: 920px; }
.consult-shell.is-single {
  grid-template-columns: minmax(0, 920px);
  max-width: 920px;
}
.consult-shell.is-single .consult-main { max-width: none; }
.consult-shell.is-single .stack { max-width: none; }
.consult-wrap { max-width: 860px; margin: 3vh auto 0; }
.consult-shell .consult-wrap { max-width: none; margin: 0; width: 100%; }
.flow-rail {
  display: flex;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.flow-rail li {
  flex: 1;
  position: relative;
  padding: 0 8px 0 0;
}
.flow-rail li::after {
  content: "";
  display: block;
  height: 1px;
  margin: 8px 12px 0 0;
  background: var(--line);
}
.flow-rail li.is-done { color: var(--gold); }
.flow-rail li.is-done::after { background: var(--gold); box-shadow: var(--glow); }
.flow-rail li.is-now { color: var(--ink); }
.flow-rail li.is-now::after { background: var(--gold); }
.consult-hero { margin-bottom: 26px; }
.consult-hero h1 {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-style: normal;
}
.consult-hero h1::after {
  content: "_";
  animation: blink 1s step-end infinite;
  color: var(--gold);
}
.mode-rail { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.mode-chip {
  flex-direction: row;
  align-items: center;
  gap: 0;
  color: var(--ink);
  cursor: pointer;
}
.mode-chip input { display: none; }
.mode-chip span {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 6px 12px;
  background: rgba(6, 17, 12, 0.9);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}
.mode-chip:hover span, .mode-chip:has(input:checked) span {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold);
  box-shadow: var(--glow);
}
.consult-bar {
  display: flex;
  gap: 10px;
  background: rgba(3, 16, 10, 0.95);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 8px;
  box-shadow: var(--shadow);
}
.consult-bar::before {
  content: "root@osint:~#";
  display: flex;
  align-items: center;
  padding: 0 8px 0 10px;
  color: var(--gold);
  font-family: var(--display);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.consult-bar input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 1.02rem;
  padding: 10px 12px;
  box-shadow: none;
}
.consult-hint { color: var(--muted); font-size: 0.76rem; margin: 12px 0 0; font-family: var(--display); }
.extract-panel {
  margin: 18px 0 0;
  border: 1px dashed var(--line);
  border-radius: 2px;
  background: rgba(6, 17, 12, 0.45);
  padding: 0 14px 4px;
}
.extract-panel > summary {
  cursor: pointer;
  padding: 12px 0;
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--display);
}
.extract-form { display: grid; gap: 10px; padding-bottom: 14px; }
.extract-form textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  background: rgba(2, 8, 5, 0.8);
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
  border-radius: 2px;
}
.extract-hits { margin: 0 0 12px; }
.extract-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.extract-list.compact { margin-bottom: 22px; }
.extract-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: rgba(2, 8, 5, 0.55);
}
.extract-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1;
  cursor: pointer;
}
.extract-chip .type-tag { margin: 0; }
.lookup-form {
  display: flex;
  gap: 10px;
  margin: 0 0 28px;
}
.lookup-form input {
  flex: 1;
  background: rgba(3, 16, 10, 0.95);
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  font-size: 1.02rem;
  padding: 12px 14px;
  border-radius: 2px;
}
.kind-extract { border-color: rgba(94, 234, 212, 0.35); }
.queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  padding: 0 4px 16px;
}
.queue-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.queue-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: rgba(2, 8, 5, 0.55);
}
.queue-row.q-failed, .queue-row.q-fail { border-color: rgba(255, 92, 122, 0.35); }
.queue-row.q-empty { border-color: rgba(255, 225, 74, 0.28); }
.queue-row.q-running { border-color: rgba(0, 255, 156, 0.35); }
.queue-row .muted { display: block; }
.consult-wait {
  color: var(--gold);
  margin: 22px 0;
  display: none;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.htmx-indicator { display: none; }
.htmx-request.htmx-indicator, .htmx-request .htmx-indicator { display: flex; }
.spinner {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(0, 255, 156, 0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.consult-empty {
  margin-top: 28px;
  padding: 22px 24px;
  border: 1px dashed var(--line);
  border-radius: 2px;
  background: rgba(6, 17, 12, 0.55);
}
.consult-empty-kicker {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.empty-steps {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}
.empty-steps li { margin: 8px 0; }
.empty-steps strong { color: var(--ink); }

.consult-chain { margin-top: 22px; }
.consult-chain.is-empty { display: none; margin: 0; }
.chain-box {
  padding: 18px 18px 14px;
  border: 1px dashed var(--line);
  border-radius: 2px;
  background: rgba(6, 17, 12, 0.55);
}
.chain-box.is-linked {
  border-style: solid;
  border-color: var(--gold);
  box-shadow: var(--glow);
}
.chain-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.chain-head h2 { margin: 0 0 6px; font-size: 1.05rem; }
.chain-head .lede { margin: 0; }
.chain-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.chain-graph { margin: 8px 0 16px; }
.chain-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.chain-step { position: relative; padding: 0 0 16px 18px; }
.chain-step::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.chain-step:last-child { padding-bottom: 0; }
.chain-step:last-child::before { display: none; }
.chain-join {
  margin: 0 0 8px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  font-family: var(--display);
}
.chain-node {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  width: 100%;
  text-align: left;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(3, 16, 10, 0.9);
  color: var(--ink);
  cursor: pointer;
}
.chain-node:hover, .chain-step.is-now .chain-node {
  border-color: var(--gold);
  box-shadow: var(--glow);
}
.chain-index {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--display);
  font-size: 0.7rem;
  margin-top: 2px;
}
.chain-body { display: grid; gap: 3px; min-width: 0; }
.chain-body strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chain-node time {
  color: var(--muted);
  font-size: 0.66rem;
  font-family: var(--display);
}
.chain-findings {
  list-style: none;
  margin: 8px 0 0;
  padding: 0 0 0 8px;
  display: grid;
  gap: 4px;
}
.chain-findings li {
  font-size: 0.76rem;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.search-history {
  position: sticky;
  top: 18px;
  padding: 16px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(6, 17, 12, 0.72);
}
.search-history h2 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}
.history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.history-head .eyebrow { margin: 0 0 4px; }
.history-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.history-clear { padding: 4px 8px; font-size: 0.7rem; }
.search-history.is-min .history-filter,
.search-history.is-min .history-list,
.search-history.is-min .history-empty { display: none; }
.search-history.is-min { padding-bottom: 10px; }
.history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.history-replay { margin: 0; }
.history-item {
  display: grid;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 10px 10px 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(3, 16, 10, 0.9);
  color: var(--ink);
  cursor: pointer;
}
.history-item:hover {
  border-color: var(--gold);
  box-shadow: var(--glow);
}
.history-item.is-fail { border-color: rgba(255, 80, 80, 0.35); }
.history-item strong {
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-item .muted {
  font-size: 0.7rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.history-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--display);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.history-kind { color: var(--gold); }
.history-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}
.history-filter {
  width: 100%;
  margin: 0 0 10px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(3, 16, 10, 0.9);
  color: var(--ink);
  font-size: 0.76rem;
}
.chain-idents {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chain-chip {
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 2px;
  font-size: 0.72rem;
  font-family: var(--display);
}
.chain-export { position: absolute; left: -9999px; }

.result-banner { padding: 12px 14px; border-radius: 2px; background: rgba(255, 92, 122, 0.1); border: 1px solid rgba(255, 92, 122, 0.3); margin-top: 22px; }
.result-card {
  margin-top: 22px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 2px;
  padding: 24px;
  box-shadow: var(--shadow);
  animation: rise 0.28s ease;
}
.result-card.kind-plate { border-left-color: var(--green); }
.result-card.kind-username { border-left-color: var(--purple); }
.result-card.kind-phone, .result-card.kind-email { border-left-color: var(--blue); }
.result-card.kind-cnpj { border-left-color: var(--amber); }
.result-card.kind-cpf { border-left-color: var(--red); }
.result-card.kind-cnj, .result-card.kind-processos { border-left-color: var(--red); }
.result-card.kind-negativa { border-left-color: var(--amber); }
.result-card.kind-imovel { border-left-color: var(--gold); }
.result-card.kind-diario { border-left-color: var(--blue); }
.result-head { margin-bottom: 16px; }
.result-head h2 { margin: 4px 0 8px; font-size: 1.35rem; }
.section-kicker {
  color: var(--gold);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 22px 0 10px;
  font-family: var(--display);
}
.section-kicker::before { content: "> "; }
.fact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 0 0 18px; }
.fact-grid dt { color: var(--muted); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; }
.fact-grid dd { margin: 3px 0 0; word-break: break-word; }
.hit-list, .note-list { list-style: none; padding: 0; margin: 0 0 16px; }
.hit-list li, .note-list li { padding: 11px 0; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 2px; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.save-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.save-extra { font-size: 0.76rem; }
.save-extra input { width: 200px; padding: 8px 10px; }

.timeline {
  list-style: none;
  margin: 0 0 22px;
  padding: 0 0 0 18px;
  border-left: 1px solid var(--line);
}
.timeline li {
  position: relative;
  padding: 0 0 18px 16px;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -21px;
  top: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: var(--glow);
}
.timeline .tl-when {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.timeline .tl-social::before { background: var(--purple); }
.timeline .tl-org::before { background: var(--amber); }
.timeline .tl-owner::before, .timeline .tl-alert::before { background: var(--red); }
.timeline .tl-web::before { background: var(--blue); }
.timeline .tl-vehicle::before, .timeline .tl-plate::before { background: var(--green); }
.timeline .tl-evidence::before { background: var(--blue); }
.timeline .tl-verdict::before { background: var(--amber); }
.timeline .tl-task::before { background: var(--purple); }
.timeline .tl-monitor::before { background: var(--gold); }
.year-slider { display: flex; align-items: center; gap: 8px; min-width: 0; }
.year-slider input[type="range"] { width: 110px; }
.search-all-form { display: flex; align-items: center; flex: 0 0 auto; }
.search-all-btn {
  appearance: none;
  height: 30px;
  padding: 0 14px;
  border: 1px solid #8a303c;
  border-radius: 999px;
  background: #5a121c;
  color: #ff8a96;
  font: inherit;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(180, 32, 48, 0.25);
}
.search-all-btn:hover { background: #7a1824; color: #fff; border-color: #c44; }
.track-group,
.track-shell {
  display: flex;
  align-items: center;
  height: 30px;
  padding: 2px;
  background: rgba(4, 21, 13, 0.55);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: none;
}
.track-group { gap: 0; }
.track-kicker {
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0 8px 0 10px;
  flex: 0 0 auto;
}
.track-item {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 26px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.74rem;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}
.track-item:hover { color: var(--ink); }
.view-tab.track-item.is-active,
.chip.track-item.is-on,
.chip.track-item:has(input:checked) {
  background: rgba(148, 163, 156, 0.14);
  color: var(--ink);
  box-shadow: none;
}
.track-shell {
  gap: 10px;
  padding: 0 12px;
}
.track-shell > span { color: var(--muted); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; }
.graph-search.track-shell input,
.year-slider.track-shell input[type="search"] {
  min-width: 180px;
  height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}
.graph-search.track-shell input:focus,
.year-slider.track-shell input:focus {
  border: 0;
  box-shadow: none;
}
.year-slider.track-shell,
.year-range.track-shell {
  min-width: 0;
  flex: 1 1 280px;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}
.year-range .year-kicker {
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex: 0 0 auto;
}
.year-range .year-end,
.year-range .year-span,
.year-slider.track-shell output {
  min-width: 3.2ch;
  color: var(--muted);
  font-size: 0.72rem;
  flex: 0 0 auto;
}
.year-mid {
  flex: 1 1 140px;
  min-width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.year-range .year-span {
  min-width: 0;
  max-width: 100%;
  text-align: center;
  color: var(--ink);
  line-height: 1.1;
}
.year-track {
  position: relative;
  flex: 1 1 120px;
  min-width: 88px;
  height: 18px;
}
.year-track input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  width: 100%;
  height: 2px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
  transform: translateY(-50%);
}
.year-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  border-radius: 999px;
  background: var(--line);
  transform: translateY(-50%);
}
.year-track::after {
  content: "";
  position: absolute;
  left: var(--year-from, 0%);
  width: var(--year-span, 100%);
  top: 50%;
  height: 2px;
  border-radius: 999px;
  background: #6f9b82;
  transform: translateY(-50%);
}
.year-slider.track-shell input[type="range"],
.year-track input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 999px;
  background: transparent;
}
.year-slider.track-shell input[type="range"]::-webkit-slider-thumb,
.year-track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--muted);
  border: 1px solid var(--line);
  box-shadow: none;
  cursor: pointer;
  pointer-events: auto;
}
.year-track input[type="range"]::-moz-range-track {
  height: 2px;
  border: 0;
  background: transparent;
}
.year-track input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  border: 1px solid var(--line);
  box-shadow: none;
  cursor: pointer;
  pointer-events: auto;
}

.mini-graph {
  height: auto;
  min-height: 0;
  width: 100%;
  margin: 0 0 22px;
  border: 1px solid var(--line);
  background: #080d0a;
  padding: 14px 14px 8px;
}
.mini-graph.is-tree { overflow: auto; }
.tree-caption {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.8rem;
  max-width: 72ch;
  line-height: 1.45;
}
.tree-board { overflow-x: auto; }
.tree-board svg { display: block; min-width: 100%; }
.tree-node rect {
  fill: #101814;
  stroke: #3a4f44;
  stroke-width: 1;
}
.tree-node.is-seed rect { stroke: #6f9b82; stroke-width: 1.4; fill: #13201a; }
.tree-node.kind-org rect { stroke: #8a7d55; }
.tree-node.kind-person rect, .tree-node.kind-owner rect { stroke: #5d7a88; }
.tree-node.kind-profile rect, .tree-node.kind-email rect { stroke: #5e7a62; }
.tree-node.kind-vehicle rect { stroke: #4f7a68; }
.tree-kicker {
  fill: #7d9486;
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--display);
}
.tree-title { fill: #e4efe8; font-size: 11px; font-family: var(--font); }
.tree-sub { fill: #7d9486; font-size: 9px; font-family: var(--font); }
.tree-edge { fill: #8aa394; font-size: 8px; font-family: var(--display); letter-spacing: 0.04em; }
.tree-key-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 12px 0 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.tree-key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.72rem;
}
.tree-key i {
  width: 14px;
  height: 9px;
  border: 1px solid #3a4f44;
  background: #101814;
  display: inline-block;
}
.tree-key.kind-org i { border-color: #8a7d55; }
.tree-key.kind-person i, .tree-key.kind-owner i { border-color: #5d7a88; }
.tree-key.kind-profile i, .tree-key.kind-email i { border-color: #5e7a62; }
.tree-key.kind-vehicle i { border-color: #4f7a68; }
.tree-reads-kicker {
  margin: 12px 0 6px;
  color: var(--gold);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--display);
}
.tree-reads {
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}
.tree-reads li {
  padding: 7px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}
.tree-reads strong { color: var(--ink); font-weight: 500; }

.graph-panel {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  min-height: 68vh;
  margin: 0 0 18px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.graph-stage { position: relative; flex: 1; min-height: 560px; display: flex; border-top: 1px solid var(--line); overflow: hidden; }
.graph-balloon {
  position: fixed;
  z-index: 80;
  width: 260px;
  max-width: min(92vw, 380px);
  max-height: min(70vh, 560px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px 12px;
  background: #04150d;
  border: 1px solid var(--gold);
  border-radius: 2px;
  box-shadow: var(--glow);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(6px) scale(0.96);
  transform-origin: top left;
  transition: width 0.22s ease, opacity 0.18s ease, transform 0.22s ease, box-shadow 0.22s ease;
}
.graph-balloon.is-visible {
  opacity: 1;
  transform: none;
}
.graph-balloon.is-open {
  width: min(360px, calc(100vw - 24px));
  padding: 14px 16px;
  box-shadow: var(--glow), var(--shadow);
}
.graph-balloon.is-open:has(.graph-balloon-map),
.graph-balloon.is-open:has(.graph-balloon-thumb) {
  width: min(440px, calc(100vw - 24px));
}
.graph-balloon.is-open:has(.graph-balloon-preview):not(:has(.graph-balloon-thumb)):not(:has(.graph-balloon-map)) {
  width: min(320px, calc(100vw - 24px));
}
.graph-balloon-preview {
  margin: 0 0 10px;
}
.graph-balloon-kicker {
  margin: 0 0 6px;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold);
}
.graph-balloon-story-title {
  margin: 8px 0 0;
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--text);
}
.graph-balloon-desc {
  margin: 6px 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}
.graph-balloon-embed {
  display: block;
  width: 100%;
  height: 228px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #020604;
}
.graph-balloon-pdf {
  height: 260px;
}
.graph-balloon-pdf-thumb {
  max-height: 280px;
  object-fit: contain;
  background: #120e08;
}
.graph-balloon h2 {
  margin: 4px 0 6px;
  font-size: 0.95rem;
  line-height: 1.3;
  word-break: break-word;
}
.graph-balloon-lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.4;
}
.graph-balloon.is-open .graph-balloon-lead { margin-bottom: 10px; }
.graph-balloon .fact-grid { margin: 8px 0 0; grid-template-columns: 1fr; gap: 8px; }
.graph-balloon { cursor: pointer; }
.graph-balloon-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.politica-block {
  margin: 10px 0 4px;
  padding: 8px 10px 10px;
  border: 1px solid #2a4a34;
  background: #0c1610;
  border-radius: 4px;
}
.politica-kicker {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d4b45a;
}
.politica-facts { margin-top: 0 !important; }
.queue-complete {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: #8aa394;
}
.queue-complete strong { color: #d7e4dc; }
.processo-block {
  margin: 10px 0 4px;
  padding: 8px 10px 10px;
  border: 1px solid #5a3a3a;
  background: #161010;
  border-radius: 4px;
}
.split-list h2 + .table { margin-bottom: 18px; }
.social-preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 10px;
}
.social-preview-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex: 0 0 auto;
}
.graph-balloon-thumb {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  background: #020604;
  border: 1px solid var(--line);
  border-radius: 2px;
}
.graph-balloon-map {
  position: relative;
  display: block;
  width: 100%;
  height: 228px;
  overflow: hidden;
  border: 1px solid var(--gold);
  border-radius: 2px;
  box-shadow: var(--glow);
}
.graph-menu {
  position: fixed;
  z-index: 85;
  min-width: 228px;
  padding: 6px;
  background: #04150d;
  border: 1px solid var(--gold);
  border-radius: 2px;
  box-shadow: var(--glow), var(--shadow);
}
.graph-menu[hidden] { display: none; }
.graph-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--ink);
  font: inherit;
  padding: 8px 10px;
  cursor: pointer;
}
.graph-menu button:hover { background: var(--gold-soft); color: var(--gold); }
.graph-menu .sep { height: 1px; margin: 4px 6px; background: var(--line); }
.graph-menu .k { color: var(--muted); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 10px 2px; }
.graph-menu .picks { padding: 2px 4px 6px; }
.graph-menu label.chk {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.78rem;
  line-height: 1.35;
}
.graph-menu label.chk:hover { background: var(--gold-soft); color: var(--gold); }
.graph-menu label.chk input { margin: 0; }
.graph-composer {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 8, 5, 0.72);
}
.graph-composer[hidden] { display: none; }
.graph-composer-panel {
  width: min(440px, 94vw);
  padding: 18px 18px 16px;
  background: #04150d;
  border: 1px solid var(--gold);
  box-shadow: var(--glow), var(--shadow);
}
.graph-composer-panel input[type="file"] {
  width: 100%;
  padding: 6px 0;
  color: var(--ink);
  font: inherit;
}
.graph-stage.is-linking #cy,
.graph-stage.is-selecting #cy { cursor: crosshair; }
.graph-stage.is-selecting { user-select: none; }
.graph-lasso {
  position: absolute;
  z-index: 38;
  border: 1px dashed #00ff9c;
  background: rgba(0, 255, 156, 0.12);
  pointer-events: none;
}
.graph-lasso[hidden] { display: none; }
.graph-select-bar {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(4, 21, 13, 0.94);
  border: 1px solid var(--gold);
  box-shadow: var(--glow), var(--shadow);
}
.graph-select-bar[hidden] { display: none; }
.graph-select-bar p { margin: 0; font-size: 0.78rem; color: var(--ink); white-space: nowrap; }
.graph-stage.is-split .graph-canvas { flex: 1.4; }
.graph-canvas { position: relative; flex: 1; min-width: 0; min-height: 520px; display: flex; }
.graph-canvas[hidden],
#cy[hidden],
#org-map[hidden] { display: none !important; }
.graph-stage.is-map .graph-canvas { display: none !important; }
.graph-stage.is-map .canvas-tools,
.graph-stage.is-map .canvas-layers,
.graph-stage.is-map .graph-select-bar { display: none !important; }
.graph-stage.is-map #org-map {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  align-self: stretch;
}
.graph-stage.is-map #org-map.leaflet-container {
  width: 100% !important;
  height: 100% !important;
}
.split-list { width: 340px; overflow: auto; background: #020604; padding: 12px; border-right: 1px solid var(--line); }
.split-list h2 { margin: 0 0 8px; font-size: 1rem; }
.split-list tr { cursor: pointer; }
#cy { flex: 1; min-height: 520px; background: #020604; }
#cy.is-dead {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}
#cy canvas { background: transparent !important; }
#cy.is-dots,
.graph-stage.is-dots #cy {
  background-color: #020604;
  background-image: radial-gradient(rgba(200, 255, 212, 0.22) 1px, transparent 1.2px);
  background-size: 18px 18px;
}
.canvas-tools {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 36;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.graph-stage.is-split .canvas-tools { left: 352px; }
.canvas-tools-group {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  background: rgba(4, 21, 13, 0.92);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.canvas-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.canvas-tools-group .canvas-btn:last-child { border-bottom: 0; }
.canvas-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: square;
  stroke-linejoin: miter;
}
.canvas-btn svg circle { fill: currentColor; stroke: none; }
.canvas-btn:hover,
.canvas-btn[aria-pressed="true"],
.canvas-btn[aria-expanded="true"] {
  background: var(--gold-soft);
  color: var(--gold);
}
.canvas-btn:disabled { opacity: 0.35; cursor: default; }
.canvas-layers {
  position: absolute;
  left: 56px;
  top: 50%;
  transform: translateY(-18%);
  z-index: 37;
  min-width: 148px;
  padding: 8px;
  background: rgba(4, 21, 13, 0.96);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.graph-stage.is-split .canvas-layers { left: 396px; }
.canvas-layers label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  color: var(--muted);
  font-size: 0.78rem;
}
.canvas-layers label:hover { color: var(--gold); }
#org-map {
  position: relative;
  flex: 1;
  min-height: 520px;
}
#org-map,
.graph-balloon-map,
.geo-stage {
  background:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 255, 156, 0.015) 2px, rgba(0, 255, 156, 0.015) 4px),
    #020604;
}
#org-map .leaflet-container,
.geo-stage .leaflet-container {
  background: #020604;
  font-family: var(--font);
  color: var(--ink);
}
#org-map.is-street .leaflet-tile-pane,
.geo-stage.is-street .leaflet-tile-pane {
  filter: grayscale(0.35) sepia(0.55) hue-rotate(72deg) saturate(1.8) brightness(0.72) contrast(1.15);
  opacity: 0.92;
}
.geo-basemap.track-group {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 500;
  background: rgba(4, 21, 13, 0.9);
  border-color: var(--gold);
  box-shadow: var(--glow);
}
.graph-balloon-map .geo-basemap { top: 8px; left: 8px; }
.geo-basemap .track-item.is-active {
  background: rgba(148, 163, 156, 0.16);
  color: var(--gold);
}
#org-map .leaflet-control-zoom,
.geo-stage .leaflet-control-zoom {
  border: 1px solid var(--gold) !important;
  border-radius: 2px !important;
  box-shadow: var(--glow) !important;
  overflow: hidden;
}
#org-map .leaflet-control-zoom a,
.geo-stage .leaflet-control-zoom a {
  background: #04150d !important;
  color: var(--gold) !important;
  border-bottom: 1px solid var(--line) !important;
  width: 30px;
  height: 30px;
  line-height: 30px;
  font-family: var(--display);
}
#org-map .leaflet-control-zoom a:hover,
.geo-stage .leaflet-control-zoom a:hover { background: var(--gold-soft) !important; }
#org-map .leaflet-control-attribution,
.geo-stage .leaflet-control-attribution {
  background: rgba(4, 21, 13, 0.86) !important;
  color: var(--muted) !important;
  font-family: var(--font);
  font-size: 0.68rem;
  border: 1px solid var(--line);
}
#org-map .leaflet-control-attribution a,
.geo-stage .leaflet-control-attribution a { color: var(--gold) !important; }
#org-map .leaflet-popup-content-wrapper,
#org-map .leaflet-popup-tip {
  background: #04150d;
  color: var(--ink);
  border-radius: 2px;
  box-shadow: var(--glow), var(--shadow);
}
#org-map .leaflet-popup-content-wrapper {
  border: 1px solid var(--gold);
  padding: 0;
}
#org-map .leaflet-popup-content { margin: 12px 14px 14px; }
#org-map .leaflet-popup-close-button { color: var(--gold) !important; }
.geo-pop .type-tag { margin: 0; }
.geo-pop strong { display: block; margin: 4px 0 8px; font-size: 0.95rem; }
.geo-pop p { margin: 0 0 6px; }
.geo-pop .btn { margin-top: 8px; }
.geo-mark {
  background: transparent;
  border: 0;
}
.geo-core {
  display: block;
  width: 10px;
  height: 10px;
  margin: 6px;
  background: var(--gold);
  box-shadow: var(--glow);
  transform: rotate(45deg);
}
.geo-pulse {
  position: absolute;
  inset: 0;
  border: 1px solid var(--gold);
  opacity: 0.45;
  animation: geo-ping 1.8s ease-out infinite;
}
@keyframes geo-ping {
  0% { transform: scale(0.4); opacity: 0.7; }
  100% { transform: scale(1.6); opacity: 0; }
}
.geo-hud {
  position: absolute;
  top: 12px;
  left: auto;
  right: 12px;
  z-index: 500;
  min-width: 180px;
  padding: 10px 12px;
  background: rgba(4, 21, 13, 0.88);
  border: 1px solid var(--gold);
  box-shadow: var(--glow);
  pointer-events: none;
}
.geo-hud .eyebrow { margin: 0; }
.geo-hud strong {
  display: block;
  font-family: var(--display);
  font-size: 1.4rem;
  color: var(--gold);
  text-shadow: var(--glow);
}
.geo-hud span { color: var(--muted); font-size: 0.72rem; }
.view-tabs { display: flex; }
.view-tab { border: 0; }
.graph-toolbar {
  position: relative;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 10px;
  margin: 0;
  padding: 8px 12px;
  background: #04150d;
  border-bottom: 1px solid var(--line);
  overflow: visible;
}
.graph-search.track-shell {
  flex: 0 1 180px;
  min-width: 132px;
  max-width: 220px;
}
.graph-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0; }
.filter-kicker {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-right: 4px;
}
.chip { cursor: pointer; }
.graph-search { margin: 0; }
.legend { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 0.78rem; flex-wrap: wrap; }
.dot { width: 12px; height: 8px; border-radius: 1px; display: inline-block; margin-right: 4px; border: 1px solid currentColor; background: #121a16; box-shadow: none; }
.dot.person { border-color: #5d7a88; color: #5d7a88; }
.dot.org { border-color: #8a7d55; color: #8a7d55; }
.dot.case { border-color: #8a5d5d; color: #8a5d5d; }
.dot.profile { border-color: #5e7a62; color: #5e7a62; }
.dot.asset { border-color: #4f7a68; color: #4f7a68; }
.dot.pub { border-color: #6a7a70; color: #6a7a70; }
.dot.note { border-color: #b8a15a; color: #b8a15a; }

.case-board {
  position: relative;
  z-index: 2;
  margin: 0 0 14px;
  padding: 10px 14px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 2px;
}
.case-board > summary {
  cursor: pointer;
  color: var(--gold);
  font-family: var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.board-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  margin-top: 12px;
}
.board-grid h2 { margin: 0 0 8px; font-size: 1rem; }
.note-tree { list-style: none; padding-left: 0; margin: 0 0 14px; }
.note-tree ul { padding-left: 16px; border-left: 1px solid var(--line); }
.note-card {
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.note-card p { margin: 4px 0; }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); }
@media (max-width: 900px) {
  .board-grid { grid-template-columns: 1fr; }
}

.more-menu { position: relative; }
.more-menu > summary { list-style: none; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-panel.case-dossier {
  min-width: min(640px, 92vw);
  max-height: min(80vh, 720px);
}
.seed-grid.compact { gap: 8px; }
.seed-grid.compact label { font-size: 0.78rem; }
.dossier-chips {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dossier-chips li {
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: #04150d;
  font-size: 0.74rem;
  color: var(--ink);
}
.dossier-chips li span {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 6px;
  font-size: 0.64rem;
}
.dossier-chips li.is-seed { border-color: var(--gold); }
.more-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  min-width: 320px;
  max-height: min(78vh, 640px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: var(--shadow);
}
.tool-pick {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.tool-pick .section-kicker { margin: 4px 0 0; }
.tool-pick .muted { margin: 0 0 4px; font-size: 0.74rem; line-height: 1.4; }
.tool-pick label {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 8px;
  margin: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  background: #020604;
  color: var(--ink);
  font-size: 0.78rem;
}
.tool-pick label.is-off { opacity: 0.42; }
.tool-pick input { margin-top: 3px; }
.tool-pick strong { display: block; color: var(--gold); font-weight: 500; }
.tool-pick small { display: block; color: var(--muted); font-size: 0.7rem; }
.tool-pick .btn { align-self: stretch; text-align: center; }

.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 16px;
  min-width: 0;
}
.source-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  height: auto;
  overflow: visible;
  border: 1px solid var(--line);
  padding: 12px 14px 14px;
  background: #04150d;
}
.source-grid .source-card {
  height: 100%;
  min-height: 300px;
  padding: 18px 20px 20px;
  gap: 12px;
}
.source-grid .source-card h3 { font-size: 1.05rem; }
.source-grid .source-card p,
.source-grid .source-card a,
.source-grid .source-card code { font-size: 0.86rem; }
.source-grid .source-facts { margin-top: auto; }
.source-card header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 0;
}
.source-card h3 { margin: 0; flex: 1 1 8ch; min-width: 0; font-size: 0.95rem; overflow-wrap: anywhere; }
.source-card p,
.source-card a,
.source-card code {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.source-card a { color: var(--gold); display: inline-block; max-width: 100%; }
.source-card.is-pronta { border-color: rgba(0, 255, 156, 0.28); }
.source-card.is-parcial { border-color: rgba(255, 225, 74, 0.35); }
.source-card.is-precisa-chave { border-color: rgba(255, 225, 74, 0.45); }
.source-card.is-desligada { opacity: 0.55; }
.source-card.is-embutido { border-color: rgba(0, 255, 156, 0.28); }
.source-card.is-equivalente { border-color: rgba(94, 234, 212, 0.28); }
.source-card.is-parcial { border-color: rgba(255, 225, 74, 0.35); }
.source-card.is-fora { opacity: 0.62; border-color: rgba(255, 92, 122, 0.35); }
.source-facts { margin: 0; grid-template-columns: 1fr; gap: 6px; }
.source-facts dt { color: var(--gold); font-size: 0.68rem; }
.source-facts dd { margin: 0; font-size: 0.78rem; }
.panel { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 2px; padding: 16px 18px; margin-bottom: 16px; }
.panel h2 { margin-top: 0; font-size: 1.05rem; }
.table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; }
.plain { padding-left: 18px; }
.attrs { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; }
.attrs dt { color: var(--muted); }
.evidence { list-style: none; padding: 0; }
.evidence li { border-top: 1px solid var(--line); padding: 10px 0; }
.muted { color: var(--muted); font-size: 0.78rem; }
.type-tag { color: var(--gold); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; margin: 0; font-family: var(--display); }
.type-tag::before { content: "[ "; }
.type-tag::after { content: " ]"; }
.crumb { color: var(--muted); font-size: 0.82rem; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 255, 156, 0.02) 2px, rgba(0, 255, 156, 0.02) 4px),
    radial-gradient(700px 360px at 80% 0%, rgba(0, 255, 156, 0.1), transparent 50%),
    var(--bg);
}
.login-card {
  width: min(420px, 92vw);
  background: var(--bg-elev);
  border: 1px solid var(--gold);
  border-radius: 2px;
  padding: 32px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--glow), var(--shadow);
}
.brand-mark {
  font-family: var(--display);
  font-size: 1.8rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-shadow: var(--glow);
}
.brand-mark::after { content: "_"; animation: blink 1s step-end infinite; }
.fine { color: var(--muted); font-size: 0.76rem; }

.tools-layout { display: grid; grid-template-columns: 1fr 320px; gap: 12px; min-height: 0; flex: 1; }
#framework-tree { overflow: auto; background: #020604; border: 1px solid var(--line); border-radius: 2px; min-height: 520px; }
.tool-drawer { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 2px; padding: 16px; }
.tool-drawer[hidden] { display: none; }
.tools-toolbar { flex-wrap: wrap; }
.flag { border: 1px solid var(--line); border-radius: 2px; padding: 0 5px; font-size: 0.72rem; color: var(--muted); }
.dot.folder { background: var(--gray); }
.dot.tool { background: var(--blue); }
.dot.br { background: var(--gold); }

details.advanced { border: 1px solid var(--line); border-radius: 2px; padding: 10px 14px; }
details.advanced summary { cursor: pointer; color: var(--muted); }

#tooltip {
  position: fixed;
  z-index: 90;
  max-width: 280px;
  padding: 8px 11px;
  border-radius: 2px;
  background: #03140c;
  border: 1px solid var(--gold);
  color: var(--ink);
  font-size: 0.74rem;
  line-height: 1.4;
  cursor: pointer;
  box-shadow: var(--glow);
}

.inspect-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 8, 5, 0.78);
}
.inspect-overlay[hidden] { display: none; }
.inspect-list {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}
.inspect-list li {
  padding: 7px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.82rem;
}
.inspect-panel {
  width: min(640px, 96vw);
  max-height: min(88vh, 820px);
  overflow: auto;
  padding: 22px 22px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--gold);
  border-radius: 2px;
  box-shadow: var(--glow), var(--shadow);
}
.inspect-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.inspect-head h2 { margin: 4px 0 0; font-size: 1.2rem; word-break: break-word; }
.inspect-lock {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 0.74rem;
  font-family: var(--display);
}
.inspect-actions { display: flex; flex-wrap: wrap; gap: 8px; }
button.inspect-open {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold);
  text-align: left;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
button.inspect-open:hover { color: var(--ink); }
.inspect-hint { cursor: help; }
body.inspect-open-body { overflow: hidden; }

.alvo-tree { display: flex; flex-direction: column; gap: 18px; margin-bottom: 22px; }
.alvo-group {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
}
.alvo-group h2 { margin: 0 0 12px; font-size: 1rem; }
.alvo-field { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; margin-bottom: 10px; }
.alvo-field:last-child { margin-bottom: 0; }

.manual { max-width: 1120px; }
.manual-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 36px;
  align-items: start;
}
.manual-toc {
  position: sticky;
  top: 18px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 14px 16px 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
}
.manual-toc ol {
  margin: 0;
  padding: 0 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}
.manual-toc a { color: var(--muted); text-decoration: none; }
.manual-toc a:hover { color: var(--gold); }
.manual-body { min-width: 0; }
.manual-section {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 16px;
}
.manual-section:last-child { border-bottom: 0; }
.manual-section h2 { margin: 6px 0 12px; font-size: 1.15rem; }
.manual-section p, .manual-section li { color: var(--ink); line-height: 1.55; max-width: 72ch; }
.manual-section ul, .manual-section ol { margin: 0 0 12px; padding-left: 1.2rem; }
.manual-section code, .manual-section kbd {
  font-size: 0.82em;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0 5px;
  background: rgba(255, 255, 255, 0.03);
}
.manual-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  margin: 10px 0 16px;
}
.manual-table th, .manual-table td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.manual-table th { color: var(--gold); font-family: var(--display); font-weight: 400; letter-spacing: 0.06em; }
.manual-dl { display: grid; gap: 12px; margin: 0 0 12px; }
.manual-dl dt { color: var(--gold); font-family: var(--display); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.78rem; }
.manual-dl dd { margin: 4px 0 0; max-width: 72ch; }

.media-board {
  position: relative;
  z-index: 2;
  margin: 18px 0 0;
  clear: both;
}
.media-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin: 12px 0 0;
}
.media-toolbar .muted { margin: 0; max-width: 52ch; }
.media-combos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}
.media-combos li {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}
.media-notes { margin: 8px 0 0; color: var(--muted); }
.media-notes p { margin: 0 0 8px; max-width: 72ch; }
.media-notes.is-empty {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  background: #04150d;
}
.media-slot { margin-top: 14px; min-height: 8px; }
.media-news { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 12px; }
.media-news li {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 10px 12px;
  background: var(--bg-elev);
}
.media-news p { margin: 6px 0 0; }
.media-gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.media-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 2px;
  overflow: hidden;
}
.media-tile img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  background: #111;
}
.media-tile span {
  display: block;
  padding: 0 8px 8px;
  font-size: 0.74rem;
  color: var(--muted);
}
.media-picker { margin: 0; }
.media-case-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}
.media-news li.media-pick {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 12px;
  align-items: start;
}
.media-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  cursor: pointer;
}
.media-check input { margin-top: 4px; }
.media-pick-body strong { display: block; }
.media-pick-body .tl-when,
.media-pick-body .muted { margin-right: 8px; }
.media-gallery li.media-pick-img {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  border-radius: 2px;
  overflow: hidden;
  padding: 0 0 8px;
}
.media-tile-pick {
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  position: relative;
}
.media-tile-pick input {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
}
.media-tile-pick img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  background: #111;
}
.media-tile-pick span {
  display: block;
  padding: 0 8px;
  font-size: 0.74rem;
  color: var(--muted);
}
.media-fonte {
  display: inline-block;
  margin-top: 6px;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
}
.media-fonte:hover { text-shadow: 0 0 8px rgba(0, 255, 156, 0.45); }
.media-page-url {
  word-break: break-all;
  font-size: 0.68rem;
}
.media-picker-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 14px;
}
.media-picker-actions .muted { margin: 0; max-width: 52ch; }
.media-add-status { margin: 10px 0 0; color: var(--muted); }
.media-add-status:empty { display: none; }
.inspect-thumb {
  display: block;
  max-width: 100%;
  max-height: 280px;
  margin: 0 0 12px;
  border: 1px solid var(--line);
}
.identity-board { margin: 18px 0 0; }
.identity-queue {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.identity-col {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  padding: 10px 12px;
  border-radius: 2px;
}
.identity-col h3 { margin: 0 0 8px; font-size: 0.82rem; }
.identity-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.identity-col li p { margin: 4px 0 0; }
.match-card .fact-grid { margin-top: 10px; }
@media (max-width: 1100px) {
  .identity-queue { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 800px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .seed-grid { grid-template-columns: 1fr; }
  .page-head, .graph-bar { flex-direction: column; }
  .tools-layout { grid-template-columns: 1fr; }
  .consult-bar { flex-direction: column; }
  .consult-bar::before { padding: 8px 10px 0; }
  .main { padding: 22px 18px 40px; }
  .consult-shell { grid-template-columns: 1fr; margin-top: 0; }
  .consult-wrap { margin-top: 0; }
  .search-history { position: static; }
  .chain-head { flex-direction: column; }
  .flow-rail { display: none; }
  .manual-layout { grid-template-columns: 1fr; }
  .manual-toc { position: static; }
}

.mesa-tabs {
  display: flex;
  gap: 0;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.mesa-tab {
  padding: 8px 14px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.mesa-tab.is-on {
  color: var(--ink);
  border-bottom-color: var(--gold);
}
.nav-badge {
  display: inline-block;
  margin-left: 6px;
  min-width: 1.25rem;
  padding: 0 5px;
  border-radius: 8px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 11px;
  text-align: center;
}
.desk-digest {
  margin: 0 0 22px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  background: var(--gold-soft);
}
.desk-digest .hit-list { margin: 0; }
.desk-digest .hit-list li { padding: 8px 0; }
.copy-cite {
  align-self: flex-start;
  margin-top: 4px;
  font-size: 11px;
}
