:root {
    --solveur-sous-primary: #2c3e50;
    --solveur-sous-grid: #ced4da;
    --solveur-sous-bg: #f8f9fa;
    --solveur-ret-haut: #e74c3c;
    --solveur-ret-bas: #e74c3c;
}

.solveur-soustraction {
    font-family: "Courier New", monospace;
}

.solveur-soustraction .solveur-panel {
    max-width: 650px;
}

.solveur-soustraction .solveur-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.solveur-soustraction .solveur-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    align-items: end;
}

.solveur-soustraction .solveur-option {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.solveur-soustraction .solveur-switch {
    align-items: stretch;
}

.solveur-soustraction .solveur-feedback .alert {
    margin-bottom: 0;
}

.solveur-soustraction .solveur-output {
    overflow-x: auto;
}

.solveur-soustraction .math-grid {
    background-color: #fff;
    background-image:
        linear-gradient(var(--solveur-sous-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--solveur-sous-grid) 1px, transparent 1px);
    background-size: 30px 30px;
    display: inline-grid;
    padding: 30px;
    border: 2px solid #adb5bd;
    grid-auto-rows: 30px;
    grid-auto-columns: 30px;
    position: relative;
    min-height: 150px;
}

.solveur-soustraction .cell {
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.6rem;
    font-weight: bold;
    position: relative;
}

.solveur-soustraction .virgule-abs {
    position: absolute;
    right: -5px;
    bottom: -10px;
    color: #e74c3c;
    font-size: 2.3rem;
    z-index: 10;
    font-family: sans-serif;
}

.solveur-soustraction .emprunt-haut {
    font-size: 0.9rem;
    position: absolute;
    left: -1px;
    top: 3px;
    color: var(--solveur-ret-haut);
}

.solveur-soustraction .retenue-bas {
    font-size: 0.8rem;
    position: absolute;
    left: -7px;
    bottom: 3px;
    font-weight: normal;
    color: var(--solveur-ret-bas);
}

.solveur-soustraction .full-line {
    border-bottom: 3px solid black;
    height: 30px;
    pointer-events: none;
    z-index: 5;
    transform: translateY(2px);
}

.solveur-soustraction .color-0 {
    color: #212529;
}

.solveur-soustraction .color-1 {
    color: #6f42c1;
}

.solveur-soustraction .unite {
    color: #0d6efd !important;
}

.solveur-soustraction .zero-inutile {
    color: #adb5bd;
    font-weight: normal;
}

.solveur-soustraction .op-sign {
    font-size: 1.5rem;
    font-weight: bold;
}

@media (min-width: 768px) {
    .solveur-soustraction .solveur-fields,
    .solveur-soustraction .solveur-options {
        grid-template-columns: 1fr 1fr;
    }

    .solveur-soustraction .solveur-options {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media print {
    .solveur-soustraction .solveur-panel {
        display: none;
    }

    .solveur-soustraction .math-grid {
        border: none;
    }
}