/* Nodes page KISS pass. Fewer knobs, more answers. Astonishing technology. */
.nodes-hero {
  padding-bottom: 6px;
}

.nodes-hero-copy {
  max-width: 820px;
}

.nodes-hero h1 {
  max-width: 860px;
  font-size: clamp(44px, 7vw, 86px);
}

.node-atlas-kiss {
  padding: clamp(16px, 2.2vw, 24px);
}

.node-atlas-kiss .panel-head {
  align-items: center;
}

.export-link {
  white-space: nowrap;
}

.kiss-search {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 220px) auto;
  gap: 10px;
  margin-top: 12px;
}

.kiss-search input,
.kiss-search select,
.kiss-search button,
.advanced-controls input,
.advanced-controls select {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
}

.kiss-search button {
  color: #1a1002;
  border: 0;
  background: linear-gradient(145deg, #fff0ba, #ffc14b);
  font-weight: 600;
  cursor: pointer;
}

.advanced-controls {
  margin-top: 10px;
  border: 1px solid var(--line2);
  border-radius: 16px;
  background: rgba(255,255,255,.035);
  overflow: hidden;
}

.advanced-controls summary,
.ranking-note summary {
  cursor: pointer;
  list-style: none;
  padding: 13px 14px;
  color: var(--soft);
  font-weight: 600;
}

.advanced-controls summary::-webkit-details-marker,
.ranking-note summary::-webkit-details-marker {
  display: none;
}

.advanced-controls summary::after,
.ranking-note summary::after {
  content: " +";
  color: var(--gold2);
}

.advanced-controls[open] summary::after,
.ranking-note[open] summary::after {
  content: " −";
}

.advanced-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 12px 12px;
}

.advanced-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.kiss-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.network-summary {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
}

.results-head h2 {
  font-size: clamp(22px, 2.2vw, 30px);
}

.results-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.kiss-node-grid {
  margin-top: 0;
}

.node-card.simple-node {
  display: grid;
  gap: 10px;
  padding: 15px;
}

.simple-node .node-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.simple-node h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.simple-node h3 code {
  color: var(--gold2);
}

.node-score-small {
  flex: 0 0 auto;
  color: var(--green);
  border: 1px solid rgba(84,230,163,.22);
  background: rgba(84,230,163,.075);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 600;
}

.node-line {
  margin: 0;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.35;
}

.simple-node .node-agent {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-node {
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255,255,255,.065);
  font-weight: 600;
  cursor: pointer;
}

.copy-node:hover,
.copy-node:focus-visible {
  border-color: rgba(248,184,78,.42);
  background: rgba(248,184,78,.10);
}

.ranking-note {
  padding: 0;
}

.ranking-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 14px 6px;
}

.ranking-grid div {
  padding: 13px;
  border-radius: 14px;
  border: 1px solid var(--line2);
  background: rgba(255,255,255,.045);
}

.ranking-grid strong {
  display: block;
  color: var(--gold2);
  margin-bottom: 4px;
}

.ranking-grid span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.ranking-note .section-note {
  padding: 0 14px 14px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(15,17,23,.96);
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
  font-weight: 600;
}

@media (max-width: 900px) {
  .kiss-search,
  .advanced-grid,
  .ranking-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .node-atlas-kiss .panel-head {
    align-items: flex-start;
  }

  .node-atlas-kiss .panel-head,
  .results-head {
    display: grid;
  }

  .export-link {
    width: 100%;
  }

  .kiss-search,
  .advanced-grid,
  .ranking-grid {
    grid-template-columns: 1fr;
  }

  .kiss-summary {
    grid-template-columns: 1fr 1fr;
  }
}


/* tiny final polish */
.active-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.active-filter-row[hidden] {
  display: none;
}

.filter-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.filter-chip {
  min-height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(248,184,78,.22);
  background: rgba(248,184,78,.075);
  color: var(--gold2);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
}

.filter-chip.clear-all {
  color: var(--soft);
  border-color: var(--line2);
  background: rgba(255,255,255,.045);
}

.node-card.simple-node {
  border-color: var(--line2) !important;
  background: rgba(255,255,255,.038);
  box-shadow: none;
}

.node-card.simple-node:first-child,
.node-card.simple-node:nth-child(2) {
  border-color: rgba(248,184,78,.26) !important;
  background: rgba(248,184,78,.045);
}

.quality-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.quality-badge.reliable {
  color: var(--green);
  border-color: rgba(84,230,163,.32);
  background: rgba(84,230,163,.08);
}

.quality-badge.good {
  color: var(--gold2);
  border-color: rgba(248,184,78,.28);
  background: rgba(248,184,78,.075);
}

.quality-badge.new {
  color: var(--blue);
  border-color: rgba(117,168,255,.28);
  background: rgba(117,168,255,.075);
}

.quality-badge.weak {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(255,255,255,.04);
}

.simple-node h3 {
  font-size: clamp(18px, 1.7vw, 21px);
}

.node-score-small::after {
  content: " score";
  color: var(--muted);
  font-weight: 600;
}

/* Compact large-result node list + load more */
.kiss-node-grid.node-list-mode {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}

.node-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.15fr) minmax(420px, 2fr) minmax(96px, auto);
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(255, 255, 255, 0.04);
}

.node-row-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.node-row-main code {
  color: #ffe08a;
  font-size: 1.02rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-row-main small {
  color: rgba(235, 242, 255, 0.58);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-row-meta {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  color: rgba(235, 242, 255, 0.82);
}

.node-row-meta span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.node-row-meta b {
  color: rgba(235, 242, 255, 0.48);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.compact-copy {
  min-width: 86px;
  padding: 10px 12px;
}

.node-load-wrap {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
  color: rgba(235, 242, 255, 0.62);
}

.node-load-more {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 217, 90, 0.32);
  background: linear-gradient(135deg, #ffe59a, #ffbf4d);
  color: #171208;
  font-weight: 600;
  cursor: pointer;
}

.node-load-more:disabled {
  opacity: 0.65;
  cursor: wait;
}

.node-load-wrap.is-complete {
  margin-top: 14px;
}

@media (max-width: 980px) {
  .node-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .node-row-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .compact-copy {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .node-row {
    padding: 13px;
  }

  .node-row-main code,
  .node-row-main small {
    white-space: normal;
    overflow-wrap: anywhere;
  }

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

  .node-load-wrap {
    display: grid;
    text-align: center;
  }

  .node-load-more {
    width: 100%;
  }
}

/* Fix stretched quality pill in compact node rows */
.node-row .quality-badge {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  justify-self: start;
  width: auto !important;
  min-width: 0 !important;
  max-width: max-content;
  padding: 0.34rem 0.7rem;
  line-height: 1;
  white-space: nowrap;
}

/* Node list builder */
.node-builder-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 0 16px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 217, 90, 0.18);
  background: rgba(255, 217, 90, 0.055);
}

.node-builder-bar[hidden] {
  display: none !important;
}

.node-builder-bar strong {
  display: block;
  color: #ffd95a;
  font-size: 1rem;
}

.node-builder-bar span {
  color: rgba(235, 242, 255, 0.62);
  font-size: 0.86rem;
}

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

.node-builder-actions button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.075);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 850;
  cursor: pointer;
}

.node-builder-actions button[data-copy-selected-nodes] {
  border-color: rgba(255, 217, 90, 0.32);
  background: linear-gradient(135deg, #ffe59a, #ffbf4d);
  color: #171208;
}

.node-builder-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.node-select-control {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  width: max-content;
  gap: 0.42rem;
  color: rgba(235, 242, 255, 0.66);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
}

.node-select-control input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #ffd95a;
}

.node-card.simple-node .node-select-control {
  margin-bottom: 0.65rem;
}

.node-row .node-select-control {
  margin-bottom: 0.2rem;
}

.simple-node.is-selected {
  border-color: rgba(255, 217, 90, 0.38) !important;
  box-shadow: 0 0 0 1px rgba(255, 217, 90, 0.10), 0 18px 55px rgba(255, 217, 90, 0.05);
}

@media (max-width: 760px) {
  .node-builder-bar {
    display: grid;
  }

  .node-builder-actions {
    justify-content: stretch;
  }

  .node-builder-actions button {
    flex: 1 1 140px;
  }
}

/* Tuck node selection under copy button */
.node-row-actions,
.node-card-actions {
  display: grid;
  gap: 7px;
  align-content: center;
}

.node-row-actions {
  min-width: 96px;
}

.node-row-actions .node-select-control,
.node-card-actions .node-select-control {
  justify-self: center;
  margin: 0 !important;
  font-size: 0.66rem;
  color: rgba(235, 242, 255, 0.56);
}

.node-row-actions .node-select-control input,
.node-card-actions .node-select-control input {
  width: 14px;
  height: 14px;
}

.node-row-actions .node-select-control span,
.node-card-actions .node-select-control span {
  line-height: 1;
}

/* (duplicate .node-row grid rule removed 2026-07 — merged into base rule above;
   it appeared after the 980px media query and re-broke mobile/tablet stacking) */

@media (max-width: 980px) {
  .node-row-actions {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .node-row-actions .compact-copy {
    flex: 1;
  }
}

@media (max-width: 560px) {
  .node-row-actions {
    display: grid;
  }
}

/* Fix stretched quality pill in compact node rows */
.node-row .quality-badge {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  justify-self: start;
  width: auto !important;
  min-width: 0 !important;
  max-width: max-content;
  padding: 0.34rem 0.7rem;
  line-height: 1;
  white-space: nowrap;
}

/* Cleaner node add/select control */
.node-row-actions,
.node-card-actions {
  align-content: center;
  justify-items: center;
}

.node-select-control {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer;
}

.node-select-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px !important;
  height: 1px !important;
}

.node-select-control span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 26px;
  padding: 0 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(235, 242, 255, 0.16);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(235, 242, 255, 0.66);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}

.node-select-control span::before {
  content: "+";
  color: rgba(255, 217, 90, 0.85);
  font-weight: 600;
}

.node-select-control input:checked + span {
  border-color: rgba(255, 217, 90, 0.48);
  background: rgba(255, 217, 90, 0.16);
  color: #ffd95a;
}

.node-select-control input:checked + span::before {
  content: "✓";
}

.node-row-actions .node-select-control,
.node-card-actions .node-select-control {
  justify-self: center;
}

/* Tone down selected rows so they do not scream */
.simple-node.is-selected {
  border-color: rgba(255, 217, 90, 0.26) !important;
  box-shadow: inset 3px 0 0 rgba(255, 217, 90, 0.72), 0 18px 55px rgba(255, 217, 90, 0.035) !important;
}

/* Make builder bar less bulky */
.node-builder-bar {
  padding: 10px 12px !important;
  border-color: rgba(255, 217, 90, 0.14) !important;
  background: rgba(255, 217, 90, 0.035) !important;
}

.node-builder-bar strong {
  font-size: 0.92rem !important;
}

.node-builder-bar span {
  font-size: 0.82rem !important;
}

.node-builder-actions button {
  min-height: 34px !important;
  padding: 0 11px !important;
  font-size: 0.86rem !important;
}

.node-builder-actions button[data-copy-selected-nodes] {
  box-shadow: none !important;
}

@media (max-width: 560px) {
  .node-row-actions {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
  }

  .node-row-actions .compact-copy {
    flex: 1;
  }
}

.status-pill-link {
  text-decoration: none;
  cursor: pointer;
}

.status-pill-link:hover {
  filter: brightness(1.08);
}


/* Recent node presence trail. Filled = reachable when checked, blank = missed. */
.presence-trail {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 18px;
}

.presence-trail small {
  margin-left: 6px;
  color: rgba(235, 242, 255, 0.52);
  font-size: 0.72rem;
  font-weight: 600;
}

.presence-trail.aggregate small {
  margin-left: 0;
}

.presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  border: 1px solid rgba(235, 242, 255, 0.18);
  background: rgba(255, 255, 255, 0.055);
}

.presence-dot.up {
  border-color: rgba(84, 230, 163, 0.36);
  background: rgba(84, 230, 163, 0.70);
}

.presence-dot.down {
  border-color: rgba(235, 242, 255, 0.14);
  background: rgba(255, 255, 255, 0.035);
}

.node-row-main .presence-trail {
  margin-top: 2px;
}

.node-card.simple-node .presence-trail {
  margin: 1px 0;
}


.node-detail-link {
  color: inherit;
  text-decoration: none;
}

.node-detail-link:hover {
  color: #ffd95a;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.node-detail-button {
  text-decoration: none;
}


.node-agent-version-link {
  display: inline-block;
  max-width: 100%;
  color: rgba(235, 242, 255, 0.78);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-agent-version-link:hover {
  color: #ffd95a;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.node-agent-small {
  font-size: 0.92rem;
  line-height: 1.35;
}

.node-row-main .node-agent-small {
  max-width: 420px;
}
