@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

.md-typeset h1 {
  font-weight: 700;
}

.md-typeset table:not([class]) {
  width: 100%;
  table-layout: fixed;
}

.md-typeset table:not([class]) th,
.md-typeset table:not([class]) td {
  vertical-align: top;
  word-wrap: break-word;
}

.md-typeset img {
  border: 1px solid #d8dee9;
  border-radius: 8px;
  padding: 4px;
  background: #fff;
}

/* Explorer visual language */
.csx-hero,
.csx-panel,
.csx-card,
.csx-btn,
.csx-field,
.csx-table,
.csx-status,
.csx-bar-head,
.csx-kv-grid,
.csx-link-chip {
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
}

.csx-hero,
.csx-panel,
.csx-card {
  max-width: 100%;
}

.csx-hero *,
.csx-panel *,
.csx-card * {
  box-sizing: border-box;
  min-width: 0;
}

.csx-hero {
  position: relative;
  border: 1px solid #9ecfcb;
  border-radius: 18px;
  padding: 22px;
  margin: 8px 0 18px;
  background:
    radial-gradient(circle at 8% 14%, rgba(15, 118, 110, 0.20) 0, rgba(15, 118, 110, 0.06) 35%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(135deg, #f6fbfb 0%, #ecf8f8 45%, #fff7ef 100%);
  overflow: hidden;
}

.csx-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(15, 118, 110, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 118, 110, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}

.csx-hero > div {
  position: relative;
  z-index: 1;
}

.csx-hero h2 {
  margin: 0 0 8px;
  font-size: 1.65rem;
}

.csx-eyebrow {
  margin: 0 0 6px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f766e;
  font-weight: 700;
}

.csx-hero p {
  margin: 0 0 10px;
  max-width: 760px;
}

.csx-hero-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.csx-link-chip {
  border: 1px solid #99b8d1;
  background: #ffffffcf;
  color: #0b4d7a !important;
  text-decoration: none !important;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
}

.csx-link-chip:hover {
  border-color: #0f766e;
  color: #0f766e !important;
}

.csx-shell {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 13px;
  margin: 10px 0 16px;
}

.csx-panel {
  border: 1px solid #d6e3f2;
  border-radius: 14px;
  padding: 15px;
  background: linear-gradient(165deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 12px 30px -24px rgba(12, 74, 110, 0.38);
  animation: csx-rise 320ms ease both;
  overflow: hidden;
}

.csx-panel h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.csx-upload-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}

.csx-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-weight: 600;
  font-size: 13px;
}

.csx-field textarea,
.csx-field input[type="file"],
.csx-field select {
  border: 1px solid #c4d6ea;
  border-radius: 10px;
  padding: 8px;
  font-size: 13px;
  background: #fff;
}

.csx-field textarea {
  font-family: "IBM Plex Mono", "Fira Code", monospace;
}

.csx-btn {
  border: 1px solid #0f766e;
  border-radius: 10px;
  background: linear-gradient(135deg, #0f766e 0%, #0b5f58 100%);
  color: #fff;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 7px 16px -10px rgba(15, 118, 110, 0.9);
}

.csx-btn:hover {
  transform: translateY(-1px);
}

.csx-btn-muted {
  border-color: #64748b;
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

.csx-status {
  margin: 8px 0 0;
  font-weight: 700;
  color: #0f766e;
}

.csx-status.error {
  color: #b91c1c;
}

.csx-kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  font-size: 13px;
}

.csx-kv-grid > div {
  overflow-wrap: anywhere;
}

.csx-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 11px;
  margin: 10px 0 16px;
}

.csx-card {
  border: 1px solid #d7e2ec;
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(160deg, #ffffff 0%, #f3f8ff 100%);
  box-shadow: 0 12px 30px -24px rgba(28, 50, 76, 0.42);
}

.csx-card-label {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4b5563;
  font-weight: 700;
}

.csx-card-value {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  overflow-wrap: anywhere;
}

.csx-bars {
  display: grid;
  gap: 10px;
}

.csx-bar-row {
  display: grid;
  gap: 4px;
  animation: csx-rise 260ms ease both;
  animation-delay: calc(var(--csx-stagger, 0) * 35ms);
}

.csx-bar-head {
  font-weight: 700;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.csx-bar-track {
  width: 100%;
  background: #e2e8f0;
  height: 11px;
  border-radius: 999px;
  overflow: hidden;
}

.csx-bar-fill {
  height: 100%;
  background: #0ea5e9;
  border-radius: 999px;
  transition: width 320ms ease;
}

.csx-key-stable { background: #16a34a; }
.csx-key-unstable { background: #dc2626; }
.csx-key-inconclusive { background: #ca8a04; }
.csx-key-ranking { background: #0284c7; }
.csx-key-decision { background: #4f46e5; }
.csx-key-distribution { background: #db2777; }
.csx-key-compilation_only { background: #0891b2; }
.csx-key-sampling_only { background: #f97316; }
.csx-key-combined_light { background: #16a34a; }

.csx-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.csx-table-wrap {
  overflow-x: auto;
}

.csx-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}

.csx-table thead {
  background: #eff6ff;
}

.csx-table th,
.csx-table td {
  border-bottom: 1px solid #dbe4ee;
  padding: 8px 9px;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.csx-table tr:hover td {
  background: #f8fafc;
}

@keyframes csx-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .csx-upload-grid {
    grid-template-columns: 1fr;
  }

  .csx-btn {
    width: 100%;
  }

  .csx-hero h2 {
    font-size: 1.35rem;
  }
}

@media (max-width: 360px) {
  .csx-shell,
  .csx-card-grid {
    grid-template-columns: 1fr;
  }
}

/* Dataset Registry visual language */
.csr-hero,
.csr-controls,
.csr-table,
.csr-entry,
.csr-artifact-link,
.csr-link-btn {
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
}

.csr-hero {
  border: 1px solid #9dcfc9;
  border-radius: 18px;
  padding: 20px;
  margin: 8px 0 16px;
  background:
    radial-gradient(circle at 10% 12%, rgba(14, 116, 144, 0.2) 0, rgba(14, 116, 144, 0.06) 40%, rgba(255, 255, 255, 0) 72%),
    linear-gradient(145deg, #f4fbfb 0%, #eff7ff 58%, #fff8ef 100%);
}

.csr-hero h2 {
  margin-top: 0;
  margin-bottom: 8px;
}

.csr-metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: 10px;
}

.csr-metrics > div {
  border: 1px solid #d0dbe8;
  border-radius: 12px;
  padding: 10px 12px;
  background: #ffffffc9;
}

.csr-metrics span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.csr-metrics strong {
  display: block;
  margin-top: 3px;
  font-size: 1.05rem;
}

.csr-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin: 10px 0 12px;
  padding: 10px;
  border: 1px solid #d6e4f3;
  border-radius: 13px;
  background: #f9fbff;
}

.csr-filter-group {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.csr-controls input,
.csr-controls select {
  border: 1px solid #bdd2e6;
  border-radius: 9px;
  height: 36px;
  padding: 6px 8px;
  background: #fff;
  max-width: 100%;
}

.csr-controls input {
  flex: 1 1 280px;
  min-width: 220px;
}

.csr-controls select {
  flex: 1 1 220px;
  min-width: 170px;
}

.csr-filter-count {
  margin: 0;
  margin-left: auto;
  align-self: center;
  font-size: 13px;
  color: #1e293b;
  white-space: nowrap;
}

.csr-table-wrap {
  overflow-x: auto;
  border: 1px solid #d9e5f2;
  border-radius: 13px;
  box-shadow: 0 12px 32px -28px rgba(15, 23, 42, 0.5);
}

.csr-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
}

.csr-table thead {
  background: linear-gradient(135deg, #eaf4ff 0%, #eef8f6 100%);
}

.csr-table th,
.csr-table td {
  border-bottom: 1px solid #dce7f2;
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.csr-table td:last-child,
.csr-table th:last-child {
  width: 160px;
}

.csr-row {
  cursor: pointer;
}

.csr-row:hover td,
.csr-row:focus td {
  background: #f8fbff;
}

.csr-row:focus {
  outline: 2px solid #0891b2;
  outline-offset: -2px;
}

.csr-pill {
  display: inline-block;
  border: 1px solid #a9c2db;
  border-radius: 999px;
  padding: 2px 8px;
  margin: 0 4px 4px 0;
  font-size: 12px;
  font-weight: 700;
  background: #f8fcff;
  color: #0f3f61;
}

.csr-link-btn {
  display: inline-block;
  border: 1px solid #0f766e;
  border-radius: 8px;
  padding: 4px 8px;
  text-decoration: none !important;
  color: #0f766e !important;
  font-size: 12px;
  font-weight: 700;
  background: #effcf9;
}

.csr-link-btn:hover {
  background: #dbf4ef;
}

.csr-entry {
  border: 1px solid #d6e5f2;
  border-radius: 16px;
  padding: 14px;
  margin: 16px 0;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  box-shadow: 0 14px 30px -28px rgba(15, 23, 42, 0.5);
}

.csr-entry h2 {
  margin-top: 0;
  margin-bottom: 6px;
}

.csr-entry-meta {
  margin-top: 0;
  margin-bottom: 10px;
  color: #1f2937;
}

.csr-pill-row {
  margin-bottom: 6px;
}

.csr-fold {
  margin: 10px 0;
  border: 1px solid #d8e4f0;
  border-radius: 11px;
  background: #fff;
  padding: 6px 10px;
}

.csr-fold > summary {
  cursor: pointer;
  font-weight: 700;
  color: #0f172a;
}

.csr-mini-table-wrap {
  overflow-x: auto;
  margin-top: 8px;
}

.csr-mini-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.csr-mini-table th,
.csr-mini-table td {
  border-bottom: 1px solid #dbe7f2;
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.csr-artifact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}

.csr-artifact-link {
  display: block;
  border: 1px solid #ceddec;
  border-radius: 10px;
  padding: 8px;
  text-decoration: none !important;
  background: #ffffff;
}

.csr-artifact-link span {
  display: block;
  color: #0b4d7a;
  font-weight: 700;
}

.csr-artifact-link small {
  display: block;
  margin-top: 3px;
  color: #475569;
  font-family: "IBM Plex Mono", "Fira Code", monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.csr-codeblock {
  margin: 8px 0 4px;
  padding: 10px;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  overflow-x: auto;
  white-space: pre;
}

.csr-backtop {
  margin: 10px 0 0;
  text-align: right;
  font-size: 13px;
}

@media (max-width: 980px) {
  .csr-controls {
    align-items: stretch;
  }

  .csr-controls input,
  .csr-controls select {
    min-width: 0;
    width: 100%;
    flex-basis: 100%;
  }

  .csr-filter-count {
    margin-left: 0;
    width: 100%;
    text-align: left;
  }
}
