/* Shared outer layout for the four tools with a primary workspace and an auxiliary panel. */
.exp-page-layout,
.workspace,
.prices-layout,
.speed-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.exp-page-layout > *,
.workspace > *,
.prices-layout > *,
.speed-layout > * {
  min-width: 0;
}

/* Keep the useful mobile DOM order while placing the main content on the left on desktop. */
.exp-page-layout .exp-modules,
.prices-layout .results-card {
  grid-column: 1;
  grid-row: 1;
}

.exp-page-layout .module-nav,
.prices-layout .filter-card {
  grid-column: 2;
  grid-row: 1;
}

.exp-page-layout .module-nav,
.workspace .result-card,
.prices-layout .filter-card,
.speed-layout .speed-summary {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.exp-page-layout .module-nav-panel,
.workspace .result-card,
.prices-layout .filter-card,
.speed-layout .speed-summary {
  padding: 20px;
  border-radius: 20px;
}

.exp-page-layout .module-nav-title {
  margin: 0 0 10px;
}

/* The outer 300px sidebar narrows the module column near the desktop breakpoint. */
@media (min-width: 1101px) and (max-width: 1220px) {
  .exp-page-layout .vital-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1100px) {
  .exp-page-layout,
  .workspace,
  .prices-layout,
  .speed-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .exp-page-layout .module-nav,
  .exp-page-layout .exp-modules,
  .prices-layout .filter-card,
  .prices-layout .results-card {
    grid-column: 1;
  }

  .exp-page-layout .module-nav,
  .prices-layout .filter-card {
    grid-row: 1;
  }

  .exp-page-layout .exp-modules,
  .prices-layout .results-card {
    grid-row: 2;
  }

  .exp-page-layout .module-nav,
  .workspace .result-card,
  .prices-layout .filter-card,
  .speed-layout .speed-summary {
    max-height: none;
    overflow-y: visible;
  }

  .workspace .result-card,
  .prices-layout .filter-card,
  .speed-layout .speed-summary {
    position: static;
  }

  .exp-page-layout .module-nav {
    top: 0;
  }

  .exp-page-layout .module-nav-panel {
    padding: 0;
    border-radius: 12px;
  }
}

@media (max-width: 560px) {
  .exp-page-layout,
  .workspace,
  .prices-layout,
  .speed-layout {
    gap: 18px;
  }

  .workspace .result-card,
  .prices-layout .filter-card,
  .speed-layout .speed-summary {
    padding: 16px;
    border-radius: 16px;
  }
}
