html, body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

h1 {
    font-size: 1.6rem;
}

h1:focus {
    outline: none;
}

.app-header {
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    background: var(--bs-body-bg);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    font-weight: 600;
    text-decoration: none;
    color: var(--bs-body-color);
    white-space: nowrap;
}

.app-header .nav-link {
    padding: 0.25rem 0.75rem;
}

.app-header .nav-link.active {
    font-weight: 600;
    text-decoration: underline;
}

/* ---- Saisie du texte ---- */
/* Police à chasse fixe : les lignes vides qui séparent les paragraphes et les marqueurs de titre se
   repèrent bien mieux qu'en caractères proportionnels. */
.source-text {
    font-family: ui-monospace, 'Cascadia Mono', Consolas, 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.45;
    min-height: 22rem;
    resize: vertical;
}

/* ---- Aperçu ---- */
/* Le document affiché embarque son propre style ; l'iframe l'isole de celui de l'application, ce qui
   rend l'aperçu fidèle au fichier imprimé. */
.preview-frame {
    width: 100%;
    height: 70vh;
    min-height: 420px;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 6px;
    background: #fff;
}

.settings-group {
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 6px;
    padding: 0.75rem 1rem 1rem;
    margin-bottom: 0.75rem;
}

.settings-group > legend {
    float: none;
    width: auto;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bs-secondary-color);
    padding: 0 0.35rem;
    margin-bottom: 0.5rem;
}

.form-label {
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
}

.summary-figure {
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.1;
}

.summary-label {
    font-size: 0.72rem;
    color: var(--bs-secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ---- Éléments Blazor par défaut ---- */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Chargement");
    }

[data-bs-theme="dark"] .loading-progress circle {
    stroke: #3a3f44;
}

[data-bs-theme="dark"] .loading-progress circle:last-child {
    stroke: #6ea8fe;
}
