:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #6b7280;
  --accent: #dc3545;
  --accent-dark: #b02a37;
  --stroke: #e6eef8;
  --bg-elev: #f8fafe;
  --panel: #ffffff;
  --panel-soft: var(--accent);
  --accent-2: #dc3545;
  --line: #e6eef8;
  --ok: #32d583;
  --warn: #f9b949;
  --radius: 16px;
  --shadow: 0 24px 40px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
}

body {
  display: grid;
  grid-template-columns: 280px 1fr;
}

.bg-glow {
  position: fixed;
  border-radius: 999px;
  filter: blur(75px);
  pointer-events: none;
  z-index: 0;
}

.bg-glow-a {
  width: 260px;
  height: 260px;
  background: rgba(15, 23, 42, 0.04);
  top: -90px;
  left: -80px;
}

.bg-glow-b {
  width: 300px;
  height: 300px;
  background: rgba(230, 238, 248, 0.8);
  bottom: -90px;
  right: -100px;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  padding: 22px;
  z-index: 2;
}

.brand h1 {
  margin: 8px 0 4px;
  font-size: 1.4rem;
}

.brand-kicker {
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#cliVersion {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
}

#sideNav {
  margin-top: 20px;
  display: grid;
  gap: 6px;
}

.nav-link {
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  display: block;
  transition: all .18s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
  border-color: var(--accent-dark);
  background: var(--accent);
}

.main {
  padding: 28px;
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 18px;
}

.topbar-info {
  display: grid;
  gap: 8px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-size: 0.74rem;
}

.topbar h2 {
  margin: 4px 0 0;
}

.latest-release-mini.is-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.latest-mini-card {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.96), rgba(250, 252, 255, 0.98));
  padding: 10px 12px;
  max-width: 680px;
}

.latest-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.latest-mini-version {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--accent);
  color: #ffffff;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
}

.latest-mini-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.latest-mini-list {
  margin: 8px 0;
  padding-left: 18px;
  color: #1f2937;
  font-size: 0.9rem;
}

.latest-mini-list li + li {
  margin-top: 4px;
}

.latest-mini-link {
  color: var(--accent-dark);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}

.latest-mini-link:hover {
  text-decoration: underline;
}

.search-wrap input {
  width: 360px;
  max-width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--stroke);
  color: var(--ink);
  padding: 11px 14px;
  border-radius: 12px;
  font-family: inherit;
}

.panel {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.92), rgba(250, 252, 255, 0.98));
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
  scroll-margin-top: 18px;
}

.section-title {
  margin: 0 0 8px;
}

.section-sub {
  margin: 0 0 14px;
  color: var(--muted);
}

.section-actions {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 12px;
}

.section-action-btn {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.section-action-btn:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.guide-details {
  border: 1px dashed var(--stroke);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
}

.guide-details summary {
  cursor: pointer;
  color: #243447;
  font-weight: 600;
}

.guide-details p {
  color: var(--muted);
}

.guide-code-block {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 10px;
  margin-top: 8px;
}

.guide-code-block pre {
  margin: 0;
  padding: 10px;
  background: #ffffff;
  border-radius: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 100%;
}

.guide-code-block code { display: block; }

.guide-code-block .copy-btn { align-self: flex-start; height: 36px; }

.guide-subtitle {
  margin: 10px 0 4px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #3b4658;
}

.guide-list {
  margin: 6px 0 0;
  padding-left: 18px;
  color: #334155;
}

.cards {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.version-cards {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.release-card {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--surface);
  padding: 14px;
}

.release-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.release-version {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: #ffe8ec;
  color: var(--accent-dark);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
}

.release-version.is-latest {
  background: var(--accent);
  color: #ffffff;
}

.release-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.release-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.change-type {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 600;
}

.change-release { background: #f1f5f9; color: #0f172a; }
.change-feature { background: #e8f7ee; color: #166534; }
.change-fix { background: #eef2ff; color: #3730a3; }
.change-docs { background: #fff7e6; color: #9a6700; }
.change-refactor { background: #f4f4f5; color: #3f3f46; }
.change-performance { background: #e0f2fe; color: #0c4a6e; }
.change-security { background: #fee2e2; color: #991b1b; }
.change-test { background: #ede9fe; color: #5b21b6; }
.change-chore { background: #f3f4f6; color: #374151; }
.change-other { background: #f8fafc; color: #334155; }

.release-details {
  margin-top: 10px;
}

.release-list {
  margin: 8px 0 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.release-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.release-item-text {
  color: #1f2937;
  font-size: 0.9rem;
  line-height: 1.35;
}

.step-card,
.command-card,
.scenario-card,
.faq-card,
.error-card {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--surface);
  padding: 13px;
}

.step-index {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
}

.code-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 8px 10px;
  margin-top: 8px;
}

code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.84rem;
  color: #0b4a6f;
}

.copy-btn {
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--accent);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
}

.copy-btn:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.command-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--accent);
  color: #ffffff;
  border-radius: 999px;
  padding: 4px 8px;
}

details {
  margin-top: 8px;
  border: 1px dashed var(--stroke);
  border-radius: 10px;
  padding: 8px 10px;
}

details summary {
  cursor: pointer;
  color: #3b4658;
}

.list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #334155;
}

.hidden-by-search {
  display: none !important;
}

@media (max-width: 960px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-wrap input {
    width: 100%;
  }
}
