:root {
  --bg: #11110f;
  --bar: #1a1916;
  --line: #2c2a26;
  --text: #f3efe6;
  --muted: #a39e94;
  --label: #d9d3c7;
  --action: #c2410c;
  --action-text: #fff;
  --secondary-bg: #3c3832;
  --secondary-line: #c8c2b4;
  --secondary-on: #3f3c36;
  --link: #f3d5b5;
  --focus: #f6edd9;
  --problem: #e0b15a;
  --edge-out: #f0c9a0;
  --edge-in: #5f8fbf;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Helvetica Neue", Arial, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  display: flex;
  flex-direction: column;
}

button, label, input { font: inherit; color: inherit; }

.kg-map-bar {
  flex: none;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 20px;
  background: var(--bar);
  border-bottom: 1px solid var(--line);
}

.kg-map-identity { display: flex; flex-direction: column; flex: none; line-height: 1.2; }
.kg-map-identity h1 { margin: 0; font-size: 20px; font-weight: 750; letter-spacing: -.025em; }
.kg-map-identity span { margin-top: 3px; color: var(--label); font-size: 12px; }
.kg-map-header-meta { display: flex; align-items: center; gap: 18px; color: var(--label); font-size: 13px; }
.kg-map-updated { display: inline-flex; align-items: center; white-space: nowrap; gap: 3px; }
.kg-map-updated time { color: var(--text); font-variant-numeric: tabular-nums; }
.kg-map-version {
  margin: 0;
  color: var(--label);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.kg-map-brand {
  color: var(--label);
  text-decoration: none;
  font-weight: 500;
}
.kg-map-site-short, .kg-map-cta-short { display: none; }

.kg-map-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.kg-map-nav a { color: var(--label); text-decoration: none; }
.kg-map-nav a:hover, .kg-map-nav a:focus-visible { color: var(--text); }

.kg-map-nav a.kg-map-cta,
a.kg-map-cta {
  background: var(--action);
  color: var(--action-text);
  border-radius: 4px;
  padding: 7px 12px;
  text-decoration: none;
  font-weight: 650;
}
.kg-map-nav a.kg-map-cta:hover,
.kg-map-nav a.kg-map-cta:focus-visible { color: var(--action-text); background: #e85d04; }

.layout {
  display: flex;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  overflow: hidden;
}

.side, .panel {
  flex: none;
  min-width: 200px;
  height: 100%;
  overflow: auto;
  background: rgba(22, 21, 18, .92);
  padding: 14px 14px 24px;
}

.side {
  width: 280px;
  container-type: inline-size;
  container-name: kg-side;
}

.panel {
  width: 300px;
  flex-shrink: 0;
  background: #24221e;
  border-left: 3px solid var(--secondary-line);
}

.panel.is-closed, #handlePanel.is-closed { display: none; }

.panel .title { margin: 0; font-size: 18px; line-height: 1.25; }

.handle {
  flex: none;
  width: 8px;
  cursor: col-resize;
  background: #1a1916;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  touch-action: none;
}

.handle:hover, .handle.dragging { background: var(--secondary-line); }

.side h2, .panel h2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin: 18px 0 8px;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--label);
  font-weight: 650;
}

.side .kg-map-summary { padding: 0; max-width: none; }

.side .kg-map-summary h1 {
  font-size: 16px;
  line-height: 1.3;
  margin: 0 0 8px;
}

.side .kg-map-summary h2 { margin: 16px 0 6px; }
.side .kg-map-summary > p:first-child { color: var(--text); font-size: 15px; font-weight: 650; margin-bottom: 18px; }

.side .kg-map-summary p,
.side .kg-map-summary li { margin: 0 0 6px; }

.side .kg-map-summary li,
.side .kg-map-summary time {
  font-size: 15px;
  color: var(--text);
}

.side .kg-map-summary .k,
.panel .k {
  color: var(--label);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.side .kg-map-summary ul,
.side .kg-map-summary ol { margin: 0 0 8px; padding-left: 1.1rem; }

.side .kg-map-summary a,
.panel a { color: var(--link); }

.side .kg-map-summary a.kg-map-cta {
  color: var(--action-text);
}

.modes, .relations { display: flex; flex-wrap: wrap; gap: 6px; }

.modes button, .ghost, .rel-more, .panel-head button {
  background: var(--secondary-bg);
  border: 1px solid var(--secondary-line);
  color: var(--text);
  border-radius: 4px;
  padding: 6px 8px;
  cursor: pointer;
}

.modes button[aria-pressed="true"] {
  background: var(--secondary-on);
  border-color: var(--focus);
}

.panel-head button,
.drawer-close {
  background: var(--secondary-bg);
  border-color: var(--secondary-line);
  color: var(--text);
}

.check {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
}

.relations .check { width: 100%; }

.check input { accent-color: var(--link); }

.count { color: var(--muted); font-variant-numeric: tabular-nums; }

.problems, .rel-list { list-style: none; margin: 0; padding: 0; }

.problems button, .rel-jump {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  cursor: pointer;
  color: var(--text);
}

.problems button strong { display: block; color: var(--problem); font-size: 13px; font-weight: 650; }

.note { color: var(--muted); font-size: 12px; margin: 8px 0 0; }

.stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr) auto;
  grid-template-rows: max-content auto minmax(0, 1fr) auto auto;
  align-items: start;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.stage > .host,
.stage > .labels,
.stage > .skeleton,
.stage > .stage-error,
.stage > .stage-message,
.stage > .backdrop,
.stage > .kg-pulse { grid-area: 1 / 1 / -1 / -1; }

.stage .host { position: absolute; inset: 0; opacity: 0; touch-action: none; }

.stage.is-ready .host {
  opacity: 1;
  transition: opacity 200ms ease;
}

.stage .host[hidden] { display: none; }

.labels {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.stage-error {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.stage-error[hidden] { display: none; }

.stage-error p {
  max-width: 380px;
  margin: 0;
  text-align: center;
  border: 1px solid var(--problem);
  background: rgba(17, 17, 15, .94);
  padding: 16px;
}

.stats {
  position: relative;
  grid-area: 5 / 1 / 6 / 3;
  justify-self: start;
  margin: 0 0 12px 12px;
  z-index: 2;
  max-width: min(420px, 100%);
  background: rgba(17, 17, 15, .86);
  border: 1px solid var(--line);
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted);
  pointer-events: auto;
}

.stats p { margin: 0; }

.stats-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  align-items: center;
}

.stats-term { display: inline-flex; align-items: center; gap: 2px; }

.stats-terms[hidden] { display: none; }

.hint {
  position: relative;
  grid-area: 4 / 1 / 5 / 3;
  align-self: end;
  justify-self: start;
  margin: 0 0 8px 12px;
  z-index: 3;
  max-width: 280px;
  background: rgba(17, 17, 15, .86);
  border: 1px solid var(--line);
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted);
  pointer-events: none;
}

.hint[hidden], .pad[hidden], .stats[hidden] { display: none; }

.pad {
  position: relative;
  grid-area: 4 / 3 / 6 / 4;
  align-self: end;
  margin: 0 12px 12px 8px;
  z-index: 3;
  display: grid;
  grid-template-columns: 36px 36px 36px;
  gap: 4px;
}

.pad button {
  width: 36px;
  height: 36px;
  background: #1a1916;
  color: var(--text);
  border: 1px solid var(--line);
  cursor: pointer;
}

.pad button:hover { border-color: var(--focus); }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.panel-head h2 { margin: 0; }

.panel .k {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
}

.panel .title { font-size: 20px; font-weight: 650; }

.panel .v { margin: 2px 0 0; font-size: 15px; color: var(--text); word-break: break-word; }

.panel .direction {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 16px 0 4px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
}

.panel .rel-count { margin: 8px 0 0; color: var(--muted); font-size: 12px; }

.panel .problem-call {
  margin-top: 12px;
  padding: 8px;
  border: 1px solid var(--problem);
  color: var(--text);
}

.panel .problem-cta { margin-top: 8px; }

.panel .rel-more { margin-top: 6px; }

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

.kg-map-admin { margin: 16px 0 0; }

.kg-map-admin a, .kg-map-admin button {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 8px;
  text-decoration: none;
  cursor: pointer;
}

.drawer-toggle, .drawer-close, .backdrop { display: none; }

.search {
  position: relative;
  grid-area: 2 / 1;
  margin: 8px 0 0 12px;
  z-index: 4;
  width: min(320px, 100%);
}

.search-label, .spotlight, .kg-map-sr, .screen-reader-text, .kg-map-score-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.search input {
  width: 100%;
  background: #1a1916;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
}

.suggest {
  list-style: none;
  margin: 4px 0 0;
  padding: 4px;
  background: #1a1916;
  border: 1px solid var(--line);
  max-height: min(280px, 40vh);
  overflow: auto;
}

.suggest button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 8px;
  cursor: pointer;
  color: var(--text);
}

.suggest button:hover, .suggest button:focus-visible { background: #2c2a26; }

.legend-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0 0 8px;
  color: var(--muted);
}

.legend-row strong {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}

.legend-relation strong {
  flex: none;
  white-space: nowrap;
}

.help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border: 1px solid #8c877e;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  vertical-align: middle;
  position: relative;
  flex: none;
}

.help:hover, .help:focus-visible, .help[aria-expanded="true"] { color: #e85d04; border-color: #e85d04; }
.help::before { content: ""; position: absolute; inset: -14px; }

.help-pop {
  position: fixed;
  z-index: 30;
  width: min(340px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  overflow: auto;
  margin: 0;
  background: #24221e;
  color: var(--text);
  border: 1px solid var(--secondary-line);
  border-radius: 6px;
  padding: 14px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  font-size: 15px;
  line-height: 1.5;
  text-transform: none;
  letter-spacing: 0;
}
.help-pop p { margin: 0 30px 0 0; }
.help-pop-close { float: right; width: 28px; height: 28px; margin: -5px -7px 0 6px; padding: 0; color: var(--label); background: transparent; border: 0; font-size: 22px; line-height: 1; cursor: pointer; }
.help-pop-close:hover, .help-pop-close:focus-visible { color: #e85d04; }

.kg-map-node-out {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.35em;
  text-decoration: none;
  vertical-align: middle;
}

.kg-map-node-out::after { content: "↗"; }

.panel .v-url {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

@container kg-side (max-width: 240px) {
  .legend-relation {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}

.swatch {
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
}

.skeleton {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.skeleton[hidden] { display: none; }

.skeleton-node, .skeleton-line {
  position: absolute;
  background: #3a362f;
  animation: kg-rest 1.8s ease-in-out infinite;
}

.skeleton-node {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.skeleton-node:nth-child(1) { left: 38%; top: 42%; }
.skeleton-node:nth-child(2) { left: 50%; top: 34%; width: 22px; height: 22px; background: #8a8478; }
.skeleton-node:nth-child(3) { left: 62%; top: 48%; }
.skeleton-line { height: 1px; }
.skeleton-line:nth-child(4) { left: 40%; top: 46%; width: 12%; }
.skeleton-line:nth-child(5) { left: 54%; top: 44%; width: 10%; }

@keyframes kg-rest {
  50% { opacity: .4; }
}

.stage-message {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.stage-message[hidden] { display: none; }

.stage-message p {
  max-width: 380px;
  margin: 0;
  text-align: center;
  border: 1px solid var(--line);
  background: rgba(17, 17, 15, .94);
  padding: 16px;
}

body.resizing, body.resizing * { cursor: col-resize; user-select: none; }

a:focus-visible, button:focus-visible, .handle:focus-visible, input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 1050px) {
  .kg-map-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 8px 12px; }
  .kg-map-header-meta { grid-column: 1 / -1; grid-row: 2; gap: 18px; }
  .kg-map-nav { grid-column: 2; grid-row: 1; margin-left: 0; }
}

@media (max-width: 1023px) {
  .drawer-toggle, .drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 8px 12px;
    background: var(--secondary-bg);
    color: var(--text);
    border: 1px solid var(--secondary-line);
    border-radius: 4px;
    cursor: pointer;
  }

  .kg-map-bar { min-height: 72px; gap: 4px 6px; }
  .kg-map-identity { flex-direction: row; align-items: baseline; gap: 5px; min-width: 0; white-space: nowrap; }
  .kg-map-identity h1 { font-size: 16px; }
  .kg-map-identity span { margin: 0; font-size: 10px; }
  .kg-map-header-meta { font-size: 11px; gap: 14px; }
  .kg-map-nav { width: auto; flex-wrap: nowrap; gap: 7px; }
  .kg-map-nav > a:not(.kg-map-brand):not(.kg-map-cta) { display: none; }
  .kg-map-site-full, .kg-map-cta-full { display: none; }
  .kg-map-site-short, .kg-map-cta-short { display: inline; }
  .kg-map-nav a.kg-map-cta { padding: 6px 8px; }
  .layout { position: relative; }

  .side {
    position: absolute;
    z-index: 6;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(100%, 320px) !important;
    max-height: none;
    min-width: 0;
    transform: translateX(-105%);
    transition: transform 200ms ease;
  }

  .layout.is-filters .side { transform: none; }
  .handle { display: none; }

  .panel {
    display: block;
    position: absolute;
    z-index: 6;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    height: min(40vh, 360px);
    width: 100% !important;
    min-width: 0;
    transform: translateY(110%);
    transition: transform 200ms ease;
  }

  .panel.is-open { display: block; transform: none; }
  .panel.is-closed { display: block; }
  .layout:has(.panel.is-open) .hint,
  .layout:has(.panel.is-open) .stats,
  .layout:has(.panel.is-open) .pad { display: none; }
  .stage { min-height: 0; }

  .modes button,
  .pad button,
  .check,
  .rel-more,
  .panel-head button,
  .search input,
  .suggest button,
  .drawer-toggle,
  .drawer-close,
  .kg-map-cta,
  .kg-map-node-out {
    min-height: 44px;
  }

  .help { width: 16px; height: 16px; min-width: 16px; min-height: 16px; }

  .pad { grid-template-columns: 44px 44px 44px; }
  .pad button { width: 44px; height: 44px; }

  .backdrop {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 5;
    margin: 0;
    border: 0;
    background: rgba(17, 17, 15, .55);
    color: transparent;
  }

  /* Reserva o tamanho dos contadores e impede que a ajuda da física se mova. */
  .stats { min-height: 148px; }
  #statEngine { display: inline-block; min-width: 130px; }

  .backdrop[hidden] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .stage.is-ready .host,
  .side,
  .panel,
  .skeleton-node,
  .skeleton-line {
    transition: none;
    animation: none;
  }
}


/* Bloco da Nota Global (Método de Inspeção GEO - Decisão 14) */
.kg-map-score {
  position: relative;
  grid-area: 1 / 1;
  margin: 12px 0 0 12px;
  z-index: 5;
  max-height: 100%;
  overflow: auto;
  background: #11110f;
  border: 1px solid #2c2a26;
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  max-width: 260px;
  color: #f3efe6;
  pointer-events: auto;
}

.kg-map-score-badge {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.kg-map-score-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a39e94;
}

.kg-map-score-number-wrap {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.kg-map-score-value {
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  color: #ff9a55; /* Laranja da identidade visual sobre fundo escuro */
}

.kg-map-score-max {
  font-size: 13px;
  font-weight: 500;
  color: #706f6c;
}

/* Cobertura do Método GEO (A1) */
.kg-map-score-coverage {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}

.kg-map-score-coverage-text {
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  color: #f3efe6;
}

.kg-map-score-coverage-link {
  color: #ff9a55;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 700;
  transition: color 0.15s ease;
}

.kg-map-score-coverage-link:hover,
.kg-map-score-coverage-link:focus {
  color: #ffb885;
}

.kg-map-score-coverage-desc {
  font-size: 10px;
  line-height: 1.2;
  color: #a39e94;
}

.kg-map-score-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  line-height: 1.4;
  border-top: 1px solid #23221f;
  padding-top: 6px;
}

.kg-map-score-version {
  color: #d9d3c7;
  font-weight: 500;
}

.kg-map-score-date {
  color: #a39e94;
}

.kg-map-score-link {
  color: #ff9a55;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.kg-map-score-link:hover,
.kg-map-score-link:focus {
  color: #ffb885;
}

/* Tablet e Mobile: nota no topo e centralizada (A3.4, C22) */
@media (max-width: 1023px) {
  .stage {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  }

  .stage > .host, .stage > .labels, .stage > .skeleton,
  .stage > .stage-error, .stage > .stage-message {
    grid-area: 3 / 1 / -1 / -1;
  }

  .kg-map-score {
    grid-area: 1 / 1 / 2 / -1;
    justify-self: center;
    margin: 8px 12px;
    width: auto;
    max-width: calc(100% - 24px);
    max-height: none;
    overflow: visible;
    text-align: center;
    align-items: center;
    padding: 8px 12px;
    gap: 4px;
  }

  .kg-map-score-badge {
    justify-content: center;
  }

  .kg-map-score-meta {
    align-items: center;
  }

  .kg-map-score-value {
    font-size: 24px;
  }

  .kg-map-score-coverage {
    align-items: center;
    text-align: center;
  }

  .search { grid-area: 2 / 1 / 3 / -1; justify-self: center; width: min(320px, calc(100% - 24px)); margin: 8px 12px 0; }
  .hint { grid-area: 4 / 1 / 5 / 2; max-width: none; margin: 0 8px 8px 12px; }
  .stats { grid-area: 5 / 1 / 6 / 2; margin: 0 8px 12px 12px; }
  .pad { grid-area: 4 / 2 / 6 / 3; }
}

/* Selo de staging do Metodo GEO (A6.10 / C42) */
.kg-map-score-staging-badge {
  display: inline-block;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffb885;
  background: #2a1b10;
  border: 1px solid #733816;
  border-radius: 4px;
  padding: 2px 6px;
  margin-top: 4px;
  align-self: flex-start;
}

@media (max-width: 720px) {
  .kg-map-score-staging-badge {
    align-self: center;
  }
}


/* Seção de Achados fora do plugin no drawer (A2) */
.kg-map-findings {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line, rgba(255, 255, 255, 0.08));
}

.kg-map-findings:focus {
  outline: 2px solid #ff9a55;
  outline-offset: 4px;
}

.kg-map-findings h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--fg, #f3efe6);
}

.kg-map-findings .note {
  margin: 0 0 14px 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted, #a39e94);
}

.kg-map-findings-group {
  margin-bottom: 14px;
}

.kg-map-findings-layer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg, #f3efe6);
}

.kg-map-findings-layer-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  background: #2a1b10;
  color: #ff9a55;
  border: 1px solid rgba(255, 154, 85, 0.3);
}

.kg-map-findings-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.kg-map-findings-item {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  line-height: 1.4;
  color: var(--fg, #f3efe6);
}

.kg-map-findings-item:last-child {
  border-bottom: none;
}

.kg-map-findings-code {
  color: #ff9a55;
  font-weight: 700;
}

.kg-map-findings-crit {
  display: inline-block;
  font-family: monospace;
  font-size: 11px;
  color: #a39e94;
  margin-left: 2px;
}

.kg-map-findings-crit a {
  color: #ff9a55;
  text-decoration: underline;
}

.kg-map-findings-crit a:focus-visible {
  outline: 2px solid #ff9a55;
  outline-offset: 2px;
}

.kg-map-findings-desc {
  display: block;
  margin-top: 2px;
  color: var(--fg, #f3efe6);
}

.kg-map-findings-meta {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted, #a39e94);
}

/* Achados resolvidos em cinza num details */
.kg-map-findings-resolved {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  color: #8c887f;
}

.kg-map-findings-resolved summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #a39e94;
  outline: none;
  user-select: none;
}

.kg-map-findings-resolved summary:focus-visible {
  outline: 2px solid #ff9a55;
  outline-offset: 2px;
}

.kg-map-findings-resolved .kg-map-findings-item {
  opacity: 0.8;
  color: #a39e94;
}

.kg-map-findings-resolved .kg-map-findings-layer-badge {
  background: #20201e;
  color: #a39e94;
  border-color: rgba(255, 255, 255, 0.1);
}

.kg-map-findings-resolved .kg-map-findings-code {
  color: #d0ccc4;
}

/* Linha curta no bloco de score quando gauge_enabled */
.kg-map-score-findings {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.3;
}

.kg-map-score-findings-link {
  color: #ff9a55;
  text-decoration: underline;
  cursor: pointer;
}

.kg-map-score-findings-link:hover {
  color: #ffb885;
}

.kg-map-score-findings-link:focus-visible {
  outline: 2px solid #ff9a55;
  outline-offset: 2px;
}


/* Mostrador Visual de Prontidão Técnica e Presença em IA (A3) */
.kg-map-score-visual {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kg-map-gauges-container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
}

.kg-map-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 120px;
  text-align: center;
}

.kg-map-gauge-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a39e94;
  margin-bottom: 4px;
}

.kg-map-gauge-visual {
  position: relative;
  width: 120px;
  height: 100px;
  --gauge-pct: 0;
  isolation: isolate;
}

.kg-map-gauge-visual::before {
  content: "";
  position: absolute;
  inset: -6px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 60%, transparent 38%, rgba(255, 154, 85, .30) 50%, transparent 66%);
  -webkit-mask: conic-gradient(from 240deg at 50% 60%, #000 calc(var(--gauge-pct) * 2.4deg), transparent 0);
          mask: conic-gradient(from 240deg at 50% 60%, #000 calc(var(--gauge-pct) * 2.4deg), transparent 0);
  opacity: 0;
}

.kg-map-score:not(.is-armed) .kg-map-gauge-visual::before {
  opacity: .45;
}

.kg-map-score.is-done .kg-map-gauge-visual::before {
  animation: kgBreath 4s ease-in-out infinite alternate;
  will-change: opacity, transform;
}

.kg-map-score.is-done [data-gauge="presenca"] .kg-map-gauge-visual::before {
  animation-delay: -1.3s;
}

.kg-map-score.is-paused .kg-map-gauge-visual::before {
  animation-play-state: paused;
}

.kg-map-gauge-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.kg-map-gauge-track {
  stroke: #2c2a26;
}

.kg-map-gauge-fill {
  stroke: #ff9a55;
  stroke-dashoffset: var(--gauge-offset);
}

.kg-map-score.is-armed .kg-map-gauge-fill {
  animation: kgGaugeRev 2000ms cubic-bezier(.7, 0, .25, 1) both;
  animation-play-state: paused;
}

.kg-map-score.is-armed.is-run .kg-map-gauge-fill {
  animation-play-state: running;
}

.kg-map-score.is-armed [data-gauge="presenca"] .kg-map-gauge-fill {
  animation-delay: 150ms;
}

@keyframes kgGaugeRev {
  from {
    stroke-dashoffset: var(--gauge-total, 209.44);
  }
  to {
    stroke-dashoffset: var(--gauge-offset, 0);
  }
}

@keyframes kgBreath {
  from {
    opacity: .30;
    transform: scale(.985);
  }
  to {
    opacity: .75;
    transform: scale(1.025);
  }
}

@media (prefers-reduced-motion: reduce) {
  .kg-map-gauge-fill {
    transition: none !important;
    animation: none !important;
  }
  .kg-map-gauge-visual::before {
    animation: none !important;
    opacity: .45;
  }
  .kg-pulse > i {
    animation: none !important;
  }
}

/* === Pulso DOM do nó selecionado no mapa 2D (R3) === */
.kg-pulse {
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  z-index: 2;
  pointer-events: none;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 154, 85, .55), 0 0 14px 4px rgba(255, 154, 85, .35);
}

.kg-pulse > i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  animation: kgBreath 3.6s ease-in-out infinite alternate;
  will-change: opacity, transform;
  box-shadow: 0 0 18px 6px rgba(255, 154, 85, .30);
}

.kg-pulse[hidden] {
  display: none;
}

.kg-pulse.is-paused > i {
  animation-play-state: paused;
}

.kg-map-gauge-cap-line {
  stroke: #b7b7af;
}

.kg-map-gauge-center {
  position: absolute;
  top: 36px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.kg-map-gauge-value {
  font-size: 26px;
  line-height: 1;
  font-weight: 800;
  color: #ff9a55;
  font-variant-numeric: tabular-nums;
  display: block;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.kg-map-gauge-max {
  font-size: 10px;
  line-height: 1.2;
  font-weight: 600;
  color: #a39e94;
  text-transform: lowercase;
  margin-top: 1px;
}

.kg-map-gauge-cap {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.3;
}

.kg-map-gauge-cap-link {
  color: #b7b7af;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.kg-map-gauge-cap-link:hover,
.kg-map-gauge-cap-link:focus-visible {
  color: #ffb885;
}

.kg-map-gauge-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  width: 100%;
}

.kg-map-gauge-details .kg-map-score-date,
.kg-map-gauge-details .kg-map-score-version { font-size: 11px; line-height: 1.3; }
.kg-map-gauge-details .kg-map-score-version { color: #b7b7af; font-weight: 600; }

.kg-map-score-attribution {
  border-top: 1px solid #23221f;
  padding-top: 6px;
  text-align: center;
  width: 100%;
}

/* Mostrador do Índice de Presença em IA (A4 / A4.1) */
.kg-map-gauge-track-dashed {
  stroke-dasharray: 4 6;
}

.kg-map-gauge-value-empty {
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  color: #a39e94;
  text-transform: lowercase;
}

.kg-map-gauge-margin-band {
  stroke: #ff9a55;
  stroke-opacity: 0.35;
  stroke-width: 3;
  fill: none;
}

.kg-map-gauge-margin-text {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  color: #a39e94;
}

.kg-map-gauge-status-desc,
.kg-map-gauge-round-desc,
.kg-map-gauge-coverage {
  font-size: 10px;
  line-height: 1.3;
  color: #a39e94;
}

.kg-map-score-visual {
  max-width: none;
}

@media (max-width: 1023px) and (min-width: 768px) {
  .kg-map-gauge {
    width: 104px;
  }
  .kg-map-gauge-visual {
    width: 104px;
    height: 87px;
  }
  .kg-map-gauge-center {
    top: 30px;
  }
  .kg-map-gauge-value {
    font-size: 22px;
  }
}

@media (max-width: 767px) {
  .kg-map-gauge {
    width: 96px;
  }
  .kg-map-gauge-visual {
    width: 96px;
    height: 80px;
  }
  .kg-map-gauge-center {
    top: 26px;
  }
  .kg-map-gauge-value {
    font-size: 20px;
  }
}

/* Estilos de Validade e Pendências (A6 / Etapa 7 / J08) */
.kg-map-score-validity {
  color: #a39e94;
  font-size: 11px;
  line-height: 1.3;
}

.kg-map-score-pending {
  border-top: 1px solid #23221f;
  padding-top: 6px;
  margin-top: 4px;
  width: 100%;
  font-size: 11px;
  line-height: 1.4;
  text-align: left;
}

.kg-map-score-pending-header,
.kg-map-score-pending-summary {
  font-weight: 600;
  color: #d9d3c7;
  cursor: pointer;
}

.kg-map-score-pending-layers {
  margin-top: 4px;
}

.kg-map-score-pending-layer-title {
  font-weight: 600;
  color: #ff9a55;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-top: 4px;
}

.kg-map-score-pending-list {
  list-style: none;
  margin: 2px 0 0 0;
  padding: 0;
}

.kg-map-score-pending-item {
  color: #a39e94;
  font-size: 10px;
  padding: 1px 0;
}

.kg-map-score-pending-link {
  color: #ff9a55;
  text-decoration: underline;
}

.kg-map-score-pending-status {
  color: #b7b7af;
}
