h2 {
    margin-top: 1.2em;
}

h2 + h3 {
    margin-top: 1.2em;
}

.processing {
    border: 1px solid var(--fg);
    border-radius: 3px;
    padding: 1ex 0.5em;
    background-color: var(--table-header-bg);
    vertical-align: baseline;
    height: 1.55em;
    font-size: 1em;
    margin-top: 2em;
    font-weight: bold;
}

:is(.grammar, .attributes, .rejection) {
    font-size: 0.83em;
    font-weight: bold;
    margin-top: 2em;
    margin-bottom: 0;
}

:is(.grammar, .attributes, .rejection) + :is(p, pre) {
    margin-top: 0;
}

ul ul {
    padding-left: 1.5em;
}

table {
    margin-left: 0;
}

th:empty {
    display: none;
}

/* we abuse <var> for token attributes */
var {
    color: var(--links);
}

/* we abuse <b> for literal characters and character sequences */
b {
    font-family: var(--mono-font);
    font-weight: normal;
    font-style: normal;
    background-color: var(--searchresults-li-bg);
}

/* we abuse <u> to mean "characters captured from this nonterminal" */
u {
    font-family: var(--mono-font);
    font-weight: normal;
    text-decoration: none;
    background-color: var(--quote-bg);
}

/* we abuse <kbd> for named control characters */
kbd {
}

/* Summary table of quoted literal forms */

.escapes-table th {
    background-color: var(--quote-bg);
    font-size: 15px;
    text-align: left;
    vertical-align: bottom;
}

.escapes-table td {
    white-space: nowrap
}


/* Different rules on the PEGs description page */

.pegs-description ul {
    margin-top: 0;
}

.pegs-description p:has( + ul ) {
    margin-bottom: 0;
}

.pegs-description var {
    color: var(--fg);
    font-weight: bolder;
}

.pegs-description h5 {
    margin-bottom: 0;
}

.pegs-description h5 + p {
    margin-top: 1em;
}

.pegs-description pre small {
    font-family: sans-serif;
}

.pegs-description code {
    white-space: preserve nowrap;
}

.pegs-description .sketch {
    padding: 10px 10px;
    background-color: var(--quote-bg);
}

.pegs-description .sketch p {
    margin-bottom: 0;
}

