html, body {
    margin: 0;
    background: #121212;
    color: #eee;
    font-family: "Segoe UI", system-ui, sans-serif;
}

/* L'application occupe exactement la hauteur de l'écran :
   le menu, le titre et le manche restent fixes, seule la zone du bas défile. */
body {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topnav {
    flex: 0 0 auto;
}

.page {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;         /* secours si l'écran est trop petit (et pour l'accueil) */
    padding: 0;               /* le manche va d'un bord à l'autre de l'écran */
}

/* ---------- Menu du haut (commun à toutes les pages) ---------- */
.topnav {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    padding: .6rem 1.5rem;
    background: #1c1c1c;
    border-bottom: 1px solid #2c2c2c;
}

.topnav a {
    color: #bbb;
    text-decoration: none;
    font-size: .95rem;
}

.topnav a:hover {
    color: #fff;
}

.topnav a.active {
    color: #d9b77a;
}

.topnav .brand {
    font-weight: 700;
    color: #fff;
    margin-right: .6rem;
}

/* Sélecteur de langue FR / EN (à droite du menu) */
.topnav .lang {
    margin-left: auto;
    display: flex;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    overflow: hidden;
}

.topnav .lang button {
    background: transparent;
    border: none;
    color: #bbb;
    font: inherit;
    font-size: .85rem;
    font-weight: 600;
    padding: .3rem .7rem;
    cursor: pointer;
}

.topnav .lang button + button {
    border-left: 1px solid #3a3a3a;
}

.topnav .lang button:hover {
    color: #fff;
}

.topnav .lang button.active {
    background: #d9b77a;
    color: #121212;
}

/* ---------- En-tête de page (titre + sous-titre) ---------- */
.page-header {
    padding: .6rem 1.5rem .7rem;
}

.page-header h1 {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.15;
}

.page-header p {
    margin: .5rem 0 0;
    font-size: 1.1rem;
    color: #c8c8c8;
}

/* ---------- Pages avec manche : manche en haut, panneau de réglages en dessous ---------- */
.layout {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.layout > .fretboard,
.page-header {
    flex: 0 0 auto;
}

/* ---------- Panneau de réglages (sous le manche) ---------- */
.panel {
    flex: 1 1 auto;
    min-height: 160px;        /* en dessous, c'est la page entière qui défile */
    overflow-y: auto;         /* le contenu du panneau défile sous le manche */
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    align-content: flex-start;
    gap: .8rem 2.5rem;
    background: #2a2624;
    padding: .8rem 1.5rem;
    box-sizing: border-box;
}

/* Panneau en deux parties : réglages fixes en haut, liste qui défile en dessous */
.panel-split {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    overflow: hidden;
    gap: .6rem;
    padding-bottom: 0;
}

.panel-settings {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem 2.5rem;
}

.panel-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.field > label,
.notation legend {
    display: block;
    font-weight: 600;
    margin-bottom: .25rem;
    padding: 0;
}

/* Boutons radio Dièse / Bémol */
.notation {
    border: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem 1.4rem;
}

.notation legend {
    width: 100%;
}

.notation label {
    display: flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
    padding: .3rem 0;
}

.notation input {
    accent-color: #d9b77a;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
}

.panel select {
    width: 260px;
    max-width: 100%;
    padding: .35rem .5rem;
    font-size: 1rem;
    border-radius: 6px;
    border: 1px solid #555;
    background: #1c1a19;
    color: #eee;
}

/* ---------- Erreurs Blazor ---------- */
#blazor-error-ui {
    background: #ffe08a;
    color: #222;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    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;
}
