/* La toile et les contrôles occupent des cases distinctes : aucun bouton flottant. */
:root {
    font-family:
        system-ui,
        -apple-system,
        sans-serif;
    color: #253b3b;
    background: #f4f0e7;
    font-size: 14px;
    color-scheme: light;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    border-bottom: 1px solid #cfcfc0;
    flex-shrink: 0;
}
.marque {
    font-size: 10px;
    letter-spacing: 0.2em;
    color: #657b76;
}
h1 {
    font-weight: 500;
    font-size: 29px;
    letter-spacing: -1px;
    margin: 2px 0;
}
h1 span {
    font-size: 12px;
    color: #8e7450;
    margin-left: 12px;
    vertical-align: top;
    letter-spacing: 0;
}
h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 14px 0 8px;
}
main {
    display: flex;
    flex: 1;
    min-height: 0;
}
.atelier {
    padding: 16px 24px 10px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    min-height: 0;
}
.outils {
    display: flex;
    gap: 8px;
    align-items: end;
    flex-wrap: wrap;
    padding-bottom: 12px;
}
label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    color: #526660;
}
button,
select,
input {
    font: inherit;
}
button,
select,
input[type='number'],
input[type='text'],
#nom {
    border: 1px solid #c7cec4;
    background: #fffdf8;
    color: #253b3b;
    border-radius: 7px;
    padding: 9px 10px;
    min-height: 40px;
}
button {
    cursor: pointer;
    font-size: 13px;
}
button:hover {
    background: #e4ece4;
}
button:disabled {
    opacity: 0.4;
    cursor: default;
}
button:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 3px solid #d79742;
    outline-offset: 2px;
}
.principal {
    background: #275c53;
    color: #fff;
    border-color: #275c53;
    font-weight: 600;
}
.principal:hover {
    background: #397266;
}
.mesures,
.legende {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    color: #657b76;
    padding: 6px 0;
    min-height: 27px;
}
.mesures output {
    color: #275c53;
    text-align: center;
}
.surface {
    flex: 1;
    min-height: 70px;
    position: relative;
    border: 1px solid #c9cbbc;
    border-radius: 10px;
    overflow: hidden;
    background: #fffdf8;
}
canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}
.transport {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 7px 0;
}
.volume {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-left: auto;
}
input[type='range'] {
    width: 110px;
    accent-color: #275c53;
    touch-action: none;
}
.clavier {
    display: flex;
    gap: 3px;
    height: 59px;
    flex-shrink: 0;
}
.clavier button {
    flex: 1;
    padding: 4px 0;
    min-width: 0;
    font-size: 10px;
    display: flex;
    align-items: end;
    justify-content: center;
    border-bottom: 3px solid #c7cec4;
}
.clavier .noire {
    background: #344947;
    color: #fff;
    border-bottom-color: #172b29;
}
.clavier .jouee {
    background: #dca754;
    color: #203831;
}
.etat {
    font-size: 11px;
    color: #657b76;
    padding-top: 7px;
    min-height: 23px;
}
aside {
    width: 310px;
    border-left: 1px solid #cfcfc0;
    background: #eeeee5;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
aside[hidden] {
    display: none;
}
.entete-panneau {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    border-bottom: 1px solid #cfcfc0;
}
.contenu-panneau {
    overflow: auto;
    overscroll-behavior: contain;
    padding: 10px 16px 25px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.contenu-panneau p {
    font-size: 12px;
    line-height: 1.6;
    color: #60736e;
    margin: 0 0 7px;
}
.paire {
    display: flex;
    gap: 10px;
}
.paire label {
    width: 50%;
}
.fichier {
    padding: 9px;
    background: #fffdf8;
    border: 1px dashed #adbdb1;
    border-radius: 7px;
}
.fichier input {
    max-width: 100%;
    font-size: 11px;
}
.contenu-panneau a {
    color: #275c53;
}
button,
select {
    touch-action: manipulation;
}
@media (max-width: 700px) {
    header {
        padding: 8px 12px;
    }
    h1 {
        font-size: 23px;
    }
    .marque {
        font-size: 8px;
    }
    .atelier {
        padding: 8px 10px 5px;
    }
    .outils {
        gap: 5px;
        padding-bottom: 4px;
    }
    .outils label {
        font-size: 10px;
    }
    .outils button span {
        display: none;
    }
    .outils button,
    .outils select {
        padding: 7px;
        font-size: 11px;
        min-height: 36px;
    }
    main {
        flex-direction: column;
    }
    aside {
        width: 100%;
        max-height: 40dvh;
        border-left: 0;
        border-top: 1px solid #cfcfc0;
        flex-shrink: 0;
    }
    .entete-panneau {
        padding: 4px 12px;
    }
    .entete-panneau h2 {
        margin: 0;
        font-size: 14px;
    }
    .entete-panneau button {
        min-height: 32px;
        padding: 4px 9px;
    }
    .contenu-panneau {
        padding: 8px 12px 20px;
    }
    .clavier {
        height: 47px;
    }
    .transport {
        gap: 5px;
    }
    .transport button {
        padding: 7px;
        min-height: 36px;
    }
    .volume {
        font-size: 10px;
    }
    input[type='range'] {
        width: 75px;
    }
    .etat {
        font-size: 10px;
    }
    .mesures,
    .legende {
        font-size: 9px;
    }
    .mesures #hauteur {
        display: none;
    }
}
@media (max-height: 500px) {
    header {
        padding: 4px 12px;
    }
    .marque {
        display: none;
    }
    .clavier {
        height: 36px;
    }
    .etat {
        display: none;
    }
    .atelier {
        padding-top: 5px;
    }
    .outils {
        padding-bottom: 2px;
    }
    .transport {
        padding: 3px 0;
    }
}
