/* Shared code-example component: no article or route-specific selectors. */
.mallary-code-example {
  --mce-bg: #fafafa;
  --mce-toolbar: #fff;
  --mce-rule: #e4e4e7;
  --mce-text: #27272a;
  --mce-muted: #71717a;
  --mce-active: #0369a1;
  --mce-selected: #f0f9ff;
  --mce-string: #116149;
  --mce-keyword: #7e22ce;
  --mce-function: #075985;
  --mce-number: #9a3412;
  color-scheme: light;
  min-width: 0;
  max-width: 100%;
  margin: 1.5rem 0;
  overflow: hidden;
  border: 1px solid var(--mce-rule);
  border-radius: 8px;
  background: var(--mce-bg);
  color: var(--mce-text);
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  text-align: left;
  scroll-margin-top: 6rem;
}
.dark .mallary-code-example {
  color-scheme: dark;
  --mce-bg: #121214;
  --mce-toolbar: #18181b;
  --mce-rule: #303035;
  --mce-text: #e4e4e7;
  --mce-muted: #a1a1aa;
  --mce-active: #7dd3fc;
  --mce-selected: #17252e;
  --mce-string: #86efac;
  --mce-keyword: #d8b4fe;
  --mce-function: #7dd3fc;
  --mce-number: #fdba74;
}
.mallary-code-example .mce-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--mce-toolbar);
  border-bottom: 1px solid var(--mce-rule);
}
.mallary-code-example .mce-request {
  min-width: 0;
  font: 600 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}
.mallary-code-example .mce-copy {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--mce-rule);
  border-radius: 5px;
  background: var(--mce-toolbar);
  color: var(--mce-text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}
.mallary-code-example .mce-copy:hover {
  border-color: var(--mce-muted);
}
.mallary-code-example .mce-copy[data-copied] {
  color: var(--mce-string);
}
.mallary-code-example .mce-check-icon,
.mallary-code-example .mce-copy[data-copied] .mce-copy-icon {
  display: none;
}
.mallary-code-example .mce-copy[data-copied] .mce-check-icon {
  display: block;
}
.mallary-code-example .mce-copy[hidden],
.mallary-code-example .mce-tabs[hidden],
.mallary-code-example .mce-panel[hidden] {
  display: none;
}
.mallary-code-example .mce-tabs {
  display: flex;
  gap: 4px;
  max-width: 100%;
  padding: 0 12px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--mce-rule) transparent;
  background: var(--mce-toolbar);
  border-bottom: 1px solid var(--mce-rule);
}
.mallary-code-example .mce-tab {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 14px;
  border-bottom: 2px solid transparent;
  color: var(--mce-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
}
.mallary-code-example .mce-tab:hover {
  color: var(--mce-text);
  background: var(--mce-bg);
  text-decoration: none;
}
.mallary-code-example .mce-tab[aria-selected='true'] {
  border-bottom-color: var(--mce-active);
  background: var(--mce-selected);
  color: var(--mce-active);
}
.mallary-code-example .mce-copy:focus-visible,
.mallary-code-example .mce-tab:focus-visible,
.mallary-code-example .mce-pre:focus-visible {
  outline: 2px solid var(--mce-active);
  outline-offset: -3px;
}
.mallary-code-example .mce-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px 0;
  color: var(--mce-muted);
  font: 400 11px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.mallary-code-example .mce-panel {
  scroll-margin-top: 6rem;
}
.mallary-code-example .mce-file span:last-child {
  flex-shrink: 0;
}
.mallary-code-example .mce-file span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.mallary-code-example .mce-panel .mce-pre {
  display: block;
  max-width: 100%;
  max-height: 28rem;
  margin: 0;
  padding: 18px 20px 24px;
  overflow: auto;
  overscroll-behavior-x: contain;
  border: 0;
  border-radius: 0;
  background: var(--mce-bg);
  color: var(--mce-text);
  font: 400 13px/1.8 ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  tab-size: 2;
  text-align: left;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
  scrollbar-width: thin;
  scrollbar-color: var(--mce-rule) transparent;
}
.mallary-code-example .mce-pre::after {
  content: none;
}
.mallary-code-example .mce-panel .mce-pre code {
  display: block;
  width: max-content;
  min-width: 100%;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
  vertical-align: baseline;
}
.mallary-code-example code::before,
.mallary-code-example code::after {
  content: none;
}
.mallary-code-example .token {
  background: transparent;
}
.mallary-code-example .token.comment,
.mallary-code-example .token.prolog {
  color: var(--mce-muted);
}
.mallary-code-example .token.string,
.mallary-code-example .token.char,
.mallary-code-example .token.attr-value {
  color: var(--mce-string);
}
.mallary-code-example .token.keyword,
.mallary-code-example .token.boolean,
.mallary-code-example .token.important {
  color: var(--mce-keyword);
}
.mallary-code-example .token.function,
.mallary-code-example .token.class-name,
.mallary-code-example .token.builtin,
.mallary-code-example .token.property,
.mallary-code-example .token.variable {
  color: var(--mce-function);
}
.mallary-code-example .token.number {
  color: var(--mce-number);
}
.mallary-code-example .mce-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 480px) {
  .mallary-code-example .mce-toolbar { padding: 10px 12px; }
  .mallary-code-example .mce-copy { min-height: 44px; }
  .mallary-code-example .mce-tabs { padding: 0 4px; gap: 0; }
  .mallary-code-example .mce-tab { padding: 0 12px; }
  .mallary-code-example .mce-file { padding-left: 14px; padding-right: 14px; font-size: 10px; }
  .mallary-code-example .mce-panel .mce-pre { padding: 16px 14px 20px; font-size: 12px; }
}
@media (max-width: 360px) {
  .mallary-code-example .mce-copy { min-width: 44px; padding: 6px; }
  .mallary-code-example [data-code-copy-label] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
