/* === ZMIENNE KOLORYSTYCZNE (DLA SPÓJNOŚCI) === */
:root {
    /* Kolory główne */
    --primary-color: #3498db;    /* Główny niebieski akcent */
    --primary-dark: #2980b9;     /* Ciemniejszy niebieski (hover) */
    --success-color: #27ae60;    /* Zielony (zapisz, auto) */
    --danger-color: #e74c3c;     /* Czerwony (usuń, błędy) */

    /* Tła i teksty */
    --header-bg: #2c3e50;        /* Ciemny nagłówek */
    --app-bg: #ffffff;           /* Tło główne aplikacji */
    --sidebar-bg: #f8f9fa;       /* Tło paska bocznego */
    --toolbar-bg: #ffffff;       /* Tło paska narzędzi */
    --canvas-bg: #ffffff;        /* Tło nut (papier) */

    /* Elementy UI */
    --border-color: #e9ecef;     /* Delikatne ramki */
    --text-main: #2c3e50;        /* Główny kolor tekstu */
    --text-muted: #95a5a6;       /* Wygaszony tekst/ikony */
    --input-dark-bg: #34495e;    /* Tło ciemnych inputów */

    /* Cienie */
    --shadow-soft: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-hover: 0 4px 12px rgba(52, 152, 219, 0.15);
}

/* === LAYOUT GŁÓWNY === */
.am-wrapper {
    /* Nowoczesny stos czcionek systemowych */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--app-bg);
    border-radius: 10px; /* Większe zaokrąglenie */
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); /* Wyraźniejszy cień */
    display: flex;
    flex-direction: column;
    height: 750px; /* Nieco wyższa aplikacja */
    overflow: hidden;
    position: relative;
    max-width: 1200px;
    margin: 30px auto;
    border: none; /* Usuwamy starą ramkę */
    color: var(--text-main);
}

/* === NAGŁÓWEK === */
.am-header {
    background: var(--header-bg);
    color: #fff;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px; /* Wyższy nagłówek */
    flex-shrink: 0;
}

.am-logo {
    font-weight: 800;
    font-size: 20px;
    color: #ecf0f1;
    letter-spacing: -0.5px;
}
.am-logo span { color: var(--primary-color); font-weight: 400; }

.am-meta-controls { display: flex; gap: 12px; align-items: center; }

/* Ciemne inputy w nagłówku - bardziej eleganckie */
.am-dark-input, .am-dark-select, .am-tempo-wrapper {
    background: var(--input-dark-bg) !important;
    border: 1px solid transparent;
    color: #ecf0f1;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s;
}

.am-dark-input:focus, .am-dark-select:focus {
    border-color: var(--primary-color);
    outline: none;
}

.am-tempo-wrapper {
    display: flex;
    align-items: center;
    padding: 0 12px;
}

.am-tempo-wrapper input {
    border: none !important;
    background: transparent !important;
    padding: 8px 2px !important;
    color: white;
    font-weight: 600;
}
.am-tempo-wrapper span { color: var(--text-muted); font-size: 12px; margin-right: 5px; }


/* === GŁÓWNE CIAŁO === */
.am-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* === SIDEBAR (ŚCIEŻKI) === */
.am-sidebar {
    width: 280px; /* Nieco szerszy sidebar */
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.am-sb-head {
    padding: 15px 20px;
    background: transparent;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.am-sb-actions button {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.am-sb-actions button:hover { background: var(--primary-color); color: white; }

.track-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    /* Subtelny pasek przewijania */
    scrollbar-width: thin;
    scrollbar-color: #dcdcdc transparent;
}

/* Kafelki ścieżek - Nowoczesny wygląd */
.t-item {
    background: #fff;
    border: 1px solid var(--border-color); /* Cieńsza ramka */
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border-left: 4px solid transparent;
    box-shadow: var(--shadow-soft);
}

/* Aktywna ścieżka */
.t-item.active {
    border-color: var(--primary-color);
    border-left-color: var(--primary-color);
    background: #f0f7fd; /* Bardzo jasne niebieskie tło */
    box-shadow: var(--shadow-hover);
    transform: translateX(2px);
}

.t-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

.t-name {
    width: 100%;
    border: none;
    background: transparent;
    font-weight: 600;
    color: var(--text-main);
    font-size: 15px;
    outline: none;
    padding: 2px 0;
}
.t-item.active .t-name { color: var(--primary-dark); }

/* Przycisk usuwania - subtelniejszy */
.t-del {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 18px; line-height: 1;
    padding: 4px; border-radius: 4px; transition: all 0.2s;
    opacity: 0.6;
}
.t-item:hover .t-del { opacity: 1; }
.t-del:hover { color: var(--danger-color); background: #fdecec; }

.t-sel {
    width: 100%;
    font-size: 12px;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: #fff;
    color: var(--text-main);
}

.am-status-box {
    padding: 10px;
    background: var(--header-bg);
    color: #bdc3c7;
    font-size: 12px;
    text-align: center;
    border-top: 1px solid #34495e;
}

/* === EDITOR (PRAWA STRONA) === */
.am-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f9fbfd; /* Bardzo jasne tło pod papierem */
    overflow: hidden;
}

/* === PASEK NARZĘDZI (TOOLBAR) === */
.am-toolbar {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--toolbar-bg);
    flex-wrap: wrap;
    box-shadow: var(--shadow-soft);
    z-index: 10;
}

.am-group {
    display: flex;
    background: transparent; /* Usuwamy szare tło grupy */
    gap: 2px;
    padding: 0;
    margin-right: 8px;
}

/* Przyciski narzędzi - Nowy wygląd */
.tool-btn, .dur-btn {
    background: #f1f3f5;
    border: 1px solid transparent;
    padding: 8px 14px; /* Większe przyciski */
    cursor: pointer;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-main);
    transition: all 0.2s;
    display: flex; align-items: center; gap: 8px; font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.dur-btn { font-size: 20px; line-height: 1; padding: 4px 10px; font-weight: normal; }
.tool-btn i { color: var(--text-muted); font-size: 14px; transition: color 0.2s; }

/* Hover i Active */
.tool-btn:hover, .dur-btn:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.tool-btn.active, .dur-btn.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.tool-btn.active i { color: #fff; }

/* Specjalne kolory przycisków */
.tool-btn.del:hover { background: var(--danger-color); color: white; }
.tool-btn.del:hover i { color: white; }
.tool-btn.play { background: #e8f6f3; color: var(--success-color); }
.tool-btn.play:hover { background: var(--success-color); color: white; }
.tool-btn.play i { color: var(--success-color); }
.tool-btn.play:hover i { color: white; }

.sep { width: 2px; height: 24px; background: var(--border-color); margin: 0 10px; border-radius: 2px;}

/* === PAPIER NUTOWY === */
.am-canvas-scroll {
    flex: 1;
    overflow: auto;
    padding: 30px;
    text-align: center;
    position: relative;
    background: #f9fbfd; /* Tło pod kartką */
}

#am-paper {
    display: inline-block;
    min-width: 850px;
    background: var(--canvas-bg);
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08); /* Efekt kartki papieru */
    border-radius: 4px;
}
#am-paper svg { overflow: visible; }

/* Podświetlanie */
.am-active-note path {
    fill: var(--danger-color) !important;
    stroke: var(--danger-color) !important;
    filter: drop-shadow(0 0 3px rgba(231, 76, 60, 0.5)); /* Lekka poświata */
}

/* === PIANINO === */
.am-piano-container {
    height: 165px;
    border-top: 1px solid var(--border-color);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    gap: 15px;
    flex-shrink: 0;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.03);
}

.am-piano {
    position: relative;
    height: 120px;
    overflow-x: auto;
    overflow-y: hidden;
    background: #222; /* Ciemniejsze tło pod klawiszami */
    padding: 10px 12px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.3);
}

/* nowy układ klawiatury (key-wrap) */
#piano-keys { position: relative; height: 100px; display: flex; align-items: flex-end; gap: 2px; }
.key-wrap { position: relative; width: 52px; height: 100px; }

.key { cursor: pointer; border-radius: 0 0 4px 4px; transition: all 0.1s; }

.key.kw {
    width: 52px; height: 100px; background: linear-gradient(to bottom, #fff 0%, #f5f5f5 100%);
    border: 1px solid #bbb; margin-right: 1px; position: relative; z-index: 1;
    box-shadow: inset 0 -3px 5px rgba(0,0,0,0.1);
}
.key.kw:hover { background: #fcfcfc; }
.key.kw:active { background: #e0e0e0; box-shadow: inset 0 3px 5px rgba(0,0,0,0.1); }
.key.kw span {
    position: absolute; bottom: 8px; left: 0; width: 100%; text-align: center;
    font-size: 12px; font-weight: 700; color: #9aa0a6; pointer-events: none;
}

.key.kb {
    width: 32px; height: 64px;
    background: linear-gradient(to bottom, #333 0%, #111 100%);
    position: absolute;
    top: 0;
    left: 34px;
    z-index: 2;
    border: 1px solid #000;
    border-bottom-width: 4px;
    box-shadow: 2px 2px 3px rgba(0,0,0,0.3);
    border-radius: 0 0 4px 4px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.key.kb span {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,0.55);
    padding-bottom: 6px;
    pointer-events: none;
}
.key.kb:hover { background: linear-gradient(to bottom, #444 0%, #222 100%); }
.key.kb:active { border-bottom-width: 1px; transform: translateY(2px); }
.key.kb { margin: 0; }

.octave-btn {
    width: 36px; height: 36px; background: #fff; border: 1px solid var(--border-color);
    border-radius: 8px; cursor: pointer; font-weight: bold; color: var(--text-main);
    font-size: 18px; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-soft);
}
.octave-btn:hover { background: var(--primary-color); color: white; border-color: transparent; }

/* === PRZYCISK ZAPISZ === */
.am-btn-primary {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 10px 20px; /* Większy przycisk */
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 2px 5px rgba(39, 174, 96, 0.3);
}
.am-btn-primary:hover { background: #219150; transform: translateY(-1px); }
.am-btn-primary:active { transform: translateY(0); }

/* ... (Twoje poprzednie style) ... */

/* === DASHBOARD LISTA PROJEKTÓW === */
.am-dashboard {
    max-width: 1000px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-main);
}

.am-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.am-dash-header h2 { margin: 0; font-size: 24px; color: #2c3e50; }

.am-projects-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.am-projects-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #95a5a6;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 12px;
}

.am-projects-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.am-projects-table tr:last-child td { border-bottom: none; }
.am-projects-table tr:hover td { background: #fdfdfd; }

.am-proj-title {
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 15px;
}
.am-proj-title:hover { text-decoration: underline; }

.am-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-flex; align-items: center; gap: 5px;
    transition: all 0.2s;
}

.am-btn-edit {
    background: #fff;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}
.am-btn-edit:hover {
    background: var(--primary-color);
    color: #fff;
}

.am-empty-state {
    text-align: center;
    padding: 40px;
    background: #fff;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: #95a5a6;
}
/* Badge dla tonacji */
.am-badge {
    background: #e1f5fe;
    color: #0288d1;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* Przycisk usuwania w tabeli */
.am-btn-del-proj {
    background: #fff;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    margin-left: 5px;
    cursor: pointer;
}
.am-btn-del-proj:hover {
    background: #e74c3c;
    color: white;
}


/* === FIX: elementy rysunkowe (belki, ending, kreski) nie mogą przechwytywać kliknięć === */
#am-paper .abcjs-beam-elem,
#am-paper .abcjs-ending,
#am-paper .abcjs-ending *,
#am-paper .abcjs-bar,
#am-paper .abcjs-bar *,
#am-paper .abcjs-staff-extra,
#am-paper .abcjs-staff-extra * {
  pointer-events: none;
}

#am-paper .abcjs-note,
#am-paper .abcjs-note * {
  pointer-events: auto;
}


/* =========================================================
   RESPONSIVE / MOBILE-FIRST OVERRIDES (DOPISZ NA KOŃCU)
   ========================================================= */

/* Lepsze zachowanie wysokości na urządzeniach mobilnych (adres bar) */
:root{
  --am-header-h: 60px;
  --am-piano-h: 165px;
}

/* Bazowy wrapper: zamiast sztywnego 750px – elastycznie */
.am-wrapper{
  height: min(900px, calc(100dvh - 40px));
  margin: 16px auto;
}

/* Bezpieczne odstępy na mniejszych ekranach */
@media (max-width: 1024px){
  .am-wrapper{
    max-width: 100%;
    border-radius: 0;
    margin: 0;
    height: 100dvh;
  }
}

/* =========================================================
   TABLET (<= 1024px)
   ========================================================= */
@media (max-width: 1024px){
  /* Header: mniej „ciasno” */
  .am-header{
    padding: 0 12px;
  }

  .am-logo{
    font-size: 18px;
  }

  /* Meta controls – zawijanie */
  .am-meta-controls{
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .am-dark-input, .am-dark-select, .am-tempo-wrapper{
    padding: 7px 10px;
    font-size: 13px;
  }

  /* Sidebar trochę węższy */
  .am-sidebar{
    width: 240px;
  }

  /* Toolbar: mniejsze odstępy, większe przyciski dotykowe */
  .am-toolbar{
    padding: 10px 12px;
    gap: 6px;
  }

  .tool-btn, .dur-btn{
    padding: 10px 12px;
    font-size: 13px;
  }

  /* Papier: mniej paddingu */
  .am-canvas-scroll{
    padding: 16px;
  }

  #am-paper{
    padding: 18px;
    min-width: 720px; /* nadal czytelne na tabletach */
  }

  /* Piano: trochę niższe */
  .am-piano-container{
    height: 150px;
    padding: 12px;
    gap: 12px;
  }

  .am-piano{
    height: 110px;
  }

  #piano-keys{
    height: 92px;
  }

  .key-wrap{
    width: 48px;
    height: 92px;
  }

  .key.kw{
    width: 48px;
    height: 92px;
  }

  .key.kb{
    width: 30px;
    height: 58px;
    left: 30px;
  }
}

/* =========================================================
   MOBILE (<= 768px)
   ========================================================= */
@media (max-width: 768px){
  /* Layout: sidebar pod spodem (stack) */
  .am-body{
    flex-direction: column;
  }

  .am-sidebar{
    width: 100%;
    border-right: none;
    border-top: 1px solid var(--border-color);
    order: 2;
    max-height: 36vh;
  }

  .am-editor{
    order: 1;
    min-height: 0;
  }

  /* Nagłówek: kompakt, ale czytelny */
  .am-header{
    height: auto;
    min-height: var(--am-header-h);
    padding: 10px 12px;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
  }

  .am-logo{
    font-size: 18px;
    width: 100%;
  }

  .am-meta-controls{
    width: 100%;
    justify-content: flex-start;
  }

  /* Toolbar: sticky na górze edytora (super na mobile) */
  .am-toolbar{
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 10px;
    gap: 6px;
  }

  .am-group{
    margin-right: 0;
    flex-wrap: wrap;
  }

  .tool-btn, .dur-btn{
    padding: 11px 12px;
    border-radius: 10px;
  }

  .sep{
    display: none; /* mniej bałaganu */
  }

  /* Papier: 100% szerokości, bez min-width */
  .am-canvas-scroll{
    padding: 10px;
  }

  #am-paper{
    width: 100%;
    min-width: 0 !important;
    padding: 12px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
  }

  /* SVG nut: skaluje się do kontenera */
  #am-paper svg{
    width: 100%;
    height: auto;
  }

  /* Piano: bardziej “mobile friendly” i przewijane */
  .am-piano-container{
    height: 140px;
    padding: 10px;
    gap: 10px;
    flex-wrap: nowrap;
  }

  .octave-btn{
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex-shrink: 0;
  }

  .am-piano{
    height: 110px;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Zabezpieczenie przed “ściskaniem” klawiszy */
  #piano-keys{
    min-width: 720px; /* pozwala przewijać klawiaturę */
    height: 92px;
  }

  .key-wrap{
    width: 46px;
    height: 92px;
  }

  .key.kw{
    width: 46px;
    height: 92px;
  }

  .key.kb{
    width: 28px;
    height: 56px;
    left: 28px;
  }

  /* Lista ścieżek: wygodniejsze kliknięcia */
  .track-list{
    padding: 10px;
  }

  .t-item{
    padding: 12px;
  }

  .t-name{
    font-size: 16px;
  }
}

/* =========================================================
   SMALL MOBILE (<= 420px)
   ========================================================= */
@media (max-width: 420px){
  .am-dark-input, .am-dark-select, .am-tempo-wrapper{
    width: 100%;
  }

  .tool-btn{
    flex: 1 1 auto;
    justify-content: center;
  }

  /* Piano jeszcze ciaśniej, ale czytelnie */
  #piano-keys{
    min-width: 760px;
  }
}

/* =========================================================
   Drobne UX poprawki (touch / scroll / tap highlight)
   ========================================================= */
@media (hover: none){
  .tool-btn:hover, .dur-btn:hover{
    transform: none;
  }
}

.am-piano,
.track-list,
.am-canvas-scroll{
  -webkit-tap-highlight-color: transparent;
}

/* Zapobiega rozjechaniu layoutu przy bardzo długich nazwach */
.t-name{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* =========================================================
   OFF-CANVAS SIDEBAR (TABLET + MOBILE)
   ========================================================= */

@media (max-width: 1024px){

  /* Body blokowany przy otwartym sidebarze */
  body.am-sidebar-open{
    overflow: hidden;
  }

  /* Sidebar jako off-canvas */
  .am-sidebar{
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: 280px;
    max-width: 85vw;
    z-index: 1001;
    background: var(--sidebar-bg);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 8px 0 25px rgba(0,0,0,0.2);
    border-right: none;
  }

  /* Widoczny sidebar */
  body.am-sidebar-open .am-sidebar{
    transform: translateX(0);
  }

  /* Overlay */
  .am-sidebar-overlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  body.am-sidebar-open .am-sidebar-overlay{
    opacity: 1;
    pointer-events: auto;
  }

  /* Editor zawsze full width */
  .am-body{
    flex-direction: column;
  }

  .am-editor{
    width: 100%;
  }

  /* Toolbar: przycisk Ścieżki widoczny */
  .am-toggle-sidebar{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
  }
}

/* Desktop – przycisk ukryty */
@media (min-width: 1025px){
  .am-toggle-sidebar{
    display: none;
  }
}

/* =========================================================
   WIĘCEJ MIEJSCA NA NUTY / MNIEJ NA KLAWIATURĘ
   ========================================================= */

/* Zmienne – łatwe do dalszego tuningu */
:root{
  --am-piano-h-desktop: 130px;
  --am-piano-h-mobile: 110px;
}

/* =========================
   DESKTOP
   ========================= */

.am-piano-container{
  height: var(--am-piano-h-desktop);
  padding: 10px;
}

.am-piano{
  height: 95px;
}

#piano-keys{
  height: 88px;
}

.key-wrap{
  height: 88px;
}

.key.kw{
  height: 88px;
}

.key.kb{
  height: 54px;
}

/* Editor zawsze rozciąga się maksymalnie */
.am-editor{
  min-height: 0;
}

/* Scroll nut ma priorytet */
.am-canvas-scroll{
  flex: 1 1 auto;
  min-height: 0;
  padding-bottom: 16px;
}

/* =========================
   TABLET
   ========================= */
@media (max-width: 1024px){
  .am-piano-container{
    height: 120px;
    padding: 8px;
  }

  .am-piano{
    height: 90px;
  }

  #piano-keys{
    height: 82px;
  }

  .key-wrap,
  .key.kw{
    height: 82px;
  }

  .key.kb{
    height: 50px;
  }
}

/* =========================
   MOBILE
   ========================= */
@media (max-width: 768px){

  /* Nuty mają absolutny priorytet */
  .am-editor{
    flex: 1 1 auto;
  }

  .am-canvas-scroll{
    padding: 8px;
  }

  /* Pianino mniejsze, ale nadal używalne */
  .am-piano-container{
    height: var(--am-piano-h-mobile);
    padding: 6px;
  }

  .am-piano{
    height: 85px;
  }

  #piano-keys{
    height: 78px;
    min-width: 720px;
  }

  .key-wrap,
  .key.kw{
    height: 78px;
  }

  .key.kb{
    height: 46px;
    left: 26px;
  }
}

/* =========================
   MAŁE TELEFONY
   ========================= */
@media (max-width: 420px){
  .am-piano-container{
    height: 100px;
  }

  .am-piano{
    height: 78px;
  }

  #piano-keys{
    height: 72px;
    min-width: 760px;
  }

  .key-wrap,
  .key.kw{
    height: 72px;
  }

  .key.kb{
    height: 42px;
  }
}

/* =========================================================
   PRZYCISK "ŚCIEŻKI" W HEADERZE – RESPONSYWNIE
   ========================================================= */

/* Domyślnie: ukryty wszędzie */
.am-header .am-toggle-sidebar{
    display: none !important;
}

/* Telefony + małe tablety */
@media (max-width: 900px){
    .am-header .am-toggle-sidebar{
        display: inline-flex !important;
        align-items: center;
        gap: 6px;
        margin-right: 10px;
        white-space: nowrap;
    }
}
