:root {
  color-scheme: light;
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-2: #edf3f7;
  --surface-3: #f9fbfc;
  --text: #17202a;
  --ink: #101828;
  --muted: #657384;
  --line: #d8e0e8;
  --accent: #0d9488;
  --accent-strong: #0f766e;
  --info: #1d4ed8;
  --danger: #b42318;
  --warn: #b7791f;
  --review: #4c6fff;
  --trail: #677489;
  --person: #2563eb;
  --company: #475569;
  --campaign: #7c3aed;
  --public-body: #047857;
  --finding: #b42318;
  --shadow: 0 12px 36px rgba(23, 32, 42, 0.08);
  --shadow-soft: 0 8px 22px rgba(23, 32, 42, 0.06);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-view {
  min-height: 100vh;
  display: flex;
  background: #f5f8fc;
}

.login-layout {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(460px, 1.05fr) minmax(420px, 0.95fr);
}

.login-hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 30px;
  padding: clamp(40px, 8vw, 96px);
  background:
    radial-gradient(circle at 24% 18%, rgba(20, 184, 166, 0.16), transparent 28%),
    linear-gradient(135deg, #061522 0%, #08263f 52%, #061522 100%);
  color: #f8fafc;
}

.login-hero::before,
.login-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.login-hero::before {
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.08) 1px, transparent 1px);
  background-size: 92px 92px;
  opacity: 0.45;
}

.login-hero::after {
  background:
    linear-gradient(180deg, transparent 0 12%, rgba(34, 211, 238, 0.22) 12% 38%, transparent 38%),
    linear-gradient(180deg, transparent 0 58%, rgba(16, 185, 129, 0.2) 58% 76%, transparent 76%);
  background-position: 18% 0, 76% 0;
  background-repeat: no-repeat;
  background-size: 2px 100%, 2px 100%;
  opacity: 0.7;
}

.login-hero-copy {
  position: relative;
  z-index: 1;
}

.login-hero-copy {
  max-width: 650px;
}

.login-eyebrow {
  margin: 0 0 16px;
  color: #5eead4;
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.login-hero h1 {
  max-width: 650px;
  margin: 0;
  color: #f8fafc;
  font-size: clamp(42px, 5vw, 68px);
  line-height: 1.02;
}

.login-hero-copy p:not(.login-eyebrow) {
  max-width: 560px;
  margin: 24px 0 0;
  color: #b8c7d8;
  font-size: 18px;
  line-height: 1.55;
}

.login-card {
  width: min(440px, calc(100% - 48px));
  align-self: center;
  justify-self: center;
  display: grid;
  gap: 18px;
  padding: 8px 0;
  color: var(--ink);
}

.login-brand {
  display: grid;
  justify-items: start;
  margin-bottom: 8px;
}

.login-heading {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.login-heading h2 {
  margin: 0;
  color: #0f172a;
  font-size: 30px;
  line-height: 1.2;
}

.login-heading p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

.login-card label {
  display: grid;
  gap: 8px;
  color: #334155;
  font-size: 14px;
  font-weight: 850;
}

.login-card input {
  min-height: 50px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 12px 14px;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 650;
}

.login-card input:focus {
  outline: 3px solid rgba(13, 148, 136, 0.18);
  border-color: var(--accent);
  background: #ffffff;
}

.login-submit {
  min-height: 50px;
  margin-top: 4px;
  border-radius: 6px;
  background: #0d5bd7;
  font-size: 15px;
}

.login-submit:hover {
  background: #0b4db7;
}

.login-error {
  margin: 0;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  background: #fef2f2;
  color: var(--danger);
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 750;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid #1b2a37;
  background: #0f1720;
  color: #f8fafc;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: grid;
  justify-items: center;
  padding: 2px 0 6px;
}

.brand-logo {
  display: block;
  width: 100%;
  object-fit: contain;
}

.login-logo {
  max-width: 290px;
  max-height: 175px;
}

.sidebar-logo {
  max-width: 210px;
  max-height: 130px;
}

.sidebar-section-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.sidebar-section-title span,
.sidebar-section-title small {
  display: block;
}

.sidebar-section-title span {
  color: #f8fafc;
  font-size: 13px;
  font-weight: 850;
}

.sidebar-section-title small {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 750;
}

.primary,
.ghost {
  border: 0;
  border-radius: 8px;
  min-height: 36px;
  padding: 8px 12px;
  font-weight: 750;
}

.primary {
  background: var(--accent);
  color: white;
}

.primary:hover {
  background: var(--accent-strong);
}

.pipeline-form {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: #16212b;
  padding: 12px;
}

.pipeline-form label {
  display: grid;
  gap: 5px;
  color: #adbac7;
  font-size: 12px;
  font-weight: 800;
}

.pipeline-form input {
  min-height: 34px;
  border-color: rgba(255, 255, 255, 0.18);
  background: #0f1720;
  color: #f8fafc;
}

.pipeline-form input::placeholder {
  color: #738091;
}

.pipeline-grid {
  display: grid;
  grid-template-columns: 0.7fr 1fr;
  gap: 8px;
}

.ghost {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.ghost:hover {
  background: var(--surface-2);
}

.ghost.active {
  border-color: #99d8d1;
  background: #e5f6f3;
  color: var(--accent-strong);
}

.investigation-list {
  display: grid;
  gap: 8px;
}

.investigation-item {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #16212b;
  color: #eef2f5;
  padding: 12px;
  text-align: left;
}

.investigation-item.active {
  border-color: #5eead4;
  background: #1e303b;
}

.investigation-item strong,
.investigation-item span {
  display: block;
}

.investigation-item span {
  color: #adbac7;
  margin-top: 4px;
  font-size: 13px;
}

.workspace {
  padding: 24px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 17px;
}

h3 {
  font-size: 14px;
}

.caution {
  max-width: 760px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.artifact-links {
  min-width: 360px;
  max-width: min(640px, 48vw);
}

.topbar-actions {
  min-width: 360px;
  max-width: min(640px, 48vw);
  display: grid;
  gap: 10px;
  justify-items: end;
}

.topbar-actions .artifact-links {
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.session-pill {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.session-pill .ghost {
  min-height: 30px;
  padding: 6px 10px;
}

.app-notice {
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 750;
}

.app-notice.success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.app-notice.error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #991b1b;
}

.artifact-panel {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.artifact-panel.empty {
  color: var(--muted);
  font-size: 13px;
}

.artifact-primary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.artifact-action,
.artifact-format-link {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.artifact-action {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 800;
}

.artifact-action:first-child {
  border-color: rgba(15, 118, 110, 0.28);
  background: #e6f4f1;
  color: var(--accent-strong);
}

.artifact-menu {
  position: relative;
  max-width: 100%;
}

.artifact-menu summary {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text);
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.artifact-menu summary::-webkit-details-marker {
  display: none;
}

.artifact-menu summary span {
  display: inline-grid;
  min-width: 24px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
}

.artifact-menu-content {
  position: absolute;
  z-index: 30;
  right: 0;
  top: calc(100% + 8px);
  width: min(680px, calc(100vw - 44px));
  max-height: min(620px, calc(100vh - 180px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 12px;
}

.artifact-group + .artifact-group {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.artifact-group h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.artifact-group-list {
  display: grid;
  gap: 7px;
}

.artifact-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 34px;
}

.artifact-row > span {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.artifact-row > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.artifact-format-link {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.artifact-action:hover,
.artifact-format-link:hover,
.artifact-menu summary:hover {
  background: var(--surface-2);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
}

.metric {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 13px 14px;
  box-shadow: var(--shadow-soft);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.metric strong {
  display: block;
  font-size: 24px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.metric-accent {
  border-color: rgba(13, 148, 136, 0.3);
}

.metric-danger {
  border-color: rgba(180, 35, 24, 0.24);
}

.metric-warn {
  border-color: rgba(183, 121, 31, 0.28);
}

.view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px;
  box-shadow: var(--shadow-soft);
}

.view-tab {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  min-height: 36px;
  padding: 8px 10px;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.view-tab:hover {
  background: var(--surface-2);
  color: var(--text);
}

.view-tab.active {
  border-color: #99d8d1;
  background: #e5f6f3;
  color: var(--accent-strong);
}

.view-tab b {
  display: inline-grid;
  min-width: 22px;
  min-height: 20px;
  place-items: center;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  padding: 2px 7px;
  font-size: 11px;
  line-height: 1;
}

.view-tab.active b {
  background: #ccfbf1;
  color: var(--accent-strong);
}

.insight-board {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.executive-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.45fr) minmax(300px, 0.75fr);
  gap: 14px;
}

.executive-brief,
.executive-next,
.report-map,
.decision-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.executive-brief {
  min-height: 210px;
  padding: 18px;
  display: grid;
  gap: 14px;
  align-content: start;
  border-left: 5px solid var(--trail);
}

.executive-brief.critical {
  border-left-color: var(--danger);
  background: #fff7f6;
}

.executive-brief.attention {
  border-left-color: var(--warn);
  background: #fffaf0;
}

.executive-brief.watch {
  border-left-color: var(--info);
}

.executive-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.executive-status span,
.section-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.executive-status strong {
  border-radius: 999px;
  background: #111827;
  color: #fff;
  padding: 5px 9px;
  font-size: 12px;
}

.executive-brief h3 {
  max-width: 920px;
  font-size: 24px;
  line-height: 1.18;
}

.executive-brief p,
.executive-next p,
.report-map p {
  color: #334155;
  font-size: 14px;
  line-height: 1.45;
}

.risk-meter {
  display: grid;
  gap: 8px;
}

.risk-meter div {
  display: grid;
  grid-template-columns: 86px minmax(120px, 1fr) 36px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.risk-meter i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: #cbd5e1;
}

.risk-meter i.FORTE {
  background: var(--danger);
}

.risk-meter i.MEDIO {
  background: var(--warn);
}

.risk-meter i.A_VALIDAR {
  background: var(--review);
}

.executive-next {
  padding: 16px;
  display: grid;
  gap: 10px;
  align-content: start;
  background: #fff;
}

.executive-next strong,
.network-summary strong,
.export-summary strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 17px;
}

.executive-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.decision-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.decision-card {
  padding: 13px;
  text-align: left;
  display: grid;
  gap: 6px;
  color: var(--text);
}

.decision-card:hover {
  border-color: var(--accent);
  background: #f0fbf9;
}

.decision-card span,
.decision-card small {
  color: var(--muted);
  font-size: 12px;
}

.decision-card span {
  font-weight: 850;
  text-transform: uppercase;
}

.decision-card strong {
  font-size: 22px;
}

.network-note {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
  display: grid;
  gap: 3px;
}

.network-note:hover {
  border-color: #cfd8e3;
  background: #fff;
}

.network-note span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.network-note strong,
.network-note small {
  overflow-wrap: anywhere;
}

.network-note strong {
  color: #1f2a37;
  font-size: 12px;
}

.network-note small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.report-map {
  display: grid;
  grid-template-columns: minmax(320px, 1.25fr) minmax(260px, 0.9fr) minmax(220px, 0.7fr);
  gap: 16px;
  padding: 16px;
  background: #fff;
}

.report-map ol {
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}

.report-map li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.report-map li > span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
}

.report-map li button {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  text-align: left;
}

.report-map li button:hover strong {
  color: var(--accent-strong);
}

.report-map li strong,
.report-map li small {
  display: block;
  overflow-wrap: anywhere;
}

.report-map li small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.insight-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  padding: 12px;
}

.insight-card.accent-card {
  border-color: #99d8d1;
  background: #f0fbf9;
}

.insight-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.insight-card strong,
.insight-card p {
  overflow-wrap: anywhere;
}

.insight-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.38;
}

.compact-action {
  justify-self: start;
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.control-strip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 12px;
  box-shadow: var(--shadow-soft);
}

.filter-summary {
  grid-column: 1 / -1;
}

.filter-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.filter-chip-list span,
.filter-neutral {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}

.control-strip label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

select,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--text);
  min-height: 38px;
  padding: 7px 10px;
}

.analysis-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.58fr) minmax(0, 1.42fr);
  gap: 16px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.panel-head {
  min-height: 58px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.subtle {
  display: block;
  color: var(--muted);
  margin-top: 3px;
  font-size: 12px;
}

.progress-list {
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.progress-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 170px minmax(220px, 1fr);
  gap: 4px 12px;
}

.progress-row strong {
  color: var(--accent-strong);
  overflow-wrap: anywhere;
}

.progress-row span,
.progress-row small {
  overflow-wrap: anywhere;
}

.progress-row small {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

.findings-column {
  position: sticky;
  top: 14px;
}

.details-column {
  grid-column: 1 / -1;
  position: static;
}

.findings-list {
  max-height: calc(100vh - 340px);
  overflow: auto;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.finding-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text);
  padding: 11px;
  text-align: left;
  display: grid;
  gap: 6px;
}

.finding-card:hover,
.finding-card.selected {
  border-color: var(--accent);
  background: #eefaf8;
}

.finding-card strong,
.finding-card span,
.finding-card small {
  overflow-wrap: anywhere;
}

.finding-card small {
  color: var(--muted);
}

.finding-card-route {
  color: #344054;
  line-height: 1.35;
}

.finding-card-meta {
  font-weight: 760;
}

.badge {
  justify-self: start;
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  color: white;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.FORTE {
  background: var(--danger);
}

.MEDIO {
  background: var(--warn);
}

.A_VALIDAR {
  background: var(--review);
}

.TRILHA {
  background: var(--trail);
}

.review-table-row:not(.selected) .badge.FORTE,
.finding-card:not(.selected) .badge.FORTE {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #991b1b;
}

.graph-workspace {
  min-height: 760px;
}

.graph-head {
  align-items: center;
}

.graph-actions {
  display: flex;
  gap: 8px;
}

.graph-canvas-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #f5f7f9;
}

#graphCanvas {
  display: block;
  width: 100%;
  height: min(70vh, 720px);
  min-height: 520px;
}

.d3-graph-svg {
  display: block;
  width: 100%;
  height: min(70vh, 720px);
  min-height: 520px;
  background:
    linear-gradient(#edf2f6 1px, transparent 1px),
    linear-gradient(90deg, #edf2f6 1px, transparent 1px),
    #f8fafc;
  background-size: 28px 28px;
  cursor: grab;
}

.d3-graph-svg:active {
  cursor: grabbing;
}

.d3-link {
  stroke-linecap: round;
}

.d3-link.selected {
  stroke: #17202a;
  stroke-opacity: 0.86;
  stroke-width: 2.2;
}

.d3-link.selected-relationship {
  stroke-opacity: 0.96;
  stroke-width: 3.4;
}

.d3-link.selected-relationship.selected {
  stroke-opacity: 1;
  stroke-width: 3.8;
}

.d3-link.qsa-context:not(.selected-relationship) {
  stroke-dasharray: 5 6;
  stroke-linecap: round;
}

.d3-link.dimmed {
  stroke-opacity: 0.08;
}

.d3-node {
  cursor: pointer;
}

.d3-node.dimmed {
  opacity: 0.24;
}

.d3-node-dot {
  stroke: #fff;
  stroke-width: 1.8;
  filter: drop-shadow(0 2px 4px rgba(23, 32, 42, 0.18));
}

.d3-node.selected .d3-node-dot {
  stroke: #111827;
  stroke-width: 3;
}

.d3-node.selected .d3-node-ring {
  stroke: #111827;
  stroke-width: 4;
}

.d3-node-label {
  fill: #263240;
  font-size: 11px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(248, 250, 252, 0.94);
  stroke-width: 4px;
  stroke-linejoin: round;
  pointer-events: none;
}

.d3-node-label.qsa-context {
  fill: #6f647c;
  font-size: 10px;
  font-weight: 700;
  stroke: rgba(248, 250, 252, 0.82);
  stroke-width: 3px;
}

.d3-node-label.hidden {
  display: none;
}

.dense-graph-canvas {
  display: block;
  width: 100%;
  height: min(70vh, 720px);
  min-height: 520px;
  background: #f5f7f9;
}

.graph-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.graph-lanes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.graph-lane {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  width: 1px;
}

.graph-lane i {
  display: block;
  width: 1px;
  height: 100%;
  background: #e6edf3;
}

.graph-lane b {
  position: absolute;
  top: 14px;
  transform: translateX(-50%);
  color: #708093;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.edge {
  stroke: #c7d0da;
  stroke-width: 1.2;
  stroke-opacity: 0.7;
}

.edge.qsa {
  stroke: #7c3aed;
}

.edge.electoral {
  stroke: #2563eb;
}

.edge.public-act {
  stroke: #047857;
}

.edge.finding-link {
  stroke: #b42318;
  stroke-width: 1.6;
  stroke-opacity: 0.78;
}

.lane-guide {
  stroke: #e6edf3;
  stroke-width: 1;
}

.lane-label {
  fill: #708093;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.graph-node {
  outline: none;
}

.node-dot {
  stroke: white;
  stroke-width: 1.7;
  filter: drop-shadow(0 2px 3px rgba(23, 32, 42, 0.16));
}

.graph-node.selected .node-dot {
  stroke: #111827;
  stroke-width: 3;
}

.node-dot.finding {
  fill: var(--finding);
}

.node-dot.person {
  fill: var(--person);
}

.node-dot.company {
  fill: var(--company);
}

.node-dot.campaign {
  fill: var(--campaign);
}

.node-dot.public-body {
  fill: var(--public-body);
}

.node-dot.politician {
  fill: #111827;
}

.node-dot.other {
  fill: #94a3b8;
}

.node-dot.FORTE {
  fill: var(--danger);
}

.node-dot.MEDIO {
  fill: var(--warn);
}

.node-dot.A_VALIDAR {
  fill: var(--review);
}

.node-dot.TRILHA {
  fill: var(--trail);
}

.node-label {
  fill: #263240;
  font-size: 11px;
  paint-order: stroke;
  stroke: #fbfcfd;
  stroke-width: 3;
  stroke-linejoin: round;
}

.graph-legend {
  position: static;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  border-top: 1px solid var(--line);
  background: #f5f7f9;
  padding: 10px 14px 12px;
}

.graph-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  padding: 5px 8px;
  color: var(--muted);
  font-size: 12px;
}

.graph-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--trail);
}

.graph-legend i.finding {
  background: var(--finding);
}

.graph-legend i.politician {
  background: #111827;
}

.graph-legend i.person {
  background: var(--person);
}

.graph-legend i.company {
  background: var(--company);
}

.graph-legend i.campaign {
  background: var(--campaign);
}

.graph-legend i.public-body {
  background: var(--public-body);
}

.graph-legend i.donor {
  background: #df3f13;
}

.graph-legend i.supplier {
  background: #8d756b;
}

.graph-legend i.qsa {
  background: #315fba;
}

.graph-legend i.contact {
  background: #e2a42d;
}

.graph-legend i.ring {
  border: 3px solid #bd2a2a;
  background: transparent;
}

.graph-tooltip {
  position: absolute;
  z-index: 4;
  width: min(280px, calc(100% - 24px));
  border: 1px solid #c8d3dd;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(23, 32, 42, 0.14);
  padding: 9px 10px;
  pointer-events: none;
}

.graph-tooltip strong,
.graph-tooltip span,
.graph-tooltip small {
  display: block;
  overflow-wrap: anywhere;
}

.graph-tooltip strong {
  font-size: 12px;
}

.graph-tooltip span,
.graph-tooltip small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

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

.timeline-head {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.timeline-head strong {
  color: var(--text);
}

.timeline-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));
  align-items: end;
  gap: 4px;
  min-height: 88px;
  margin-top: 10px;
}

.timeline-bar {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
}

.timeline-bar i {
  display: block;
  width: 22px;
  border-radius: 6px 6px 0 0;
  background: var(--accent);
}

.timeline-bar span {
  font-size: 10px;
}

.detail-pane {
  max-height: calc(100vh - 260px);
  overflow: auto;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.detail-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.relationship-detail {
  background: #fff;
  border-color: #f0b35b;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.08);
}

.node-detail-card {
  background: #fff;
}

.node-detail-header {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.node-detail-header strong,
.node-detail-header p {
  overflow-wrap: anywhere;
}

.node-detail-header p {
  margin: 0;
  color: #344054;
  line-height: 1.45;
}

.node-type-pill {
  justify-self: start;
  border: 1px solid #d8e0e7;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 850;
}

.node-type-pill.campaign {
  border-color: #b9c7f7;
  background: #f0f4ff;
  color: #315ac4;
}

.node-type-pill.public-body {
  border-color: #9dd8ca;
  background: #edfdf8;
  color: #047857;
}

.node-type-pill.person {
  border-color: #f3b7a8;
  background: #fff6f2;
  color: #a23e21;
}

.node-type-pill.company {
  border-color: #d9cfc8;
  background: #fbf8f6;
  color: #475569;
}

.node-type-pill.finding {
  border-color: #f2b8ae;
  background: #fff3f0;
  color: #b42318;
}

.node-fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 8px;
  margin: 0;
}

.node-fact-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px;
  min-width: 0;
}

.node-fact-grid dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.node-fact-grid dd {
  margin: 3px 0 0;
  color: #111827;
  font-size: 12px;
  font-weight: 780;
  overflow-wrap: anywhere;
}

.node-finding-list {
  display: grid;
  gap: 8px;
}

.node-finding-list h4 {
  margin: 0;
  color: #1f2a37;
  font-size: 12px;
  font-weight: 850;
}

.node-finding-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  padding: 9px;
  text-align: left;
  display: grid;
  gap: 5px;
}

.node-finding-button:hover {
  border-color: var(--accent);
  background: #eefaf8;
}

.node-finding-button strong,
.node-finding-button small {
  overflow-wrap: anywhere;
}

.node-finding-button small {
  color: var(--muted);
  line-height: 1.35;
}

.relationship-detail h4 {
  margin: 0;
  color: #1f2a37;
  font-size: 12px;
  font-weight: 850;
}

.relationship-path-block,
.relationship-path-grid > div,
.relationship-qsa-block {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.relationship-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin: 0;
}

.relationship-status-grid div {
  border: 1px solid #e8edf2;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px;
  min-width: 0;
}

.relationship-status-grid dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.relationship-status-grid dd {
  margin: 3px 0 0;
  color: #1f2a37;
  font-size: 12px;
  font-weight: 820;
  overflow-wrap: anywhere;
}

.relationship-warning {
  margin: 0;
  border: 1px solid #f2d7a6;
  border-radius: 8px;
  background: #fffbeb;
  color: #7c4a03;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
}

.relationship-qsa-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.relationship-qsa-row {
  border: 1px solid #e4dcf7;
  border-radius: 8px;
  background: #fbf9ff;
  padding: 8px 9px;
  min-width: 0;
}

.relationship-qsa-row strong,
.relationship-qsa-row span {
  display: block;
  overflow-wrap: anywhere;
}

.relationship-qsa-row strong {
  color: #1f2a37;
  font-size: 12px;
  line-height: 1.25;
}

.relationship-qsa-row span {
  margin-top: 3px;
  color: #5d4c91;
  font-size: 10px;
  font-weight: 780;
  line-height: 1.35;
}

.relationship-path-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.relationship-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.relationship-node-chip,
.relationship-edge-chip {
  max-width: 100%;
  min-width: 0;
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.relationship-node-chip {
  border: 1px solid #d8e0e7;
  background: #f8fafc;
  padding: 7px 8px;
}

.relationship-node-chip strong,
.relationship-node-chip small {
  display: block;
}

.relationship-node-chip strong {
  color: #111827;
  font-size: 12px;
  line-height: 1.25;
}

.relationship-node-chip small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.relationship-node-chip.campaign {
  border-color: #b9c7f7;
  background: #f0f4ff;
}

.relationship-node-chip.public-body {
  border-color: #9dd8ca;
  background: #edfdf8;
}

.relationship-node-chip.person {
  border-color: #f3b7a8;
  background: #fff6f2;
}

.relationship-node-chip.company {
  border-color: #d9cfc8;
  background: #fbf8f6;
}

.relationship-edge-chip {
  border: 1px solid #e4e9ef;
  background: #fff;
  color: #475569;
  padding: 5px 7px;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

.relationship-edge-chip.electoral {
  border-color: #c5d1fb;
  color: #315ac4;
}

.relationship-edge-chip.qsa {
  border-color: #d5cdf0;
  color: #5d4c91;
}

.relationship-edge-chip.public-act {
  border-color: #abdcca;
  color: #047857;
}

.relationship-empty {
  margin: 0;
}

.insight-section {
  background: #fff;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
}

.insight-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px;
  min-width: 0;
}

.insight-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.insight-metric strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.risk-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.risk-chip-list span {
  border-radius: 999px;
  background: #fff7df;
  color: #92400e;
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 800;
}

.party-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.party-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px;
}

.party-card span,
.party-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.party-card span {
  font-weight: 800;
}

.party-card strong {
  display: block;
  margin: 4px 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

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

.partner-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.partner-list strong,
.partner-list small {
  display: block;
  overflow-wrap: anywhere;
}

.partner-list small {
  color: var(--muted);
  font-size: 12px;
}

.member-company-panel {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.member-company-panel h4 {
  margin: 0;
  font-size: 13px;
}

.member-company-list {
  display: grid;
  gap: 8px;
}

.member-company-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px;
  display: grid;
  gap: 7px;
}

.member-company-card header {
  display: grid;
  gap: 3px;
}

.member-company-card strong,
.member-company-card small,
.member-company-card span {
  display: block;
  overflow-wrap: anywhere;
}

.member-company-card strong {
  font-size: 13px;
}

.member-company-card small,
.member-company-card span {
  color: var(--muted);
  font-size: 12px;
}

.member-qsa-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
  list-style: none;
}

.member-qsa-list li {
  border-top: 1px solid var(--line);
  padding-top: 5px;
}

.company-network-list {
  display: grid;
  gap: 8px;
}

.company-network-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px;
  display: grid;
  gap: 4px;
}

.company-network-list strong,
.company-network-list small,
.company-network-list span {
  display: block;
  overflow-wrap: anywhere;
}

.company-network-list strong {
  color: var(--text);
  font-size: 13px;
}

.company-network-list small,
.company-network-list span {
  color: var(--muted);
  font-size: 12px;
}

.contracts-section {
  background: #fff;
}

.additive-section {
  background: #fff;
}

.additive-list {
  display: grid;
  gap: 9px;
}

.additive-row {
  border: 1px solid #f1c27d;
  border-radius: 8px;
  background: #fff8ed;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.additive-row > div {
  display: grid;
  gap: 2px;
}

.additive-row small,
.additive-row p {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.additive-row dl {
  display: grid;
  grid-template-columns: minmax(92px, auto) 1fr;
  gap: 5px 10px;
  margin: 0;
  font-size: 12px;
}

.additive-row dt {
  color: #92400e;
  font-weight: 850;
}

.additive-row dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.contract-list {
  display: grid;
  gap: 9px;
}

.contract-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
  display: grid;
  gap: 7px;
}

.contract-card header,
.contract-card footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.contract-card header strong,
.contract-card footer span,
.contract-card p,
.contract-card small {
  overflow-wrap: anywhere;
}

.contract-card header span {
  flex: 0 0 auto;
  color: var(--danger);
  font-size: 12px;
  font-weight: 850;
}

.contract-card small,
.contract-card footer {
  color: var(--muted);
  font-size: 12px;
}

.contract-card p {
  color: #334155;
  font-size: 13px;
  line-height: 1.38;
}

.detail-link {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.finding-hero {
  background: #fff;
}

.detail-section p,
.detail-section li,
.detail-section dd {
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
}

.chain-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 7px;
}

dl {
  margin: 0;
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 6px 10px;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.evidence-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.evidence-list a {
  color: var(--accent-strong);
}

.document-head {
  align-items: center;
}

.document-link {
  text-decoration: none;
}

.document-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  padding: 14px 14px 0;
}

.document-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  padding: 10px 12px;
}

.document-metric span,
.document-row small,
.document-detail-list small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.document-metric strong {
  display: block;
  margin-top: 3px;
  font-size: 21px;
}

.document-queue {
  display: grid;
  gap: 8px;
  padding: 14px;
  max-height: 440px;
  overflow: auto;
}

.document-row {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(280px, 1.1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  padding: 10px 12px;
}

.document-row[data-finding-id] {
  cursor: pointer;
}

.document-row[data-finding-id]:hover {
  border-color: var(--accent);
  background: #f2fbf9;
}

.document-row strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.document-row p {
  color: #334155;
  font-size: 13px;
  line-height: 1.35;
}

.document-row-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 6px;
}

.document-row-metrics span {
  border-radius: 999px;
  background: #e8eef5;
  padding: 4px 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.document-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 7px;
  background: #e8eef5;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.document-badge.P1 {
  background: #fee4df;
  color: var(--danger);
}

.document-badge.P2 {
  background: #fff7df;
  color: #92400e;
}

.document-detail-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}

.document-detail-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px;
}

.document-detail-list strong {
  display: block;
  margin: 5px 0 3px;
}

.document-detail-list a {
  color: var(--accent-strong);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.coverage-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  padding: 14px;
}

.screening-head {
  align-items: center;
}

.pncp-head {
  align-items: center;
}

.pncp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.screening-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  padding: 14px 14px 0;
}

.screening-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  padding: 10px 12px;
}

.screening-metric span,
.screening-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.screening-metric strong {
  display: block;
  margin-top: 3px;
  font-size: 21px;
}

.screening-metric.critical {
  border-color: #f3b2aa;
  background: #fff5f3;
}

.screening-metric.critical strong {
  color: var(--danger);
}

.screening-metric.warning {
  border-color: #f3d89c;
  background: #fffbeb;
}

.screening-metric.warning strong {
  color: #92400e;
}

.screening-list {
  display: grid;
  gap: 10px;
  padding: 14px;
  overflow: visible;
}

.screening-panel {
  overflow: visible;
}

.screening-note {
  display: grid;
  gap: 4px;
  border: 1px solid #b7d7d3;
  border-radius: 8px;
  background: #f0fdfa;
  color: var(--text);
  padding: 10px 12px;
}

.screening-note strong,
.screening-note span,
.screening-note small {
  display: block;
}

.screening-note span,
.screening-note small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.screening-note.compact {
  border-color: var(--line);
  background: #f8fafc;
}

.screening-other-checks summary {
  cursor: pointer;
  list-style: none;
}

.screening-other-checks summary::-webkit-details-marker {
  display: none;
}

.screening-other-checks summary::after {
  content: "Expandir";
  display: inline-flex;
  width: fit-content;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--accent-strong);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 850;
}

.screening-other-checks[open] summary::after {
  content: "Recolher";
}

.screening-compact-list {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.screening-compact-row {
  display: grid;
  grid-template-columns: auto minmax(180px, 0.8fr) minmax(220px, 1fr);
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 7px;
}

.screening-compact-row .screening-badge {
  display: inline-flex;
}

.screening-compact-row strong,
.screening-compact-row small {
  overflow-wrap: anywhere;
}

.sanction-hit-summary {
  display: grid;
  gap: 4px;
  border: 1px solid #f3b2aa;
  border-radius: 8px;
  background: #fff5f3;
  padding: 12px 14px;
}

.sanction-hit-summary strong {
  color: var(--danger);
  font-size: 15px;
}

.sanction-hit-summary span,
.sanction-hit-summary small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.pncp-list {
  display: grid;
  gap: 8px;
  padding: 14px;
  max-height: 460px;
  overflow: auto;
}

.screening-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(220px, 0.9fr) 54px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  padding: 10px 12px;
}

.pncp-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(240px, 1fr) 54px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.pncp-row:hover {
  border-color: var(--accent);
}

.screening-row strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.pncp-row strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.pncp-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.screening-row a {
  color: var(--accent-strong);
}

.screening-count {
  justify-self: end;
  min-width: 34px;
  border-radius: 999px;
  background: #e8eef5;
  color: var(--text);
  text-align: center;
  padding: 5px 8px;
  font-weight: 800;
}

.screening-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 7px;
  background: #e8eef5;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.screening-badge.hit,
.screening-badge.possible_hit {
  background: #fee4df;
  color: var(--danger);
}

.screening-badge.clear {
  background: #dcfce7;
  color: #166534;
}

.screening-badge.partial {
  background: #dbeafe;
  color: #1d4ed8;
}

.screening-badge.missing_identifier,
.screening-badge.not_applicable {
  background: #eef2f7;
  color: #475569;
}

.screening-badge.not_configured {
  background: #fff7df;
  color: #92400e;
}

.screening-badge.source_paused {
  background: #f1f5f9;
  color: #475569;
}

.sanction-group {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  padding: 12px;
}

.sanction-group.hit,
.sanction-group.possible_hit {
  border-color: #efb0a9;
  background: #fffafa;
}

.sanction-group header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.sanction-group header strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.sanction-group header small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.sanction-linkage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #d7e1eb;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.sanction-linkage span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.sanction-linkage strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.sanction-record-list {
  display: grid;
  gap: 8px;
}

.sanction-record {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.sanction-record:first-child {
  border-top: 0;
  padding-top: 0;
}

.sanction-record strong {
  display: block;
}

.sanction-record small,
.sanction-match-details,
.sanction-candidate-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.sanction-match-details {
  margin: 0;
  color: #334155;
}

.sanction-candidate-note {
  margin: 0;
  border-left: 3px solid #f59e0b;
  background: #fffbeb;
  padding: 7px 9px;
  color: #7c2d12;
}

.sanction-record dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 5px 10px;
  margin: 0;
}

.sanction-record dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.sanction-record dd {
  margin: 0;
  line-height: 1.35;
}

.sanction-record a {
  color: var(--accent-strong);
  font-weight: 800;
}

.pncp-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 7px;
  background: #e8eef5;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.pncp-badge.match {
  background: #fee4df;
  color: var(--danger);
}

.pncp-badge.no_match {
  background: #dcfce7;
  color: #166534;
}

.pncp-badge.error {
  background: #fff7df;
  color: #92400e;
}

.pncp-badge.not_applicable {
  background: #e8eef5;
  color: var(--muted);
}

.pncp-badge.alto,
.pncp-badge.medio {
  background: #fee4df;
  color: var(--danger);
}

.pncp-badge.normal,
.pncp-badge.baixo {
  background: #dcfce7;
  color: #166534;
}

.pncp-badge.sem_amostra,
.pncp-badge.amostra_pequena,
.pncp-badge.sem_mediana,
.pncp-badge.incompleto {
  background: #e8eef5;
  color: var(--muted);
}

.pncp-badge.anti_evidencia {
  background: #dcfce7;
  color: #166534;
}

.triage-block {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.triage-block header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.triage-block header strong {
  color: var(--ink);
  font-size: 12px;
}

.triage-block .risk-chip-list {
  margin: 0;
}

.finding-timeline-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.finding-timeline-list li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border-left: 3px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px 10px;
}

.finding-timeline-list li.campaign {
  border-left-color: #2563eb;
}

.finding-timeline-list li.qsa,
.finding-timeline-list li.company {
  border-left-color: #7c3aed;
}

.finding-timeline-list li.contract {
  border-left-color: #dc2626;
}

.finding-timeline-list li.additive,
.finding-timeline-list li.payment {
  border-left-color: #f59e0b;
}

.finding-timeline-list li.aggregate {
  border-left-color: #64748b;
  background: #eef2f7;
}

.timeline-year-details {
  margin-top: 8px;
  border-top: 1px solid #cbd5e1;
  padding-top: 8px;
}

.timeline-year-details summary {
  cursor: pointer;
  color: #334155;
  font-size: 12px;
  font-weight: 850;
}

.timeline-year-details[open] summary {
  margin-bottom: 8px;
}

.timeline-year-contracts {
  display: grid;
  max-height: 360px;
  overflow: auto;
  border: 1px solid #dbe4ef;
  border-radius: 7px;
  background: #fff;
}

.timeline-year-contract {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 8px;
}

.timeline-year-contract + .timeline-year-contract {
  border-top: 1px solid #e2e8f0;
}

.finding-timeline-list .timeline-year-contract time {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.timeline-year-contract strong {
  display: block;
  font-size: 12px;
}

.timeline-year-contract span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.finding-timeline-list li.position {
  border-left-color: #0f766e;
}

.finding-timeline-list time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.finding-timeline-list strong,
.finding-timeline-list p {
  overflow-wrap: anywhere;
}

.finding-timeline-list p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.enrichment-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.enrichment-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.enrichment-card header strong {
  overflow-wrap: anywhere;
}

.section-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.benchmark-list {
  display: grid;
  gap: 7px;
}

.benchmark-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.9fr) minmax(170px, 1.1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px;
}

.benchmark-row strong,
.benchmark-row small {
  display: block;
  overflow-wrap: anywhere;
}

.benchmark-row small {
  color: var(--muted);
  font-size: 12px;
}

.benchmark-row a {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.comparison-head {
  align-items: center;
}

.comparison-method {
  margin: 0;
  padding: 12px 14px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.comparison-list {
  display: grid;
  gap: 10px;
  padding: 14px;
  max-height: calc(100vh - 330px);
  min-height: 360px;
  overflow: auto;
}

.comparison-row {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 5px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.comparison-row.alto,
.comparison-row.medio {
  border-left-color: var(--danger);
}

.comparison-row.normal {
  border-left-color: #2563eb;
}

.comparison-row.baixo {
  border-left-color: #16a34a;
}

.comparison-row.sem_amostra,
.comparison-row.sem_mediana,
.comparison-row.amostra_pequena,
.comparison-row.not_applicable {
  border-left-color: #94a3b8;
}

.comparison-row-head {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.comparison-row-head strong,
.comparison-row-head small {
  display: block;
  overflow-wrap: anywhere;
}

.comparison-row-head small,
.comparison-context,
.comparison-sample small {
  color: var(--muted);
  font-size: 12px;
}

.comparison-ratio {
  min-width: 136px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  padding: 8px 10px;
  text-align: right;
}

.comparison-ratio span,
.comparison-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.comparison-ratio strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.comparison-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.comparison-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px 10px;
}

.comparison-metric strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.comparison-assessment {
  margin: 0;
  color: var(--text);
  font-weight: 750;
}

.comparison-context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.comparison-samples {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.comparison-samples summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.comparison-samples > div {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.comparison-sample {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-top: 1px solid #edf2f7;
  padding-top: 7px;
}

.comparison-sample strong,
.comparison-sample small {
  display: block;
  overflow-wrap: anywhere;
}

.comparison-sample a {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.comparison-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ai-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.ai-head {
  align-items: start;
}

.ai-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.ai-messages {
  min-height: 360px;
  max-height: calc(100vh - 360px);
  overflow: auto;
  padding: 14px;
  display: grid;
  gap: 10px;
  align-content: start;
  background: var(--surface-3);
}

.ai-message {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 11px 12px;
  max-width: min(780px, 92%);
  display: grid;
  gap: 6px;
}

.ai-message.user {
  justify-self: end;
  background: #e8f6f3;
  border-color: #99d8d1;
}

.ai-message.error {
  border-color: #fecaca;
  background: #fff1f2;
}

.ai-message span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.ai-message small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.ai-message-content {
  color: #24313f;
  font-size: 14px;
  line-height: 1.48;
  overflow-wrap: anywhere;
  white-space: normal;
}

.ai-message-content p,
.ai-message-content ul,
.ai-message-content ol {
  margin: 0;
}

.ai-message-content p + p,
.ai-message-content p + ul,
.ai-message-content p + ol,
.ai-message-content ul + p,
.ai-message-content ol + p,
.ai-markdown-table-wrap + p,
.ai-message-content p + .ai-markdown-table-wrap {
  margin-top: 10px;
}

.ai-message-content ul,
.ai-message-content ol {
  padding-left: 20px;
}

.ai-message-content li + li {
  margin-top: 4px;
}

.ai-message-content strong {
  color: var(--ink);
  font-weight: 850;
}

.ai-message-content code {
  border-radius: 5px;
  background: #eef2f7;
  padding: 1px 4px;
  font-size: 12px;
}

.ai-message-content a {
  color: var(--accent-strong);
  font-weight: 750;
}

.ai-markdown-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ai-markdown-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: #fff;
}

.ai-markdown-table th,
.ai-markdown-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.4;
}

.ai-markdown-table th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.ai-markdown-table tr:last-child td {
  border-bottom: 0;
}

.ai-chat-form {
  border-top: 1px solid var(--line);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.ai-chat-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  font: inherit;
}

.ai-chat-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-context-panel {
  position: sticky;
  top: 14px;
}

.ai-context-summary {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.signals-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1.15fr) minmax(360px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.signal-review-panel {
  position: sticky;
  top: 14px;
}

.review-table {
  display: grid;
  padding: 12px;
  min-width: 0;
}

.review-table-head,
.review-table-row {
  display: grid;
  grid-template-columns: 128px minmax(260px, 1fr) minmax(130px, 0.34fr);
  gap: 10px;
  align-items: center;
}

.review-table-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  padding: 0 10px 8px;
  text-transform: uppercase;
}

.review-table-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  margin-top: 7px;
  padding: 10px;
  text-align: left;
}

.review-table-row:hover,
.review-table-row.selected {
  border-color: var(--accent);
  background: #f0fbf9;
}

.review-table-row strong,
.review-table-row span,
.review-table-row small,
.review-table-row p {
  overflow-wrap: anywhere;
}

.review-table-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.review-table-row .badge {
  display: inline-flex;
  font-style: normal;
  white-space: normal;
}

.signal-value {
  font-weight: 850;
  white-space: nowrap;
}

.signal-next {
  grid-column: 2 / -1;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.signal-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 10px 0;
}

.signal-detail-tabs button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 850;
}

.signal-detail-tabs button.active {
  border-color: #99d8d1;
  background: #e5f6f3;
  color: var(--accent-strong);
}

.signal-detail-tabpanes {
  display: grid;
  gap: 10px;
}

.contract-table-wrap {
  overflow: auto;
  padding: 14px;
}

.contract-review-list {
  display: grid;
  gap: 10px;
}

.contract-review-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  cursor: pointer;
}

.contract-review-card:hover {
  border-color: var(--accent);
  background: #f7fcfb;
}

.contract-review-card header {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.contract-review-card strong,
.contract-review-card small,
.contract-review-card p,
.contract-review-card footer span {
  display: block;
  overflow-wrap: anywhere;
}

.contract-review-card header strong {
  margin-top: 5px;
}

.contract-review-card small,
.contract-review-card p,
.contract-review-card footer {
  color: var(--muted);
  font-size: 12px;
}

.contract-card-value {
  min-width: 130px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  padding: 8px 10px;
  text-align: right;
}

.contract-card-value span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.contract-card-value strong {
  margin-top: 4px;
  font-size: 20px;
}

.contract-card-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.contract-review-card footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.contract-review-card a {
  color: var(--accent-strong);
  font-weight: 850;
  text-decoration: none;
}

.contract-review-table {
  width: 100%;
  min-width: 1480px;
  border-collapse: separate;
  border-spacing: 0 7px;
}

.contract-review-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-align: left;
  text-transform: uppercase;
  padding: 0 8px;
}

.contract-review-table td {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 9px 8px;
  font-size: 12px;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.contract-review-table td:first-child {
  border-left: 1px solid var(--line);
  border-radius: 8px 0 0 8px;
  font-weight: 800;
}

.contract-review-table td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 8px 8px 0;
}

.contract-review-table tr[data-contract-finding] {
  cursor: pointer;
}

.contract-review-table tr[data-contract-finding]:hover td {
  border-color: var(--accent);
  background: #f0fbf9;
}

.contract-review-table a {
  color: var(--accent-strong);
  font-weight: 850;
  text-decoration: none;
}

.sanction-group {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.sanction-group header {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.sanction-group header strong,
.sanction-group header small {
  display: block;
  overflow-wrap: anywhere;
}

.sanction-group header small,
.sanction-record small {
  color: var(--muted);
  font-size: 12px;
}

.sanction-record-list {
  display: grid;
  gap: 8px;
}

.sanction-record {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.sanction-record dl {
  grid-template-columns: 92px 1fr;
  margin-top: 7px;
}

.sanction-record a {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

body[data-active-view="signals"] .graph-only-control {
  display: none;
}

body[data-active-view="graph"] .metrics {
  display: none;
}

body[data-active-view="graph"] .topbar {
  display: none;
}

.source-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.source-row strong,
.source-row span {
  display: block;
}

.source-row span {
  color: var(--muted);
  margin-top: 4px;
  font-size: 13px;
}

.empty-state,
.muted {
  color: var(--muted);
}

.empty-state {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

@media (min-width: 1500px) {
  .analysis-layout {
    grid-template-columns: minmax(300px, 0.78fr) minmax(560px, 1.42fr) minmax(330px, 0.85fr);
  }

  .details-column {
    grid-column: auto;
    position: sticky;
    top: 14px;
  }
}

@media (max-width: 1100px) {
  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-hero {
    min-height: auto;
    padding: 40px 32px;
  }

  .login-hero h1 {
    font-size: 42px;
  }

  .login-card {
    width: min(520px, calc(100% - 48px));
    padding: 42px 0;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .analysis-layout,
  .ai-layout,
  .signals-layout,
  .control-strip,
  .metrics,
  .executive-grid,
  .decision-grid,
  .report-map {
    grid-template-columns: 1fr;
  }

  .findings-column,
  .details-column,
  .ai-context-panel,
  .signal-review-panel {
    position: static;
  }

  .graph-workspace {
    order: 1;
  }

  .findings-column {
    order: 2;
  }

  .details-column {
    order: 3;
  }

  .topbar {
    flex-direction: column;
  }

  .artifact-links {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }

  .topbar-actions {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    justify-items: stretch;
  }

  .artifact-panel,
  .artifact-primary {
    justify-items: start;
    justify-content: flex-start;
  }

  .artifact-menu-content {
    left: 0;
    right: auto;
    width: min(680px, calc(100vw - 44px));
  }

  .screening-row,
  .pncp-row,
  .sanction-linkage,
  .screening-compact-row,
  .benchmark-row,
  .contract-review-card header,
  .contract-card-metrics,
  .comparison-row-head,
  .comparison-sample,
  .review-table-head,
  .review-table-row,
  .sanction-group header {
    grid-template-columns: 1fr;
  }

  .comparison-ratio {
    text-align: left;
  }

  .progress-row {
    grid-template-columns: 1fr;
  }

  .progress-row small {
    grid-column: 1;
  }

  .document-row {
    grid-template-columns: 1fr;
  }

  .document-row-metrics {
    justify-content: start;
  }

  .screening-count {
    justify-self: start;
  }
}

@media (max-width: 640px) {
  .login-hero {
    gap: 22px;
    padding: 28px 20px;
  }

  .login-hero h1 {
    font-size: 34px;
  }

  .login-hero-copy p:not(.login-eyebrow) {
    font-size: 16px;
  }

  .login-card {
    width: calc(100% - 32px);
    padding: 32px 0;
  }

  .login-heading h2 {
    font-size: 26px;
  }

  .workspace,
  .sidebar {
    padding: 14px;
  }

  .topbar,
  .panel-head,
  .document-head,
  .pncp-head,
  .screening-head {
    align-items: stretch;
  }

  .artifact-primary,
  .graph-actions,
  .pncp-actions,
  .ai-head-actions,
  .executive-actions {
    width: 100%;
  }

  .artifact-action,
  .primary,
  .ghost {
    justify-content: center;
    width: 100%;
  }

  .view-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .view-tab {
    flex: 0 0 auto;
  }

  #graphCanvas,
  .d3-graph-svg,
  .dense-graph-canvas {
    height: 58vh;
    min-height: 360px;
  }

  .executive-brief h3 {
    font-size: 20px;
  }

  .risk-meter div,
  .report-map li {
    grid-template-columns: 1fr;
  }

  .contract-review-card footer,
  .executive-status {
    display: grid;
    justify-items: start;
  }
}
