/* Jam layout (new). Desktop and tablet only; phones keep the classic layout.
   Uses the app's theme variables so every appearance works. */
@media (min-width: 701px) {
  html.jam-b #practice .loop-panel { display: none; }
  html.jam-b #practice .fret-panel > .panel-heading {
    flex-wrap: wrap;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
  }
  /* Once scrolled past, the heading becomes a full-width toolbar fixed to the
     top of the window, aligned with the panel; a spacer keeps its place. */
  html.jam-b #practice .fret-panel > .panel-heading.jamb-stuck {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    margin: 0;
    padding: calc(10px + env(safe-area-inset-top, 0px)) var(--jamb-pr, 24px) 10px var(--jamb-pl, 24px);
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: 0 10px 24px -14px #000a;
  }
  html.jam-b #practice .fret-panel > .panel-heading.jamb-stuck h2 { display: none; }
  html.jam-b #practice .fret-panel > .panel-heading h2 { font-size: 1.15rem; margin: 2px 0 0; }
  html.jam-b .jamb-band { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-top: 10px; border-top: 1px solid var(--line); }
  html.jam-b .jamb-label { font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  html.jam-b #jambBand { min-height: 40px; font-size: .875rem; }
  html.jam-b .jamb-surprise { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px dashed var(--accent); background: transparent; color: var(--accent); font-size: .85rem; font-weight: 600; cursor: pointer; }
  html.jam-b .jamb-surprise:hover { background: var(--accent-soft); border-style: solid; }
  html.jam-b .jamb-surprise.is-rolling svg { animation: jamb-roll .45s ease-out; }
  @keyframes jamb-roll { from { transform: rotate(-200deg) scale(.7); } to { transform: none; } }
  html.jam-b .jamb-chip-wrap { position: relative; }
  html.jam-b .jamb-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); color: var(--text); font-size: .875rem; cursor: pointer; }
  html.jam-b .jamb-chip i { font-style: normal; font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
  html.jam-b .jamb-chip[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-soft); }
  html.jam-b .jamb-chip.is-off span:not(.jamb-caret) { color: var(--muted); }
  html.jam-b .jamb-caret { font-size: .7rem; color: var(--muted); }
  html.jam-b .jamb-pop { position: absolute; top: calc(100% + 8px); left: 0; z-index: 50; width: 320px; max-width: calc(100vw - 32px); max-height: min(70vh, 560px); overflow-y: auto; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); box-shadow: 0 18px 50px #0007; display: grid; gap: 14px; }
  html.jam-b .jamb-pop[hidden] { display: none; }
  html.jam-b .jamb-pop-right { left: auto; right: 0; }
  html.jam-b .jamb-pop > * { margin: 0; padding: 0; border: 0; min-width: 0; }
  html.jam-b .jamb-pop select { width: 100%; }
  html.jam-b .jamb-pop .saved-loops > summary { display: none; }
  html.jam-b .jamb-pop .saved-loops-body { padding: 0; }
  html.jam-b .jamb-switch { margin-left: auto; font-size: .82rem; color: var(--muted); }
  html.jam-b .jamb-switch:hover { color: var(--text); }
}
@media (prefers-reduced-motion: reduce) { html.jam-b .jamb-chip { transition: none; } html.jam-b .jamb-surprise.is-rolling svg { animation: none; } }
@media (max-width: 700px) { html.jam-b .jamb-band { display: none; } }
/* Shown only in the classic layout. */
.jam-layout-try { margin-left: auto; font-size: .82rem; color: var(--muted); }
.jam-layout-try:hover { color: var(--text); }
@media (max-width: 700px) { .jam-layout-try { display: none; } }

/* Band/arrangement above the loop; compact lead controls directly over the neck. */
@media(min-width:701px){
 html.jam-b .jamb-band{display:grid;grid-template-columns:minmax(295px,1.3fr) repeat(3,minmax(0,1fr));align-items:center;gap:10px}
 html.jam-b .jamb-band-choice{display:flex;align-items:center;gap:10px;min-width:0}
 html.jam-b #jambBand{min-width:0;width:150px;flex:1}
 html.jam-b .jamb-surprise{flex:none;white-space:nowrap;padding:0 10px}
 html.jam-b .jamb-band>.jamb-chip-wrap{min-width:0}
 html.jam-b .jamb-band .jamb-chip{display:flex;width:100%;min-width:0;white-space:nowrap}
 html.jam-b .jamb-chip i,html.jam-b .jamb-caret{flex:none}
 html.jam-b .jamb-chip [data-chip]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 html.jam-b .jamb-chip .jamb-caret{margin-left:auto}
 html.jam-b #practice .loop-arrangement{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;border-top:0;padding-top:0;margin:12px 0}
 html.jam-b #practice .arrangement-controls{min-width:0;flex-wrap:wrap}
 html.jam-b .jamb-saved{flex:none;margin-top:20px}
 html.jam-b .jamb-saved>.jamb-chip{white-space:nowrap}
 html.jam-b #practice .fret-panel .lead-view-tools.mode-lead-map{grid-template-columns:minmax(190px,230px) minmax(130px,165px) minmax(240px,320px);justify-content:start;gap:10px 16px;border-top:1px solid var(--line);padding-top:12px;margin:12px 0 4px}
 html.jam-b #practice .lead-view-tools select{min-height:38px;padding:7px 10px;font-size:.8rem}
 html.jam-b #practice .mode-lead-map #pentPositionControl{max-width:320px}
 html.jam-b .jamb-pop{position:fixed;inset:auto;right:auto;margin:0;z-index:200;max-width:calc(100vw - 24px);box-sizing:border-box;overscroll-behavior:contain}
 html.jam-b .jamb-pop input{min-width:0;max-width:100%}
 html.jam-b .jamb-pop .saved-loops-body{display:grid;gap:10px}
}
@media(min-width:701px) and (max-width:1150px){
 html.jam-b .jamb-band{grid-template-columns:repeat(3,minmax(0,1fr))}
 html.jam-b .jamb-band-choice{grid-column:1/-1}
 html.jam-b #jambBand{flex:none;width:165px}
 html.jam-b #practice .fret-panel .lead-view-tools.mode-lead-map{grid-template-columns:minmax(180px,1fr) minmax(120px,.7fr) minmax(220px,1.2fr)}
 html.jam-b #practice #loopChoices{flex-wrap:wrap}
 html.jam-b #practice .progression-field{flex-basis:200px;width:200px}
}
@media(max-width:700px){html.jam-b .jamb-saved{display:none}}
