/* Shared light code standard. See docs/architecture/code-block-standard.md. */
:root {
  --code-surface: #f7f9fc;
  --code-chrome: #fff;
  --code-stroke: rgba(8, 125, 255, .15);
  --code-foreground: #000d3b;
  --code-muted-foreground: #3f536d;
  --code-active: #056bdc;
  --code-font: var(--font-mono, ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace);
  --code-label-font: var(--font-sans, system-ui, sans-serif);
}
.hero-terminal, .model-page .hero-terminal, .auth-terminal {
  --code-background: var(--code-surface);
  --code-toolbar: var(--code-chrome);
  --code-border: var(--code-stroke);
  --code-text: var(--code-foreground);
  --code-muted: var(--code-muted-foreground);
  --code-accent: var(--code-active);
  border: 1px solid var(--code-border);
  border-radius: 12px;
  background: var(--code-background);
  color: var(--code-text);
  box-shadow: none;
  transform: none;
}
.model-page .hero-terminal { max-width: 100%; }
.model-content-section .hero-terminal, .model-quickstart .hero-terminal { margin: 24px 0; }
.hero-terminal::before, .hero-terminal-header::before, .hero-terminal-header .dot, .auth-terminal-head .dot { display: none; }
.hero-terminal-header, .auth-terminal-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 56px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--code-stroke);
  background: var(--code-chrome);
}
.hero-terminal-header .title, .guide-code .hero-terminal-header .title, .auth-terminal-head .title {
  position: static;
  flex: 1;
  min-width: 0;
  margin-left: 0;
  color: var(--code-muted-foreground);
  font: 500 13px/var(--text-leading-heading) var(--code-label-font);
  text-align: left;
  overflow-wrap: anywhere;
  transform: none;
}
.hero-terminal .code-copy, .first-free-examples .code-copy {
  flex-shrink: 0;
  min-height: 32px;
  margin-left: auto;
  padding: 4px 12px;
  border: 1px solid var(--code-stroke);
  border-radius: 6px;
  background: var(--code-chrome);
  color: var(--code-muted-foreground);
  font: 500 13px/1.5 var(--code-label-font);
}
.hero-terminal .code-copy:hover, .first-free-examples .code-copy:hover { border-color: var(--code-active); color: var(--code-active); background: var(--code-chrome); }
.hero-terminal .copy-feedback, .first-free-examples .copy-feedback { color: var(--code-muted-foreground); font-size: 12px; }
.code-tabs, .first-free-toolbar .code-tabs { gap: 20px; padding: 0 20px; background: var(--code-chrome); overflow-x: auto; }
.code-tabs { border-bottom: 1px solid var(--code-stroke); }
.code-tab { flex-shrink: 0; min-height: 44px; padding: 10px 0; color: var(--code-muted-foreground); font: 500 13px/1.5 var(--code-label-font); }
.code-tab[aria-selected="true"] { color: var(--code-active); border-bottom-color: var(--code-active); background: transparent; }
.hero-terminal-body, .guide-code .hero-terminal-body, .auth-terminal-body, .code-block,
.code-frame.syntax-block, pre.code-frame, .blog-prose pre, .kg-code-card pre {
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  max-height: min(560px, 70vh);
  padding: 24px;
  background: var(--code-surface);
  color: var(--code-foreground);
  font: 400 13px/1.8 var(--code-font);
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  scrollbar-color: #91a9c6 #f7f9fc;
  scrollbar-width: thin;
}
.hero-terminal-body :is(pre, code), .code-block code { font: inherit; color: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.code-frame code, .blog-prose pre code, .kg-code-card pre code { font: inherit; color: inherit; white-space: inherit; }
.hero-terminal-body .k, .auth-terminal-body .k, .code-block .k { color: var(--syntax-keyword); }
.hero-terminal-body .s, .auth-terminal-body .s, .code-block .s { color: var(--syntax-string); }
.hero-terminal-body .c, .auth-terminal-body .c, .code-block .c { color: var(--syntax-comment); }
.hero-terminal .first-free-dependencies { color: var(--code-muted-foreground); }
.code-block, .first-free-examples { border: 1px solid var(--code-stroke); border-radius: 12px; background: #f7f9fc; }
.first-free-toolbar { background: var(--code-chrome); }
.first-free-panels { height: auto; }
.first-free-panels > .code-block { height: auto; }
.code-frame.syntax-block, pre.code-frame, .blog-prose pre, .kg-code-card pre {
  margin: 16px 0;
  border: 1px solid var(--code-stroke);
  border-radius: 12px;
}
.hero-terminal-footer { gap: 16px; padding: 12px 20px; border-top: 1px solid var(--code-stroke); background: var(--code-chrome); color: var(--code-muted-foreground); }
.hero-terminal-footer code { min-width: 0; color: var(--code-muted-foreground); overflow-wrap: anywhere; }
.hero-terminal-footer a { color: var(--code-active); }
:is(.hero-terminal, .first-free-examples) :is(.code-copy, .hero-terminal-footer a):focus-visible { outline: 2px solid var(--code-active); outline-offset: 3px; }
@media (max-width: 680px) {
  .hero-terminal-header, .guide-code .hero-terminal-header, .auth-terminal-head { padding: 12px 16px; gap: 8px; }
  .hero-terminal .code-copy, .first-free-examples .code-copy { min-height: 44px; }
  .hero-terminal-body, .guide-code .hero-terminal-body, .auth-terminal-body, .code-block,
  .code-frame.syntax-block, pre.code-frame, .blog-prose pre, .kg-code-card pre { padding: 20px 16px; font-size: 13px; }
  .code-tabs, .first-free-toolbar .code-tabs { padding-inline: 16px; }
  .hero-terminal-footer { flex-wrap: wrap; padding: 12px 16px; }
}
