:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-code: #f3f4f6;
  --text: #1c2127;
  --text-soft: #56606b;
  --border: #e3e6ea;
  --accent: #0d7c66;
  --accent-soft: #e3f4ef;
  --accent-text: #ffffff;
  --bar-other: #c9cfd6;
  --radius: 10px;
  --mono: ui-monospace, 'SFMono-Regular', 'JetBrains Mono', Menlo, Consolas, monospace;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f1216;
    --bg-soft: #161a20;
    --bg-code: #1b2027;
    --text: #e6e9ed;
    --text-soft: #9aa4af;
    --border: #262c34;
    --accent: #3fd0ad;
    --accent-soft: #123a31;
    --accent-text: #0b1512;
    --bar-other: #3a424c;
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #0f1216;
  --bg-soft: #161a20;
  --bg-code: #1b2027;
  --text: #e6e9ed;
  --text-soft: #9aa4af;
  --border: #262c34;
  --accent: #3fd0ad;
  --accent-soft: #123a31;
  --accent-text: #0b1512;
  --bar-other: #3a424c;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code,
pre {
  font-family: var(--mono);
  font-size: 0.875em;
}

:not(pre) > code {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1em 0.35em;
  overflow-wrap: anywhere;
}

pre {
  position: relative;
  margin: 1rem 0 1.5rem;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.55;
}

pre code {
  display: block;
  padding: 1rem 1.15rem;
  background: none !important;
}

.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 9px;
  font: 12px var(--sans);
  color: var(--text-soft);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}

pre:hover .copy,
.copy:focus {
  opacity: 1;
}

/* Header */

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: 1160px;
  height: 60px;
  margin: 0 auto;
  padding: 0 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.logo:hover {
  text-decoration: none;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-text);
  font-family: var(--mono);
  font-size: 0.95rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-left: auto;
  font-size: 0.95rem;
}

.nav a {
  color: var(--text-soft);
}

.nav a:hover,
.nav a[aria-current='page'] {
  color: var(--text);
  text-decoration: none;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--text-soft);
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--text);
}

/* Home */

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  padding: 5rem 0 4rem;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero p {
  margin: 0 0 1.75rem;
  color: var(--text-soft);
  font-size: 1.15rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.button {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  border: 1px solid var(--accent);
}

.button:hover {
  text-decoration: none;
  filter: brightness(1.08);
}

.button.primary {
  background: var(--accent);
  color: var(--accent-text);
}

.button.secondary {
  color: var(--accent);
  background: transparent;
}

.install {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
}

.install span {
  color: var(--text-soft);
  user-select: none;
}

.tabs {
  min-width: 0;
}

.tab-list {
  display: flex;
  gap: 0.25rem;
  margin-bottom: -1px;
}

.tab-list button {
  padding: 0.45rem 0.9rem;
  font: 500 0.9rem var(--sans);
  color: var(--text-soft);
  background: none;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
}

.tab-list button[aria-selected='true'] {
  color: var(--text);
  background: var(--bg-code);
  border-color: var(--border);
}

.tabs pre {
  margin: 0;
  border-top-left-radius: 0;
}

.tab-panel[hidden] {
  display: none;
}

.section {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}

.section h2 {
  margin: 0 0 0.5rem;
  font-size: 1.9rem;
  letter-spacing: -0.02em;
}

.section .lead {
  margin: 0 0 2.5rem;
  color: var(--text-soft);
  max-width: 44rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.feature {
  padding: 1.4rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.feature h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.feature p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.bench {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem 3rem;
}

.bench h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.bar-row {
  display: grid;
  grid-template-columns: 9.5rem 1fr 4rem;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.bar-row .name {
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-row.us .name {
  color: var(--text);
  font-weight: 600;
}

.bar {
  height: 12px;
  background: var(--bar-other);
  border-radius: 0 4px 4px 0;
}

.bar-row.us .bar {
  background: var(--accent);
}

.bar-row .value {
  font-family: var(--mono);
  font-size: 0.85rem;
  text-align: right;
}

.note {
  margin-top: 2rem;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.footer {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.9rem;
}

.footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

/* Guide */

.docs {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 3rem;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px;
}

.sidebar {
  position: sticky;
  top: 60px;
  align-self: start;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 2rem 0;
  font-size: 0.92rem;
}

.sidebar h4 {
  margin: 1.25rem 0 0.4rem;
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar h4:first-child {
  margin-top: 0;
}

.sidebar ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar a {
  display: block;
  padding: 0.25rem 0.75rem;
  color: var(--text-soft);
  border-left: 2px solid var(--border);
}

.sidebar a:hover {
  color: var(--text);
  text-decoration: none;
}

.sidebar a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}

.content {
  min-width: 0;
  max-width: 50rem;
  padding: 2.5rem 0 5rem;
}

.content h1 {
  margin: 0 0 0.75rem;
  font-size: 2.3rem;
  letter-spacing: -0.02em;
}

.content h2 {
  margin: 3.5rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 1.6rem;
  letter-spacing: -0.01em;
}

.content h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.2rem;
}

.content h2 a.anchor,
.content h3 a.anchor {
  margin-left: 0.4rem;
  color: var(--border);
  font-weight: 400;
}

.content h2:hover a.anchor,
.content h3:hover a.anchor {
  color: var(--text-soft);
}

.content .intro {
  color: var(--text-soft);
  font-size: 1.1rem;
}

.table-wrap {
  margin: 1rem 0 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 0.55rem 0.85rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg-soft);
  font-weight: 600;
}

tr:last-child td {
  border-bottom: none;
}

.callout {
  margin: 1.25rem 0;
  padding: 0.9rem 1.1rem;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.callout p {
  margin: 0;
}

.menu-toggle {
  display: none;
}

/* Highlighting (highlight.js classes) */

.hljs-comment {
  color: var(--text-soft);
  font-style: italic;
}

.hljs-keyword,
.hljs-built_in,
.hljs-literal {
  color: #a3398c;
}

.hljs-string,
.hljs-regexp {
  color: #2f7d32;
}

.hljs-number {
  color: #b35900;
}

.hljs-title,
.hljs-title.function_ {
  color: #2f5fb3;
}

.hljs-attr,
.hljs-property {
  color: #0d6a7c;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .hljs-keyword,
  :root:not([data-theme='light']) .hljs-built_in,
  :root:not([data-theme='light']) .hljs-literal {
    color: #e38bd2;
  }
  :root:not([data-theme='light']) .hljs-string,
  :root:not([data-theme='light']) .hljs-regexp {
    color: #9fd88e;
  }
  :root:not([data-theme='light']) .hljs-number {
    color: #f0b070;
  }
  :root:not([data-theme='light']) .hljs-title,
  :root:not([data-theme='light']) .hljs-title.function_ {
    color: #8ab4f8;
  }
  :root:not([data-theme='light']) .hljs-attr,
  :root:not([data-theme='light']) .hljs-property {
    color: #7fd4e0;
  }
}

:root[data-theme='dark'] .hljs-keyword,
:root[data-theme='dark'] .hljs-built_in,
:root[data-theme='dark'] .hljs-literal {
  color: #e38bd2;
}

:root[data-theme='dark'] .hljs-string,
:root[data-theme='dark'] .hljs-regexp {
  color: #9fd88e;
}

:root[data-theme='dark'] .hljs-number {
  color: #f0b070;
}

:root[data-theme='dark'] .hljs-title,
:root[data-theme='dark'] .hljs-title.function_ {
  color: #8ab4f8;
}

:root[data-theme='dark'] .hljs-attr,
:root[data-theme='dark'] .hljs-property {
  color: #7fd4e0;
}

/* Small screens */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    padding: 3rem 0;
  }
  .features {
    grid-template-columns: 1fr 1fr;
  }
  .bench {
    grid-template-columns: 1fr;
  }
  .docs {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .sidebar {
    display: none;
    position: static;
    max-height: none;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
  }
  .sidebar.open {
    display: block;
  }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    padding: 0.4rem 0.8rem;
    font: 500 0.9rem var(--sans);
    color: var(--text);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
  }
}

@media (max-width: 600px) {
  .features {
    grid-template-columns: 1fr;
  }
  .nav .hide-small,
  .nav a[href^='https://github.com'] {
    display: none;
  }
  .nav {
    gap: 0.9rem;
    font-size: 0.9rem;
  }
  .bar-row {
    grid-template-columns: 7rem 1fr 3.5rem;
  }
  .content h1 {
    font-size: 1.9rem;
  }
}

td > code:first-child:last-child {
  white-space: nowrap;
}

/* Tables of numbers: cells stay on one line, and the table scrolls sideways when it does not fit. */
table.numbers th,
table.numbers td:not(:first-child) {
  white-space: nowrap;
}

/* Benchmarks page: summary cards, bar charts, mode switches, test progress, paired bars. */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.stat {
  padding: 1.1rem 1.2rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat .value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.stat .label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.88rem;
  color: var(--text-soft);
}

.segmented .tab-list {
  display: inline-flex;
  gap: 0.25rem;
  margin: 0.5rem 0 1.25rem;
  padding: 0.25rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.segmented .tab-list button {
  padding: 0.35rem 0.95rem;
  border: none;
  border-radius: 999px;
}

.segmented .tab-list button[aria-selected='true'] {
  color: var(--accent-text);
  background: var(--accent);
}

.charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 1.5rem 2rem;
  margin-bottom: 1.5rem;
}

.chart {
  padding: 1rem 1.1rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.chart h3,
.chart h4 {
  margin: 0 0 0.2rem;
  font-size: 0.98rem;
  font-weight: 600;
}

.chart .subtitle {
  margin: 0 0 0.8rem;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.chart-row {
  display: grid;
  grid-template-columns: 8.5rem 1fr 4.2rem;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.45rem;
  font-size: 0.86rem;
}

.chart-row .name {
  overflow: hidden;
  color: var(--text-soft);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chart-row.us .name {
  color: var(--text);
  font-weight: 600;
}

.chart-row .track {
  position: relative;
  height: 14px;
  background: var(--bg-soft);
  border-radius: 4px;
}

.chart-row .fill {
  height: 100%;
  min-width: 2px;
  background: var(--bar-other);
  border-radius: 4px;
}

.chart-row.us .fill {
  background: var(--accent);
}

.chart-row.interprets .fill {
  background: repeating-linear-gradient(45deg, var(--bar-other), var(--bar-other) 4px, transparent 4px, transparent 7px);
}

.chart-row .value {
  font-family: var(--mono);
  font-size: 0.8rem;
  text-align: right;
  white-space: nowrap;
}

.chart-row .value small {
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--text-soft);
}

.progress-table td {
  vertical-align: middle;
}

.progress {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 5.5rem;
}

.progress .track {
  height: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress .fill {
  height: 100%;
  background: var(--bar-other);
}

.progress.full .fill {
  background: var(--accent);
}

.progress .count {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-soft);
}

.progress.full .count {
  color: var(--text);
  font-weight: 600;
}

.pairs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 1rem 2rem;
}

.pair {
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pair .head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.6rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.pair .times {
  flex: none;
  line-height: 1.5;
  padding: 0.05rem 0.55rem;
  font-size: 0.8rem;
  color: var(--accent-text);
  background: var(--accent);
  border-radius: 999px;
}

.pair .chart-row {
  grid-template-columns: 3.5rem 1fr 4.2rem;
  margin-bottom: 0.3rem;
}

details.raw {
  margin: 0.5rem 0 1.5rem;
}

details.raw summary {
  cursor: pointer;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0 0 1rem;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.legend span::before {
  content: '';
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  margin-right: 0.35rem;
  vertical-align: -0.1rem;
  border-radius: 3px;
  background: var(--bar-other);
}

.legend .us::before {
  background: var(--accent);
}

.legend .interprets::before {
  background: repeating-linear-gradient(45deg, var(--bar-other), var(--bar-other) 3px, transparent 3px, transparent 5px);
}

@media (max-width: 900px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .chart-row {
    grid-template-columns: 6.5rem 1fr 3.8rem;
  }
  .stat .value {
    font-size: 1.6rem;
  }
}

/* Home page */

.eyebrow {
  margin: 0 0 0.75rem !important;
  font-size: 0.85rem !important;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent) !important;
}

.hero .install {
  margin-top: 1rem;
}

.example {
  min-width: 0;
}

.result {
  margin-top: 0.75rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid color-mix(in srgb, #d64545 35%, var(--border));
  border-left: 4px solid #d64545;
  border-radius: var(--radius);
  background: color-mix(in srgb, #d64545 6%, var(--bg));
}

.result .result-title {
  margin: 0 0 0.4rem;
  font-size: 0.88rem;
  color: var(--text-soft);
}

.result ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.result li {
  position: relative;
  padding-left: 1.4rem;
  font-size: 0.95rem;
  line-height: 1.7;
}

.result li::before {
  content: "\2715";
  position: absolute;
  left: 0;
  color: #d64545;
  font-weight: 700;
}

.section.alt {
  background: var(--bg-soft);
}

.section.alt .stat,
.section.alt .use {
  background: var(--bg);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.step {
  position: relative;
  padding: 1.4rem 1.4rem 1.4rem 4.2rem;
}

.step-number {
  position: absolute;
  top: 1.25rem;
  left: 1.2rem;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
}

.step h3,
.use h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.step p,
.use p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.uses {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.use {
  padding: 1.3rem;
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
}

.more-link {
  font-weight: 600;
}

.paths {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.path {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}

.path:hover {
  text-decoration: none;
  border-color: var(--accent);
  transform: translateY(-2px);
}

.path-who {
  font-size: 0.85rem;
  color: var(--text-soft);
}

.path-what {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}

.path-what::after {
  content: " \2192";
}

.path-desc {
  font-size: 0.92rem;
  color: var(--text-soft);
}

@media (max-width: 900px) {
  .steps {
    grid-template-columns: 1fr;
  }
  .uses,
  .paths {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .uses,
  .paths {
    grid-template-columns: 1fr;
  }
}

/* Playground */

.pg {
  max-width: 1160px;
  margin: 0 auto;
  padding: 2rem 16px 3rem;
}

.pg-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: flex-end;
  justify-content: space-between;
}

.pg-head h1 {
  margin: 0 0 0.25rem;
  font-size: 2rem;
  letter-spacing: -0.02em;
}

.pg-intro {
  margin: 0;
  color: var(--text-soft);
}

.pg-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
}

.pg-controls .button {
  padding: 0.5rem 1rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  background: transparent;
  color: var(--accent);
}

.pg-controls .button.primary {
  background: var(--accent);
  color: var(--accent-text);
}

.pg-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-soft);
}

.pg-field select {
  min-width: 17rem;
  padding: 0.5rem 0.6rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.pg-mode {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.pg-mode select {
  min-width: 0;
  padding: 0.25rem 0.4rem;
  font-size: 0.85rem;
}

.pg-hint {
  margin: 1.25rem 0;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  background: var(--accent-soft);
  border-radius: var(--radius);
}

.pg-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: stretch;
}

.pg-side {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.pg-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  overflow: hidden;
}

.pg-panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.pg-panel-head h2 {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0;
  font-size: 0.95rem;
}

.pg-step {
  display: inline-grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.75rem;
}

.pg-badge,
.pg-note {
  font-size: 0.78rem;
  color: var(--text-soft);
}

.pg-badge {
  padding: 0.1rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
}

.pg textarea {
  flex: 1;
  width: 100%;
  min-height: 7rem;
  margin: 0;
  padding: 0.85rem 1rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.55;
  tab-size: 2;
  color: var(--text);
  background: var(--bg-code);
  border: 0;
  outline: none;
  resize: vertical;
}

.pg textarea:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.pg textarea.pg-invalid {
  box-shadow: inset 3px 0 0 #e0a100;
}

.pg-schema textarea {
  min-height: 34rem;
}

.pg textarea.pg-value {
  min-height: 9rem;
}

.pg textarea.pg-options {
  flex: none;
  min-height: 4.2rem;
  height: 4.2rem;
}

.pg-output {
  flex: 1;
}

.pg-result {
  flex: 1;
  padding: 0.9rem 1rem;
  background: var(--bg);
}

.pg-status {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.pg-status::before {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  font-size: 0.9rem;
  color: #ffffff;
}

.is-valid .pg-status {
  color: var(--accent);
}

.is-valid .pg-status::before {
  content: "\2713";
  background: var(--accent);
  color: var(--accent-text);
}

.is-invalid .pg-status {
  color: #d64545;
}

.is-invalid .pg-status::before {
  content: "\2715";
  background: #d64545;
}

.is-problem .pg-status {
  color: #b27b00;
}

.is-problem .pg-status::before {
  content: "!";
  background: #e0a100;
}

.pg-errors {
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}

.pg-errors li {
  padding: 0.45rem 0.7rem;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  border-left: 3px solid #d64545;
  border-radius: 0 6px 6px 0;
  background: color-mix(in srgb, #d64545 7%, var(--bg));
}

.pg-error-message {
  display: block;
  font-weight: 600;
}

.pg-result pre {
  margin: 0.4rem 0 0;
  padding: 0.6rem 0.8rem;
  font-size: 0.8rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pg-errors pre {
  background: var(--bg);
}

.pg-returns,
.pg-after-title,
.pg-speed {
  margin: 0.6rem 0 0;
  font-size: 0.88rem;
  color: var(--text-soft);
}

.pg-speed {
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}

.pg-code {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.2rem 1rem;
}

.pg-code summary {
  padding: 0.6rem 0;
  font-weight: 600;
  cursor: pointer;
}

.pg-code > p {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.92rem;
  color: var(--text-soft);
}

.pg-code pre {
  max-height: 32rem;
  overflow: auto;
}

.pg-footer-note {
  margin: 1.5rem 0 0;
  color: var(--text-soft);
}

@media (max-width: 900px) {
  .pg-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .pg-schema textarea {
    min-height: 18rem;
  }
}

@media (max-width: 600px) {
  .pg {
    padding: 1.25rem 1rem 2rem;
  }
  .pg-field select {
    min-width: 0;
    width: 100%;
  }
  .pg-controls,
  .pg-controls .pg-field {
    width: 100%;
  }
}

/* Playground and Schema from JSON: switch between the two tools */

.pg-switch {
  display: inline-flex;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  padding: 0.25rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.pg-switch a {
  padding: 0.3rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-soft);
  border-radius: 999px;
}

.pg-switch a:hover {
  text-decoration: none;
  color: var(--text);
}

.pg-switch a[aria-current='page'] {
  color: var(--accent-text);
  background: var(--accent);
}

/* Schema from JSON */

.inf-samples {
  display: flex;
  flex-direction: column;
}

.inf-sample + .inf-sample {
  border-top: 1px solid var(--border);
}

.inf-sample-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--bg-soft);
}

.inf-remove {
  padding: 0;
  font: inherit;
  color: var(--text-soft);
  background: none;
  border: 0;
  cursor: pointer;
}

.inf-remove:hover {
  color: #d64545;
}

.pg .inf-sample textarea {
  display: block;
  min-height: 15rem;
}

.inf-add {
  padding: 0.75rem 0.9rem;
  border-top: 1px solid var(--border);
}

.inf-add .button,
.inf-actions .button {
  padding: 0.45rem 0.95rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  background: transparent;
  color: var(--accent);
}

.inf-actions .button.primary {
  background: var(--accent);
  color: var(--accent-text);
}

.inf-actions .button:disabled {
  opacity: 0.5;
  cursor: default;
}

.inf-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  padding: 0.8rem 0.9rem;
  background: var(--bg);
}

.inf-check {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.inf-check input {
  accent-color: var(--accent);
}

.inf-tabs .tab-list {
  margin: 0;
}

.inf-tabs .tab-list button {
  padding: 0.2rem 0.75rem;
  font: inherit;
  font-size: 0.82rem;
  color: var(--text-soft);
  background: none;
  cursor: pointer;
}

.inf-output {
  flex: 1;
  margin: 0;
  max-height: 38rem;
  border: 0;
  border-radius: 0;
  overflow: auto;
}

.inf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0.9rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.pg-output > .pg-result.is-problem {
  flex: none;
}
