:root {
  --bg: #09090b;
  --bg-card: #18181b;
  --bg-hover: #27272a;
  --border: #3f3f46;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #22d3ee;
  --primary-hover: #06b6d4;
  --sidebar-width: 260px;
  --content-max: 920px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }

.site {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1.25rem;
}

.sidebar-brand:hover { text-decoration: none; color: var(--text); }

.sidebar-logo {
  width: 36px;
  height: 36px;
  background: rgba(34, 211, 238, 0.15);
  color: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sidebar-brand strong { display: block; font-size: 0.95rem; }
.sidebar-brand small { display: block; color: var(--muted); font-size: 0.75rem; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.nav-link {
  display: block;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.875rem;
  text-decoration: none;
}

.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text);
  text-decoration: none;
}

.nav-link.active {
  background: rgba(34, 211, 238, 0.15);
  color: var(--primary);
  font-weight: 500;
}

.sidebar-footer {
  padding: 1rem 0.75rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: auto;
}

.sidebar-issues-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0 0.75rem 0.25rem;
}

.sidebar-issues-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar-issues-list a {
  display: block;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-issues-list a:hover {
  color: var(--primary);
  background: rgba(34, 211, 238, 0.08);
  text-decoration: none;
}

.sidebar-issues-loading,
.sidebar-issues-empty {
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.sidebar-issues-all {
  padding: 0.35rem 0.75rem 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.sidebar-issues-all:hover {
  color: var(--primary);
}

.sidebar-footer a { color: var(--muted); }
.sidebar-footer a:hover { color: var(--primary); }

.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.content {
  flex: 1;
  max-width: var(--content-max);
  padding: 2rem 2.5rem 3rem;
  width: 100%;
}

.page-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  font-weight: 700;
}

.page-lead {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.content h1 { font-size: 1.75rem; margin-top: 0; }
.content h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.content h3 { font-size: 1.05rem; margin-top: 1.5rem; }

.content p, .content li { color: #cbd5e1; }
.content strong { color: var(--text); }

.content pre {
  background: #0a0a0b;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.85rem;
}

.content code {
  background: var(--bg-hover);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.875em;
}

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

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.9rem;
}

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

.content th {
  background: var(--bg-card);
  color: var(--text);
  font-weight: 600;
}

.content tr:nth-child(even) td {
  background: rgba(24, 24, 27, 0.5);
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.table-scroll table {
  margin: 0;
  min-width: 100%;
}

.content blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--primary);
  background: var(--bg-card);
  color: var(--muted);
}

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

.content ul, .content ol { padding-left: 1.25rem; }

.hero-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.12);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero {
  margin: -0.5rem 0 1.75rem;
  text-align: center;
}

.content .banner {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: block;
  margin: 0 0 1rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1rem;
}

.hero-badges a {
  line-height: 0;
  text-decoration: none;
}

.hero-badges img {
  display: block;
  height: 22px;
  width: auto;
}

.hero-lead {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

.hero-lead a {
  color: var(--primary);
}

.quick-links {
  text-align: center;
  margin: 1.25rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.quick-links a { margin: 0 0.15rem; }

.site-footer {
  max-width: var(--content-max);
  padding: 1rem 2.5rem 2rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.site-footer p { margin: 0; }

.mobile-header { display: none; }
.sidebar-overlay { display: none; }

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-hover);
  cursor: pointer;
  flex-shrink: 0;
}

.menu-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

body.nav-open .menu-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.nav-open .menu-toggle-bar:nth-child(2) {
  opacity: 0;
}

body.nav-open .menu-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 900px) {
  .mobile-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    padding: 0 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    z-index: 150;
  }

  .mobile-title {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 180;
  }

  body.nav-open .sidebar-overlay {
    display: block;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: min(280px, 85vw);
    z-index: 200;
    border-bottom: none;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
    padding-top: 56px;
    width: 100%;
  }

  .content {
    padding: 1.25rem 1rem 2rem;
    max-width: 100%;
  }

  .site-footer {
    padding: 1rem 1rem 2rem;
    max-width: 100%;
  }

  .hero-badges img {
    height: 20px;
  }

  .content .banner {
    border-radius: 8px;
  }

  .table-scroll th,
  .table-scroll td {
    min-width: 100px;
    font-size: 0.85rem;
    padding: 0.5rem 0.6rem;
  }
}
