:root
{
  --text-color: #1a1a1a;
  --heading-color: #0d2d45;
  --link-color: #0b5f8d;
  --link-hover: #083f5f;
  --muted-link: #6f7fcc;
  --table-border: #c9d3de;
  --code-bg: #f6f8fa;
}

html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

body
{
  margin-top: 5mm;
  margin-right: 4mm;
  margin-bottom: 6mm;
  margin-left: 3mm;
  color: var(--text-color);
  font-family: Arial, Helvetica, Geneva, sans-serif;
  font-size: 10pt;
  line-height: 1.45;
}

p, li, table, td, th
{
  font-family: Arial, Helvetica, Geneva, sans-serif;
  font-size: 10pt;
}

h1, h2, h3
{
  margin: 0.45em 0 0.35em;
  color: var(--heading-color);
  font-family: Arial, Helvetica, Geneva, sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: 28px; }
h2 { font-size: 18pt; }
h3 { font-size: 14pt; }

h4.section {
  /* On screen, <h4> was inheriting the ~10pt body size from UA; set explicit “slightly larger”
     (about +8%: ~10.8pt from a 10pt body) plus a touch more line-height. */
  font-size: 1.08em;
  line-height: 1.45;
  margin: 0.6em 0 0.35em;
  color: var(--heading-color);
  font-weight: 700;
}

table { border-collapse: collapse; }

th, td { vertical-align: top; }
th { font-weight: 700; }

div.indent { margin-left: 40px; }

/*
 * Visible borders only when the author asked for a border.
 * Note: [border] alone matches border="0" too — that must stay borderless
 * (layout tables like home.html use border="0" explicitly).
 */
table[border]:not([border="0"]):not([border=""]) th,
table[border]:not([border="0"]):not([border=""]) td {
  border: 1px solid var(--table-border);
  padding: 0.3em 0.45em;
}

pre,
code,
kbd,
samp {
  font-family: "Courier New", Courier, monospace;
  font-size: 10pt;
}

pre {
  padding: 0.5em 0.65em;
  overflow-x: auto;
  background: var(--code-bg);
  border: 1px solid #e5ebf0;
}

sup {
  font-family: Arial, Helvetica, Geneva, sans-serif;
  font-size: 10px;
}

a {
  color: var(--link-color);
}

a:hover {
  color: var(--link-hover);
}

a.bar,
a.bar:link,
a.bar:visited {
  color: #ffffff;
  text-decoration: none;
}

a.bar:hover {
  color: #ffffff;
  text-decoration: underline;
}

.indextop {
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: x-large;
  font-weight: 700;
}

.indexsub {
  color: var(--muted-link);
  font-family: Arial, Helvetica, sans-serif;
  font-size: xx-small;
}

.jump,
.jump:link {
  color: var(--muted-link);
  font-family: Arial, Helvetica, sans-serif;
  font-size: smaller;
  font-style: normal;
  text-decoration: none;
}

.jump:hover {
  color: #0000ff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: smaller;
  font-style: normal;
  text-decoration: underline;
}

/* Drop-cap / “uncial” first letter (requires stylesheet to load) */
p.monogram::first-letter {
  font-size: 150%;
  font-weight: bold;
}

/* ----- Print: readable tables, examples, and minimal chrome ----- */
@media print {
  @page {
    margin: 12mm 14mm;
  }

  html {
    -webkit-print-color-adjust: economy;
    print-color-adjust: economy;
  }

  body {
    margin: 0;
    padding: 0;
    color: #000;
    background: #fff !important;
    font-size: 10pt;
    line-height: 1.35;
  }

  h1,
  h2,
  h3,
  h4 {
    color: #000;
    page-break-after: avoid;
    break-after: avoid;
  }

  h4 {
    font-size: 12pt;
    margin: 0.6em 0 0.35em;
  }

  /* Slightly above 12pt so print matches the on-screen “small bump” intent. */
  h4.section {
    font-size: 12.4pt;
    line-height: 1.4;
  }

  p,
  li {
    orphans: 2;
    widows: 2;
  }

  hr {
    border: none;
    border-top: 1px solid #999;
    margin: 0.75em 0;
  }

  a {
    color: #000;
    text-decoration: underline;
    text-underline-offset: 1px;
  }

  a[href^="http"]::after,
  a[href^="//"]::after {
    content: " (" attr(href) ")";
    font-size: 85%;
    font-weight: normal;
    word-break: break-all;
  }

  /* Tables: legacy pages often omit border="" or use cellspacing only */
  table {
    border-collapse: collapse;
    max-width: 100%;
    break-inside: auto;
    page-break-inside: auto;
  }

  table[cellspacing] {
    border-spacing: 0;
  }

  /* Same idea as screen: skip tables explicitly marked borderless */
  table:not([border="0"]):not([border=""]) th,
  table:not([border="0"]):not([border=""]) td {
    border: 1px solid #666;
    padding: 0.25em 0.4em;
    vertical-align: top;
  }

  table:not([border="0"]):not([border=""]) th {
    font-weight: 700;
    background: #f0f0f0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  table:not([border="0"]):not([border=""]) tbody tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  table:not([border="0"]):not([border=""]) thead {
    display: table-header-group;
  }

  /* Examples / code */
  pre {
    background: #fff !important;
    border: 1px solid #666;
    padding: 0.4em 0.55em;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: visible;
    break-inside: avoid;
    page-break-inside: avoid;
    font-size: 9pt;
    -webkit-print-color-adjust: economy;
    print-color-adjust: economy;
  }

  code,
  kbd,
  samp {
    font-size: 9pt;
    word-break: break-word;
  }

  sup {
    font-size: 8pt;
  }
}
