:root, [data-theme="dark"] {
  --ink: #0f0e0c;
  --panel: #16140f;
  --surface: #1c1914;
  --line: rgba(239, 230, 212, 0.12);
  --paper: #efe6d4;
  --muted: #9a9184;
  --copper: #c17a3a;
  --copper2: #e8a05a;
}
[data-theme="light"] {
  --ink: #ebe4d8;
  --panel: #fff;
  --surface: #faf8f5;
  --line: rgba(20, 18, 14, 0.14);
  --paper: #14120e;
  --muted: #6b6560;
  --copper: #a8682a;
  --copper2: #c17a3a;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Sora, sans-serif;
  background: var(--ink);
  color: var(--paper);
  line-height: 1.6;
}
a { color: var(--copper2); text-decoration: none; }
a:hover { text-decoration: underline; }
.shell { display: flex; min-height: 100vh; align-items: flex-start; }
.side {
  position: sticky;
  top: 0;
  width: 240px;
  height: 100vh;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 22px 16px 24px;
  overflow-x: hidden;
  overflow-y: auto;
}
.side-top { margin-bottom: 18px; }
.brand {
  font-family: Fraunces, serif;
  font-size: 1.15rem;
  color: var(--copper2);
  display: block;
  margin-bottom: 10px;
}
.docs-switchers {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.theme-toggle {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--copper2); border-color: rgba(193, 122, 58, 0.45); }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .theme-toggle .ico-sun { display: block; }
[data-theme="dark"] .theme-toggle .ico-moon { display: none; }
[data-theme="light"] .theme-toggle .ico-sun { display: none; }
[data-theme="light"] .theme-toggle .ico-moon { display: block; }
.lang-switch { display: flex; gap: 4px; }
.lang-switch button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.lang-switch button.active {
  color: var(--copper2);
  border-color: rgba(193, 122, 58, 0.55);
  background: rgba(193, 122, 58, 0.1);
}
.nav-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 16px 0 6px;
}
.side a.item {
  display: block;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--paper);
  font-size: 13px;
  text-decoration: none;
}
.side a.item:hover, .side a.item.active {
  background: rgba(193, 122, 58, 0.12);
  color: var(--copper2);
}
.main { flex: 1; min-width: 0; padding: 28px 36px 80px; max-width: 860px; }
h1 { font-family: Fraunces, serif; font-weight: 500; font-size: 2rem; margin: 0 0 10px; }
h2 { font-family: Fraunces, serif; font-weight: 500; font-size: 1.25rem; margin: 36px 0 10px; scroll-margin-top: 20px; }
h3 { font-size: 0.95rem; margin: 22px 0 8px; }
.lead { color: var(--muted); font-size: 15px; margin: 0 0 22px; }
p, li { font-size: 14px; }
ul { padding-left: 18px; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}
pre {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 40px 14px 14px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  margin: 0 0 14px;
}
pre code { background: none; border: 0; padding: 0; }
.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
}
.copy:hover { color: var(--copper2); }
.lang-tabs { display: flex; gap: 4px; margin: 12px 0 0; }
.lang-tabs button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.lang-tabs button.active {
  color: var(--copper2);
  border-color: rgba(193, 122, 58, 0.55);
  background: rgba(193, 122, 58, 0.1);
}
.pane { display: none; }
.pane.active { display: block; }
.note {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
  margin: 14px 0;
}
#live-quotes { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 10px 0 18px; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 11px; letter-spacing: 0.04em; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: var(--panel);
}
.card h3 { margin: 0 0 6px; font-family: Fraunces, serif; font-weight: 500; }
.card p { margin: 0; color: var(--muted); font-size: 13px; }
.foot { margin-top: 40px; color: var(--muted); font-size: 12px; }
.quote-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.quote-head button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--copper2);
  border-radius: 999px;
  padding: 5px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.quote-meta { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.credits { color: var(--copper2); font-weight: 600; white-space: nowrap; }
@media (max-width: 800px) {
  .shell { display: block; }
  .side {
    width: auto;
    height: auto;
    max-height: 42vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    z-index: 20;
  }
  .main { padding: 20px 16px 64px; }
  .cards { grid-template-columns: 1fr; }
  h2 { scroll-margin-top: calc(42vh + 8px); }
}
