:root {
    --accent-color: #1bab65;
    --page-width: 800px;
}

body {
    font-family: sans-serif;
    margin: 0;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    min-height: 100vh;
}

h1 {
    font-size: 3em;
}

h2 {
    font-size: 2em;
}

h3 {
    font-size: 1.5em;
}

h4 {
    font-size: 1.25em;
}

h5 {
    font-size: 1em;
}

h6 {
    font-size: 0.83em;
}

.content-wrap {
    padding-inline: 16px;
    box-sizing: border-box;
    width: 100%;
    max-width: var(--page-width);
    margin: auto;
    margin-block: 1em;
}

.content-wrap.small {
    max-width: 400px;
}

header {
    border-bottom: 1px solid #ccc;
}

header>div {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    box-sizing: border-box;
    max-width: var(--page-width);
    margin: auto;
}

header span {
    font-size: 24px;
    font-weight: bold;
}

footer {
    background-color: #f7f7f7;
    color: #555;
    padding: 16px;
    text-align: center;
}

footer a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;

    &:hover {
        text-decoration: underline;
    }
}

.question {
    margin-block: 2em;
    border: 1px solid #ccc;
    padding: 16px;
    /* border-radius: 10px;
    overflow: hidden; */
}

.question .header {
    /* background-color: #eee; */
    border-bottom: 1px solid #ccc;
    /* font-weight: bold; */
    padding-inline: 8px;
}

.question .body {
    padding: 16px;
}

.selection {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    margin-block: 8px;
}

hr {
    border: none;
    border-bottom: 1px solid #ccc;
}

input,
select,
button {
    font: inherit;
}

input[type=text],
input[type=password],
input[type=email],
input[type=number],
input[type=url],
input[type=tel],
input[type=date],
select {
    appearance: none;
    border: 1px solid #aaa;
    padding: 8px 16px;
    background-color: white;
}

select {
    padding-right: calc(16px + 24px);
    background-position: calc(100% - 8px);
    background-repeat: no-repeat;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='m7 10l5 5l5-5z'/%3E%3C/svg%3E");
}

.grid {
    display: grid;
    row-gap: 16px;
    column-gap: 8px;
    grid-auto-columns: 1fr;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

header button,
header .button {
    line-height: 1;
}

button,
.button {
    --button-color: var(--accent-color);
    --button-text-color: white;
    appearance: none;
    text-decoration: none;
    cursor: default;
    user-select: none;
    padding: 8px 16px;
    border: none;
    background-color: var(--button-color);
    color: var(--button-text-color);
    border-radius: 2px;
}

button:hover,
.button:hover {
    background-color: color-mix(in srgb, var(--button-color), #fff 20%);
}

button:active,
.button:active {
    background-color: color-mix(in srgb, var(--button-color), #000 20%);
}

button:disabled,
.button:disabled {
    background-color: color-mix(in srgb, var(--button-color), #fff 50%);
}

button.secondary,
.button.secondary {
    --button-color: #ddd;
    --button-text-color: black;
}

.button-bar {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    margin-block: 1em;
}

.glue {
    flex: 1;
}

table {
    border-collapse: collapse;
    margin-block: 1em;
    --border-color: #ddd;
}

table.fw {
    width: 100%;
    box-sizing: border-box;
}

table tr {
    border: 1px solid var(--border-color);
}

table tr:nth-child(even) {
    background-color: #eee;
}

table td,
table th {
    padding: 8px 12px;
    text-align: left;
}

thead {
    background-color: var(--accent-color);
    color: white;
    --border-color: var(--accent-color);
}

tbody {
    border-inline: 1px solid #ddd;
}

table button,
table .button {
    margin-block: -4px;
    padding-block: 4px;
}

.tabs {
    display: flex;
    flex-direction: row;
    gap: 8px;
    padding-inline: 16px;
    position: relative;
    margin-block: 1em;
}

.tabs.noborder {
    margin-block-end: 0px;
}

.tabs::before {
    z-index: 1;
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    right: 0;
    box-sizing: border-box;
    border-bottom: 2px solid var(--accent-color);
}

.tabs.noborder::before {
    content: none;
}

.tab {
    --tab-vertical-padding: 4px;
    --tab-color: var(--accent-color);
    padding: var(--tab-vertical-padding) 16px;
    background-color: var(--tab-color);
    color: white;
    border: 2px solid var(--tab-color);
    border-bottom: none;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    font-weight: bold;
    cursor: default;
    user-select: none;
}

.tabs.noborder .tab {
    padding-bottom: calc(var(--tab-vertical-padding) - 2px);
}

.tab:hover {
    --tab-color: color-mix(in srgb, var(--accent-color), #fff 20%);
}

.tab:active {
    --tab-color: color-mix(in srgb, var(--accent-color), #000 20%);
}

.tab.disabled {
    --tab-color: color-mix(in srgb, var(--accent-color), #fff 50%);
}

.tab.active {
    z-index: 1;
    --tab-color: white;
    color: var(--accent-color);
    border-color: var(--accent-color);
}

dialog {
    border: none;
    padding: 16px;
    margin-inline: auto;
    box-sizing: border-box;
    padding-block: 0;
    border: 1px solid #ddd;
}

dialog.small {
    width: 100%;
    max-width: 400px;
}