label.checkbox {
    --height: 17px;
    --spacing: 2px;
    display: inline-block;
}

label.checkbox > input[type=checkbox]{
    height: 0;
    width: 0;
    visibility: hidden;
    display:none
}

label.checkbox > span {
    cursor: pointer;
    text-indent: -9999px;
    width: calc(2 * var(--height));
    height: var(--height);
    background: grey;
    display: block;
    border-radius: 0;
    position: relative;
}

label.checkbox > span::after {
    content: '';
    position: absolute;
    top: var(--spacing);
    left: var(--spacing);
    width: calc(var(--height) - 2*var(--spacing));
    height: calc(var(--height) - 2*var(--spacing));
    background: #fff;
    border-radius: 0;
    transition: 0.3s;
}

:is(label.checkbox > input:checked) + span {
    background: var(--action);
}

:is(label.checkbox > input:checked) + span::after {
    left: calc(100% - var(--spacing));
    transform: translateX(-100%);
}

label.checkbox:active > span::after {
    width: calc(1.2*var(--height));
}

.button, button, .dangerous-button {
    background: var(--button);
    color: var(--light);

    font-family: var(--title-font);
    font-size: 1em;
    padding: 6px;
    border: 1px var(--action) solid;
    cursor: pointer;
}

.dangerous-button {
    background: var(--bad);
    border: 1px var(--bad) solid;
}

.button:hover:not([disabled]), button:hover:not([disabled]), .dangerous-button:hover:not([disabled]) {
    border-color: var(--good);
    background: var(--button-hover);
    transition: background 0.1s;
}

.button:active, button:active, .dangerous-button:active {
    background: var(--good);
    color: var(--dark);
}

.button:disabled, button:disabled, .dangerous-button:disabled {
    background: var(--light2);
    color: var(--dark);
    cursor: not-allowed;
    border: 1px solid var(--light1)
}

div.tooltip {
    position: absolute;
    text-align: center;
    transition-property: opacity;
    transition-duration: 0.5s;
    background: var(--button-hover);
    border-color: var(--good);
    pointer-events: none;
    opacity: 0;
    visibility: none;
    color: var(--light);
    font-family: var(--title-font);
    font-size: 0.8em;
    padding: 3px;
    border: 1px solid var(--action);
    white-space: nowrap;
    z-index: 1;
    white-space: normal;
    max-width: 400px;
    word-wrap: break-word;
    width: max-content; 
}

.icon-button {
    background: var(--button);
    padding: 0.05rem;
    padding-top: 0;
    width: 22px;
    height: 24px;
    font-family: initial;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    margin-left: 3px;
    cursor: pointer;
}

select[size] {
    appearance:none;
    width: 100%;
    min-width: 15ch;
    max-width: 30ch;
    border: 1px solid var(--dark);
    border-radius: 0.25em;
    padding: 0.25em 0.5em;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1.1;
    background-color: #aaa;
    background-image: linear-gradient(to top, #f9f9f9, #fff 33%);
    font-family: var(--title-font);
}


label.file-upload input[type=file] {
    display:none;
}

table tbody tr th:first-child {
    text-align:right;
}

select {
    text-overflow: ellipsis;
    min-width: 0;
}
