/* Everything */
.graphiql-container {
  background-color: hsl(var(--color-base));
  display: flex;
  height: 100%;
  margin: 0;
  overflow: hidden;
  width: 100%;
}

/* The sidebar */
.graphiql-container .graphiql-sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--px-8);
  width: var(--sidebar-width);
}
.graphiql-container .graphiql-sidebar button {
  color: hsla(var(--color-neutral), var(--alpha-secondary));
  height: var(--sidebar-width);
  width: var(--sidebar-width);
}
.graphiql-container .graphiql-sidebar button.active {
  color: hsla(var(--color-neutral), 1);
}
.graphiql-container .graphiql-sidebar button:not(:first-child) {
  margin-top: var(--px-4);
}
.graphiql-container .graphiql-sidebar button > svg {
  height: calc(var(--sidebar-width) - (2 * var(--px-12)));
  padding: var(--px-12);
  width: calc(var(--sidebar-width) - (2 * var(--px-12)));
}

/* The main content, i.e. everything except the sidebar */
.graphiql-container .graphiql-main {
  display: flex;
  flex: 1;
}

/* The current session and tabs */
.graphiql-container .graphiql-sessions {
  background-color: hsla(var(--color-neutral), var(--alpha-background-light));
  /* Adding the 8px of padding to the inner border radius of the query editor */
  border-radius: calc(var(--border-radius-12) + var(--px-8));
  display: flex;
  flex-direction: column;
  flex: 1;
  max-height: 100%;
  margin: var(--px-16);
  margin-left: 0;
}

/* The session header containing tabs and the logo */
.graphiql-container .graphiql-session-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  height: var(--session-header-height);
}

/* The button to add a new tab */
button.graphiql-tab-add {
  margin-left: var(--px-12);
}
button.graphiql-tab-add > svg {
  color: hsla(var(--color-neutral), var(--alpha-secondary));
  display: block;
  height: var(--px-16);
  width: var(--px-16);
}

/* The right-hand-side of the session header */
.graphiql-container .graphiql-session-header-right {
  align-items: center;
  display: flex;
}

/* The GraphiQL logo */
.graphiql-container .graphiql-logo {
  color: hsla(var(--color-neutral), var(--alpha-secondary));
  font-size: var(--font-size-h4);
  font-weight: var(--font-weight-medium);
  padding: var(--px-12) var(--px-16);
}

/* Undo default link styling for the default GraphiQL logo link */
.graphiql-container .graphiql-logo .graphiql-logo-link {
  color: hsla(var(--color-neutral), var(--alpha-secondary));
  text-decoration: none;
}

/* The editor of the session */
.graphiql-container .graphiql-session {
  display: flex;
  flex: 1;
  padding: 0 var(--px-8) var(--px-8);
}

/* All editors (query, variable, headers) */
.graphiql-container .graphiql-editors {
  background-color: hsl(var(--color-base));
  border-radius: calc(var(--border-radius-12));
  display: flex;
  flex: 1;
  flex-direction: column;
}
.graphiql-container .graphiql-editors.full-height {
  margin-top: calc(var(--px-8) - var(--session-header-height));
}

/* The query editor and the toolbar */
.graphiql-container .graphiql-query-editor {
  border-bottom: 1px solid
    hsla(var(--color-neutral), var(--alpha-background-heavy));
  display: flex;
  flex: 1;
  padding: var(--px-16);
}

/* The query editor */
.graphiql-container .graphiql-query-editor-wrapper {
  display: flex;
  flex: 1;
}

/* The vertical toolbar next to the query editor */
.graphiql-container .graphiql-toolbar {
  margin-left: var(--px-16);
  width: var(--toolbar-width);
}
.graphiql-container .graphiql-toolbar > * + * {
  margin-top: var(--px-8);
}

/* The toolbar icons */
.graphiql-toolbar-icon {
  color: hsla(var(--color-neutral), var(--alpha-tertiary));
  display: block;
  height: calc(var(--toolbar-width) - (var(--px-8) * 2));
  padding: var(--px-8);
  width: calc(var(--toolbar-width) - (var(--px-8) * 2));
}

/* The tab bar for editor tools */
.graphiql-container .graphiql-editor-tools {
  align-items: center;
  cursor: row-resize;
  display: flex;
  justify-content: space-between;
  padding: var(--px-8);
}
.graphiql-container .graphiql-editor-tools button {
  color: hsla(var(--color-neutral), var(--alpha-secondary));
}
.graphiql-container .graphiql-editor-tools button.active {
  color: hsla(var(--color-neutral), 1);
}

/* The tab buttons to switch between editor tools */
.graphiql-container .graphiql-editor-tools-tabs {
  cursor: auto;
  display: flex;
}
.graphiql-container .graphiql-editor-tools-tabs > button {
  padding: var(--px-8) var(--px-12);
}
.graphiql-container .graphiql-editor-tools-tabs > button + button {
  margin-left: var(--px-8);
}

/* An editor tool, e.g. variable or header editor */
.graphiql-container .graphiql-editor-tool {
  flex: 1;
  padding: var(--px-16);
}

/* The response view */
.graphiql-container .graphiql-response {
  --editor-background: transparent;
  display: flex;
  flex: 1;
  flex-direction: column;
  position: relative;
}

/* The results editor wrapping container */
.graphiql-container .graphiql-response .result-window {
  position: relative;
  flex: 1;
}

/* The footer below the response view */
.graphiql-container .graphiql-footer {
  border-top: 1px solid
    hsla(var(--color-neutral), var(--alpha-background-heavy));
}

/* The plugin container */
.graphiql-container .graphiql-plugin {
  border-left: 1px solid
    hsla(var(--color-neutral), var(--alpha-background-heavy));
  flex: 1;
  max-width: calc(100% - 2 * var(--px-16));
  overflow-y: auto;
  padding: var(--px-16);
}

/* Generic drag bar for horizontal resizing */
.graphiql-container .graphiql-horizontal-drag-bar {
  width: var(--px-12);
  cursor: col-resize;
}
.graphiql-container .graphiql-horizontal-drag-bar:hover::after {
  border: var(--px-2) solid
    hsla(var(--color-neutral), var(--alpha-background-heavy));
  border-radius: var(--border-radius-2);
  content: '';
  display: block;
  height: 25%;
  margin: 0 auto;
  position: relative;
  /* (100% - 25%) / 2 = 37.5% */
  top: 37.5%;
  width: 0;
}

/* Generic icon style */
.graphiql-container .graphiql-chevron-icon {
  color: hsla(var(--color-neutral), var(--alpha-tertiary));
  display: block;
  height: var(--px-12);
  padding: var(--px-12);
  width: var(--px-12);
}

/* Generic spin animation */
.graphiql-spin {
  animation: spin 0.8s linear 0s infinite;
}
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* The header of the settings dialog */
reach-portal .graphiql-dialog-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: var(--px-24);
}

/* The title of the settings dialog */
reach-portal .graphiql-dialog-title {
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-medium);
}

/* A section inside the settings dialog */
reach-portal .graphiql-dialog-section {
  align-items: center;
  border-top: 1px solid
    hsla(var(--color-neutral), var(--alpha-background-heavy));
  display: flex;
  justify-content: space-between;
  padding: var(--px-24);
}
reach-portal .graphiql-dialog-section > :not(:first-child) {
  margin-left: var(--px-24);
}

/* The section title in the settings dialog */
reach-portal .graphiql-dialog-section-title {
  font-size: var(--font-size-h4);
  font-weight: var(--font-weight-medium);
}

/* The section caption in the settings dialog */
reach-portal .graphiql-dialog-section-caption {
  color: hsla(var(--color-neutral), var(--alpha-secondary));
}

reach-portal .graphiql-table {
  border-collapse: collapse;
  width: 100%;
}
reach-portal .graphiql-table :is(th, td) {
  border: 1px solid hsla(var(--color-neutral), var(--alpha-background-heavy));
  padding: var(--px-8) var(--px-12);
}

/* A single key the short-key dialog */
reach-portal .graphiql-key {
  background-color: hsla(var(--color-neutral), var(--alpha-background-medium));
  border-radius: var(--border-radius-4);
  padding: var(--px-4);
}

/* Avoid showing native tooltips for icons with titles */
.graphiql-container svg {
  pointer-events: none;
}
