body {
  margin: 2%;
  max-width: 60em;
  font-family: sans-serif;
}

div.Abstract h1 { 
  font-style: italic;
  font-size: inherit;
  font-weight: normal;
}

div.conventions h1 {
  font-size: inherit;
  font-weight: normal;
}

div.page {
  clear: both;
  page-break-before: always;
  page-break-after: always;
}

div.chapter {
  page-break-before: always;
  page-break-after: always;
}

div.chapter h1 {
  border-top: solid thin black;
  border-bottom: solid thin black; 
  padding-top: 1em;
  padding-bottom: 1em;
  margin-top: 3em;
  margin-bottom: 2em; 
}

div.references dt {
  font-weight: bold;
  margin-top: 1em;
}

pre.xml {
  padding: 0.5em;
  border: solid black 1px;
}

dl.terminology dt {
  font-weight: bold;
}

dt { margin-left: 1em; }

p.figure {
  text-align: center;
}D

p.figure object { width: 100% }

div.editorial {
  color: rgb(0,100,0);
  background-color: rgb(230,230,255);
  padding: 0.5em;
}

.rule { font-family: sans-serif; }

p.pattern {
  padding-left: 5em;
  font-family: sans-serif;
}

p.pattern em { font-weight: bold }

table.samples {
  border-collapse: collapse;
  width: 100%;
}

table.samples th {
  padding: 0.5em;
  border: solid black 1px;
}

table.samples td {
  padding: 0.5em;
  border: solid black 1px;
}

table.samples td pre {
  background-color: inherit;
}

.missing:after {
  color: red;
  font-weight: bold;
  content: " (missing)";
  display: inline;
}

.incomplete:after {
  color: red;
  font-weight: bold;
  content: " (incomplete)";
  display: inline;
}

div.tof a {
   counter-increment: figure-num;
   padding-left: 0em;
}

div.tof a:before {font-style: italic; padding-right: 0.5em; content: counter(figure-num) " "}

p.figure:before {content: "Figure " counter(figure-num) " - "}
p.figure { counter-increment: figure-num; page-break-after: avoid;}

div.figure { page-break-inside: avoid; text-align: center; }

div.toc a.h1 {
   counter-increment: chapter-num;
   counter-reset: subsection-num;
   padding-left: 0em;
}
div.toc a.h2 {
   counter-increment: subsection-num;
   counter-reset: subsubsection-num;
   padding-left: 1em;
}
div.toc a.h3 {
   counter-increment: subsubsection-num;
   counter-reset: subsubsubsection-num;
   padding-left: 2em;
}
div.toc a.h4 {
   counter-increment: subsubsubsection-num;
   padding-left: 6em;
}
div.toc a.h1:before {
   padding-right: 0.5em; content: counter(chapter-num) " ";
}
div.toc a.h2:before {
   padding-right: 0.5em; content: counter(chapter-num) "." counter(subsection-num) " ";
}
div.toc a.h3:before {
   padding-right: 0.5em; 
   content: counter(chapter-num) "." counter(subsection-num) "." counter(subsubsection-num) " "
}
div.toc a.h4:before {
   padding-right: 0.5em; 
   content: counter(chapter-num) "." counter(subsection-num) "." counter(subsubsection-num) "." counter(subsubsubsection-num) " "
}

div.chapter.first { counter-reset: chapter-num, figure-num; }
div.chapter h1 { counter-increment: chapter-num; counter-reset: subsection-num }
div.chapter h2 { counter-increment: subsection-num; counter-reset: subsubsection-num }
div.chapter h3 { counter-increment: subsubsection-num; counter-reset: subsubsubsection-num }
div.chapter h4 { counter-increment: subsubsubsection-num; counter-reset: subsubsubsubsection-num }
div.chapter h5 { counter-increment: subsubsubsubsection-num }
div.chapter h1:before {content: counter(chapter-num) " "}
div.chapter h2:before {content: counter(chapter-num) "." counter(subsection-num) " "}
div.chapter h3:before {
   content: counter(chapter-num) "." counter(subsection-num) "." counter(subsubsection-num) " "
}
div.chapter h4:before {
   content: counter(chapter-num) "." counter(subsection-num) "."
    counter(subsubsection-num) "." counter(subsubsubsection-num) " " 
}

div.chapter h5:before {
   content: counter(chapter-num) "." counter(subsection-num) "."
     counter(subsubsection-num) "." counter(subsubsubsection-num)"."
     counter(subsubsubsubsection-num) " " 
}

div.references h1 { counter-increment: chapter-num; counter-reset: subsection-num }
div.references h1:before { content: counter(chapter-num) " " }

body { counter-reset: figure-num; }
span.figure:before { counter-increment: figure-num; }

span.figure:before {
   content: "Figure " counter(figure-num) ": "
}

ul { margin-left: 2em; }

p.example { padding-left: 0.5em; }

.example { font-family: monospace }

div.references p {
 counter-increment: ref-num;
 text-indent: -2em;
 margin-left: 2em;
 text-align: left;
 }

div.references p:before { font-weight: bold; content: "[" counter(ref-num) "]  " }

@media print {
  body { font-family: DejaVu Sans, Arial, sans-serif }
  .rule { font-family: DejaVu Sans, sans-serif; }

  a.tt { text-decoration: none; color: black }
  a.tt:visited { text-decoration: none; color: black }
  .fn {
      display: prince-footnote;
      counter-increment: footnote
  }
  table { font-size: 60% }
  pre { font-size: 70%; }
  table pre {  margin-left: 0 }
  p.pattern {
    padding-left: 5em;
    font-family: DejaVu Sans, sans-serif;
  }
}

@media screen {
/* see http://trentrichardson.com/examples/csstooltips/ */

  a.tt:visited { color: rgb(40,40,255); text-decoration: none }
  a.tt { color: rgb(40,40,255); text-decoration: none }
  a.tt span.fn {display: none}
  a.tt:hover { z-index: 10; position: relative; background:""; }
  a.tt:hover span.fn {
   display: block;
   position: absolute;
   top:1.5em; right:0;
   width: 15em;
   color: black;
   background-color: rgb(240,240,200);
   border: solid black 1px;
   padding: 0.3em;
   text-align: left;
  }

  div.page {
     padding-top: 3em;
  }
  div.chapter {
     padding-top: 3em;
  }
  div.chapter h1 {
     border-top: solid thin gray;
     border-bottom: solid thin gray; 
  }
  div.toc a:hover {
     text-decoration: underline; color: blue;
  }
  div.toc a:active {
     text-decoration: underline; color: red;
  }
  div.toc a:visited {
     color: #666;
  }
  p.copyright {
     position: relative;
     border-top: solid thin gray;
     margin-top: 3em;
     padding-top: 0.5em;
  }
  table pre { font-size: 60%; margin-left: 0 }
}

