:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --ink: #111b2e;
  --muted: #68768d;
  --line: #dfe5ed;
  --blue: #315cf4;
  --blue-soft: #edf1ff;
  --teal: #11867c;
  --rose: #c94f60;
  --sidebar: 0px;
}

html { background: var(--bg); }

body {
  min-width: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
}

.sidebar {
  position: sticky;
  top: 0;
  left: auto;
  z-index: 20;
  display: flex;
  width: 100%;
  height: 66px;
  padding: 0 max(24px, calc((100% - 1280px) / 2));
  gap: 34px;
  align-items: center;
  flex-direction: row;
  border-right: 0;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(14px);
}

.brand {
  min-width: 214px;
  gap: 10px;
  font-family: Manrope, sans-serif;
  font-size: 14px;
  letter-spacing: -0.03em;
}

.brand small {
  margin-top: 1px;
  font-size: 9px;
  letter-spacing: 0.02em;
}

.brand-symbol {
  width: 31px;
  height: 31px;
  padding-left: 5px;
  border-radius: 8px;
  font-size: 23px;
}

.brand-symbol span { font-size: 16px; }

.nav-label,
.sidebar-bottom { display: none; }

.sidebar nav {
  display: flex;
  min-width: 0;
  height: 100%;
  gap: 2px;
  align-items: stretch;
}

.nav-item {
  position: relative;
  width: auto;
  margin: 0;
  padding: 0 15px;
  gap: 7px;
  border-radius: 0;
  color: #6f7c91;
  font-size: 11px;
  white-space: nowrap;
}

.nav-item > span {
  width: auto;
  font-size: 14px;
}

.nav-item.active {
  background: transparent;
  color: var(--ink);
}

.nav-item.active::after {
  position: absolute;
  right: 15px;
  bottom: 0;
  left: 15px;
  height: 2px;
  background: var(--blue);
  content: "";
}

.nav-item b {
  border: 1px solid var(--line);
  background: var(--surface);
}

main {
  min-width: 0;
  margin-left: 0;
}

.topbar {
  width: min(calc(100% - 48px), 1280px);
  height: 52px;
  margin: 0 auto;
  padding: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.breadcrumb { display: none; }
.topbar { justify-content: flex-end; }

.top-actions { gap: 8px; }

.provider-link {
  height: 30px;
  padding: 6px 9px;
  border-color: var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-size: 9px;
}

.provider-link.selected {
  border-color: #cdd6ff;
  background: var(--blue-soft);
}

.avatar {
  width: 30px;
  height: 30px;
  background: var(--ink);
  color: white;
}

.page-body {
  width: min(calc(100% - 48px), 1280px);
  max-width: none;
  margin: 0 auto;
  padding: 20px 0 48px;
}

.dataset-banner {
  min-height: 44px;
  margin-bottom: 0;
  padding: 8px 0;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: #52647d;
}

.dataset-banner > span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
}

.dataset-banner > div {
  min-width: 0;
  flex: 1;
}

.dataset-banner b {
  display: inline;
  margin: 0 7px 0 0;
  color: var(--ink);
  font-size: 10px;
}

.dataset-banner div > span { font-size: 10px; }

.overview-hero {
  min-height: 245px;
  margin: 0;
  padding: 42px 0 34px;
  gap: 36px;
  align-items: flex-end;
}

.overview-hero > div { max-width: 940px; }

.overview-hero h1 {
  max-width: 900px;
  margin-bottom: 15px;
  font-size: clamp(38px, 4.5vw, 62px);
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.overview-hero p {
  max-width: 760px;
  color: #627189;
  font-size: 15px;
  line-height: 1.55;
}

.overview-hero .primary {
  margin-bottom: 4px;
  padding: 12px 17px;
  box-shadow: none;
}

.primary,
.secondary {
  border-radius: 6px;
  box-shadow: none;
}

.stats-grid {
  margin-bottom: 22px;
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat {
  min-width: 0;
  padding: 18px 20px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.stat:last-child { border-right: 0; }

.stat-label {
  color: #748197;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat-label span { display: none; }

.stat-value {
  margin: 6px 0 2px;
  color: var(--ink);
  font-size: 31px;
}

.stat-detail { font-size: 9px; }

.overview-grid {
  margin-bottom: 18px;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  gap: 18px;
}

.overview-grid.performance-grid { grid-template-columns: 1fr; }

.overview-stats {
  margin-top: 18px;
  margin-bottom: 0;
}

.panel {
  border-color: var(--line);
  border-radius: 9px;
  box-shadow: none;
}

.panel-heading { padding: 20px 21px 14px; }

.panel-heading h2 {
  color: var(--ink);
  font-size: 13px;
}

.panel-heading p {
  color: #7b889c;
  font-size: 9px;
}

.chart-empty,
.chart-container { height: 245px; }

.chart-empty { background: linear-gradient(180deg, #fff, #fbfcff); }

.empty-orbit {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.chart-legend { padding-bottom: 18px; }

.source-row,
.content-row {
  padding-right: 21px;
  padding-left: 21px;
}

.lab-grid {
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
}

.experiment-form { border-top: 3px solid var(--blue); }

.research-readiness,
.research-message,
.connection-card {
  border-radius: 8px;
  box-shadow: none;
}

table { min-width: 760px; }

dialog { border-radius: 10px; }

@media (max-width: 1050px) {
  .sidebar { padding-right: 20px; padding-left: 20px; gap: 18px; }
  .brand { min-width: 180px; }
  .nav-item { padding-right: 10px; padding-left: 10px; }
  .nav-item > span { display: none; }
  .topbar,
  .page-body { width: min(calc(100% - 40px), 1280px); }
  .overview-grid { grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.75fr); }
  .lab-grid { grid-template-columns: 270px minmax(0, 1fr); }
}

@media (max-width: 800px) {
  .sidebar {
    position: sticky;
    width: 100%;
    height: auto;
    min-height: 92px;
    padding: 12px 16px 0;
    gap: 8px;
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .brand {
    min-width: 0;
    margin-right: auto;
    font-size: 13px;
  }

  .brand > span:last-child { display: block; }
  .brand-symbol { margin: 0; }

  .sidebar nav {
    order: 3;
    width: calc(100% + 32px);
    height: 38px;
    margin: 0 -16px;
    padding: 0 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sidebar nav::-webkit-scrollbar { display: none; }

  .nav-item {
    padding: 0 12px;
    font-size: 10px;
  }

  .nav-item.active::after { right: 12px; left: 12px; }

  main { margin-left: 0; }

  .topbar {
    width: 100%;
    height: 46px;
    padding: 0 16px;
  }

  .breadcrumb { display: none; }

  .top-actions {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    scrollbar-width: none;
  }

  .top-actions::-webkit-scrollbar { display: none; }
  .avatar { display: none; }

  .page-body {
    width: 100%;
    padding: 14px 16px 36px;
  }

  .dataset-banner { margin-bottom: 0; }

  .overview-hero {
    min-height: 0;
    padding: 34px 0 30px;
    gap: 24px;
    align-items: flex-start;
    flex-direction: column;
  }

  .overview-hero h1 { font-size: clamp(34px, 10vw, 48px); }
  .overview-hero p { font-size: 14px; }
  .overview-hero .primary { align-self: flex-start; }

  .overview-grid,
  .lab-grid { grid-template-columns: 1fr; }

  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }

  .page-heading:not(.overview-hero) {
    gap: 16px;
    align-items: flex-start;
  }

  .dataset-banner div > span { display: inline; }
}

@media (max-width: 520px) {
  .topbar { padding: 0 12px; }
  .page-body { padding-right: 12px; padding-left: 12px; }

  .provider-link {
    flex: 0 0 auto;
    font-size: 9px;
  }

  .dataset-banner {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .panel-heading { flex-wrap: wrap; }

  .equity-panel .panel-actions {
    width: 100%;
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
  }

  .source-row { min-width: 0; }
  .source-row > div:nth-child(2) { min-width: 0; }

  .overview-hero h1 { font-size: 35px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat { padding: 15px 12px; }
  .stat-value { font-size: 27px; }
  .panel-heading { padding: 18px; }
  .source-row,
  .content-row { padding-right: 18px; padding-left: 18px; }
  .form-row { grid-template-columns: 1fr; }
  .experiment-form { padding-right: 18px; padding-left: 18px; }
}
