/* Screen and editor grid layout. Scrolling happens only inside the roll. */

#screen-start {
  height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 8vh 16px 16px;
}

.start-col {
  width: min(560px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-title {
  font-family: var(--font-mono);
  font-size: 42px;
  color: var(--accent);
  letter-spacing: 2px;
}

.app-subtitle { color: var(--text-dim); margin-top: -8px; }

.start-actions { display: flex; gap: 8px; margin: 12px 0; }

.start-recent-title { font-size: 14px; color: var(--text-dim); margin-top: 12px; }

/* the demos wrapper must reproduce the column's own gap, otherwise its
   heading sits tighter to its list than "Recent projects" does */
#demo-section { display: flex; flex-direction: column; gap: 12px; }

.start-hint { color: var(--text-dim); font-size: 12px; margin-top: 16px; }

/* ---- editor ---- */

#screen-editor {
  height: 100vh;
  display: grid;
  grid-template-areas:
    "toolbar toolbar toolbar"
    "tracks  roll    arp"
    "status  status  status";
  grid-template-rows: auto 1fr auto;
  grid-template-columns: auto 1fr auto;
}

#screen-editor[hidden] { display: none; }

#toolbar {
  grid-area: toolbar;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

#tracks-panel {
  grid-area: tracks;
  width: 200px;
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

#tracks-panel .track-list { overflow-y: auto; flex: 1; }

#tracks-panel.collapsed { width: 0 !important; border: none; }

#tools-panel {
  grid-area: arp;
  width: 230px;
  background: var(--bg-1);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* the scroll area sits DARKER than the cards it holds, so each card reads
   as its own box rather than dissolving into the panel */
#tools-panel .tool-scroll { overflow-y: auto; flex: 1; background: var(--bg-0); }

#tools-panel.collapsed { width: 0 !important; border: none; }

/* drag handles on the panels' inner edges */
.panel-resize {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 5px;
  cursor: col-resize;
  z-index: 10;
}
.panel-resize.right { right: -1px; }
.panel-resize.left { left: -1px; }
.panel-resize:hover { background: var(--accent-dim); opacity: 0.5; }
.collapsed .panel-resize { display: none; }

#status-bar {
  grid-area: status;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 10px;
  background: var(--bg-1);
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 12px;
  min-height: 26px;
}

.st-spacer { flex: 1; }

/* ---- roll area ---- */

#roll-area {
  grid-area: roll;
  position: relative;
  display: grid;
  grid-template-areas:
    "ccorner chords"
    "corner  ruler"
    "keys    roll"
    "acorner auto";
  grid-template-rows: 20px 28px 1fr 20px;
  grid-template-columns: 64px 1fr;
  overflow: hidden;
  background: var(--bg-0);
}

/* canvas attribute sizes must not become the row's min-content size -
   otherwise the 1fr roll row can't shrink when the automation lanes open */
#roll-viewport, #keys-canvas, #auto-canvas { min-height: 0; }
#roll-area.mono-mode { grid-template-rows: 20px 28px 1fr 0px; }
#roll-area.mono-mode #auto-corner,
#roll-area.mono-mode #auto-canvas { display: none; }

#auto-corner {
  grid-area: acorner;
  background: var(--bg-1);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.auto-lane-btn {
  color: var(--text-dim);
  font-size: 9px;
  text-align: left;
  padding: 0 4px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 3px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  white-space: nowrap;
}
.auto-lane-btn:hover { color: var(--text); background: var(--bg-2); }
.auto-lane-btn.expanded { color: var(--text); align-items: flex-start; padding-top: 3px; }
.auto-master-btn { font-weight: 600; font-size: 10px; }
.auto-dot { color: var(--accent); font-size: 7px; }

#auto-canvas {
  grid-area: auto;
  width: 100%;
  height: 100%;
}

#chords-corner {
  grid-area: ccorner;
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  user-select: none;
}

#chords-canvas {
  grid-area: chords;
  width: 100%;
  height: 20px;
}

#ruler-corner {
  grid-area: corner;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

#ruler-canvas {
  grid-area: ruler;
  width: 100%;
  height: 28px;
  cursor: pointer;
}

#keys-canvas {
  grid-area: keys;
  width: 64px;
  height: 100%;
  cursor: pointer;
}

#roll-viewport {
  grid-area: roll;
  position: relative;
  overflow: hidden;
}

#roll-viewport canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#overlay-canvas { outline: none; }

/* custom scrollbars */
.scrollbar {
  position: absolute;
  background: transparent;
  z-index: 5;
}
.scrollbar .thumb {
  position: absolute;
  background: var(--line-strong);
  border-radius: 4px;
  opacity: 0.7;
}
.scrollbar .thumb:hover { background: var(--text-dim); }
.scrollbar-h { left: 64px; right: 10px; bottom: 0; height: 8px; }
.scrollbar-h .thumb { top: 1px; height: 6px; }
.scrollbar-v { top: 48px; bottom: 10px; right: 0; width: 8px; }
.scrollbar-v .thumb { left: 1px; width: 6px; }
