/** http://dev.w3.org/csswg/css-lists/#ua-stylesheet **/
/* Set up list items */
  li {
    display: list-item;
    /* counter-increment: list-item; (implied by display: list-item) */
  }

  /* Set up ol and ul so that they reset the list-item counter */
  ol, ul {
    counter-reset: list-item;
  }

  /* Default list style types for ordered lists */
  ol {
    list-style-type: decimal;
  }

  /* Default list style types for unordered lists up to 3 deep */
  ul { list-style-type: disc; }
  ul ul { list-style-type: square; }
  ul ul ul { list-style-type: circle; }
  /* Alternately, if Values & Units Level 3 is supported, replace
     the above three lines with: */
  ul { list-style-type: disc; }
  ul ul { list-style-type: cycle(disc, square, circle); }

  /* The type attribute on ol and ul elements */
  ul[type="disc"] { list-style-type: disc; }
  ul[type="circle"] { list-style-type: circle; }
  ul[type="square"] { list-style-type: square; }
  ol[type="1"] { list-style-type: decimal; }
  ol[type="a"] { list-style-type: lower-alpha; }
  ol[type="A"] { list-style-type: upper-alpha; }
  ol[type="i"] { list-style-type: lower-roman; }
  ol[type="I"] { list-style-type: upper-roman; }

  /* The start attribute on ol elements */
  ol[start] {
    counter-reset: list-item calc(attr(start integer, 1) - 1);
  }

  /* The value attribute on li elements */
  li[value] {
    counter-set: list-item attr(value integer, 1);
    counter-increment: none; /* Turn off default increase */
  }

  /* Handling reversed lists */
  ol[reversed] {
    counter-reset: list-item calc(attr(start integer, **magic**) + 1);
    /* Where **magic** is the number of child <li> elements. */
  }
  ol[reversed] > li {
    counter-increment: list-item -1;
  }

  /* Box Model Rules */
  ol, ul {
    display: block;
    margin: 1em 0;
    marker-side: list-container;
  }

  ol:dir(ltr), ul:dir(ltr) {
    padding-left: 40px;
  }
  ol:dir(rtl), ul:dir(rtl) {
    padding-right: 40px;
  }

  ol ol, ol ul, ul ul, ul ol {
    margin-top: 0;
    margin-bottom: 0;
  }

  li {
    text-align: match-parent;
  }

  li::marker {
    display: inline;
    text-align: end;
    unicode-bidi: isolate;
    /* 'position' computes to "static" or "marker" depending on list-style-position */
  }
