body {
    font-family: system-ui, sans-serif;
    max-width: 1040px;
    margin: 2rem auto;
    color: #1a1a1a;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ccc;
    padding-bottom: .5rem;
    margin-bottom: 1.5rem;
}

nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .25rem 1rem;
}

nav a.active {
    font-weight: 600;
}

section {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

form label {
    display: block;
    margin-top: .75rem;
    font-weight: 600;
}

form input, form select {
    width: 100%;
    padding: .4rem;
    margin-top: .25rem;
    box-sizing: border-box;
}

form.inline-form, form.login-form {
    max-width: 400px;
}

button {
    margin-top: 1rem;
    padding: .5rem 1rem;
    cursor: pointer;
}

.hint {
    font-size: .85rem;
    color: #555;
}

.flashes {
    list-style: none;
    padding: 0;
}

.flash-error {
    color: #b00020;
}

.flash-success {
    color: #157347;
}

/* Zone d'édition JSON Lines (pages de type, data.html). Le texte n'est pas replié
   (attribut wrap="off" du gabarit) : une entrée reste une ligne à l'œil comme
   au format, et une valeur longue défile horizontalement. */
.jsonl-editor {
    width: 100%;
    margin-top: .25rem;
    padding: .4rem;
    box-sizing: border-box;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .85rem;
    white-space: pre;
    overflow: auto;
}


/* Suivi des travaux en tâche de fond (_jobs.html). */
#jobs-table {
    width: 100%;
    border-collapse: collapse;
}

#jobs-table th, #jobs-table td {
    border-bottom: 1px solid #ddd;
    padding: .4rem;
    text-align: left;
    vertical-align: top;
    font-size: .9rem;
}

#jobs-table progress {
    width: 100%;
    display: block;
    margin-bottom: .2rem;
}

/* Un <progress> sans attribut "value" s'affiche indéterminé : c'est l'état
   d'un travail dont le total n'est pas encore connu. */

#jobs-table .inline-form, #jobs-table .inline-form button {
    margin: 0;
}

.job-error {
    color: #b00020;
}

.job-done {
    color: #157347;
}

.job-cancelled {
    color: #8a6d00;
}

/* Liste des types de contenu (import.html). */
.types-table {
    width: 100%;
    border-collapse: collapse;
}

.types-table th, .types-table td {
    border-bottom: 1px solid #ddd;
    padding: .4rem;
    text-align: left;
    vertical-align: top;
    font-size: .9rem;
}

.types-table code {
    word-break: break-all;
}

.contexo-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .25rem 1rem;
    max-width: 720px;
}

.contexo-form .wide {
    grid-column: 1 / -1;
}

.base-table {
    width: 100%;
    border-collapse: collapse;
}

.base-table th, .base-table td {
    border-bottom: 1px solid #ddd;
    padding: .5rem;
    text-align: left;
    vertical-align: top;
}

.base-table form, .base-table button {
    margin: 0;
}

.base-table button {
    white-space: nowrap;
}

.contexo-state {
    font-variant-numeric: tabular-nums;
}

@media (max-width: 700px) {
    header {
        align-items: flex-start;
        flex-direction: column;
        gap: .75rem;
    }

    nav {
        justify-content: flex-start;
    }

    .contexo-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .contexo-form .wide {
        grid-column: auto;
    }

    .base-table {
        display: block;
        overflow-x: auto;
    }
}
