@font-face {
    font-family: "Font Awesome 6 Free";
    src: url(fa-solid-900.woff2);
}

:root {
    --bg-color: #d5d1c9;
    --text-color: black;
    --bg-color-primary: #2571d4;
    --text-color-primary: white;
    --bg-color-success: #2f7a2c;
    --text-color-success: white;
    --bg-color-warning: #bd2237;
    --text-color-warning: white;
    --separator-color: #999997;
    --widget-radius: 0px;
    --widget-padding: 1px 4px;
    --widget-border-width: 2px;
    --widget-shadow: none;
    --widget-color: #d5d1c9;
    --widget-border-color: #f1f1f0;
    --widget-border-style: outset;
    --widget-pressed-color: #d5d1c9;
    --widget-border-pressed-style: inset;
    --top-bar-height: 32px;
    --btn-min-height: initial;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-size: 1em;
    line-height: 18px;
    font-weight: normal;
}

div, section {
    background-color: var(--bg-color);
}

dialog {
    position: relative;
    margin: auto;
    max-height: 90vh;
    max-width: 90vw;
}

body,
button,
.btn,
select {
    color: var(--text-color);
}

body {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 14px;
}

a {
    text-decoration: none;
    color: var(--bg-color-primary);
}

a:visited {
    color: var(--bg-color-primary);
}

a:hover {
    text-decoration: underline;
    cursor: pointer;
}

h1 {
    font-size: 1.5em;
}

h2 {
    font-size: 1.2em;
}

h3 {
    font-size: 1.1em;
}

.relative {
    position: relative;
}

.toggle > input[type="checkbox"] {
    display: none;
}

button,
.btn,
select,
.breadcrumbs,
.toggle > label {
    display: inline-block;
    background-color: var(--widget-color);
    border-radius: var(--widget-radius);
    border-style: var(--widget-border-style);
    border-color: var(--widget-border-color);
    border-width: var(--widget-border-width);
    box-shadow: var(--widget-shadow);
    color: var(--text-color);
    padding: var(--widget-padding);
    cursor: pointer;
    min-width: 2ch;
    min-height: var(--btn-min-height);
}

button.primary,
.btn.primary,
select.primary {
    background-color: var(--bg-color-primary);
    color: var(--text-color-primary);
}

button.success,
.btn.success,
select.success {
    background-color: var(--bg-color-success);
    color: var(--text-color-success);
}

button.warning,
.btn.warning,
select.warning {
    background-color: var(--bg-color-warning);
    color: var(--text-color-warning);
}

button:active,
.btn:active,
select:active {
    background-color: var(--widget-pressed-color);
    border-style: var(--widget-border-pressed-style);
}

.btn-group {
    white-space: nowrap;
}

.btn-group > button,
.btn-group > select,
.btn-group > .breadcrumbs,
.btn-group > .btn,
.btn-group > .toggle > label {
    border-radius: 0;
    border-left-width: 0;
}

.btn-group > button:first-child,
.btn-group > select:first-child,
.btn-group > .breadcrumbs:first-child,
.btn-group > .btn:first-child,
.btn-group > .toggle:first-child > label {
    border-start-start-radius: var(--widget-radius);
    border-end-start-radius: var(--widget-radius);
}

.btn-group > button:last-child,
.btn-group > select:last-child,
.btn-group > .breadcrumbs:last-child,
.btn-group > .btn:last-child,
.btn-group > .toggle:last-child > label {
    border-start-end-radius: var(--widget-radius);
    border-end-end-radius: var(--widget-radius);
}

.btn-group > .toggle > input:checked ~ label {
    background-color: var(--bg-color-primary);
    color: var(--text-color-primary);
    border-style: var(--widget-border-pressed-style);
}

a.btn {
    color: var(--text-color);
}

a.btn:hover {
    text-decoration: none;
} 

input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
textarea,
.text,
.indent {
    border-radius: var(--widget-radius);
    padding: var(--widget-padding);
    background-color: white;
}

input[type="text"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    border: 2px solid var(--bg-color-primary);
}

input[type="search"] ~ .search-icon {
    position: absolute;
    right: 1ch;
}

.text {
    border-style: inset;
    border-color: var(--widget-border-color);
    border-width: var(--widget-border-width);
}

.top-bar-height {
    height: var(--top-bar-height);
}

.height-below-top-bar {
    height: calc(100vh - var(--top-bar-height));
}

.fixed-to-top {
    position: sticky;
    top: 0;
    background-color: var(--bg-color);
}

.hbox,
.vbox {
    display: flex;
}

.hbox {
    flex-direction: row;
}

.vbox {
    flex-direction: column;
}

.vbox.wrap,
.hbox.wrap {
    flex-wrap: wrap;
}

.hbox.vertical-align,
.vbox.horizontal-align,
.form-2-col.vertical-align {
    align-items: center;
}

.hbox.horizontal-align,
.vbox.vertical-align,
.form-2-col.horizontal-align {
    justify-content: center;
}

.justify-space-around {
    justify-content: space-around;
}

.stack-container {
    position: relative;
    overflow: hidden;
}

.stack-container > * {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}

.tree-cols-1 {
    --tree-column-number: 1;
}

.tree-cols-2 {
    --tree-column-number: 2;
}

.tree-cols-3 {
    --tree-column-number: 3;
}

.tree-view {
    display: grid;
    padding-left: 16px;
    grid-template-columns: min-content repeat(var(--tree-column-number), 1fr);
    align-content: start;
}

.tree-view ul,
.tree-view li {
    display: contents;
}

.tree-view li > * {
    border-left: 1px solid var(--separator-color);
    border-radius: 0;
}

.tree-view li:hover > a {
    background-color: var(--bg-color-primary);
    color: var(--text-color-primary);
}

.tree-view li > a {
    padding: 4px;
}

.tree-view li > *:first-child {
    border-left: none;
}

.indent {
    justify-content: right;
}

.indent div {
    background-color: transparent;
    padding-left: 4px;
}

.tree-view li > .indent {
    width: 0ch;
}

.tree-view li li > .indent {
    width: 5ch;
}

.tree-view li li li > .indent {
    width: 10ch;
}

.tree-view li li li li > .indent {
    width: 15ch;
}

.tree-view li li li li > .indent {
    width: 18ch;
}

.tree-view li li li li > .indent {
    width: 20ch;
}

.square {
    aspect-ratio: 1;
}

.dynamic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, auto));
}

.gapped {
    gap: 3px;
}

.spacer {
    flex-grow: 1;
}

.separator {
    display: inline-block;
    width: 1ch;
}

.form-2-col {
    display: grid;
    grid-template-columns: 15ch 1fr;
    gap: 0.5ch;
}

.padded {
    padding: 1px 5px;
}

.illustration {
    max-width: 200px;
    max-height: 200px;
}

.background-contained {
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.transparent {
    background-color: transparent;
}

.vertical-scroll {
    height: 100%;
    overflow-y: auto;
}

.flex-fill {
    flex-grow: 1;
}

.separated,
.separated-left {
    border-left: 1px solid var(--separator-color);
}

.separated,
.separated-right,
.separated-children > * {
    border-right: 1px solid var(--separator-color);
}

.separated,
.separated-top {
    border-top: 1px solid var(--separator-color);
}

.separated,
.separated-bottom {
    border-bottom: 1px solid var(--separator-color);
}

.separated-children > *:last-child {
    border-right: none;
}

.breadcrumbs > *::after {
    font-family: "Font Awesome 6 Free";
    display: inline-block;
    content: "\f054";
    margin: 0 1ch;
    color: var(--text-color);
}

.breadcrumbs > *:last-child:after {
    display: none;
}

.text-over-img {
    background-color: #e3e3e3c4;
    color: var(--text-color);
    text-shadow: 1px 1px 2px white;
}

.fullscreen-img {
    max-height: fit-content;
    max-height: 80vh;
}

@media screen and (max-width: 1100px) {
    .hbox.responsive-1100 {
        flex-direction: column;
        overflow-y: auto;
        height: 100%;
    }

    .hbox.responsive-1100 > .vertical-scroll {
        overflow-y: initial;
        height: initial;
    }
}

@media screen and (max-width: 850px) {
    .hbox.responsive-850 {
        flex-direction: column;
        overflow-y: auto;
        height: 100%;
    }

    .hbox.responsive-850 * {
        --top-bar-height: initial;
    }
}
