body * {
    box-sizing: border-box;
}

body {
    margin: 0px;
    font-family: system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

h1, h2, h3, h4, h5, h6 {
    margin: 2px 0px;
    font-family: system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
    letter-spacing: -0.01em;
}

*+h1, *+h2, *+h3, *+h4, *+h5, *+h6 {
    margin-top: 10px;
}

p {
    margin-block-start: 5px;
    margin-block-end: 10px;
    margin-bottom: 10px;
}

table {
    width: 100%;

    border-spacing: 0px;

    color: var(--table-text);
    background-color: var(--table-bg);
}
table tr {
    font-size: var(--table-font-size);
}
table th, table td {
    padding: 8px;
    text-align: center;
}
table th[scope=row] {
    text-align: right;
}
table th[scope=row] ~ td {
    text-align: left;
}
table > thead > tr > *,
table > tbody > tr:last-of-type > * {
    border-bottom: 1px solid var(--sidebar-bg);
}

ul {
    margin-block-start: 0px;
    margin-block-end: 0px;
}

button, nav > a, a.btn {
    cursor: pointer;

    display: inline-block;
    vertical-align: bottom;
    margin: 1px 1px 2px;
    padding: 5px 13px;
    border-radius: var(--button-border-radius);

    border: none;
    background-color: var(--button-bg);
    box-shadow: rgba(0,0,0, 0.25) 2px 2px 0px;

    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    color: var(--button-text);
}
button:hover, nav > a:hover, a.btn:hover {
    background-color: var(--button-bg-hover);
}
button:active, nav > a:active, a.btn:active {
    border: none;
    padding: 5px 13px;
    box-shadow: rgba(0,0,0, 0.25) 1px 1px 0px;
}
nav a {
    margin: 2px 2px 3px;
}
nav > a:not(:last-child), nav > button:not(:last-child) {
    color: var(--secondary-button-text);
    background-color: var(--secondary-button-bg);
}
nav > a:not(:last-child):hover, nav > button:not(:last-child):hover {
    background-color: var(--secondary-button-bg-hover);
}

form {
    display: flex;
    flex-direction: column;
    justify-items: stretch;
}
form > p {
    display: flex;
    align-items: center;
}
form > p > label {
    flex: 1;

    font-weight: bold;
}
form > p > input {
    flex: 3;
}

textarea, input {
    padding: 5px;
    border: 2px solid rgba(0,0,0, 0.3);
}

ul {
    display: flex;
    padding: 0px;
    flex-direction: column;
    list-style-type: none;
}
ul > li > a {
    display: block;

    margin: 1px;
    padding: 5px 10px;
    border-radius: var(--button-border-radius);

    text-align: center;

    color: var(--button-text);
    text-decoration: none;
    background-color: var(--button-bg);
}

ul > li > a:hover {
    background-color: var(--button-bg-hover);
}

ul > li > a.selected {
    background-color: var(--secondary-highlight-colour);
    color: var(--text);
}
ul > li > a.selected:hover {
    background-color: var(--secondary-highlight-colour);
}

article {
    background-color: var(--secondary-colour);
    color: var(--text);
    padding: 15px 5px 5px;
    border-radius: 5px;
}

article > article {
    background-color: var(--main-bg);
    margin: 0 5px 8px;
    padding: 5px 5px 10px 10px ;
}

article > p {
    margin-top: 5px;
    margin-bottom: 5px;
    padding: 4px 10px;

    overflow-wrap: break-word;
}

article > p:first-of-type {
    margin-top: 0;
}

time {
    float: right;
    font-size: smaller;
    margin: 0 5px;
}

.stats-table {
    background-color: #eef2f8;
    border-radius: 8px;
    overflow: hidden;
}

.stats-table thead tr {
    background-color: #c8d8ec;
    color: #2c4a6e;
}

.stats-table tbody tr {
    background-color: #eef2f8;
    color: #2c3e50;
}

.stats-table td:first-child {
    text-align: left;
}

.chart-container {
    max-width: 340px;
    margin: 0 auto;
}

th.cell-labor, td.cell-labor { background-color: rgba(192, 50, 28, 0.07); }
th.cell-labor { color: #9a2214; }
th.cell-liberal, td.cell-liberal { background-color: rgba(74, 127, 181, 0.07); }
th.cell-liberal { color: #2d5f8a; }

