/* Modern mandoc stylesheet — compatible with mandoc -T html output.
   No JavaScript, external fonts or dependencies required. */
:root {
  color-scheme: light dark;
  --background: #ffffff;
  --foreground: #202936;
  --muted: #637083;
  --accent: #185abc;
  --rule: #e2e8f0;
  --surface: #f5f7fb;
  --code: #f1f5fa;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #111820;
    --foreground: #e3eaf2;
    --muted: #a4afc0;
    --accent: #80b5ff;
    --rule: #344151;
    --surface: #192430;
    --code: #253344;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  max-width: 940px;
  margin: 0 auto;
  padding: 2.25rem clamp(1.15rem, 5vw, 3rem) 5rem;
  background: var(--background);
  color: var(--foreground);
  font: 16px/1.7 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
/* Document masthead: keep the traditional manpage metadata. */
table.head { display: table; width: 100%; margin: 0 0 2.6rem; border-collapse: collapse; border-bottom: 1px solid var(--rule); }
table.head td { padding: 0 0 1rem; vertical-align: middle; }
td.head-ltitle { font-size: 1.22rem; font-weight: 750; letter-spacing: -.025em; white-space: nowrap; }
td.head-vol { text-align: center; color: var(--muted); font-size: .82rem; }
td.head-rtitle { text-align: right; color: var(--muted); font-size: .84rem; white-space: nowrap; }
.manual-text { min-width: 0; }
section.Sh { margin: 0 0 2.2rem; }
h1.Sh {
  margin: 2.7rem 0 1rem;
  padding: 0 0 .55rem;
  border-bottom: 1px solid var(--rule);
  font-size: 1.23rem;
  line-height: 1.4;
  letter-spacing: -.012em;
  font-weight: 750;
}
h2.Ss { margin: 1.8rem 0 .7rem; font-size: 1.02rem; line-height: 1.45; font-weight: 700; }
h1.Sh a.permalink, h2.Ss a.permalink { color: inherit; }
h1.Sh a.permalink:hover, h2.Ss a.permalink:hover { color: var(--accent); text-decoration: none; }
h1.Sh, h2.Ss, dt[id] { scroll-margin-top: 1.3rem; }
p.Pp { margin: .8rem 0; }
/* Syntax: preserve source whitespace without losing mobile usability. */
code, pre, kbd, samp, var.Ar {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .91em;
}
code.Nm { font-weight: 750; }
code.Cm { font-weight: 650; }
code.Fl { color: var(--accent); font-weight: 600; }
var.Ar { font-style: italic; color: var(--muted); }
span.Pa { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
/* SYNOPSIS: mandoc renders one two-column table per command line. */
#SYNOPSIS ~ table.Nm {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  background: var(--surface);
  font-size: .92rem;
  line-height: 1.65;
}
#SYNOPSIS ~ table.Nm:first-of-type { border-radius: 10px 10px 0 0; }
#SYNOPSIS ~ table.Nm td { padding: .35rem .55rem; vertical-align: top; }
#SYNOPSIS ~ table.Nm td:first-child { padding-left: 1rem; white-space: nowrap; width: 1%; }
#SYNOPSIS ~ table.Nm td:last-child { padding-right: 1rem; overflow-wrap: anywhere; }
/* Strip the spacer nodes mandoc inserts between synopsis lines. */
#SYNOPSIS ~ br, #SYNOPSIS ~ p.Pp:empty { display: none; }
#SYNOPSIS ~ table.Nm + table.Nm { border-top: 1px solid var(--rule); }
/* Display blocks / command examples. */
div.Bd { margin: .75rem 0 1.15rem; }
div.Bd-indent, div.Bd-unfilled, div.Bd-filled, pre {
  padding: .9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 9px;
  overflow-x: auto;
  font-size: .93rem;
}
div.Bd code { background: none; }
/* Tagged and hanging definition lists generated by mdoc. */
dl.Bl-tag, dl.Bl-hang, dl.Bl-ohang, dl.Bl-inset { margin: .6rem 0 1.5rem; }
dl.Bl-tag > dt, dl.Bl-hang > dt, dl.Bl-ohang > dt, dl.Bl-inset > dt {
  margin: 1.1rem 0 .2rem;
  font-weight: 650;
}
dl.Bl-tag > dd, dl.Bl-hang > dd, dl.Bl-ohang > dd, dl.Bl-inset > dd { margin: 0 0 .95rem 1.2rem; }
dd > dl { margin-top: .65rem; }
dd p.Pp { margin: .55rem 0; }
ul.Bl-bullet, ol.Bl-enum { padding-left: 1.5rem; margin: .75rem 0 1.1rem; }
ul.Bl-bullet li, ol.Bl-enum li { padding-left: .2rem; margin: .4rem 0; }
blockquote { margin: 1rem 0 1rem 1.5rem; }
table:not(.head):not(.foot):not(.Nm) { max-width: 100%; border-collapse: collapse; }
/* Hide mandoc's generated date / OS footer. */
table.foot { display: none !important; }
@media (max-width: 620px) {
  body { font-size: 15px; padding-top: 1.25rem; }
  table.head { margin-bottom: 2rem; }
  td.head-vol { display: none; }
  h1.Sh { margin-top: 2.2rem; }
  #SYNOPSIS ~ table.Nm td:first-child { padding-left: .7rem; }
  #SYNOPSIS ~ table.Nm td:last-child { padding-right: .7rem; }
  dl.Bl-tag > dd, dl.Bl-hang > dd, dl.Bl-ohang > dd, dl.Bl-inset > dd { margin-left: .65rem; }
}
@media print {
  :root { color-scheme: light; --background: #fff; --foreground: #111; --muted: #555; --accent: #111; --rule: #ccc; --surface: #f5f5f5; }
  body { max-width: none; padding: 0; font-size: 11pt; }
  h1.Sh, h2.Ss, dt { break-after: avoid; }
  div.Bd, table.Nm { break-inside: avoid; }
}
