:root {
  color-scheme: light;
  --bg: #f7f5f1;
  --panel: #fffdf8;
  --text: #201c17;
  --muted: #65584b;
  --line: #e4d7c7;
  --accent: #8c5a2b;
  --accent-soft: #f1e3d3;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #fbf8f3 0%, #f2ece3 100%);
  color: var(--text);
}
.home-shell, .reference-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px 72px;
}
.reference-header, .home-hero {
  margin-bottom: 22px;
}
h1 {
  margin: 6px 0 10px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.05;
}
.reference-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}
.reference-lede, .home-lede {
  color: var(--muted);
  max-width: 78ch;
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.6;
}
.reference-nav, .home-nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 20px 0 24px;
}
.reference-nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.reference-panel, .home-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(63, 43, 23, 0.06);
}
.reference-panel + .reference-panel { margin-top: 16px; }
.reference-table, table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-size: 0.88rem;
  color: var(--muted);
}
code, pre {
  background: #f6efe6;
  border-radius: 10px;
}
code {
  padding: 0.15rem 0.35rem;
}
pre {
  padding: 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  white-space: pre-wrap;
  word-break: break-word;
}
ul, ol { margin-top: 0.4rem; }
.toc {
  padding-left: 18px;
}
.toc li {
  margin: 0.3rem 0;
}
.back-top {
  margin-top: 12px;
  font-size: 0.92rem;
}
.back-top a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.home-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.tab-nav {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.home-tab {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 8px 24px rgba(63, 43, 23, 0.06);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.home-tab:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(63, 43, 23, 0.1);
}
.home-tab.is-active {
  border-color: var(--accent);
}
.tab-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}
.tab-title {
  font-size: 1.05rem;
  font-weight: 700;
}
.home-card {
  text-decoration: none;
  color: inherit;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.home-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(63, 43, 23, 0.1);
}
.home-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(63, 43, 23, 0.06);
}
.home-panel-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}
.home-card h2, .reference-panel h2 {
  margin-top: 0;
}