/* "View source" on the examples pages (site/source.js): the button, and the
   panel it opens with each file highlighted. The page defines the colors:
   --surface, --text, --muted, --border, --accent, --code-bg, --code-bar,
   --code-text and --code-muted. */
.source-toggle {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 9px 14px 9px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: 600 13px/1 system-ui, sans-serif;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.source-toggle:hover { border-color: var(--muted); }
.source-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.source-toggle[aria-expanded="true"] { background: var(--text); border-color: var(--text); color: var(--surface); }
.source-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.source { border-top: 1px solid var(--border); background: var(--code-bg); color: var(--code-text); }
.source:not([hidden]) { animation: reveal 0.22s ease-out; }
@keyframes reveal { from { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .source:not([hidden]) { animation: none; } }
.source-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 16px;
  background: var(--code-bar);
  border-block: 1px solid rgb(255 255 255 / 0.06);
  color: var(--code-muted);
  font: 12px/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.source-bar strong { color: var(--code-text); font-weight: 600; }
.source-bar .meta > * + *::before { content: "·"; margin: 0 8px; opacity: 0.6; }
.source-bar .actions { display: flex; gap: 8px; }
.source-bar button, .source-bar .open {
  padding: 5px 10px;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 6px;
  background: transparent;
  color: var(--code-text);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  transition: background-color 0.15s;
}
.source-bar button:hover, .source-bar .open:hover { background: rgb(255 255 255 / 0.06); }
.source pre {
  margin: 0;
  max-height: 480px;
  overflow: auto;
  padding: 16px 18px 22px;
  font: 12.5px/1.65 ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  tab-size: 2;
}

/* site/highlight.js's tokens, on the dark code background. */
.t-fence   { color: #f2e46b; font-weight: 700; }
.t-comment { color: #857f73; font-style: italic; }
.t-at      { color: #f2e46b; }
.t-atp     { color: #d6d1c4; }
.t-sel     { color: #e8e4d8; }
.t-hook    { color: #fb923c; font-weight: 600; }
.t-prop    { color: #7dd3fc; }
.t-var     { color: #d6d1c4; }
.t-cssv    { color: #f2e46b; font-weight: 700; }
.t-val     { color: #e3dfd3; }
.t-str     { color: #86efac; }
.t-punct   { color: #8a8478; }
.t-head    { color: #f7f4ec; font-weight: 700; }
.t-delim   { color: #f2e46b; }
.t-num     { color: #fdba74; }
.t-quoted  { color: #86efac; }
.t-text    { color: #e3dfd3; }
