@font-face {
  font-family: Roobert;
  src: url("../fonts/RoobertTRIALVF.woff2") format("woff2"), url("../fonts/RoobertTRIALVF.woff") format("woff");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: light;
  --ink: #212020; --paper: #f2f2f2; --surface: #fff; --blue: #1828ff; --link: #1828ff;
  --line: #dcdcdc; --muted: #6b6b6b; --ok: #00a862; --bad: #e0393e; --yellow: #ffdf4b;
  --error-bg: #fff5f5; --spinner-track: #e3e5ff;
  /* Editor: the docs' code colours (Shiki github-light / dark-plus), read by the CodeMirror theme in vendor/editor.js */
  --code-bg: #fff; --code-fg: #1f2328; --code-border: #212020; --code-active: #f6f8fa; --code-gutter: #8c959f;
  --code-selection: #b6d6fb; --code-match: #fae17d; --code-tooltip: #fff; --code-tooltip-line: #dcdcdc;
  --cm-comment: #6e7781; --cm-meta: #cf222e; --cm-keyword: #1f2328; --cm-head: #8250df; --cm-variable: #953800;
  --cm-string: #0a3069; --cm-number: #0550ae; --cm-operator: #1f2328; --cm-property: #8250df; --cm-punctuation: #1f2328;
  --cm-caret: #1f2328;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f2f2f2; --paper: #111; --surface: #1a1a1a; --link: #8a93ff;
  --line: #2f2f2f; --muted: #9b9b9b; --ok: #00c977; --bad: #ff5c5c;
  --error-bg: #2a1616; --spinner-track: #2a2f5c;
  --code-bg: #0b0c0e; --code-fg: #d4d4d4; --code-border: #3a3a3a; --code-active: #16181c; --code-gutter: #858585;
  --code-selection: #264f78; --code-match: #3a3d41; --code-tooltip: #1a1a1a; --code-tooltip-line: #3a3a3a;
  --cm-comment: #6a9955; --cm-meta: #c586c0; --cm-keyword: #d4d4d4; --cm-head: #dcdcaa; --cm-variable: #9cdcfe;
  --cm-string: #ce9178; --cm-number: #b5cea8; --cm-operator: #d4d4d4; --cm-property: #dcdcaa; --cm-punctuation: #d4d4d4;
  --cm-caret: #aeafad;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: Roobert, Arial, sans-serif; color: var(--ink); background: var(--paper); display: flex; flex-direction: column; letter-spacing: -.01em; }
button { font-family: inherit; }
code { font-family: "JetBrains Mono", Menlo, monospace; font-size: .9em; }

/* Header */
.pg-header { display: flex; align-items: center; gap: 18px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.pg-logo img { height: 22px; display: block; }
[data-theme="dark"] .pg-logo img { filter: brightness(0) invert(.95); }
.pg-title { font-weight: 600; font-size: 17px; }
.pg-beta { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--link); border: 1px solid var(--link); padding: 1px 6px; margin-left: 6px; vertical-align: 2px; }
.pg-links { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pg-nav-link { color: var(--ink); text-decoration: none; font-size: 1rem; margin: 0 14px 0 8px; }
.pg-nav-link:hover { color: var(--link); }
.pg-engine { font-size: 12px; color: var(--muted); }
.pg-engine::before { content: "● "; color: #bbb; }
.pg-engine.ready::before { color: var(--ok); }
.pg-engine.down::before { color: var(--bad); }
.pg-banner { background: var(--yellow); color: #212020; padding: 8px 20px; font-size: 14px; }

/* Buttons */
/* Buttons: the site's .button and .button.is-secondary */
.pg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--blue); color: #fff; border: 1px solid var(--blue); border-radius: 4px;
  padding: .5rem 1.375rem; font-size: .875rem; font-weight: 500; line-height: 1.2em; font-variation-settings: "MONO" 50;
  text-transform: uppercase; text-decoration: none; white-space: nowrap; cursor: pointer; transition: box-shadow .3s;
}
.pg-btn:hover:not(:disabled) { box-shadow: 3px 3px 0 0 var(--ink); }
.pg-btn:disabled { opacity: .4; cursor: default; }
.pg-btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.pg-btn-icon { padding: 0; width: 2.1rem; align-self: stretch; }
.pg-btn-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pg-icon-sun, [data-theme="dark"] .pg-icon-moon { display: none; }
[data-theme="dark"] .pg-icon-sun { display: block; }

/* Layout */
.pg-layout { flex: 1; display: grid; grid-template-columns: 250px 1fr; min-height: 0; }
.pg-examples { background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; padding: 12px 10px 24px; }
.pg-tabs { display: flex; margin-bottom: 8px; border: 1px solid var(--ink); }
.pg-tab { flex: 1; background: var(--surface); border: 0; padding: 7px 4px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink); }
.pg-tab.active { background: var(--ink); color: var(--surface); }
.pg-example-head p a { color: var(--link); text-decoration: none; }
.pg-example-head p a:hover { text-decoration: underline; }
#search { width: 100%; padding: 8px 10px; border: 1px solid var(--line); font: inherit; font-size: 14px; color: var(--ink); background: var(--paper); }
.pg-cat { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 8px 4px; }
.pg-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 6px 8px; font-size: 14px; color: var(--ink); cursor: pointer; }
.pg-item:hover { background: var(--paper); }
.pg-item.active { background: var(--blue); color: #fff; }
.pg-main { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); min-height: 0; }

/* Editor */
.pg-editor-pane { display: flex; flex-direction: column; min-height: 0; padding: 16px 16px 12px 20px; border-right: 1px solid var(--line); }
.pg-example-head h1 { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -.03em; }
.pg-example-head p { margin: 4px 0 12px; color: var(--muted); font-size: 14px; min-height: 1.2em; }
.pg-editor { flex: 1; min-height: 200px; overflow: hidden; border: 1px solid var(--code-border); }
.pg-params { margin-top: 8px; font-size: 13px; }
.pg-params summary { cursor: pointer; }
.pg-params textarea { width: 100%; height: 56px; margin-top: 6px; font: 13px/1.5 "JetBrains Mono", Menlo, monospace; background: var(--code-bg); color: var(--code-fg); border: 1px solid var(--code-border); padding: 8px 10px; resize: vertical; }
.pg-muted { color: var(--muted); }
.pg-toolbar { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.pg-validity { font-size: 13px; color: var(--ok); max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-validity.invalid { color: var(--bad); }
.pg-turnstile { margin-left: auto; }

/* Output */
.pg-output-pane { display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.pg-output-head { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 20px 10px; border-bottom: 1px solid var(--line); font-weight: 600; }
.pg-status { font-weight: 400; font-size: 13px; color: var(--muted); }
.pg-status.error { color: var(--bad); }
.pg-results { flex: 1; overflow: auto; padding: 16px 20px; }
.pg-error { white-space: pre-wrap; font: 13px/1.5 "JetBrains Mono", Menlo, monospace; color: var(--bad); background: var(--error-bg); border-left: 3px solid var(--bad); padding: 10px 12px; margin: 0; }
.pg-results table { border-collapse: collapse; margin: 0 0 22px; font-size: 13px; min-width: 40%; }
.pg-results caption { text-align: left; font-weight: 600; padding-bottom: 6px; font-size: 14px; }
.pg-results caption .n { color: var(--muted); font-weight: 400; }
.pg-results th, .pg-results td { border-bottom: 1px solid var(--line); padding: 5px 14px 5px 0; text-align: left; }
.pg-results th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.pg-results td { font-family: "JetBrains Mono", Menlo, monospace; font-size: 12.5px; }
.pg-results td.null { color: var(--muted); font-style: italic; }
.pg-note { color: var(--muted); font-size: 13px; }
.pg-loader { height: 100%; min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); text-align: center; }
.pg-spinner { width: 44px; height: 44px; border: 3px solid var(--spinner-track); border-top-color: var(--blue); border-radius: 50%; animation: pg-spin .8s linear infinite; }
.pg-loader-text { font-size: 15px; color: var(--ink); }
.pg-loader-secs { font-variant-numeric: tabular-nums; color: var(--muted); }
.pg-loader-hint { font-size: 12px; }
@keyframes pg-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pg-spinner { animation-duration: 2.4s; } }
.pg-footnote { margin: 0; padding: 10px 20px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.pg-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 10px 16px; font-size: 14px; }

@media (max-width: 1000px) {
  .pg-layout { grid-template-columns: 1fr; }
  .pg-examples { max-height: 180px; border-right: 0; border-bottom: 1px solid var(--line); }
  .pg-main { grid-template-columns: 1fr; }
  .pg-editor { min-height: 320px; }
  .pg-nav-link, .pg-demo { display: none; }
}
