.codeSnippetSection {
  background-color: var(--ifm-color-emphasis-100);
  padding: 5rem 0;
  width: 100%;
}

.innerContainer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 4rem;
  align-items: center;
}

.leftColumn {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.leftColumn h2 {
  color: var(--ifm-heading-color);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.leftColumn p {
  color: var(--ifm-text-color-secondary);
  font-size: 1.1rem;
  line-height: 1.7;
  margin: 0;
}

/* Button uses default Infima styling that respects light/dark theme.
   Override the outline hover: Infima fills with the light brand green and
   keeps white text (low contrast in both themes). Use dark text on the
   green fill so the label stays legible. */
.leftColumn :global(.button--outline:hover),
.leftColumn :global(.button--outline:active) {
  background-color: var(--ifm-color-primary);
  border-color: var(--ifm-color-primary);
  color: #0d1117;
}

.rightColumn {
  display: flex;
  flex-direction: column;
}

.codePanel {
  background-color: #1e2030;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
}

.tabBar {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background-color: #161b22;
}

.tabBar::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

.tab {
  flex-shrink: 0;
  padding: 0.75rem 1.25rem;
  border: none;
  background: transparent;
  color: #8b949e;
  cursor: pointer;
  font-size: 0.875rem;
  white-space: nowrap;
  transition: color 0.2s ease;
  font-family: inherit;
}

.tab:hover {
  color: #e6edf3;
}

.tabActive {
  color: var(--ifm-color-primary);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--ifm-color-primary);
}

.codeArea {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pre {
  margin: 0;
  padding: 1.25rem 1rem;
  overflow: auto;
  /* Fixed height (fits the tallest snippet) so the panel doesn't resize
     when switching tabs; taller content scrolls within this box. */
  height: 560px;
  font-size: 0.875rem;
  line-height: 1.6;
}

.codeLine {
  display: block;
}

.lineNumber {
  display: inline-block;
  width: 2.5ch;
  min-width: 2.5ch;
  margin-right: 1.5rem;
  text-align: right;
  color: rgba(255, 255, 255, 0.25);
  user-select: none;
  font-variant-numeric: tabular-nums;
}

.lineContent {
  display: inline;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background-color: #161b22;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.langBadge {
  font-size: 0.75rem;
  color: #8b949e;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: var(--ifm-font-family-monospace);
}

.copyButton {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  color: #8b949e;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.copyButton:hover {
  border-color: var(--ifm-color-primary);
  color: var(--ifm-color-primary);
}

.copyButtonCopied {
  color: var(--ifm-color-primary);
  border-color: var(--ifm-color-primary);
}

@media screen and (max-width: 996px) {
  .innerContainer {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .tabBar {
    overflow-x: auto;
  }

  .pre {
    overflow: auto;
    height: 460px;
  }
}

/* Fit the Docusaurus CodeBlock into the panel + keep a stable height so
   switching tabs doesn't resize the panel. */
.codeArea :global(.theme-code-block) {
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}
.codeArea :global(pre) {
  margin: 0;
  height: 560px;
  overflow: auto;
  border-radius: 0;
}

/* No italics in the code (some prism themes italicize comments/keywords). */
.codeArea :global(.token) {
  font-style: normal !important;
}
