:root {
  --guide-bg: #0b100e;
  --guide-sidebar: #101613;
  --guide-surface: #141c18;
  --guide-surface-2: #18221d;
  --guide-line: #2d3a34;
  --guide-text: #e7ece8;
  --guide-muted: #a8b2ab;
  --guide-accent: #8dbb59;
  --guide-accent-dim: #20301f;
  --guide-code: #b9dd8e;
}

html {
  background: var(--guide-bg);
}

body.guide-site {
  color: var(--guide-text);
  background: var(--guide-bg);
  font-size: 1rem;
  line-height: 1.65;
}

.guide-site .site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #0b100efa;
}

.guide-site .nav-links a[aria-current="page"] {
  color: var(--guide-accent);
}

.wiki-main {
  min-height: calc(100vh - 76px);
}

.wiki-layout {
  width: min(calc(100% - 2rem), 1480px);
  margin: 0 auto;
  padding: 2rem 0 5rem;
  display: grid;
  grid-template-columns: 250px minmax(0, 820px) minmax(150px, 190px);
  justify-content: center;
  align-items: start;
  gap: clamp(1.5rem, 3vw, 3rem);
}

.wiki-layout.no-toc {
  grid-template-columns: 250px minmax(0, 900px);
}

.wiki-sidebar,
.page-toc {
  min-width: 0;
}

.wiki-sidebar-inner,
.page-toc-inner {
  position: sticky;
  top: 98px;
}

.wiki-sidebar-inner {
  max-height: calc(100vh - 116px);
  overflow-y: auto;
  padding: 0 1.1rem 1.25rem;
  border: 1px solid var(--guide-line);
  background: var(--guide-sidebar);
  scrollbar-width: thin;
  scrollbar-color: #44544c transparent;
}

.wiki-sidebar-title {
  margin: 0 -1.1rem 0.75rem;
  padding: 1rem 1.1rem;
  display: block;
  border-bottom: 1px solid var(--guide-line);
  color: var(--guide-text);
  font-size: 0.98rem;
  font-weight: 800;
  text-decoration: none;
}

.wiki-sidebar-title:hover {
  color: var(--guide-accent);
}

.wiki-sidebar-toggle {
  display: none;
}

.wiki-nav {
  display: block;
}

.wiki-nav-group + .wiki-nav-group {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--guide-line);
}

.wiki-nav-group > p {
  margin: 0 0 0.35rem;
  color: #7f8e85;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.wiki-nav-group a {
  min-height: 38px;
  padding: 0.42rem 0.55rem;
  display: flex;
  align-items: center;
  border-left: 2px solid transparent;
  color: #c3ccc6;
  font-size: 0.9rem;
  line-height: 1.25;
  text-decoration: none;
}

.wiki-nav-group a:hover,
.wiki-nav-group a:focus-visible {
  color: var(--guide-text);
  background: var(--guide-surface-2);
}

.wiki-nav-group a[aria-current="page"] {
  border-left-color: var(--guide-accent);
  color: var(--guide-text);
  background: var(--guide-accent-dim);
  font-weight: 800;
}

.wiki-article {
  min-width: 0;
  padding: clamp(1.4rem, 4vw, 3rem);
  border: 1px solid var(--guide-line);
  background: var(--guide-surface);
}

.breadcrumbs {
  margin-bottom: 1.2rem;
  color: #839189;
  font-size: 0.78rem;
}

.breadcrumbs a {
  color: #aeb9b2;
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--guide-accent);
}

.breadcrumbs span {
  padding: 0 0.35rem;
  color: #5c6a62;
}

.article-header {
  margin-bottom: 2.2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--guide-line);
}

.article-header h1 {
  margin: 0;
  color: var(--guide-text);
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-size: clamp(2.15rem, 5vw, 3.35rem);
  font-weight: 800;
  line-height: 1.08;
  text-transform: none;
}

.article-header p {
  max-width: 680px;
  margin: 0.7rem 0 0;
  color: var(--guide-muted);
  font-size: 1.08rem;
}

.wiki-article h2,
.wiki-article h3 {
  color: var(--guide-text);
  font-family: "Nunito Sans", system-ui, sans-serif;
  text-transform: none;
}

.wiki-article h2 {
  margin: 2.7rem 0 0.8rem;
  padding-top: 0.25rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
  scroll-margin-top: 108px;
}

.wiki-article h3 {
  margin: 1.7rem 0 0.55rem;
  font-size: 1.2rem;
  line-height: 1.3;
}

.wiki-article p,
.wiki-article li,
.wiki-article dd,
.wiki-article td {
  color: #c2cbc5;
}

.wiki-article p {
  max-width: 720px;
}

.wiki-article p + p {
  margin-top: 0.85rem;
}

.wiki-article ul,
.wiki-article ol {
  padding-left: 1.35rem;
}

.wiki-article li + li {
  margin-top: 0.35rem;
}

.wiki-article a {
  color: #a9d878;
}

.wiki-article strong {
  color: var(--guide-text);
}

.wiki-article code {
  padding: 0.1rem 0.3rem;
  border: 1px solid #34473b;
  color: var(--guide-code);
  background: #0c120f;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.page-toc-inner {
  padding-left: 1rem;
  border-left: 1px solid var(--guide-line);
}

.page-toc p {
  margin: 0 0 0.55rem;
  color: #7f8e85;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.page-toc a {
  padding: 0.3rem 0;
  display: block;
  color: #9daaa2;
  font-size: 0.82rem;
  line-height: 1.3;
  text-decoration: none;
}

.page-toc a:hover,
.page-toc a[aria-current="location"] {
  color: var(--guide-accent);
}

.guide-home-intro {
  max-width: 650px;
}

.guide-home-section {
  margin-top: 2.2rem;
}

.guide-home-section h2 {
  margin-top: 0;
}

.guide-link-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--guide-line);
  list-style: none;
}

.guide-link-list li {
  margin: 0;
  border-bottom: 1px solid var(--guide-line);
}

.guide-link-list a {
  padding: 0.9rem 0.2rem;
  display: grid;
  grid-template-columns: minmax(130px, 0.34fr) minmax(0, 1fr);
  gap: 1rem;
  color: var(--guide-text);
  text-decoration: none;
}

.guide-link-list a:hover,
.guide-link-list a:focus-visible {
  color: var(--guide-accent);
  background: #172019;
}

.guide-link-list span {
  color: var(--guide-muted);
}

.quick-facts {
  margin: 1rem 0;
  border-top: 1px solid var(--guide-line);
}

.quick-facts > div {
  padding: 0.7rem 0;
  display: grid;
  grid-template-columns: minmax(150px, 0.42fr) minmax(0, 1fr);
  gap: 1rem;
  border-bottom: 1px solid var(--guide-line);
}

.quick-facts dt {
  color: var(--guide-muted);
}

.quick-facts dd {
  margin: 0;
  color: var(--guide-text);
  font-weight: 800;
}

.guide-note,
.guide-warning {
  margin: 1.2rem 0;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--guide-accent);
  background: #111914;
}

.guide-warning {
  border-left-color: #cf9f4b;
}

.guide-note p,
.guide-warning p {
  margin: 0;
}

.command-lines {
  margin-top: 1rem;
  border-top: 1px solid var(--guide-line);
}

.command-line,
.command-row {
  padding: 0.75rem 0;
  display: grid;
  grid-template-columns: minmax(190px, 0.42fr) minmax(0, 1fr);
  gap: 1rem;
  border-bottom: 1px solid var(--guide-line);
}

.command-line p,
.command-row p {
  margin: 0;
}

.command-row > code,
.command-line > code {
  align-self: start;
  justify-self: start;
}

.wiki-table-wrap {
  max-width: 100%;
  margin: 1rem 0;
  overflow-x: auto;
  border: 1px solid var(--guide-line);
}

.wiki-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.45;
}

.wiki-table caption {
  padding: 0.75rem 0.85rem;
  color: var(--guide-text);
  background: #0e1511;
  font-weight: 800;
  text-align: left;
}

.wiki-table th,
.wiki-table td {
  padding: 0.68rem 0.8rem;
  border-right: 1px solid var(--guide-line);
  border-bottom: 1px solid var(--guide-line);
  text-align: left;
  vertical-align: top;
}

.wiki-table th:last-child,
.wiki-table td:last-child {
  border-right: 0;
}

.wiki-table tbody tr:last-child th,
.wiki-table tbody tr:last-child td {
  border-bottom: 0;
}

.wiki-table thead th {
  color: var(--guide-text);
  background: var(--guide-surface-2);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.wiki-table tbody th {
  color: var(--guide-text);
}

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

.recipe-block {
  padding: 1rem;
  border: 1px solid var(--guide-line);
  background: #111914;
}

.recipe-block h3 {
  margin-top: 0;
}

.crafting-grid {
  width: min(100%, 300px);
  margin: 1rem auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.3rem;
}

.crafting-grid span {
  aspect-ratio: 1;
  padding: 0.3rem;
  display: grid;
  place-items: center;
  border: 1px solid #405048;
  color: #d6ddd8;
  background: #1a251f;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}

.article-search {
  margin: 1rem 0 1.5rem;
}

.article-search label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--guide-text);
  font-weight: 800;
}

.article-search input {
  width: min(100%, 520px);
  min-height: 46px;
  padding: 0.65rem 0.8rem;
  border: 1px solid #405048;
  border-radius: 0;
  outline: 0;
  color: var(--guide-text);
  background: #0c120f;
  font: inherit;
}

.article-search input:focus {
  border-color: var(--guide-accent);
  box-shadow: 0 0 0 3px #8dbb5933;
}

.article-search p {
  margin-top: 0.35rem;
  color: var(--guide-muted);
  font-size: 0.82rem;
}

.command-section {
  scroll-margin-top: 108px;
}

.command-section + .command-section {
  margin-top: 3rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--guide-line);
}

.command-section .eyebrow,
.command-section .command-group-intro {
  display: none;
}

.command-section h2 {
  margin-top: 1.5rem;
}

.command-list {
  border-top: 1px solid var(--guide-line);
}

.command-empty {
  padding: 1rem;
  border: 1px solid var(--guide-line);
  color: var(--guide-muted);
}

.guide-site .site-footer {
  border-top: 1px solid var(--guide-line);
  background: #090d0b;
}

.guide-site .footer-bottom {
  padding-top: 0;
  border-top: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1180px) {
  .wiki-layout,
  .wiki-layout.no-toc {
    grid-template-columns: 230px minmax(0, 820px);
  }

  .page-toc {
    display: none;
  }
}

@media (max-width: 820px) {
  .guide-site .site-header {
    position: relative;
  }

  .wiki-layout,
  .wiki-layout.no-toc {
    width: min(calc(100% - 1.25rem), 820px);
    padding-top: 1rem;
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .wiki-sidebar-inner {
    position: static;
    max-height: none;
    padding: 0;
    overflow: visible;
  }

  .wiki-sidebar-title {
    display: none;
  }

  .wiki-sidebar-toggle {
    width: 100%;
    min-height: 48px;
    padding: 0.7rem 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 0;
    color: var(--guide-text);
    background: var(--guide-sidebar);
    font: inherit;
    font-weight: 800;
    text-align: left;
  }

  .wiki-sidebar-toggle::after {
    content: "+";
    color: var(--guide-accent);
    font-size: 1.3rem;
  }

  .wiki-sidebar-toggle[aria-expanded="true"]::after {
    content: "−";
  }

  .wiki-nav {
    padding: 0 0.9rem 1rem;
    display: none;
  }

  .wiki-nav[data-open="true"] {
    display: block;
  }

  .wiki-article {
    padding: clamp(1.15rem, 5vw, 2rem);
  }

  .wiki-article h2 {
    scroll-margin-top: 1rem;
  }
}

@media (max-width: 600px) {
  .guide-link-list a,
  .quick-facts > div,
  .command-line,
  .command-row,
  .recipe-pair {
    grid-template-columns: 1fr;
  }

  .guide-link-list a {
    gap: 0.25rem;
  }

  .command-line,
  .command-row {
    gap: 0.45rem;
  }

  .wiki-table {
    min-width: 520px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
