/* TERRITORY.RESEARCH.05 | Relational depth */

.cc-relations-trail[hidden],
.cc-relations-structure[hidden] {
  display: none !important;
}

.cc-relations-trail {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid rgba(21, 82, 106, .12);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(249, 252, 253, .98), rgba(245, 249, 247, .98));
}

.cc-relations-trail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.cc-relations-trail__head > div {
  display: grid;
  gap: 2px;
}

.cc-relations-trail__head small {
  color: #2c6d7e;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.cc-relations-trail__head strong {
  color: #173e34;
  font-size: 14px;
}

.cc-relations-trail__head button {
  appearance: none;
  border: 1px solid rgba(31, 91, 111, .16);
  border-radius: 999px;
  background: #fff;
  color: #245e72;
  padding: 7px 11px;
  font-weight: 800;
  cursor: pointer;
}

.cc-relations-trail__head button:disabled {
  opacity: .4;
  cursor: default;
}

.cc-relations-trail ol {
  display: flex;
  align-items: stretch;
  gap: 7px;
  overflow-x: auto;
  list-style: none;
  margin: 0;
  padding: 2px 0 4px;
  scrollbar-width: thin;
}

.cc-relations-trail li {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.cc-relations-trail li button {
  appearance: none;
  display: grid;
  gap: 1px;
  max-width: 250px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(25, 83, 103, .10);
  background: rgba(255, 255, 255, .92);
  text-align: left;
  cursor: pointer;
}

.cc-relations-trail li button[aria-current="page"] {
  border-color: rgba(31, 104, 132, .28);
  background: rgba(235, 246, 249, .96);
  box-shadow: inset 0 0 0 1px rgba(31, 104, 132, .05);
}

.cc-relations-trail li small {
  color: #6f8089;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.cc-relations-trail li strong {
  color: #173d34;
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-relations-trail__arrow {
  color: #8aa0aa;
  font-size: 13px;
}

.cc-relations-bridge__caps {
  align-items: stretch;
}

.cc-relations-bridge__cap {
  appearance: none;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 11px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(30, 104, 82, .10);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .14s ease, transform .14s ease, box-shadow .14s ease;
}

.cc-relations-bridge__cap:hover,
.cc-relations-bridge__cap:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(31, 104, 132, .26);
  box-shadow: 0 8px 18px rgba(23, 69, 84, .06);
}

.cc-relations-bridge__cap strong {
  color: #173e34;
}

.cc-relations-bridge__cap small {
  color: #6a7c87;
}

.cc-relations-bridge__cap > span {
  margin-top: 3px;
  color: #256b83;
  font-size: 10px;
  font-weight: 900;
}

.cc-relations-structure {
  margin: 0 0 18px;
  padding: 15px 16px;
  border: 1px solid rgba(89, 91, 38, .12);
  border-radius: 18px;
  background: rgba(252, 251, 244, .82);
}

.cc-relations-structure > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, .9fr);
  gap: 18px;
  align-items: end;
  margin-bottom: 12px;
}

.cc-relations-structure > header small {
  display: block;
  margin-bottom: 3px;
  color: #7d7432;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.cc-relations-structure h3 {
  margin: 0;
  color: #403d20;
  font-size: 16px;
}

.cc-relations-structure > header p {
  margin: 0;
  color: #736f53;
  font-size: 12px;
  line-height: 1.45;
}

.cc-relations-structure__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.cc-structural-neighbor {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(89, 91, 38, .10);
  background: rgba(255, 255, 255, .88);
}

.cc-structural-neighbor > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.cc-structural-neighbor small {
  color: #817b55;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.cc-structural-neighbor strong {
  color: #403d20;
  line-height: 1.3;
}

.cc-structural-neighbor span {
  color: #77745d;
  font-size: 11px;
}

.cc-structural-neighbor p {
  margin: 3px 0 0;
  color: #807d67;
  font-size: 11px;
  line-height: 1.4;
}

.cc-structural-neighbor .cc-relation-expand {
  flex: 0 0 auto;
}

.cc-relation-scope--reference {
  color: #71691f;
  background: rgba(174, 160, 52, .12);
}

.cc-relation-item {
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}

.cc-relation-item:hover {
  transform: translateY(-1px);
  border-color: rgba(24, 106, 140, .20);
  box-shadow: 0 10px 24px rgba(28, 73, 91, .06);
}

.cc-relation-item__meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: #72828c;
}

.cc-relation-path {
  display: block;
  margin-top: 7px;
  color: #839099;
  font-size: 10px;
  line-height: 1.35;
}

.cc-relation-item__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
}

.cc-relation-open,
.cc-relation-expand {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-decoration: none;
}

.cc-relation-open {
  border: 1px solid rgba(27, 89, 113, .10);
  background: rgba(245, 249, 251, .92);
  color: #245f77;
}

.cc-relation-expand {
  border: 1px solid rgba(34, 103, 79, .12);
  background: rgba(244, 249, 246, .96);
  color: #24684f;
  cursor: pointer;
}

.cc-relation-open:hover,
.cc-relation-open:focus-visible,
.cc-relation-expand:hover,
.cc-relation-expand:focus-visible {
  text-decoration: none;
  border-color: rgba(30, 100, 126, .28);
  box-shadow: 0 5px 12px rgba(28, 73, 91, .05);
}

@media (max-width: 900px) {
  .cc-relations-structure > header,
  .cc-relations-structure__list {
    grid-template-columns: 1fr;
  }

  .cc-relations-trail__head,
  .cc-structural-neighbor {
    align-items: stretch;
    flex-direction: column;
  }

  .cc-relations-trail__head button,
  .cc-structural-neighbor .cc-relation-expand {
    align-self: flex-start;
  }
}

.cc-relations-trail__edge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 170px;
  color: #8aa0aa;
}

.cc-relations-trail__edge > span {
  flex: 0 0 auto;
  font-size: 13px;
}

.cc-relations-trail__edge small {
  max-width: 145px;
  overflow: hidden;
  color: #7c8b93;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}
