* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: #111;
  color: #fff;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.controls {
  width: min(960px, 100%);
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
}

.controls input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #555;
  background-color: #1c1f2c;
  color: #f3f4f8;
}

.controls button {
  padding: 10px 14px;
  background: #5a6bff;
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
}

.controls button:disabled { opacity: 0.6; cursor: not-allowed; }

#status {
  width: min(960px, 100%);
  margin-bottom: 12px;
  color: #e9edf4;
  line-height: 1.3;
  font-size: 0.9rem;
}

#captionContainer {
  width: 90%;
  height: 30%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  padding: 10px;
}

#songwriters {
  width: min(960px, 100%);
  margin-bottom: 16px;
  font-size: 0.8rem;
  color: #b0b3ba;
  text-align: center;
}

#songwriters.error {
  color: #ffc1c1;
}

.cue {
  display: flex;
  flex-direction: row;
  gap: 8px;
  padding: 1% 14px;
  border-radius: 14px;
  backdrop-filter: blur(3px);
  align-items: flex-start;
}

.timestamp {
  font-size: 0.75rem;
  color: #888;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 4px;
}

.split {
  color: #ff6b6b;
  opacity: 50%;
  font-size: 0.9em;
  display: inline-block;
  transform: translateY(-2px);
  user-select: none;
}

.line-main {
  font-size: clamp(1.2rem, 2.1vw, 3.8rem);
  font-weight: 550;
  line-height: 1.2;
  color: #f0f2f9;
  text-align: left;
  word-wrap: break-word;
  white-space: pre-wrap;
  flex: 1;
}

.line-right .line-main { text-align: right; }

.subtext {
  font-size: clamp(0.75rem, 2vw, 1.4rem);
  opacity: 0.52;
  color: #d7d8e0;
  text-align: left;
  line-height: 1.2;
  font-weight: 500;
  margin-top: 2px;
}

.line-right .subtext { text-align: right; }

.cue.adlib .line-main {
  font-size: clamp(0.95rem, 2vw, 1.6rem);
  opacity: 0.75;
  color: #dcdfe8;
  font-weight: 500;
  transform: translateY(-16px);
}

.error { color: #ffc1c1; }

.annotation-tooltip {
  position: absolute;
  z-index: 1000;
  background: #1f1f3f;
  color: #fff;
  border: 1px solid #5a6bff;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}

.annotation-tooltip.hidden { display: none; }

.line-highlight {
  background: rgba(90, 107, 255, 0.2);
  border-left: 4px solid #5a6bff;
}

.annotation-range-highlight {
  background: rgba(255, 183, 77, 0.4);
  border-radius: 3px;
  cursor: pointer;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  z-index: 1100;
}

.modal.hidden { display: none; }

.modal-content {
  background: #1f1f2e;
  border-radius: 12px;
  border: 1px solid #444;
  padding: 18px;
  width: min(520px, 90vw);
  max-height: 90vh;
  overflow: auto;
}

.modal-content h2 { margin-top: 0; }

.form-group { margin-bottom: 12px; }

.form-group label { display: block; margin-bottom: 4px; font-weight: 600; }

.form-group select, .form-group textarea {
  width: 100%;
  border: 1px solid #555;
  border-radius: 8px;
  background: #121229;
  color: #eee;
  padding: 8px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.modal-actions button {
  background: #5a6bff;
  border: none;
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.modal-actions button.secondary {
  background: #383d60;
}

.exportSection {
    width: min(960px,100%);
    margin: 12px 0; 
    display: flex; 
    flex-direction: column; 
    gap: 6px;
}

.exportOutput {
    width: 100%;
    background: #121229;
    border: 1px solid #555;
    border-radius: 8px;
    color: #f3f4f8;
    padding: 10px;
}