
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #0d1117;
  color: #e6edf3;
  line-height: 1.55;
  font-size: 16px;
}
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.site-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
  padding: 2rem 0 1.75rem;
  border-bottom: 1px solid #30363d;
}
.eyebrow { color: #c9a227; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 0.5rem; }
.site-header h1 { margin: 0 0 0.5rem; font-size: 1.85rem; }
.tagline { color: #8b949e; margin: 0 0 1rem; max-width: 40rem; }
.site-nav { margin-bottom: 1rem; }
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}
.site-nav a {
  color: #8b949e;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}
.site-nav a:hover, .site-nav a.active { color: #e6edf3; }
.site-nav a.active { text-decoration: underline; text-underline-offset: 0.2em; }
.header-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.pdf-btn, .app-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.pdf-btn { background: #c9a227; color: #1a1a2e; }
.app-link { background: transparent; color: #e6edf3; border: 1px solid #484f58; }
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 2rem 20px 3rem;
}
.layout-with-sidebar {
  grid-template-columns: 220px 1fr;
}
@media (max-width: 800px) {
  .layout-with-sidebar { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0.65rem 0.85rem;
  }
  .sidebar-details:not([open]) > ul { display: none; }
  .sidebar-details[open] > ul {
    max-height: 45vh;
    overflow-y: auto;
    margin-top: 0.5rem;
  }
}
.sidebar {
  position: sticky;
  top: 1rem;
  align-self: start;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}
.sidebar-details > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.sidebar-details > summary::-webkit-details-marker { display: none; }
.sidebar-details > summary::after {
  content: " ▾";
  font-size: 0.85em;
}
.sidebar-details[open] > summary::after { content: " ▴"; }
@media (min-width: 801px) {
  .sidebar-details > summary {
    cursor: default;
    pointer-events: none;
  }
  .sidebar-details > summary::after { content: none; }
}
.nav-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: #8b949e; margin: 0 0 0.75rem; }
.sidebar-details:not([open]) .nav-title { margin-bottom: 0; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin: 0.35rem 0; }
.sidebar a { color: #8b949e; text-decoration: none; font-size: 0.88rem; }
.sidebar a:hover { color: #e6edf3; }
.content h1 { font-size: 1.5rem; margin: 0 0 1rem; color: #e6edf3; }
.content h2 {
  color: #e6edf3;
  font-size: 1.35rem;
  margin: 2rem 0 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid #21262d;
}
.content h2:first-of-type { border-top: none; margin-top: 0; }
.content h3 { color: #c9a227; font-size: 1.05rem; margin: 1.25rem 0 0.5rem; }
.content p { margin: 0 0 0.85rem; color: #c9d1d9; }
.content ul { margin: 0 0 1rem; padding-left: 1.25rem; }
.content li { margin: 0.3rem 0; }
.content a { color: #58a6ff; }
.content code {
  background: #21262d;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.9em;
}
.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 1.25rem;
  font-size: 0.92rem;
}
.content th, .content td {
  border: 1px solid #30363d;
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: top;
}
.content th { background: #21262d; color: #e6edf3; }
.toc-item { margin-left: 0.5rem; }
.footer-note { font-size: 0.85rem; color: #8b949e; margin-top: 2rem; }
.site-footer {
  border-top: 1px solid #21262d;
  padding: 1.5rem 0;
  color: #8b949e;
  font-size: 0.85rem;
}
.site-footer a { color: #8b949e; }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.75rem;
}
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { color: #e6edf3; }
