/* ===================================================================
   Left column container (Insert + Edit Segment + Placeholders)
=================================================================== */
#left-col {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  margin: 0;
  padding: 52px 8px 52px 8px;
  box-sizing: border-box;
  height: 100vh;
}

/* Collapsible left-column window  -  glass panel */
.left-col-win {
  background: var(--glass-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--glass-border);
  border-radius: var(--win-radius);
  box-shadow: var(--glass-shadow);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  min-height: 0;
}
/* Liquid-glass shimmer on panel surface */
.left-col-win::after {
  content: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255,255,255,0.07);
  backdrop-filter: none;
  box-shadow: inset -8px -6px 0 -9px rgba(255,255,255,0.9),
              inset 0 -7px 0 -6px rgba(255,255,255,0.6);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

/* Owner 2026-09-29: panel titles ("Mojo M", "Dojo D", "Space caps"...) centred in their panel. A 3-column
   grid keeps the title truly centred while an extra control (Must Use count, bank Switch) sits at the right. */
.lcw-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 9px 13px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
}
.lcw-header:hover { background: rgba(255,255,255,0.35); }
.left-col-win.open > .lcw-header {
  border-bottom-color: var(--line);
}

.lcw-header > .lcw-title { grid-column: 2; text-align: center; }
.lcw-header > :not(.lcw-title) { grid-column: 3; justify-self: end; }
.lcw-title {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 600;
}
.lcw-arrow { display: none; }

.lcw-body {
  padding: 0 13px;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.28s ease, padding 0.28s ease;
  position: relative;
  z-index: 1;
}
.left-col-win.open .lcw-body {
  padding: 12px 13px;
  max-height: 70vh;
}
#vocab-panel.open .lcw-body {
  padding: 0;
  max-height: none;
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Vocab panel uses same collapsible style but in right column */
#vocab-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#vocab-panel .lcw-body {
  flex: 1;
  overflow-y: auto;
}

/* Studio panel: row 2 only now, margins on both sides */
#studio-panel {
  grid-row: 1;  align-self: stretch;
  min-height: 0;
}

/* Composition banner as its own floating panel  -  glass */
#comp-panel {
  background: var(--glass-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: var(--glass-shadow);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  margin-top: 0;
}
#comp-panel::after {
  content: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255,255,255,0.07);
  box-shadow: inset -8px -6px 0 -9px rgba(255,255,255,0.9),
              inset 0 -7px 0 -6px rgba(255,255,255,0.6);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

/* Segments floating panel  -  glass */
#segs-panel {
  background: var(--glass-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--glass-border);
  border-radius: var(--win-radius);
  box-shadow: var(--glass-shadow);
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
  position: relative;
}
#segments-list { padding-bottom: 52px; }
#segs-panel::after {
  content: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255,255,255,0.07);
  box-shadow: inset -8px -6px 0 -9px rgba(255,255,255,0.9),
              inset 0 -7px 0 -6px rgba(255,255,255,0.6);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.segs-panel-title {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 600;
  padding: 0;
  border-bottom: none;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* ── Height-aware left panels (owner 2026-09-29) ──────────────────────────────────────────────────────
   The column shares its height: a closed panel keeps only its header, an open one takes its content's height
   up to 45% of the column (its body then scrolls), and Mojo M takes everything left over (flex-basis 0: it
   never pushes the others). So wrapping up Absurdbank or Must Use hands the freed space straight to Mojo M
   instead of leaving it empty below fixed-height boxes.
   Id-scoped so it outranks the older per-panel body caps (30vh / 200px / 70vh) and min-heights. */
#left-col > .left-col-win { display: flex; flex-direction: column; flex: 0 0 auto; min-height: 0; }
#left-col > .left-col-win > .lcw-header { flex-shrink: 0; }
#left-col > .left-col-win.open { flex: 0 1 auto; max-height: 45%; }
#left-col > #mojo-panel.open { flex: 1 1 0; max-height: none; min-height: 140px; }
#left-col > :is(#mu-shelf-panel, #astrabank-panel, #mojo-panel).open > .lcw-body {
  max-height: none; flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin;
}
