#docsWrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  color: var(--md-sys-color-on-surface);
  line-height: 1.6;
}

#docsHeader {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

#docsHeader h1 {
  font-size: 2rem;
  font-weight: bold;
}

#backLink {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
  opacity: 0.7;
  font-size: 0.95rem;
  transition: opacity 150ms;
}

#backLink:hover {
  opacity: 1;
}

#docsLayout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

/* The contents stay in view while the page scrolls */
#docsNav {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  font-size: 0.92rem;
}

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

#docsNav ol ol {
  padding-left: 1rem;
  margin: 0.2rem 0 0.4rem;
}

#docsNav a {
  display: block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
}

#docsNav a:hover {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

#docsContent section {
  margin-bottom: 3rem;
}

#docsContent h2 {
  font-size: 1.6rem;
  font-weight: bold;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

#docsContent h3 {
  font-size: 1.2rem;
  font-weight: bold;
  margin: 1.8rem 0 0.8rem;
}

#docsContent h3.category {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.35rem;
  color: var(--md-sys-color-primary);
}

#docsContent h4 {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

#docsContent p,
#docsContent ul,
#docsContent ol,
#docsContent dl,
#docsContent table {
  margin-bottom: 1rem;
}

#docsContent ul,
#docsContent ol {
  padding-left: 1.5rem;
}

#docsContent li {
  margin-bottom: 0.35rem;
}

#docsContent a {
  color: var(--md-sys-color-primary);
}

#docsContent code,
#docsContent kbd {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--md-sys-color-surface-container-high);
}

#docsContent kbd {
  border: 1px solid var(--md-sys-color-outline-variant);
  border-bottom-width: 2px;
}

#docsContent table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

#docsContent th,
#docsContent td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

#docsContent th {
  background: var(--md-sys-color-surface-container);
  font-weight: bold;
}

/* Linked from the details panel's "?" button: the anchor isn't hidden under the top of the window */
#docsContent [id] {
  scroll-margin-top: 1rem;
}

.step {
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 12px;
  background: var(--md-sys-color-surface-container-low);
  transition: border-color 300ms, box-shadow 300ms;
}

/* The step the "?" button opened */
.step:target {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px var(--md-sys-color-primary);
}

.step dl {
  display: grid;
  grid-template-columns: minmax(8rem, max-content) 1fr;
  gap: 0.35rem 1rem;
  margin-bottom: 0.5rem;
}

.step dt {
  font-weight: bold;
}

.step dd {
  margin: 0;
}

.step p:last-child,
.step dl:last-child {
  margin-bottom: 0;
}

.advanced {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: normal;
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.tip {
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--md-sys-color-tertiary);
  background: var(--md-sys-color-surface-container);
  border-radius: 0 6px 6px 0;
  font-size: 0.95rem;
}

@media (max-width: 800px) {
  #docsWrapper {
    padding: 1.5rem 1rem;
  }

  #docsLayout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  #docsNav {
    position: static;
    max-height: none;
    padding: 0.75rem;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 12px;
  }

  .step dl {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .step dd {
    margin-bottom: 0.5rem;
  }

  #docsContent table {
    display: block;
    overflow-x: auto;
  }
}
