* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

a {
  color: var(--vscode-textLink-foreground);
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.25rem;
  padding: 0.6rem 1rem;
  background: var(--page-background);
  border-bottom: 1px solid var(--vscode-panel-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--vscode-foreground);
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
}

.tagline {
  flex: 1 1 20rem;
  margin: 0;
  color: var(--vscode-descriptionForeground);
}

.links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.install {
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  background: var(--page-accent);
  color: var(--page-accent-foreground);
  text-decoration: none;
  white-space: nowrap;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--vscode-panel-border);
}

select,
button {
  font: inherit;
  color: var(--vscode-dropdown-foreground);
  background: var(--vscode-dropdown-background);
  border: 1px solid var(--vscode-dropdown-border);
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
}

button {
  cursor: pointer;
}

button:hover {
  background: var(--vscode-list-hoverBackground);
}

:focus-visible {
  outline: 1px solid var(--vscode-focusBorder);
  outline-offset: 1px;
}

#status {
  color: var(--vscode-descriptionForeground);
}

.split {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 0;
}

.source {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--vscode-panel-border);
}

#editor {
  flex: 1;
  min-height: 0;
}

#editor .cm-editor {
  height: 100%;
}

#problems {
  max-height: 30%;
  overflow: auto;
  border-top: 1px solid var(--vscode-panel-border);
  padding: 0.25rem 1rem 0.5rem;
}

#problems h2 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--vscode-descriptionForeground);
  margin: 0.25rem 0;
}

#problem-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

#problem-list li {
  display: flex;
  gap: 0.5rem;
  padding: 0.1rem 0.25rem;
  border-radius: 3px;
  cursor: pointer;
}

#problem-list li:hover {
  background: var(--vscode-list-hoverBackground);
}

#problem-list .where,
#problem-list .code {
  color: var(--vscode-descriptionForeground);
  white-space: nowrap;
}

#problem-list .icon.warning {
  color: var(--vscode-charts-yellow);
}

#problem-list .icon.info {
  color: var(--vscode-charts-blue);
}

#panel {
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--vscode-editor-background);
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 1rem;
  padding: 0.4rem 1rem;
  border-top: 1px solid var(--vscode-panel-border);
  background: var(--page-background);
  color: var(--vscode-descriptionForeground);
  font-size: 0.85rem;
}

footer p {
  margin: 0;
}

.noscript {
  padding: 1rem;
}

/* Phones and narrow windows: the explanation below the script. */
@media (max-width: 760px) {
  html,
  body {
    height: auto;
  }

  .split {
    grid-template-columns: minmax(0, 1fr);
  }

  .source {
    border-right: 0;
    border-bottom: 1px solid var(--vscode-panel-border);
  }

  #editor {
    height: 45vh;
    flex: none;
  }

  #panel {
    height: 75vh;
  }
}
