header {
  margin-bottom: 1rem;
}

body {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1rem;
  line-height: 1.5;
  background: var(--surface);
  color: var(--on_surface);
}

a {
  color: var(--primary);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--outline);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

nav a {
  display: inline-block;
}

nav a:hover {
  color: var(--on_hover);
  background: var(--hover);
}

.theme-picker {
  position: relative;
}

.mode-picker {
  position: relative;
}

.theme-summary {
  cursor: pointer;
}

.mode-summary {
  cursor: pointer;
}

.theme-menu {
  position: absolute;
  right: 0;
  z-index: 1;
  min-width: 16rem;
  margin-top: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--outline);
  background: var(--surface);
}

.mode-menu {
  position: absolute;
  right: 0;
  z-index: 1;
  min-width: 8rem;
  margin-top: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--outline);
  background: var(--surface);
  display: grid;
  gap: 0.25rem;
}

.theme-search {
  width: 100%;
  margin-bottom: 0.5rem;
  border: 1px solid var(--outline);
  background: var(--surface_variant);
  color: var(--on_surface);
  box-sizing: border-box;
}

.theme-options {
  display: grid;
  gap: 0.25rem;
  max-height: 16rem;
  overflow-y: auto;
}

.theme-option {
  width: 100%;
  border: 1px solid var(--outline);
  background: var(--surface);
  color: var(--on_surface);
  text-align: left;
}

.mode-option {
  width: 100%;
  border: 1px solid var(--outline);
  background: var(--surface);
  color: var(--on_surface);
  text-align: left;
}

.theme-option.selected,
.theme-option:hover,
.mode-option.selected,
.mode-option:hover {
  background: var(--hover);
  color: var(--on_hover);
}

.page-title {
  text-align: center;
  margin-bottom: 0;
}

.page-subtitle {
  text-align: center;
  margin-top: 0;
}

pre,
code {
  color: inherit;
}

button,
input,
select,
summary,
nav a {
  min-height: 24px;
  min-width: 24px;
  box-sizing: border-box;
}

:focus-visible {
  outline: 2px solid var(--on_surface);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0.5rem 1rem;
  background: var(--surface);
  color: var(--on_surface);
  z-index: 10;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

@media (max-width: 40rem) {
  .theme-menu {
    position: fixed;
    left: 1rem;
    right: 1rem;
    min-width: 0;
  }
}
