/* Basic reset */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #ddd;
}

h1 {
  font-size: 18px;
  margin: 0;
}

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

.controls label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 14px;
}

button {
  padding: 6px 10px;
  border: 1px solid #bbb;
  background: #f8f8f8;
  cursor: pointer;
  border-radius: 8px;
}
button:hover { filter: brightness(0.98); }
button:active { filter: brightness(0.95); }

main { padding: 12px 16px; }

.roll-wrapper {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0;
  align-items: start;
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 10px;
}

.note-labels {
  display: grid;
  grid-auto-rows: 28px;
  border-right: 1px solid #ddd;
  background: #fafafa;
}

.note {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8px;
  border-bottom: 1px solid #eee;
  font-size: 12px;
  user-select: none;
  height: 28px;
}

.grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(16, minmax(30px, 1fr));
  grid-auto-rows: 28px;
}

.cell {
  border-bottom: 1px solid #eee;
  border-right: 1px solid #f0f0f0;
  height: 28px;
  cursor: pointer;
  outline: none;
  position: relative;
  background: white;
}

.cell:nth-child(odd).row-shade { background: #fcfcfc; }

.cell.active {
  background: #d7f0ff;
  box-shadow: inset 0 0 0 2px #8fd0ff;
}

.cell:focus-visible {
  outline: 2px solid #66aaff;
  outline-offset: -2px;
}

.playhead {
  pointer-events: none;
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ff5b5b;
  opacity: 0.8;
  transform: translateX(0);
}

footer {
  padding: 12px 16px;
  color: #666;
}
