:root {
  --guide-sidebar: 250px;
  --guide-topbar: 68px;
}

html {
  scroll-behavior: smooth;
}

.guide-page {
  background: #050b16;
  color: #e8eef8;
  min-height: 100vh;
}

.skip-link {
  background: #fff;
  color: #071426;
  left: 1rem;
  padding: 0.7rem 1rem;
  position: fixed;
  top: -5rem;
  z-index: 100;
}

.skip-link:focus {
  top: 0.5rem;
}

.sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.guide-topbar {
  align-items: center;
  background: rgba(5, 11, 22, 0.96);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  display: grid;
  gap: 1rem;
  grid-template-columns: var(--guide-sidebar) minmax(280px, 680px) auto;
  height: var(--guide-topbar);
  padding: 0 1rem;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 20;
}

.guide-back {
  align-items: center;
  color: #fff;
  display: flex;
  gap: 0.7rem;
  line-height: 1.15;
  text-decoration: none;
}

.guide-back > span:first-child {
  font-size: 1.4rem;
}

.guide-back small {
  color: #94a3b8;
  display: block;
  font-size: 0.7rem;
  margin-top: 0.15rem;
}

.guide-search input {
  background: #0b1729;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  color: #fff;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  width: 100%;
}

.guide-search input:focus {
  border-color: #818cf8;
  outline: 3px solid rgba(129, 140, 248, 0.25);
}

.guide-menu {
  background: #111f34;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 8px;
  color: #fff;
  display: none;
  padding: 0.65rem 0.8rem;
}

.guide-layout {
  display: grid;
  grid-template-columns: var(--guide-sidebar) minmax(0, 1fr);
  padding-top: var(--guide-topbar);
}

.guide-sidebar {
  background: #07101f;
  border-right: 1px solid rgba(148, 163, 184, 0.16);
  height: calc(100vh - var(--guide-topbar));
  overflow-y: auto;
  padding: 1rem;
  position: sticky;
  top: var(--guide-topbar);
}

.guide-sidebar nav,
#commandGroupNav {
  display: grid;
  gap: 0.2rem;
}

.guide-sidebar a {
  border-radius: 7px;
  color: #aebdd0;
  display: flex;
  font-size: 0.88rem;
  justify-content: space-between;
  padding: 0.58rem 0.7rem;
  text-decoration: none;
}

.guide-sidebar a:hover,
.guide-sidebar a:focus-visible {
  background: rgba(99, 102, 241, 0.15);
  color: #fff;
}

#commandGroupNav {
  border-left: 1px solid rgba(148, 163, 184, 0.22);
  margin: 0.15rem 0 0.5rem 0.7rem;
  padding-left: 0.45rem;
}

.guide-content {
  max-width: 1120px;
  padding: clamp(2rem, 5vw, 4.5rem);
  width: 100%;
}

.guide-intro,
.guide-doc-section {
  scroll-margin-top: calc(var(--guide-topbar) + 1.5rem);
}

.guide-intro h1 {
  font-size: clamp(2.3rem, 6vw, 4.4rem);
  letter-spacing: -0.05em;
  line-height: 1.02;
  max-width: 900px;
}

.guide-intro > p:not(.guide-kicker),
.guide-doc-section > header > p {
  color: #b7c4d6;
  font-size: 1.03rem;
  max-width: 850px;
}

.guide-kicker {
  color: #67e8f9;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.guide-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.5rem 0;
}

.guide-quick-links a,
.guide-toolbar button {
  background: #101d31;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  color: #dbeafe;
  cursor: pointer;
  padding: 0.65rem 0.8rem;
  text-decoration: none;
}

.guide-callout {
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 12px;
  margin-top: 2rem;
  padding: 1.1rem 1.25rem;
}

.guide-callout p {
  color: #cbd5e1;
  margin-bottom: 0;
}

.guide-doc-section {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  margin-top: 4rem;
  padding-top: 3.5rem;
}

.guide-doc-section h2 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  letter-spacing: -0.035em;
}

.tutorial-list,
.command-group-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.tutorial-list details,
.command-tutorial {
  background: #0a1526;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 11px;
  overflow: hidden;
}

.tutorial-list summary,
.command-tutorial summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 0.7rem;
  justify-content: space-between;
  list-style: none;
  padding: 1rem 1.15rem;
}

.tutorial-list summary::-webkit-details-marker,
.command-tutorial summary::-webkit-details-marker {
  display: none;
}

.tutorial-list summary::after,
.command-tutorial summary::after {
  color: #94a3b8;
  content: "+";
  font-size: 1.3rem;
}

.tutorial-list details[open] summary::after,
.command-tutorial[open] summary::after {
  content: "−";
}

.tutorial-list summary span,
.command-title {
  font-weight: 760;
}

.tutorial-list summary small,
.command-summary small {
  color: #94a3b8;
}

.tutorial-body,
.command-body {
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  color: #c4cfde;
  padding: 1.15rem;
}

.tutorial-body h3,
.command-body h4 {
  color: #f1f5f9;
  margin: 1.4rem 0 0.45rem;
}

.tutorial-body h3:first-child,
.command-body h4:first-child {
  margin-top: 0;
}

.guide-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.25rem 0;
}

#searchResultCount {
  color: #94a3b8;
  font-size: 0.85rem;
  margin-left: auto;
}

.command-group-section {
  margin-top: 2.5rem;
  scroll-margin-top: calc(var(--guide-topbar) + 1.5rem);
}

.command-group-section > header {
  align-items: end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.command-group-section h3 {
  font-size: 1.55rem;
  margin-bottom: 0.2rem;
}

.command-group-section header p,
.command-group-section header span {
  color: #94a3b8;
  margin: 0;
}

.command-summary {
  display: grid;
  gap: 0.25rem;
  margin-right: auto;
}

.command-route,
.command-example {
  background: #050b16;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 7px;
  color: #c4b5fd;
  display: block;
  margin: 0.5rem 0;
  overflow-x: auto;
  padding: 0.7rem;
  white-space: pre-wrap;
}

.command-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.command-panel {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 9px;
  padding: 0.9rem;
}

.command-panel h4 {
  margin-top: 0;
}

.option-list {
  display: grid;
  gap: 0.55rem;
  list-style: none;
  padding: 0;
}

.option-list li {
  border-left: 2px solid rgba(129, 140, 248, 0.5);
  padding-left: 0.75rem;
}

.option-meta,
.command-badge {
  background: rgba(99, 102, 241, 0.14);
  border-radius: 4px;
  color: #c7d2fe;
  display: inline-block;
  font-size: 0.73rem;
  margin-left: 0.35rem;
  padding: 0.1rem 0.35rem;
}

.command-badge.danger {
  background: rgba(239, 68, 68, 0.13);
  color: #fecaca;
}

.guide-columns {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.guide-columns ul,
.guide-numbered,
.reference-list {
  color: #c4cfde;
  line-height: 1.7;
}

.reference-list a,
.tutorial-body a {
  color: #7dd3fc;
}

.guide-empty {
  border: 1px dashed rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  color: #94a3b8;
  padding: 2rem;
  text-align: center;
}

.guide-page code {
  background: #050b16;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 4px;
  color: #c4b5fd;
  padding: 0.1rem 0.3rem;
}

[data-guide-hidden="true"] {
  display: none !important;
}

@media (max-width: 850px) {
  .guide-topbar {
    grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.4fr) auto;
  }

  .guide-menu {
    display: block;
  }

  .guide-layout {
    display: block;
  }

  .guide-sidebar {
    display: none;
    height: calc(100vh - var(--guide-topbar));
    left: 0;
    position: fixed;
    top: var(--guide-topbar);
    width: min(85vw, 300px);
    z-index: 19;
  }

  .guide-sidebar.open {
    display: block;
  }
}

@media (max-width: 620px) {
  :root {
    --guide-topbar: 126px;
  }

  .guide-topbar {
    grid-template-columns: 1fr auto;
    grid-template-rows: 52px 58px;
    height: var(--guide-topbar);
  }

  .guide-search {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .guide-content {
    padding: 1.5rem 1rem 4rem;
  }

  .command-grid,
  .guide-columns {
    grid-template-columns: 1fr;
  }

  .tutorial-list summary {
    align-items: flex-start;
    flex-direction: column;
  }
}
