/* Gatekeeper Rankings – page-specific additions. Core visual language lives in portfolio-dashboard.css. */

.gatekeeper-matrix-section {
  padding-bottom: 22px;
}

.gatekeeper-matrix-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 16px 38px var(--shadow-soft);
}

.gk-matrix-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(145deg, var(--surface), var(--surface-soft));
  color: var(--text-muted);
  font-size: .68rem;
  font-weight: 800;
}

.gk-matrix-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gk-matrix-legend .gk-matrix-hint {
  margin-left: auto;
  color: var(--text-soft);
  font-weight: 700;
}

.gk-score-key {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}

.gk-matrix-scroll {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.gk-matrix-table {
  width: max(100%, 1180px);
  border-collapse: separate;
  border-spacing: 0;
  font-size: .72rem;
}

.gk-matrix-table th,
.gk-matrix-table td {
  height: 46px;
  padding: 0;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  text-align: center;
}

.gk-matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  min-width: 44px;
  padding: 0 8px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.gk-matrix-table thead th:first-child,
.gk-matrix-company {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 176px;
  min-width: 176px;
  max-width: 176px;
  padding: 0 13px;
  background: var(--surface);
  text-align: left;
}

.gk-matrix-table thead th:first-child {
  z-index: 6;
  background: var(--surface-soft);
}

.gk-matrix-table thead th:nth-child(2),
.gk-matrix-total {
  position: sticky;
  left: 176px;
  z-index: 3;
  width: 54px;
  min-width: 54px;
  background: var(--surface);
  font-weight: 900;
}

.gk-matrix-table thead th:nth-child(2) {
  z-index: 6;
  background: var(--surface-soft);
}

.gk-matrix-company a {
  color: var(--text);
  text-decoration: none;
}

.gk-matrix-company a:hover {
  color: var(--primary-2);
}

.gk-matrix-company strong,
.gk-matrix-company small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gk-matrix-company strong {
  font-size: .74rem;
}

.gk-matrix-company small {
  margin-top: 2px;
  color: var(--text-soft);
  font-size: .56rem;
}

.gk-matrix-cell {
  width: 44px;
  min-width: 44px;
  background: var(--surface-soft);
}

.gk-matrix-cell button {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.gk-matrix-cell button:hover,
.gk-matrix-cell button.is-selected {
  outline: 2px solid var(--primary-2);
  outline-offset: -3px;
}

.gk-matrix-cell.is-missing {
  color: var(--text-soft);
}

.gk-matrix-cell.score-5,
.gk-score-key.score-5 {
  background: color-mix(in srgb, var(--success-bg) 82%, var(--primary-2) 18%);
  color: var(--success-text);
}

.gk-matrix-cell.score-4,
.gk-score-key.score-4 {
  background: var(--success-bg);
  color: var(--success-text);
}

.gk-matrix-cell.score-3,
.gk-score-key.score-3 {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.gk-matrix-cell.score-2,
.gk-score-key.score-2 {
  background: color-mix(in srgb, var(--warning-bg) 55%, var(--danger-bg) 45%);
  color: var(--warning-text);
}

.gk-matrix-cell.score-1,
.gk-score-key.score-1 {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.gk-matrix-detail {
  padding: 17px 18px 19px;
  background: linear-gradient(145deg, var(--surface), var(--surface-soft));
}

.gk-matrix-detail-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gk-matrix-detail h3 {
  margin: 10px 0 5px;
  font-size: 1rem;
}

.gk-matrix-detail h3 a {
  color: inherit;
  text-decoration: none;
}

.gk-matrix-detail h3 a:hover {
  color: var(--primary-2);
}

.gk-matrix-detail > p,
.gk-matrix-detail > div > p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: .75rem;
  line-height: 1.55;
}

.gk-matrix-detail > div:not(.gk-matrix-detail-head) {
  margin-top: 13px;
}

.gk-matrix-detail > div > b {
  color: var(--text);
  font-size: .72rem;
}

.gk-matrix-detail > small {
  display: block;
  margin-top: 14px;
  color: var(--text-soft);
  font-size: .62rem;
}

.gk-matrix-detail-score strong {
  color: var(--text);
}

@media (max-width: 720px) {
  .gk-matrix-legend .gk-matrix-hint {
    width: 100%;
    margin-left: 0;
  }

  .gk-matrix-table thead th:first-child,
  .gk-matrix-company {
    width: 138px;
    min-width: 138px;
    max-width: 138px;
  }

  .gk-matrix-table thead th:nth-child(2),
  .gk-matrix-total {
    left: 138px;
  }
}
