* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1a1a1a;
  background: #f5f5f5;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: #2b3a4a;
  color: white;
  padding: 0.75rem 1.25rem;
}

.topbar h1 {
  margin: 0;
  font-size: 1.25rem;
}

.error-banner {
  background: #fdecea;
  color: #611a15;
  border-bottom: 1px solid #f5c6cb;
  padding: 0.75rem 1.25rem;
  white-space: pre-wrap;
  font-size: 0.9rem;
}

.hidden {
  display: none !important;
}

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 300px 1fr 300px;
  overflow: hidden;
}

.pane {
  overflow-y: auto;
  padding: 1rem;
}

.pane-left {
  border-right: 1px solid #ddd;
  background: white;
  display: flex;
  flex-direction: column;
}

.pane-center {
  background: #fafafa;
}

.pane-right {
  border-left: 1px solid #ddd;
  background: white;
  display: flex;
  flex-direction: column;
}

#search-input {
  padding: 0.5rem;
  font-size: 0.95rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.song-list, .setlist {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.song-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
}

.song-row:hover {
  background: #f0f4f8;
}

.song-row.selected {
  background: #dbe9fb;
}

.song-title {
  font-size: 0.9rem;
}

.song-verses {
  font-size: 0.75rem;
  color: #666;
}

.add-btn, .remove-btn {
  border: none;
  background: #2b3a4a;
  color: white;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.remove-btn {
  background: #a33;
}

.song-list-empty, .setlist-empty {
  color: #888;
  font-size: 0.85rem;
  padding: 0.5rem;
}

.preview-empty {
  color: #888;
}

.roadmap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}

.chip {
  background: #2b3a4a;
  color: white;
  border-radius: 12px;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
}

.preview-meta {
  color: #555;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.preview-warning {
  background: #fff3cd;
  border: 1px solid #ffeeba;
  color: #856404;
  padding: 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.preview-text {
  white-space: pre-wrap;
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 1rem;
}

.setlist-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  border-radius: 4px;
  background: #f7f9fb;
  margin-bottom: 0.4rem;
  cursor: grab;
}

.setlist-row.dragging {
  opacity: 0.4;
}

.setlist-row.selected {
  background: #dbe9fb;
}

.setlist-info {
  min-width: 0;
}

.setlist-title {
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setlist-verses {
  font-size: 0.75rem;
  color: #666;
}

.outputs {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 1rem 0;
  font-size: 0.9rem;
}

#generate-btn {
  padding: 0.6rem;
  font-size: 1rem;
  background: #2b7a4b;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#generate-btn:disabled {
  background: #aaa;
  cursor: not-allowed;
}

.fruitoflips-link {
  display: block;
  text-align: center;
  margin-top: 0.75rem;
  padding: 0.5rem;
  font-size: 0.85rem;
  color: #2b3a4a;
  border: 1px solid #2b3a4a;
  border-radius: 4px;
  text-decoration: none;
}

.fruitoflips-link:hover {
  background: #eef2f6;
}
