.left() {
    text-align: left;
}
.right() {
    text-align: right;
}
.bold() {
    font-weight: bold;
}
.tableborder() {
    border: 1px solid black;
    border-collapse: collapse;
}
.collapse-left() {
    .left;
    .tableborder;
}

.collapse-right() {
    .right;
    .tableborder;
}
.collapse-center() {
    text-align: center;
    .tableborder;
}
.caption() {
    font-size: 125%;
    line-height: 130%;
    .bold;
    .left;
}

.tabletop() {
    font-family: monospace;
    margin-top: 5px;
    font-size: 11px;
    line-height: 130%;
}

.@{classMonospace} {
    font-family: monospace;
}

.@{classActive} {
    .bold;
    color: @colorActive;
}
.@{classMatch} {
    .bold;
    color: @colorMatch;
}
.@{classEmpty} {
    .bold;
    color: @colorEmpty;
}
.@{classNomatch} {
    .bold;
    color: @colorNomatch;
}
.@{classLookAhead} {
    .bold;
    color: @colorLookAhead;
}
.@{classLookBehind} {
    .bold;
    color: @colorLookBehind;
}
.@{classRemainder} {
    .bold;
    color: @colorRemainder;
}
.@{classCtrlChar} {
    font-weight: bolder;
    font-style: italic;
    font-size: 0.6em;
}
.@{classLineEnd} {
    .bold;
    color: @colorLineEnd;
}
.@{classError} {
    .bold;
    color: @colorError;
}
.@{classPhrase} {
    color: @colorPhrase;
    background-color: @colorPhraseBackground;
}
.@{classEmptyPhrase} {
    color: @colorEmpty;
}
table.@{classState} {
    .tabletop;
    .collapse-left;
    th,
    td {
        .collapse-left;
    }
    th:nth-last-child(2),
    td:nth-last-child(2) {
        .right;
    }
    caption {
        .caption;
    }
}

table.@{classStats} {
    .tabletop;
    .collapse-right;
    th,
    td {
        .collapse-right;
    }
    caption {
        .caption;
    }
}

table.@{classTrace} {
    .tabletop;
    .collapse-right;
    caption {
        .caption;
    }
    th,
    td {
        .collapse-right;
    }
    th:last-child,
    th:nth-last-child(2),
    td:last-child,
    td:nth-last-child(2) {
        .left;
    }
}
table.@{classGrammar} {
    .tabletop;
    .collapse-right;
    caption {
        .caption;
    }
    th,
    td {
        .collapse-right;
    }
    th:last-child,
    td:last-child {
        .left;
    }
}
table.@{classRules} {
    .tabletop;
    .collapse-right;
    caption {
        .caption;
    }
    th,
    td {
        .collapse-right;
    }
    a {
        color: @colorRuleLink !important;
    }
    a:hover {
        color: @colorRuleLinkHover !important;
    }
}
table.@{classAttributes} {
    .tabletop;
    .collapse-center;
    caption {
        .caption;
    }
    th,
    td {
        .collapse-center;
    }
    th:nth-child(1),
    th:nth-child(2),
    th:nth-child(3) {
        .right;
    }
    td:nth-child(1),
    td:nth-child(2),
    td:nth-child(3) {
        .right;
    }
    a {
        color: @colorRuleLink !important;
    }
    a:hover {
        color: @colorRuleLinkHover !important;
    }
}
