html,
body {
    margin: 0;
}

body {
    --primary-bg: #fdfeff;
    --primary-text: #111111;
    --secondary-bg: #eeeef3;
    --secondary-text: #9b9b9b;
    --hover-bg: #dde1e5;
    --active-bg: #cdcfd2;
    --shadow-soft: rgba(0, 0, 0, .15);
    --shadow-hard: rgba(0, 0, 0, .36);

    --dark-primary-bg: #141516;
    --dark-primary-text: #ebebeb;
    --dark-secondary-bg: #30373a;
    --dark-secondary-text: #a4a7a9;
    --dark-hover-bg: #474c50;
    --dark-active-bg: #626569;
    --dark-shadow-soft: rgba(255, 255, 255, .15);
    --dark-shadow-hard: rgba(255, 255, 255, .36);
}

.dark {
    --primary-bg: var(--dark-primary-bg);
    --primary-text: var(--dark-primary-text);
    --secondary-bg: var(--dark-secondary-bg);
    --secondary-text: var(--dark-secondary-text);
    --hover-bg: var(--dark-hover-bg);
    --active-bg: var(--dark-active-bg);
    --shadow-soft: var(--dark-shadow-soft);
    --shadow-hard: var(--dark-shadow-hard);
}

body {
    font-family: system-ui, sans-serif;
    color: var(--primary-text);
    background: var(--primary-bg);
}

input,
button,
textarea {
    font-size: inherit;
    font-family: inherit;
    color: inherit;
    background: inherit;
    margin: 0;
}

input::placeholder,
textarea::placeholder {
    color: var(--secondary-text);
}

/* style resets */

h1,
h2,
h3,
h4 {
    font-size: 1em;
}

p {
    line-height: 1.5em;
    max-width: 64ch;
}

button {
    color: inherit;
    background: var(--secondary-bg);
    border-radius: 6px;
    padding: .5em .8em;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    transition: background .2s;
}

button:hover {
    background: var(--hover-bg);
}

button:active {
    background: var(--active-bg);
}

button[disabled] {
    color: var(--secondary-text);
}

button[disabled]:hover {
    cursor: no-drop;
    background: var(--secondary-bg);
}

input[type="text"],
input[type="number"],
input[type="search"],
input:not([type="checkbox"]):not([type="range"]),
textarea:not(.textarea-itself) {
    border: none;
    background: var(--secondary-bg);
    padding: .5em .8em;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
}

select {
    padding: .5em .8em;
    cursor: pointer;
    background: var(--secondary-bg);
    border: 0;
    border-radius: 6px;
    font-size: 1em;
}

textarea:not(.textarea-itself) {
    line-height: 1.5em;
    min-height: 240px;
    resize: vertical;
}

/* loading */

.loading-bar {
    margin: 1em auto;
    width: calc(100% - 36px);
    max-width: 320px;
    height: 3px;
    background: var(--hover-bg);
    overflow: hidden;
}

@keyframes slider {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.loading-bar::after {
    content: '';
    display: block;
    height: 100%;
    width: 60%;
    padding-right: 40%;
    background-color: var(--primary-text);
    position: relative;
    top: 0;
    left: 0;
    animation: slider 1s linear infinite;
}

/* components */

.flex-spacer {
    width: 0;
    height: 0;
    flex-grow: 1;
}

.flex-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-grow: 1;
    gap: 8px;
}

.flex-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
    gap: 8px;
}

.color-red {
    color: #ba0b0b;
}

/* layout */

.app {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    min-height: 100vh;
}

.page {
    width: calc(100% - 36px);
    margin: 0 auto;
    max-width: 96em;
}

.page h3 {
    line-height: 1.5em;
}

header.page {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin: 6px auto;
}

header a.logo {
    color: inherit;
    font-weight: bold;
    text-decoration: none;
}

header a.logo:hover {
    text-decoration: underline;
}

.terms {
    width: 100%;
}

.term-container {
    width: 100%;
}

.term {
    background: var(--secondary-bg);
}

ol.cells {
    padding-left: 0;
}

.cell-controls {
    width: 100%;
}

.cell-imgs {
    flex-wrap: wrap;
}

.cell-img-placeholder {
    height: 256px;
    width: 256px;
    background: var(--secondary-bg);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cell-imgs img {
    width: 256px;
    border-radius: 6px;
}

