/* ---------- Results explorer ---------- */

.explorer-card {
  padding: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
}

.explorer-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.ex-select {
  height: 26px;
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
  color: var(--color-text-primary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  max-width: 240px;
}

.ex-search { flex: 1 1 160px; min-width: 140px; }

.ex-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--color-text-tertiary);
  font-variant-numeric: tabular-nums;
}

.ex-disagree {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--color-text-secondary);
  background: var(--color-primary-soft);
  border-radius: var(--radius-sm);
}

.explorer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--color-border-subtle);
  /* The list scrolls in place — "Show more" and opened panels must not
     stretch the page and shove the sections below around. */
  max-height: 70vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ex-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 6px;
  font-size: 13px;
  border-bottom: 1px solid var(--color-border-subtle);
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-out);
}
.ex-row:hover, .ex-row.is-open { background: var(--color-primary-soft); }

.ex-dot {
  flex: none;
  align-self: center;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-text-tertiary);
}
.ex-dot-c { background: var(--color-success); }
.ex-dot-p { background: var(--color-warning); }
.ex-dot-w { background: var(--color-danger); }
.ex-dot-n { background: var(--color-text-tertiary); }

.ex-id {
  flex: none;
  font-size: 12px;
  color: var(--color-text-tertiary);
  font-variant-numeric: tabular-nums;
}

.ex-tag {
  flex: none;
  padding: 1px 7px;
  font-size: 11px;
  color: var(--color-text-secondary);
  background: var(--color-surface-sunken);
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.ex-diff-easy { color: var(--color-success); }
.ex-diff-medium { color: var(--color-warning); }
.ex-diff-hard { color: var(--color-danger); }

.ex-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--color-text-primary);
}

.ex-empty, .ex-loading {
  padding: 24px;
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: 13px;
}

.ex-panel {
  padding: 14px 16px 18px;
  border-bottom: 1px solid var(--color-border-subtle);
  background: var(--color-surface-sunken);
  font-size: 13px;
}
.ex-panel h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}
.ex-panel h4:first-child { margin-top: 0; }

.ex-block {
  white-space: pre-wrap;
  overflow-wrap: break-word;
  color: var(--color-text-primary);
  line-height: 1.5;
  max-height: 420px;
  overflow-y: auto;
}
.ex-judge { color: var(--color-text-secondary); }

.ex-pill {
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #fff;
  border-radius: var(--radius-full);
}
.ex-stat { font-weight: 400; text-transform: none; letter-spacing: 0; }
.ex-link { font-size: 12px; text-transform: none; letter-spacing: 0; }

.ex-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ex-option {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 6px 10px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}
.ex-option .ex-letter {
  flex: none;
  width: 18px;
  font-weight: 600;
  color: var(--color-text-tertiary);
}
.ex-option.is-correct { border-color: var(--color-success); }
.ex-option.is-correct .ex-letter { color: var(--color-success); }
.ex-option.is-picked:not(.is-correct) { border-color: var(--color-danger); }
.ex-option.is-picked:not(.is-correct) .ex-letter { color: var(--color-danger); }

.ex-code {
  margin: 0;
  padding: 12px 14px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  max-height: 480px;
  overflow-y: auto;
}

/* highlight.js token colors, mapped onto the site's own tokens so code follows
   the theme toggle instead of shipping an hljs theme sheet. */
.ex-code .hljs-comment { color: var(--color-text-tertiary); font-style: italic; }
.ex-code .hljs-string { color: var(--color-success); }
.ex-code .hljs-number { color: var(--color-warning); }
.ex-code .hljs-keyword { color: var(--color-primary-bright); }
.ex-code .hljs-built_in { color: var(--color-accent); }
.ex-code .hljs-literal { color: var(--color-warning); }
.ex-code .hljs-title, .ex-code .hljs-title.function_ { color: var(--color-accent); }
.ex-code .hljs-params { color: var(--color-text-primary); }
.ex-code .hljs-operator { color: var(--color-text-secondary); }

/* The statement is reference material, not the point of the panel — keep it
   short and scrolling so the code below stays the star. */
.ex-statement {
  padding: 10px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  max-height: 200px;
}

.ex-more { margin-top: 14px; }

/* ---------- Hardest problems ---------- */

.hard-rank {
  flex: none;
  width: 34px;
  font-size: 12px;
  color: var(--color-text-tertiary);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
/* Pass rate across the field: solve rate for QA, mean unit tests for leetcode. */
.hard-rate {
  flex: none;
  align-self: center;
  width: 56px;
  height: 8px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--color-surface-sunken);
}
.hard-rate-fill {
  display: block;
  height: 100%;
  background: var(--color-success);
}
.hard-stat {
  flex: none;
  width: 48px;
  font-size: 12px;
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}
