* { box-sizing: border-box; }
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  background: #f5f5f5;
  color: #222;
}
.app-header {
  background: #2c3e50;
  color: #fff;
  padding: 16px 24px;
}
.app-header h1 { margin: 0 0 4px 0; font-size: 22px; }
.app-header p { margin: 0; opacity: 0.85; font-size: 14px; }
.app-main {
  display: flex;
  gap: 16px;
  padding: 16px;
  height: calc(100vh - 90px);
}
.panel {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.list-panel { flex: 2; }
.selected-panel { flex: 1; max-width: 360px; }
.list-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.list-toolbar input[type="search"] {
  flex: 1;
  min-width: 160px;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.list-toolbar button, .print-btn {
  padding: 6px 10px;
  border: 1px solid #2c3e50;
  background: #2c3e50;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
}
.list-toolbar button:hover, .print-btn:hover { background: #1a252f; }
.song-count { font-size: 12px; color: #666; margin-bottom: 6px; }
.song-list, .selected-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}
.song-item { border-bottom: 1px solid #eee; }
.section-header {
  list-style: none;
  margin: 8px 0 4px 0;
  padding: 0;
}
.section-toggle {
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  border: none;
  background: #e8edf3;
  color: #2c3e50;
  font-weight: bold;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
}
.section-toggle:hover { background: #dce4ee; }
.song-item label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  cursor: pointer;
}
.song-item label:hover { background: #f0f4f8; }
.song-item .code {
  font-weight: bold;
  color: #2c3e50;
  min-width: 44px;
}
.song-item .title { flex: 1; }
.match-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  color: #fff;
  margin-left: 6px;
  display: inline-block;
  white-space: nowrap;
  flex-shrink: 0;
  width: auto;
}
.match-badge.match-title { background: #2c3e50; }
.match-badge.match-lyrics { background: #8e44ad; }
.selected-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 2px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}
.remove-btn {
  border: none;
  background: transparent;
  color: #c0392b;
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
}
.selected-panel h2 { margin: 0 0 8px 0; font-size: 16px; }
.print-btn { width: 100%; margin-top: 12px; padding: 10px; font-size: 15px; }

/* Print area hidden on screen */
.print-area { display: none; }

/* Print styles */
@media print {
  body { background: #fff; }
  .app-header, .app-main { display: none !important; }
  .print-area {
    display: block !important;
    position: static;
  }
  .print-song { page-break-after: always; }
  .print-song:last-child { page-break-after: auto; }
  .print-title {
    font-size: 16px;
    margin: 0 0 8px 0;
    border-bottom: 1px solid #333;
    padding-bottom: 4px;
  }
  .print-code {
    font-size: 12px;
    color: #555;
    font-weight: normal;
  }
  .print-lines {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.25;
    white-space: pre;
  }
  .chords {
    margin: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    white-space: pre;
    color: #000;
    font-weight: bold;
  }
  .lyrics {
    margin: 0 0 2px 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    white-space: pre;
  }
  .blank-line { height: 8px; }
  .page-break { page-break-after: always; }
}
.drop-indicator {
  pointer-events: none;
  height: 3px;
  background: #2980b9;
  margin: 2px 0;
  border-radius: 2px;
  list-style: none;
}
.drag-handle { padding-right: 8px; cursor: grab; color: #888; }
.match-badge.match-section { background: #7f8c8d; }
.choices__list--multiple .choices__item { display: none !important; }
.choices__inner { min-height: 0 !important; padding: 2px 6px !important; font-size: 13px !important; height: auto !important; }
.choices__inner::before { content: "Select"; color: #555; margin-right: 4px; }
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal[hidden] { display: none; }
.modal-content {
  background: #fff;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
}
.modal-header h3 { margin: 0; }
.close-btn {
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}
.modal-body {
  padding: 12px 16px;
  overflow-y: auto;
  flex: 1;
}
.section-check-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.section-check-list li {
  padding: 4px 0;
}
.section-check-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #eee;
}
.modal-footer button {
  padding: 6px 12px;
  border: 1px solid #2c3e50;
  background: #2c3e50;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
}