/* Pre-match and live docs (/docs/prematch/, /docs/live/). Uses the tokens and components in /light/light.css. */
.pd-page code { font-family: var(--font-mono); font-size: .92em; }
.pd-page p code, .pd-page td code, .pd-page li code { background: var(--surface-sunken); border-radius: 6px; padding: 1px 6px; color: var(--ink); }
.pd-page .code code { background: none; padding: 0; color: inherit; }
.pd-page .table-box { flex: none; }
.pd-page a:not(.btn):not(.pd-switch-item) { color: var(--mint-ink); text-decoration: underline; text-underline-offset: 3px; }

/* hero */
.pd-hero { padding-top: 120px; }
.pd-hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.pd-hero-copy { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
.pd-hero-code pre { white-space: pre-wrap; word-break: break-all; }
.pd-crumbs { display: flex; gap: 8px; font: 500 13px/20px var(--font-mono); color: var(--ink-subtle); }
.pd-crumbs a { color: var(--ink-muted) !important; text-decoration: none !important; }
.pd-crumbs a:hover { color: var(--ink) !important; }
.pd-switch { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: 999px; }
.pd-switch-item { padding: 6px 16px; border-radius: 999px; font: 600 14px/20px var(--font-sans); color: var(--ink-muted); text-decoration: none; transition: background-color 160ms ease, color 160ms ease; }
.pd-switch-item:hover { color: var(--ink); }
.pd-switch-item[aria-current="page"] { background: var(--surface-card); color: var(--ink); box-shadow: var(--shadow-sm); }

/* step 1: the tree */
.pd-tree { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; counter-reset: none; }
.pd-node { position: relative; display: flex; flex-direction: column; gap: 8px; background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); min-width: 0; }
.pd-node:not(:last-child)::after { content: "→"; position: absolute; right: -11px; top: 50%; transform: translateY(-50%); z-index: 1; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); color: var(--on-mint); font: 700 12px/1 var(--font-sans); }
.pd-node-num { font: 600 12px/16px var(--font-mono); color: var(--ink-subtle); }
.pd-node-level { font-weight: 650; font-size: 18px; line-height: 24px; }
.pd-node-key { display: block; font: 500 12px/18px var(--font-mono); background: var(--mint-tint); color: var(--mint-ink); border-radius: var(--radius-sm); padding: 6px 8px; overflow-wrap: anywhere; }
.pd-node-field { display: block; color: var(--ink-subtle); font-size: 11px; }
.pd-node-name { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.pd-note { max-width: 760px; margin: 0; }

/* step 2: explorer */
.pd-explorer { display: grid; grid-template-columns: 250px 290px minmax(0, 1fr); gap: 16px; align-items: start; }
.pd-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pd-col-title { font: 600 12px/16px var(--font-mono); letter-spacing: 1px; text-transform: uppercase; color: var(--ink-subtle); margin: 4px 0 4px; overflow-wrap: anywhere; }
.pd-col-title code { text-transform: none; letter-spacing: 0; }
.pd-league, .pd-match { appearance: none; text-align: left; width: 100%; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-md); font: inherit; color: var(--ink); cursor: pointer; transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease; }
.pd-league:hover, .pd-match:hover { border-color: var(--border-strong); }
.pd-league:focus-visible, .pd-match:focus-visible, .pd-code-tab:focus-visible { outline: 2px solid var(--mint-ink); outline-offset: 2px; }
.pd-league.is-on, .pd-match.is-on { border-color: var(--mint-ink); box-shadow: 0 0 0 3px var(--mint-tint); }
.pd-league strong, .pd-match strong { font-size: 15px; line-height: 20px; font-weight: 650; }
.pd-league code, .pd-match code { font: 500 12px/16px var(--font-mono); color: var(--mint-ink); overflow-wrap: anywhere; }
.pd-league-sport, .pd-league-count { font-size: 12px; line-height: 16px; color: var(--ink-subtle); }
.pd-match-meta { display: flex; gap: 8px; align-items: center; font: 500 12px/16px var(--font-mono); color: var(--ink-subtle); }
.pd-live-clock { color: var(--live); font-weight: 600; }
.pd-score { background: var(--surface-inverse); color: var(--on-inverse); border-radius: 6px; padding: 1px 7px; }
.pd-matchlist { display: flex; flex-direction: column; gap: 8px; }
.pd-matchlist + .pd-matchlist { margin-top: 16px; }
.pd-detail { display: flex; flex-direction: column; gap: 16px; background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); min-width: 0; }
.pd-detail + .pd-detail { margin-top: 16px; }
.pd-detail-head { display: flex; flex-direction: column; gap: 6px; }
.pd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pd-chip { display: inline-flex; gap: 6px; align-items: center; font: 500 12px/16px var(--font-mono); color: var(--ink-subtle); background: var(--surface-sunken); border-radius: var(--radius-sm); padding: 5px 8px; }
.pd-chip code { color: var(--ink); background: none !important; padding: 0 !important; }
.pd-market { display: flex; flex-direction: column; gap: 8px; }
.pd-market-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.pd-market-head strong { color: var(--ink); font-weight: 650; }
.pd-market-head > code { font: 500 12px/16px var(--font-mono); color: var(--mint-ink); background: var(--mint-tint) !important; padding: 2px 6px !important; border-radius: 6px; }
.pd-status { font: 600 11px/16px var(--font-mono); text-transform: uppercase; letter-spacing: .6px; padding: 2px 8px; border-radius: 6px; }
.pd-status-open { background: var(--mint-tint); color: var(--mint-ink); }
.pd-status-suspended { background: var(--live-tint); color: var(--live); }
.pd-market.is-suspended .pd-table td:nth-child(n+3) { color: var(--ink-subtle); text-decoration: line-through; }
.pd-table table { min-width: 420px; font-size: 14px; }
.pd-table th, .pd-table td { padding: 10px 14px; }
.pd-table td code { font-size: 12px; }
.pd-json summary { cursor: pointer; font: 600 13px/20px var(--font-sans); color: var(--mint-ink); padding: 4px 0; }
.pd-json[open] summary { margin-bottom: 8px; }
.pd-json pre { max-height: 420px; }
/* with JS: only the chosen league and match are shown */
.pd-explorer.is-js .pd-matchlist:not(.is-on), .pd-explorer.is-js .pd-detail:not(.is-on) { display: none; }
.pd-explorer.is-js .pd-matchlist + .pd-matchlist, .pd-explorer.is-js .pd-detail + .pd-detail { margin-top: 0; }

/* step 3: fields */
.pd-fields { display: grid; grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr); gap: 16px; align-items: start; }
.pd-fields-code pre { max-height: 760px; }
.pd-ref table { min-width: 520px; font-size: 14px; line-height: 20px; }
.pd-ref th, .pd-ref td { text-align: left !important; vertical-align: top; padding: 12px 16px; }
.pd-ref td { font-family: var(--font-sans); font-weight: 400; color: var(--ink-muted); }
.pd-ref td:first-child { color: var(--ink); white-space: nowrap; }
.pd-ref-fields td:last-child code { overflow-wrap: anywhere; }
.pd-ref-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 16px; }

/* live: stream */
.pd-stream { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
.pd-rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.pd-rules li { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.pd-rules strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* step 5: integrate */
.pd-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.pd-step-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--mint); color: var(--on-mint); font: 700 13px/1 var(--font-mono); }
.pd-code-tabs { display: flex; flex-direction: column; gap: 12px; }
.pd-code-tablist { display: inline-flex; align-self: flex-start; padding: 4px; gap: 4px; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: 999px; }
.pd-code-tab { appearance: none; border: 0; background: none; padding: 6px 16px; border-radius: 999px; font: 600 14px/20px var(--font-sans); color: var(--ink-muted); cursor: pointer; }
.pd-code-tab[aria-selected="true"] { background: var(--surface-card); color: var(--ink); box-shadow: var(--shadow-sm); }
.pd-code-tabs.is-js .code[hidden] { display: none; }

/* responsive */
@media (max-width: 1080px) {
  .pd-tree { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
  .pd-node:not(:last-child)::after { display: none; }
  .pd-explorer { grid-template-columns: 230px minmax(0, 1fr); }
  .pd-col-detail { grid-column: 1 / -1; }
  .pd-fields, .pd-stream { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .pd-hero { padding-top: 96px; }
  .pd-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}
@media (max-width: 640px) {
  .pd-explorer { grid-template-columns: minmax(0, 1fr); }
  .pd-col-leagues { flex-direction: row; overflow-x: auto; gap: 8px; padding-bottom: 4px; scroll-snap-type: x mandatory; }
  .pd-col-leagues .pd-col-title { display: none; }
  .pd-col-leagues .pd-league { flex: 0 0 210px; scroll-snap-align: start; }
  .pd-detail { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .pd-league, .pd-match, .pd-switch-item { transition: none; }
}

/* /docs/ reference (API v2, 14 Nov 2026): "On this page" list and stacked code panels */
.pd-toc { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; padding-top: 8px; padding-bottom: 8px; }
.pd-toc .pd-col-title { margin: 0; }
.pd-toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pd-toc li a { display: inline-block; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-card); color: var(--ink-muted); font: 500 14px/20px var(--font-sans); text-decoration: none; transition: color 160ms ease, border-color 160ms ease; }
.pd-page .pd-toc li a { color: var(--ink-muted); text-decoration: none; }
.pd-toc li a:hover, .pd-page .pd-toc li a:hover { color: var(--ink); border-color: var(--ink-muted); }
.pd-page section[id] { scroll-margin-top: 96px; }
.pd-fields > .stack-32 { gap: 16px; min-width: 0; }
.pd-page .intro p + p { margin-top: 12px; }
@media (prefers-reduced-motion: reduce) {
  .pd-toc li a { transition: none; }
}
