/* Parameter reference, API and catalog pages. Colors come from pydata tokens, so dark mode follows. */

:root {
  --hmp-req: #b42318;
  --hmp-cal: #6941c6;
  --hmp-when: #b54708;
  --hmp-unit: #0e7490;
  --hmp-auto: #0e9384;
  --hmp-add: #067647;
  --hmp-chg: #b54708;
}
html[data-theme="dark"] {
  --hmp-req: #f97066;
  --hmp-cal: #b692f6;
  --hmp-when: #fdb022;
  --hmp-unit: #67e3f9;
  --hmp-auto: #5fe9d0;
  --hmp-add: #47cd89;
  --hmp-chg: #fdb022;
}

.hmp-muted { color: var(--pst-color-text-muted); }
.hmp-gap { color: var(--hmp-req); font-size: .85em; }
.hmp-broken { color: var(--hmp-req) !important; text-decoration: line-through; }
.hmp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Section intro */
.hmp-intro { background: var(--pst-color-surface); border-radius: .4rem; padding: .6rem .9rem; margin-bottom: .8rem; }
.hmp-intro p { margin-bottom: .3rem; }
.hmp-intro ul { margin: .1rem 0 .4rem 0; padding-left: 1.2rem; }
.hmp-facts { margin: 0; padding-left: 1.1rem; font-size: .9em; }

/* Copy buttons: one icon, a check once copied */
.hmp-copy {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  width: 1.8rem; height: 1.8rem; padding: 0; margin-left: .15rem;
  border-radius: .3rem; border: 1px solid var(--pst-color-border);
  background: var(--pst-color-background); color: var(--pst-color-text-muted); cursor: pointer;
}
.hmp-copy:hover, .hmp-copy:focus-visible { color: var(--pst-color-text-base); border-color: var(--pst-color-primary); }
.hmp-ico { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hmp-copy.hmp-done { color: var(--hmp-add); border-color: var(--hmp-add); }
.hmp-copy.hmp-fail { color: var(--hmp-req); border-color: var(--hmp-req); }

/* Dev/expert switch: one state for the site, shown by every handle */
.hmp-adv-switch, .tb-adv {
  font-size: .8em; padding: .2rem .6rem; min-height: 1.8rem; border-radius: .3rem;
  border: 1px solid var(--pst-color-border); background: var(--pst-color-background);
  color: var(--pst-color-text-muted); cursor: pointer;
}
.hmp-adv-switch { margin-top: .3rem; }
.hmp-adv-switch[aria-pressed="true"], .tb-adv[aria-pressed="true"] { color: var(--pst-color-primary); border-color: var(--pst-color-primary); }
.hmp-adv-on, html.hmp-adv .hmp-adv-off { display: none; }
html.hmp-adv .hmp-adv-on { display: inline; }

/* Cards */
.hmp-card {
  padding: .5rem 1rem .8rem 1.3rem;
  border-left: 3px solid var(--pst-color-primary);
  margin: 0 0 .5rem .3rem;
  font-size: .9em;
}
.hmp-card dl { display: grid; grid-template-columns: 8.5rem 1fr; gap: .3rem .8rem; margin: 0; }
.hmp-card dt { color: var(--pst-color-text-muted); font-weight: 600; }
.hmp-card dd { margin: 0; }
.hmp-card ul { margin: 0; padding-left: 1rem; }
.hmp-card dd p { margin: 0 0 .3rem 0; }
.hmp-card dd p:last-child { margin-bottom: 0; }

.hmp-embedded { border: 1px solid var(--pst-color-border); border-radius: .4rem; padding: .3rem .6rem 0 .6rem; margin: .6rem 0 1rem 0; }
.hmp-embed-note { font-size: .78em; color: var(--pst-color-text-muted); margin: .1rem 0 .4rem 0; }

/* Known keys of flow.param */
table.hmp-known, table.hmp-gates { width: 100%; border-collapse: collapse; font-size: .9em; margin: .3rem 0 1rem 0; }
.hmp-known th, .hmp-known td, .hmp-gates th, .hmp-gates td {
  border-bottom: 1px solid var(--pst-color-border); padding: .35rem .5rem; text-align: left; vertical-align: top;
}
.hmp-known thead th { color: var(--pst-color-text-muted); font-weight: 600; }
.hmp-known tr.hmp-known-card td { padding: 0 0 .3rem 0; }
.hmp-known tr:target td { box-shadow: inset 4px 0 0 var(--pst-color-primary); }

/* TOML blocks */
.hmp-toml-wrap { margin: .5rem 0 1.2rem 0; border: 1px solid var(--pst-color-border); border-radius: .4rem; overflow: hidden; }
.hmp-toml-cap { font-size: .82em; padding: .3rem .7rem; background: var(--pst-color-surface); border-bottom: 1px solid var(--pst-color-border); }
pre.hmp-toml { margin: 0; border: none; border-radius: 0; font-size: .82em; line-height: 1.5; padding: .5rem .2rem; overflow-x: auto; background: var(--pst-color-background); }
pre.hmp-toml .ln { display: inline-block; width: 2.6rem; text-align: right; color: var(--pst-color-text-muted); opacity: .6; padding-right: .5rem; user-select: none; }
pre.hmp-toml .mk { display: inline-block; width: 1.1rem; font-weight: 700; user-select: none; }
pre.hmp-toml .mk-add, .mk-add { color: var(--hmp-add); font-weight: 700; }
pre.hmp-toml .mk-chg, .mk-chg { color: var(--hmp-chg); font-weight: 700; }
pre.hmp-toml .c { color: var(--pst-color-text-muted); font-style: italic; }
pre.hmp-toml .h, pre.hmp-toml .h a { color: var(--pst-color-primary); font-weight: 700; }
pre.hmp-toml .k a { color: var(--pst-color-text-base); text-decoration: underline dotted; text-underline-offset: 3px; }
pre.hmp-toml .k a:hover, pre.hmp-toml .h a:hover { color: var(--pst-color-link-hover); }
pre.hmp-toml .s { color: var(--hmp-add); }
pre.hmp-toml .n { color: var(--hmp-cal); }
.hmp-gap-line { text-align: center; color: var(--pst-color-text-muted); font-size: .8em; background: var(--pst-color-surface); }

/* Terminal */
pre.hmp-term { background: #0b1220; color: #d7e2f0; border-radius: .4rem; padding: .8rem 1rem; font-size: .8em; line-height: 1.45; white-space: pre; overflow-x: auto; }

/* Tables that scroll sideways rather than the page */
.hmp-matrix-wrap { overflow-x: auto; }
.hmp-gates td { text-align: right !important; font-variant-numeric: tabular-nums; }
.hmp-gates td:first-child { text-align: left !important; }
.hmp-total { font-weight: 700; }

/* Home doors */
.hmp-door .sd-card-title { font-size: 1.2em; }

/* Headings that are TOML paths stay readable */
.bd-article h1 code, .bd-article h2 code, .bd-article h3 code, .bd-article h4 code, .bd-article h5 code, .bd-article h6 code {
  background: none; border: none; padding: 0; color: inherit; font-size: .88em; font-weight: 700;
}
.bd-sidebar code, .bd-breadcrumbs code, .bd-toc code { background: none; border: none; padding: 0; color: inherit; font-size: .92em; }

/* ===== Annotated TOML view (generated) ===== */
.tb { border: 1px solid var(--pst-color-border); border-radius: .45rem; margin: .4rem 0 1.3rem 0; overflow: hidden; background: var(--pst-color-background); }
.tb-bar { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .3rem .7rem; background: var(--pst-color-surface); border-bottom: 1px solid var(--pst-color-border); }
a.tb-h { font-family: var(--pst-font-family-monospace); font-weight: 700; color: var(--pst-color-primary); text-decoration: none; font-size: 1em; overflow-wrap: anywhere; }
.tb-actions { display: inline-flex; gap: .4rem; align-items: center; flex-shrink: 0; }
.tb-lines { padding: .15rem 0; }
html:not(.hmp-adv) .tb.tb-all-adv .tb-lines { display: none; }
html:not(.hmp-adv) .tb.tb-all-adv .tb-bar { border-bottom: none; }
.tl { border-bottom: 1px dashed color-mix(in srgb, var(--pst-color-border) 70%, transparent); }
.tl:last-child { border-bottom: none; }
.tl > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(15rem, 44%) 1fr; gap: .1rem 1.1rem; padding: .28rem .7rem .28rem 2rem; position: relative; align-items: baseline; }
.tl > summary::-webkit-details-marker { display: none; }
/* The chevron says a line opens; the dot marks a line you must write. */
.tl > summary::after { content: "\25B8"; position: absolute; left: .45rem; top: .3rem; color: var(--pst-color-text-muted); font-size: .8em; transition: transform .15s; }
.tl[open] > summary::after { transform: rotate(90deg); }
.tl > summary:hover, .tl[open] > summary { background: var(--pst-color-surface); }
.tl:target > summary { box-shadow: inset 4px 0 0 var(--pst-color-primary); }
.tl-code { font-family: var(--pst-font-family-monospace); font-size: .95em; white-space: pre-wrap; word-break: break-word; }
.tl-code .k { color: var(--pst-color-text-base); font-weight: 650; }
.tl-code .eq { color: var(--pst-color-text-muted); }
.tl-code .v { color: var(--hmp-add); }
.tl-code .ph { color: var(--pst-color-text-muted); font-style: italic; }
.tl-cmt .tl-code, .tl-cmt .tl-code .k, .tl-cmt .tl-code .v { color: var(--pst-color-text-muted); font-weight: 400; }
.tl-code .cm { color: var(--pst-color-text-muted); }
.tl-req > summary::before, .tl-req-ex > summary::before, .tl-chosen > summary::before { content: "\25CF"; position: absolute; left: 1.15rem; top: .32rem; font-size: .7em; color: var(--hmp-req); }
.tl-chosen > summary::before { color: var(--pst-color-primary); }
.tl-note { font-size: .95em; line-height: 1.45; color: var(--pst-color-text-base); }
.tl-adv { display: none; }
html.hmp-adv .tl-adv { display: block; }
.tc { display: inline-block; font-size: .7em; line-height: 1.45; padding: 0 .38rem; margin: 0 .1rem; border-radius: .6rem; border: 1px solid currentColor; white-space: nowrap; vertical-align: 1px; }
.tc-req { color: var(--hmp-req); }
.tc-unit, .tc-range { color: var(--hmp-unit); }
.tc-when { color: var(--hmp-when); }
.tc-cal { color: var(--hmp-cal); }
.tc-prof { color: var(--pst-color-text-muted); }
.tc-exp { color: var(--hmp-req); }
.tc-ex { color: var(--pst-color-text-muted); border-style: dotted; }
.tl .hmp-card { margin: 0 .6rem .5rem 2rem; }
.tl-legend-wrap { display: grid; grid-template-columns: 1fr; gap: .2rem; margin: .5rem 0 1.5rem 0; }
.tl-legend { font-size: .86em; margin: 0; padding-left: 1.1rem; }
.tl-key-req { font-family: var(--pst-font-family-monospace); font-weight: 650; }
.tl-key-req::before { content: "\25CF  "; color: var(--hmp-req); font-size: .75em; }
.tl-key-cmt, .tl-key-ph { font-family: var(--pst-font-family-monospace); color: var(--pst-color-text-muted); }
.tl-key-ph { font-style: italic; }
.hmp-embedded .tb { margin: .5rem 0; }

/* Section cards */
.sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .7rem; margin: .6rem 0 1.5rem 0; }
/* The title link covers the card; links in the summary sit above it. */
.sec-card { position: relative; display: flex; flex-direction: column; gap: .3rem; padding: .7rem .8rem; border: 1px solid var(--pst-color-border); border-radius: .45rem; color: var(--pst-color-text-base); background: var(--pst-color-background); }
.sec-card:hover { border-color: var(--pst-color-primary); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.sec-card a.sec-title { text-decoration: none; }
.sec-card a.sec-title::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.sec-card a.sec-title code { font-weight: 700; color: var(--pst-color-primary); background: none; border: none; padding: 0; }
.sec-sum a { position: relative; z-index: 1; }
.sec-sum { font-size: .85em; color: var(--pst-color-text-muted); }
.sec-meta { font-size: .78em; color: var(--pst-color-text-muted); margin-top: auto; }

/* Explorer: the space below the bar is kept, so loading the tree moves nothing */
.hmp-explorer { min-height: 60vh; }
.hmp-explorer .ex-bar { position: sticky; top: calc(var(--pst-header-height, 4rem) + .2rem); z-index: 2; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; min-height: 2.6rem; padding: .4rem 0; background: var(--pst-color-background); }
.hmp-explorer .ex-label { font-weight: 600; font-size: .9em; }
.hmp-explorer .ex-bar input[type=search] { flex: 1 1 16rem; height: 2.2rem; padding: .35rem .6rem; border: 1px solid var(--pst-color-border); border-radius: .3rem; background: var(--pst-color-background); color: var(--pst-color-text-base); }
.hmp-explorer .ex-bar .hmp-adv-switch { margin-top: 0; }
.hmp-explorer .ex-tree-btns button { font-size: .8em; min-height: 1.8rem; padding: .15rem .5rem; border-radius: .3rem; border: 1px solid var(--pst-color-border); background: var(--pst-color-background); color: var(--pst-color-text-muted); cursor: pointer; }
.hmp-explorer #ex-count { flex-basis: 100%; font-size: .85em; min-height: 1.2em; }
.hmp-explorer ul { list-style: none; margin: 0; padding-left: 1.1rem; }
.hmp-explorer ul.ex-root { padding-left: 0; }
.hmp-explorer li { font-size: 1rem; margin: .18rem 0; }
.hmp-explorer li.ex-leaf, .hmp-explorer li.ex-table { content-visibility: auto; contain-intrinsic-size: auto 1.6rem; }
.hmp-explorer summary { cursor: pointer; }
.hmp-explorer code { background: none; border: none; padding: 0; font-size: .95em; }
.ex-table > details > summary code { font-weight: 700; color: var(--pst-color-primary); }
.ex-leaf code { font-weight: 600; color: var(--pst-color-text-base); }
.ex-val { font-family: var(--pst-font-family-monospace); font-size: .88em; color: var(--pst-color-text-muted); }
.ex-sum { color: var(--pst-color-text-muted); font-size: .9em; margin-left: .5rem; }
.ex-count { font-size: .75em; color: var(--pst-color-text-muted); border: 1px solid var(--pst-color-border); border-radius: .6rem; padding: 0 .35rem; }
.hmp-explorer ol.ex-results { padding-left: 1.6rem; margin: .4rem 0 1rem 0; }
.ex-hit { padding: .25rem 0; border-bottom: 1px dashed color-mix(in srgb, var(--pst-color-border) 70%, transparent); }
.ex-hit .ex-sum { display: block; margin-left: 0; }
.ex-hit code { font-weight: 600; overflow-wrap: anywhere; }
.ex-label { margin-left: .5rem; font-size: .88em; font-weight: 600; }
.ex-why { display: block; margin: .1rem 0 .2rem 0; font-size: .82em; color: var(--pst-color-text-muted); font-style: italic; }
.hmp-explorer mark { background: color-mix(in srgb, var(--hmp-when) 30%, transparent); color: inherit; }
.hmp-search-text { display: none; }

/* Filters of the generated tables */
.hmp-filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .3rem 0 .8rem; }
.hmp-filter-bar label { font-weight: 600; font-size: .9em; }
.hmp-filter { flex: 1 1 16rem; height: 2.2rem; padding: .35rem .6rem; border: 1px solid var(--pst-color-border); border-radius: .3rem; background: var(--pst-color-background); color: var(--pst-color-text-base); }
.hmp-filter-count { font-size: .85em; }

/* Quantities and calibrable parameters */
.hmp-qnav { font-size: .88em; line-height: 1.9; }
.hmp-qnav a { white-space: nowrap; }
table.hmp-qt { display: table; table-layout: fixed; width: 100%; border-collapse: collapse; font-size: .86em; }
table.hmp-qt th, table.hmp-qt td { border-bottom: 1px solid var(--pst-color-border); padding: .3rem .45rem; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
table.hmp-qt thead th { position: sticky; top: var(--pst-header-height, 4rem); background: var(--pst-color-background); }
table.hmp-qt td:first-child code { background: none; border: none; padding: 0; font-size: .92em; }
.hmp-quant table.hmp-qt th:nth-child(1) { width: 38%; }
.hmp-quant table.hmp-qt th:nth-child(2) { width: 7%; }
.hmp-quant table.hmp-qt th:nth-child(3) { width: 12%; }
.hmp-quant table.hmp-qt th:nth-child(4) { width: 43%; }
table.hmp-cal th:nth-child(1) { width: 40%; }

/* Connections found in the code */
.hmp-links { border: 1px solid var(--pst-color-border); border-left: 4px solid var(--hmp-cal); border-radius: .35rem; padding: .45rem .8rem; margin: .3rem 0 1rem 0; font-size: .86em; background: var(--pst-color-background); }
.hmp-links-h { font-weight: 700; color: var(--hmp-cal); cursor: pointer; font-size: .92em; }
.hmp-links ul { margin: .2rem 0 0 0; padding-left: 1rem; }
.hmp-links li { margin: .15rem 0; }
.hmp-links code { font-size: .92em; }
.hmp-said { font-style: italic; }
a.hmp-auto { text-decoration: underline dotted; }

/* Changes between two versions */
.hmp-ch-form { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin: .3rem 0 .6rem; }
.hmp-ch-form select { margin-left: .3rem; padding: .25rem .4rem; border: 1px solid var(--pst-color-border); border-radius: .3rem; background: var(--pst-color-background); color: var(--pst-color-text-base); }
h2.hmp-ch-h { font-size: 1.15em; margin-top: 1.4rem; }
ul.hmp-changes > li.hmp-ch-sec { list-style: none; margin-left: -1rem; margin-top: .3rem; }

/* Coverage page */
details.hmp-cov { margin: .3rem 0; }
details.hmp-cov > summary { cursor: pointer; }

/* Hover card of {toml} links */
.hmp-hover {
  position: absolute; z-index: 1050; max-width: 26rem; padding: .5rem .7rem; font-size: .82rem; line-height: 1.45;
  background: var(--pst-color-surface); color: var(--pst-color-text-base);
  border: 1px solid var(--pst-color-border); border-radius: .4rem; box-shadow: 0 6px 18px rgba(0, 0, 0, .14);
}
.hmp-hover-path { display: block; font-weight: 700; background: none; border: none; padding: 0; overflow-wrap: anywhere; }
.hmp-hover-meta { display: flex; flex-wrap: wrap; gap: .1rem .5rem; color: var(--pst-color-text-muted); font-family: var(--pst-font-family-monospace); font-size: .92em; margin: .15rem 0; }
.hmp-hover-sum { margin-top: .2rem; }

/* Python API and command line */
table.api-t { width: 100%; border-collapse: collapse; font-size: .88em; margin: .3rem 0 1.2rem 0; }
table.api-t th, table.api-t td { border-bottom: 1px solid var(--pst-color-border); padding: .35rem .5rem; text-align: left; vertical-align: top; }
table.api-t thead th { color: var(--pst-color-text-muted); font-weight: 600; }
table.api-t td:first-child { white-space: nowrap; }
table.api-args td:first-child { white-space: normal; min-width: 12rem; }
.api-calls ul { list-style: none; padding-left: 0; }
.api-calls li { margin: .3rem 0; }
pre.api-call { margin: .15rem 0 0 0; padding: .35rem .6rem; border: 1px solid var(--pst-color-border); border-radius: .3rem; }
pre.cli-usage { white-space: pre-wrap; word-break: break-word; }
pre.cli-epilog { font-size: .8em; padding: .6rem .8rem; border: 1px dashed var(--pst-color-border); border-radius: .35rem; white-space: pre-wrap; }
.bd-sidebar-primary .caption-text { font-size: .78em; text-transform: uppercase; letter-spacing: .04em; color: var(--pst-color-text-muted); }

/* A key followed through the base_config chain of an example file */
.hmp-resolved { margin: .6rem 0 1rem; }
.hmp-resolved-h { font-size: .85em; color: var(--pst-color-text-muted); margin-bottom: .2rem; }

/* Catalogs of the reference: solvers, figures, data sources */
table.hmp-cat { width: 100%; border-collapse: collapse; font-size: .92em; margin: .3rem 0 1rem 0; }
.hmp-cat th, .hmp-cat td { border-bottom: 1px solid var(--pst-color-border); padding: .3rem .5rem; text-align: left; vertical-align: top; }
.hmp-cat thead th { color: var(--pst-color-text-muted); font-weight: 600; }
table.hmp-cat ul { margin: 0; padding-left: 1.1rem; }
.hmp-cat-sum { font-size: .88em; margin-top: .15rem; }
.hmp-cat-title { font-weight: 600; margin-right: .4rem; }
.hmp-cat-count { font-size: 1.02em; }
table.hmp-cat td:first-child { white-space: nowrap; }

/* Home page badges, on one line that wraps */
.hmp-badges p { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0 1rem; }
.hmp-badges img { height: 20px; }

@media (max-width: 760px) {
  .tl > summary { grid-template-columns: 1fr; }
  .hmp-card dl { grid-template-columns: 1fr; }
  .hmp-explorer summary, .hmp-explorer li.ex-leaf, .ex-hit { padding-block: .35rem; }
  .hmp-explorer .ex-bar { position: static; }
  .tb-adv { min-height: 2.4rem; }
  .hmp-copy { width: 2.4rem; height: 2.4rem; }
}
