:root {
  --bg: #E8D5C4;
  --surface: #F2E6D9;
  --text: #4A3F35;
  --text-dim: #6B5D4F;
  --border: #C9B8A8;
  --accent: #8B7355;
}

[data-theme="dark"] {
  --bg: #2C2520;
  --surface: #3A322B;
  --text: #E0D2C4;
  --text-dim: #B8A898;
  --border: #4A3F35;
  --accent: #C9A87C;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "SF Mono", "Cascadia Code", "Fira Code", "JetBrains Mono", "Menlo", "Consolas", "DejaVu Sans Mono", monospace;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
}

main {
  max-width: 72ch;
  margin: 0 auto;
  padding: 2rem 1rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1, h2, h3 {
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

h1 { font-size: 1.4rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-dim);
}

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
}

code {
  background: var(--surface);
  padding: 0.1rem 0.3rem;
  font-size: 0.9em;
}

pre code {
  background: none;
  padding: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

ul, ol {
  margin-bottom: 1rem;
  padding-left: 2rem;
  color: var(--text-dim);
}

li {
  margin-bottom: 0.3rem;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
}

.toggle:hover {
  background: var(--border);
}

.toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.disclosure {
  font-size: 0.8rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 0.5rem;
  margin-bottom: 1.5rem;
}

.context-list {
  list-style: none;
  padding-left: 0;
}

.context-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}

.context-list li:last-child {
  border-bottom: none;
}

.context-list a {
  font-weight: bold;
}

.context-list .desc {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.back {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.raw-link {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.copy-raw-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.1rem 0.35rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.75rem;
}

.copy-raw-btn:hover {
  background: var(--border);
}

.copy-raw-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.install pre {
  margin-top: 0.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

th, td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text);
  font-weight: bold;
}

td {
  color: var(--text-dim);
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 0.5rem;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}
