/* PFSP Benchmarks — single stylesheet, no external fonts or frameworks */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f4f2ec;
  --text: #1c222a;
  --muted: #5d6673;
  --faint: #8a929d;
  --border: #e4e1d8;
  --accent: #1f5f8b;
  --accent-soft: #e6eff6;
  --closed: #2e7a4d;
  --closed-soft: #e5f2ea;
  --open: #a86a12;
  --open-soft: #fbf0dc;
  --danger: #b3261e;
  --danger-soft: #fbe7e5;
  --shadow: 0 1px 2px rgba(20, 24, 30, .05), 0 4px 16px rgba(20, 24, 30, .04);
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #121519;
  --surface: #1a1f25;
  --surface-2: #20262e;
  --text: #e5e8ec;
  --muted: #a0a9b5;
  --faint: #78818d;
  --border: #2c333c;
  --accent: #7ab4e0;
  --accent-soft: #1d2c3a;
  --closed: #63c28d;
  --closed-soft: #18301f;
  --open: #e3ac52;
  --open-soft: #33281a;
  --danger: #f08b84;
  --danger-soft: #3a1f1d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.25; letter-spacing: -.005em; }
h1 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); margin: 0 0 .4em; }
h2 { font-size: 1.5rem; margin: 2.2em 0 .6em; }
h3 { font-size: 1.15rem; margin: 1.6em 0 .4em; }
p { margin: 0 0 1em; }
code, kbd, pre, .mono { font-family: var(--mono); font-size: .88em; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
pre { background: var(--surface-2); padding: 1em; border-radius: 8px; overflow-x: auto; line-height: 1.45; }
pre code { background: none; padding: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }
[hidden] { display: none !important; }
.narrow { max-width: 780px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: .5em 1em; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ---------- header ---------- */
.site-header {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.site-header .container { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 1.12rem; white-space: nowrap; }
.brand svg { flex: none; }
.nav { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 7px; font-size: .94rem; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--text); font-weight: 600; background: var(--surface-2); }
.icon-btn { background: none; border: 1px solid transparent; color: var(--muted); border-radius: 7px; width: 36px; height: 36px; display: inline-grid; place-items: center; cursor: pointer; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .menu-btn { display: inline-grid; margin-left: auto; }
  .nav { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 16px 16px; }
  .nav.open { display: flex; }
  .nav a { padding: 10px 12px; }
}

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 72px; padding: 32px 0 40px; color: var(--muted); font-size: .9rem; }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ---------- page heads ---------- */
.page-head { padding: 44px 0 8px; }
.page-head .lead { font-size: 1.12rem; color: var(--muted); max-width: 760px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 600; color: var(--accent); margin-bottom: .6em; }

/* hero */
.hero { padding-top: 64px; padding-bottom: 28px; }
.notation { text-transform: none; letter-spacing: 0; font-family: var(--serif); font-size: .95rem; font-style: italic; }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.2rem); max-width: 900px; }
.hero .lead { font-size: 1.2rem; color: var(--muted); max-width: 720px; }
.hero-search { display: flex; gap: 8px; margin-top: 26px; max-width: 520px; }
.hero-search input { flex: 1; }

/* ---------- components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card h3 { margin-top: 0; }
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
@media (max-width: 420px) { .grid-2 { grid-template-columns: 1fr; } }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: 8px; font: 500 .94rem/1.2 var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--faint); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #0d1620; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

input[type="text"], input[type="search"], select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; min-height: 40px;
}
textarea { width: 100%; font-family: var(--mono); font-size: .88rem; line-height: 1.5; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label { font-weight: 500; font-size: .92rem; }
.field { display: flex; flex-direction: column; gap: 6px; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; line-height: 1.6; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.closed { color: var(--closed); background: var(--closed-soft); }
.badge.open { color: var(--open); background: var(--open-soft); }
.badge.plain { color: var(--muted); background: var(--surface-2); }
.badge.plain::before { display: none; }
.badge.verified { color: var(--accent); background: var(--accent-soft); }

.stat { display: flex; flex-direction: column; }
.stat .v { font-family: var(--serif); font-size: 2rem; font-weight: 600; line-height: 1.1; }
.stat .k { color: var(--muted); font-size: .85rem; }
.stats-row { display: flex; gap: 28px; flex-wrap: wrap; margin: 14px 0; }

.progress { height: 8px; background: var(--open-soft); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--closed); border-radius: 99px; }
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

.notice { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 1em 0; }
.notice.warn { border-color: var(--open); background: var(--open-soft); }
.notice.ok { border-color: var(--closed); background: var(--closed-soft); }
.notice.err { border-color: var(--danger); background: var(--danger-soft); }
.notice p:last-child { margin-bottom: 0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
td.num, th.num { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
tr.clickable { cursor: pointer; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th .arrow { opacity: .35; font-size: .7rem; margin-left: 3px; }
th[aria-sort] .arrow { opacity: 1; color: var(--accent); }
.table-scroll { max-height: 70vh; overflow: auto; }
td a.id { font-weight: 600; text-decoration: none; }
td a.ref { text-decoration: none; }
td a.ref:hover { text-decoration: underline; }
td a.id:hover { text-decoration: underline; }
.dim { color: var(--faint); }

/* toolbar / filters */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0 14px; }
.toolbar .grow { flex: 1 1 220px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 8px 12px; font: 500 .88rem var(--sans); color: var(--muted); cursor: pointer; border-right: 1px solid var(--border); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.count-line { color: var(--muted); font-size: .9rem; margin: 0 0 10px; }

/* ---------- key-value ---------- */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.kv > div { padding: 16px 18px; border-right: 1px solid var(--border); }
.kv > div:last-child { border-right: 0; }
.kv .k { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.kv .v { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; margin-top: 2px; }
@media (max-width: 640px) { .kv > div { border-right: 0; border-bottom: 1px solid var(--border); } }

.perm-box { font-family: var(--mono); font-size: .85rem; background: var(--surface-2); border-radius: 8px; padding: 12px 14px; max-height: 160px; overflow: auto; word-break: break-word; line-height: 1.6; }

/* ---------- gantt ---------- */
.gantt-wrap { position: relative; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 12px; }
.gantt-wrap canvas { width: 100%; display: block; }
.gantt-tip { position: absolute; pointer-events: none; background: var(--text); color: var(--bg); font-size: .8rem; padding: 6px 9px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .08s; }

/* ---------- misc ---------- */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 18px 46px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; font-size: .9rem; }
.steps li strong { display: block; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.timeline time { color: var(--muted); font-size: .9rem; }
.formula { font-family: var(--serif); font-size: 1.12rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; overflow-x: auto; line-height: 2; }
.formula var { font-style: italic; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 8px; font-size: .9rem; opacity: 0; transition: .2s; z-index: 200; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.toc { position: sticky; top: 84px; font-size: .92rem; }
.toc a { display: block; color: var(--muted); text-decoration: none; padding: 3px 0; }
.toc a:hover { color: var(--accent); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-title h2 { margin-bottom: .4em; }
dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.meta dt { color: var(--muted); }
dl.meta dd { margin: 0; }
.ref-list { padding-left: 1.2em; }
.ref-list li { margin-bottom: .6em; }
.result { margin-top: 18px; }
@media print { .site-header, .site-footer, .toolbar, .btn { display: none !important; } body { background: #fff; } }
