:root {
    color-scheme: light;
    font-family: "Segoe UI", sans-serif;
    background: #f3efe6;
    color: #1a1a1a;
}

body {
    margin: 0;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #1b3a4b;
    color: #f3efe6;
}

.site-header nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-header a {
    color: #f3efe6;
}

main {
    padding: 1.5rem;
    max-width: 1500px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.cards article {
    background: #fffdf8;
    border: 1px solid #d6d0c4;
    padding: 1rem;
}

.cards span {
    display: block;
    color: #545c62;
    font-size: 0.85rem;
}

.cards strong {
    display: block;
    margin-top: 0.4rem;
    font-size: 1.6rem;
}

.note {
    color: #545c62;
}

.error {
    color: #8d1d28;
}

.login-panel {
    max-width: 24rem;
    margin: 4rem auto;
    background: #fffdf8;
    border: 1px solid #d6d0c4;
    padding: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.8rem;
}

input, button {
    font: inherit;
}

input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 0.25rem;
    padding: 0.45rem;
}

button {
    background: #1b3a4b;
    color: #f3efe6;
    border: 0;
    padding: 0.45rem 0.8rem;
    cursor: pointer;
}

.site-header button {
    background: transparent;
    color: #f3efe6;
    border: 1px solid #f3efe6;
}

img {
    max-width: 100%;
    height: auto;
    background: white;
    border: 1px solid #d6d0c4;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fffdf8;
}

th, td {
    text-align: left;
    padding: 0.5rem;
    border-bottom: 1px solid #d6d0c4;
    vertical-align: top;
}

.settings div {
    display: grid;
    grid-template-columns: 16rem 1fr;
    gap: 1rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #d6d0c4;
}

dt {
    color: #545c62;
}

textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 0.25rem;
    padding: 0.45rem;
}

.placement {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.6rem;
}

.check input {
    display: inline;
    width: auto;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.illustration-preview {
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

.preview-cream {
    background: #f3efe6;
}

.preview-grey {
    background: #9aa0a6;
}

.illustration-preview img {
    background: transparent;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.gallery article {
    box-sizing: border-box;
    background: #fffdf8;
    border: 1px solid #d6d0c4;
    padding: 0.8rem;
}

.gallery article.is-hidden {
    display: none !important;
}

.gallery h3 {
    margin: 0 0 0.6rem;
}

.livery-code {
    display: flex;
    gap: 1rem;
}

.livery-code span {
    display: block;
    color: #545c62;
    font-size: 0.75rem;
    font-weight: 400;
}

.livery-code strong {
    display: block;
    color: #1a1a1a;
    font-size: 1.05rem;
}

.livery-code small {
    display: block;
    margin-top: 0.15rem;
    color: #545c62;
    font-size: 0.75rem;
}

.livery-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.livery-search {
    flex: 1 1 18rem;
    max-width: 28rem;
    margin-bottom: 0;
}

.livery-blank {
    margin: 0 0 0.55rem;
}

.livery-blank input {
    display: inline;
    width: auto;
    margin: 0 0.35rem 0 0;
}

.livery-refresh {
    margin: 0 0 0.15rem;
}

.livery-waiting {
    margin: 0;
    color: #545c62;
}

.replace-image {
    display: inline-block;
    background: #1b3a4b;
    color: #f3efe6;
    padding: 0.45rem 0.8rem;
    cursor: pointer;
}

.replace-image input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.gallery figure {
    margin: 0 0 0.8rem;
}

.gallery figcaption {
    margin-bottom: 0.25rem;
    color: #545c62;
    font-size: 0.85rem;
}

.gallery a {
    display: block;
    color: inherit;
}

.gallery img {
    display: block;
    width: 100%;
    background: transparent;
}

.airport-search {
    max-width: 16rem;
}

.airport-list th,
.airport-list td {
    width: auto;
}

.recreate-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0;
}

.recreate-form button {
    white-space: nowrap;
    padding: 0.35rem 0.55rem;
    font-size: 0.85rem;
}

.airport-row {
    cursor: pointer;
}

.airport-row:hover,
.airport-row:focus {
    background: #f3efe6;
    outline: none;
}

.status {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
}

.status.complete {
    color: #1d6b3a;
}

.status.missing {
    color: #8d1d28;
}

#artwork-modal {
    width: min(960px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow: auto;
    border: 1px solid #d6d0c4;
    background: #fffdf8;
    padding: 1.2rem;
}

#artwork-modal::backdrop {
    background: rgba(26, 26, 26, 0.55);
}

.modal-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: -1.2rem;
    background: #fffdf8;
    padding: 0 0 0.6rem;
    z-index: 1;
}

.modal-bar h2 {
    margin: 0;
}

.modal-pictures {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.modal-pictures figure {
    margin: 0;
}

.modal-pictures figcaption {
    margin-bottom: 0.25rem;
    color: #545c62;
    font-size: 0.85rem;
}

.modal-pictures img {
    display: block;
    width: auto;
    max-width: 100%;
    background: #f2efe8;
    image-rendering: pixelated;
}

.missing-note {
    margin: 0;
    color: #8d1d28;
}

#recreate-status,
#livery-refresh-status {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(26, 26, 26, 0.35);
    z-index: 5;
}

#recreate-status[hidden],
#livery-refresh-status[hidden] {
    display: none;
}

.recreate-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 16rem;
    background: #fffdf8;
    border: 1px solid #d6d0c4;
    padding: 1rem 1.2rem;
}

.recreate-card p {
    margin: 0;
}

.recreate-spinner {
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid #d6d0c4;
    border-top-color: #243038;
    border-radius: 50%;
    animation: recreate-spin 0.8s linear infinite;
    flex: none;
}

#recreate-status.failed .recreate-spinner,
#livery-refresh-status.failed .recreate-spinner {
    display: none;
}

#recreate-status.failed #recreate-status-text,
#livery-refresh-status.failed #livery-refresh-text {
    color: #8d1d28;
}

@keyframes recreate-spin {
    to {
        transform: rotate(360deg);
    }
}
