/* @reportwright/pdf demo. Palette copied exactly from the ReportWright demo site (site/site.css): warm paper,
   black ink, a proofreader's red used only for key actions. Full width, no centred column. */
:root {
  --bg: #f3f0e8; --bg-2: #ebe7dc; --surface: #fbfaf6; --ink: #17150f; --muted: #5a554a;
  --rule: #d6d0c1; --rule-strong: #1715108c; --accent: #c8321a; --accent-ink: #ffffff; --accent-soft: #f6dcd4;
  --accent-text: #a8260f; --code-bg: #1b1a17; --code-ink: #ece8dc;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --gut: clamp(16px, 2.2vw, 32px);
  --fs-1: 12px; --fs-2: 13.5px; --fs-3: 15px; --fs-4: 17px; --fs-5: 20px;
  --fs-6: clamp(26px, 2.6vw, 38px); --fs-7: clamp(34px, 5.5vw, 68px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12110e; --bg-2: #1a1915; --surface: #1d1c18; --ink: #efebe0; --muted: #a8a293;
    --rule: #34312a; --rule-strong: #efebe08c; --accent: #ff6a4d; --accent-ink: #1a0802; --accent-soft: #3a1b13; --accent-text: #ff8a72;
    --code-bg: #0b0a08; --code-ink: #ece8dc; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12110e; --bg-2: #1a1915; --surface: #1d1c18; --ink: #efebe0; --muted: #a8a293;
  --rule: #34312a; --rule-strong: #efebe08c; --accent: #ff6a4d; --accent-ink: #1a0802; --accent-soft: #3a1b13; --accent-text: #ff8a72;
  --code-bg: #0b0a08; --code-ink: #ece8dc; color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--fs-3)/1.55 var(--sans); overflow-x: hidden; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
code, pre, textarea { font-family: var(--mono); }
code { font-size: var(--fs-2); background: var(--bg-2); padding: 1px 5px; border-radius: 3px; overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: var(--fs-7); } h2 { font-size: var(--fs-6); } h3 { font-size: var(--fs-4); }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }

.bar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 10px var(--gut); background: var(--bg); border-bottom: 1px solid var(--rule); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: var(--fs-4); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 2px; }
.nav a { font-family: var(--mono); font-size: var(--fs-1); text-transform: uppercase; letter-spacing: .06em; text-decoration: none; padding: 6px 10px; border-radius: 4px; color: var(--muted); }
.nav a:hover { color: var(--ink); background: var(--bg-2); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--bg-2); box-shadow: inset 0 -2px 0 var(--accent); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 16px; border-radius: 6px; border: 1px solid var(--ink); background: transparent; color: var(--ink); font: 500 var(--fs-2)/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--bg-2); }
.btn-solid { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-solid:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
.btn[disabled] { opacity: .5; cursor: default; }

main { padding: clamp(20px, 3vw, 40px) var(--gut); }
.surface { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: clamp(16px, 2vw, 24px); }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.big { font: 600 var(--fs-6)/1.1 var(--sans); color: var(--accent-text); display: block; margin-bottom: 6px; }
.install { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 20px 0; }
.install pre { margin: 0; background: var(--code-bg); color: var(--code-ink); padding: 10px 16px; border-radius: 6px; font-size: var(--fs-3); max-width: 100%; overflow-x: auto; }
.lede { font-size: var(--fs-5); max-width: none; color: var(--muted); }
footer { padding: 20px var(--gut); border-top: 1px solid var(--rule); color: var(--muted); font-size: var(--fs-2); }

/* playground */
.play { display: grid; grid-template-columns: 230px minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 16px var(--gut); }
.list { display: flex; flex-direction: column; gap: 2px; }
.list button { text-align: left; border: 0; background: transparent; color: var(--muted); font: 500 var(--fs-2)/1.3 var(--sans); padding: 8px 10px; border-radius: 4px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.list button:hover { background: var(--bg-2); color: var(--ink); }
.list button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: inset 2px 0 0 var(--accent); }
.tag { font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .05em; padding: 3px 6px; border-radius: 3px; border: 1px solid var(--rule-strong); align-self: center; }
.panel { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.panel h2 { font-size: var(--fs-5); margin: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.note { font-size: var(--fs-2); color: var(--muted); margin: 0; }
.editor { position: relative; height: 68vh; min-height: 360px; border-radius: 8px; background: var(--code-bg); overflow: hidden; }
.editor pre, .editor textarea { position: absolute; inset: 0; margin: 0; padding: 14px; border: 0; font-size: 13px; line-height: 1.5; tab-size: 2; white-space: pre; overflow: auto; }
.editor pre { color: var(--code-ink); pointer-events: none; }
.editor textarea { color: transparent; background: transparent; caret-color: #fff; resize: none; outline: none; }
.editor textarea:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.tk-c { color: #a39d8c; } .tk-s { color: #b5d68a; } .tk-k { color: #ff9f85; } .tk-n { color: #f2c14e; }
.outs { display: flex; flex-wrap: wrap; gap: 6px; }
.outs button { font: 500 var(--fs-1)/1 var(--mono); padding: 6px 10px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); border-radius: 4px; cursor: pointer; }
.outs button[aria-pressed="true"] { border-color: var(--ink); background: var(--bg-2); }
.viewer { overflow: auto; padding: 12px; display: grid; gap: 12px; align-content: start; width: 100%; height: 60vh; min-height: 320px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); }
.log { margin: 0; padding: 10px 12px; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; font-size: var(--fs-1); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 18vh; overflow: auto; }
.log.err { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
@media (max-width: 1100px) { .play { grid-template-columns: 200px minmax(0, 1fr); } .play .preview { grid-column: 1 / -1; } }
@media (max-width: 700px) {
  .play { grid-template-columns: minmax(0, 1fr); }
  .list { flex-direction: row; flex-wrap: wrap; } .list .tag { display: none; }
  .editor { height: 50vh; }
}

/* benchmarks */
.bench { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 16px; }
.bench h3 { margin-bottom: 4px; }
.bench .win { font: 600 var(--fs-2)/1.3 var(--sans); color: var(--accent-text); margin-bottom: 10px; }
.row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 10px; align-items: center; margin: 6px 0; font-size: var(--fs-2); }
.row .name { overflow-wrap: anywhere; }
.track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fill { height: 14px; border-radius: 2px; background: var(--muted); opacity: .55; flex: none; min-width: 2px; }
.row.ours .fill { background: var(--accent); opacity: 1; }
.row.ours .name { font-weight: 600; }
.track a { font-family: var(--mono); font-size: var(--fs-1); white-space: nowrap; }
@media (max-width: 500px) { .row { grid-template-columns: minmax(0, 1fr); } }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-2); }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--rule); }
.scroll { overflow-x: auto; }
pre code { background: none; padding: 0; border-radius: 0; font-size: inherit; color: inherit; }

.viewer canvas { background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .2); }
