/* Also loaded by the engines with their own layout, hence the selector outweighing theirs */
html body .debug-panel {
  position: fixed;
  right: 0.75rem;
  bottom: 6rem;
  z-index: 10000;
  font: 0.8rem/1.35 ui-monospace, Menlo, monospace;
  color: #e5e7eb;

  summary {
    list-style: none;
    cursor: pointer;
    width: 2.5rem;
    height: 2.5rem;
    margin-left: auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #111827;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.3);
    font-size: 1.2rem;

    &::-webkit-details-marker {
      display: none;
    }
  }

  .debug-content {
    position: absolute;
    right: 0;
    bottom: 3rem;
    width: min(24rem, calc(100vw - 1.5rem));
    max-height: 70dvh;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: #111827;
    box-shadow: 0 4px 16px rgb(0 0 0 / 0.4);
  }

  nav {
    display: flex;
    gap: 0.75rem;
    align-items: center;
  }

  h4 {
    margin: 0.75rem 0 0.25rem;
    color: #fbbf24;
    font-size: inherit;
  }

  dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.1rem 0.6rem;
    margin: 0;

    dd {
      margin: 0;
      overflow-wrap: anywhere;
    }
  }

  .debug-hint {
    color: #9ca3af;
    font-weight: normal;
  }

  dt {
    color: #9ca3af;
  }

  p, ul {
    margin: 0;
  }

  ul {
    padding: 0;
    list-style: none;
  }

  a {
    color: #93c5fd;
    text-decoration: none;
  }

  form {
    display: inline;
    margin: 0;
  }

  button {
    font: inherit;
    color: #93c5fd;
    background: none;
    border: none;
    padding: 0.1rem 0;
    cursor: pointer;
    text-align: left;

    &:disabled {
      color: #6b7280;
      cursor: default;
    }
  }
}
