.goal-song-suggest {
  margin-top: 16px;
  border: 1px solid var(--sep);
  border-radius: 12px;
  background: color-mix(in oklab, var(--card) 92%, #071326);
  padding: 14px;
}

.goal-song-suggest[hidden] {
  display: none !important;
}

.suggest-details-gate {
  margin-top: 14px;
}

.suggest-details-box {
  position: relative;
}

.suggest-details-gate.is-blocked textarea {
  cursor: not-allowed;
}

.suggest-details-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 74px;
  padding: 14px;
  border: 1px solid color-mix(in oklab, var(--accent) 36%, var(--sep));
  border-radius: 10px;
  background: color-mix(in oklab, var(--card) 88%, #071326);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 14%, transparent);
}

.suggest-details-overlay[hidden] {
  display: none !important;
}

.gsp-title-field {
  margin-bottom: 14px;
}

.gsp-title-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

/* ── Embedded YouTube player ──────────────────────────────────────────── */
.gsp-player-shell {
  display: grid;
  gap: 10px;
}

.gsp-yt-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--ring);
  border-radius: 12px;
  overflow: hidden;
  background: #020617;
}

.gsp-yt-frame iframe,
.gsp-yt-frame .gsp-yt-target {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.gsp-yt-cover {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  background: #020617;
}

.gsp-yt-cover[hidden] {
  display: none !important;
}

/* interactive timeline beneath the player: click to drop the clip, drag the
   filled region to slide it. Filled = chosen clip, line = playhead. */
.gsp-strip {
  position: relative;
  height: 24px;
  border: 1px solid var(--ring);
  border-radius: 8px;
  overflow: hidden;
  background: color-mix(in oklab, var(--card) 80%, #14213d);
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.gsp-strip.is-dragging {
  cursor: grabbing;
}

.gsp-strip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.gsp-strip-sel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: color-mix(in oklab, var(--accent) 50%, transparent);
  border-left: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 30%, transparent);
  cursor: grab;
}

.gsp-strip.is-dragging .gsp-strip-sel {
  cursor: grabbing;
}

.gsp-strip-head {
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 0;
  width: 2px;
  background: var(--text);
  box-shadow: 0 0 6px color-mix(in oklab, var(--text) 55%, transparent);
  pointer-events: none;
}

.gsp-title-input[readonly] {
  background: color-mix(in oklab, var(--card) 86%, #0b1830);
  color: var(--text);
  cursor: default;
  opacity: .92;
}

.gsp-transport {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.gsp-transport .hex-apply[disabled] {
  opacity: .5;
  cursor: not-allowed;
}

.gsp-key-hint {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.gsp-length-control {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) 92px auto;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.gsp-length-control .goal-music-label {
  margin: 0;
  white-space: nowrap;
}

.gsp-length-range {
  width: 100%;
  accent-color: var(--accent);
}

.gsp-length-number {
  min-width: 0;
  padding: 7px 9px;
}

.gsp-length-readout {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.gsp-status {
  margin-top: 6px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px dashed color-mix(in oklab, var(--accent) 45%, transparent);
  background: color-mix(in oklab, var(--accent) 10%, transparent);
  color: var(--text);
  font-size: 13px;
}

.gsp-status.is-error {
  border-style: solid;
  border-color: rgba(255, 77, 79, .55);
  background: rgba(255, 77, 79, .12);
  color: #ffdede;
}

.gsp-meta {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.gsp-range {
  margin-left: auto;
}

[data-theme="light"] .goal-song-suggest {
  background: #f8fbff;
  border-color: #d0d9ef;
}

[data-theme="light"] .suggest-details-overlay {
  background: #f8fbff;
  border-color: #c7d4eb;
  color: #1b2444;
}

@media (prefers-color-scheme: light) {
  [data-theme="default"] .goal-song-suggest {
    background: #f8fbff;
    border-color: #d0d9ef;
  }
  [data-theme="default"] .suggest-details-overlay {
    background: #f8fbff;
    border-color: #c7d4eb;
    color: #1b2444;
  }
}

@media (max-width: 560px) {
  .gsp-range {
    width: 100%;
    margin-left: 0;
  }
  .gsp-transport .hex-apply {
    flex: 1 1 auto;
  }
}

/* ── Catalog goal-song / horn preview ─────────────────────────────────── */
.gcat-preview {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--ring);
  border-radius: 8px;
  background: color-mix(in oklab, var(--card) 84%, #14213d);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.gcat-preview:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(59, 169, 255, .08);
}

.gcat-preview:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.gcat-modal[hidden] { display: none !important; }

.gcat-modal {
  position: fixed;
  inset: 0;
  z-index: 6000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, .72);
}

.gcat-card {
  width: min(680px, 96vw);
  border: 1px solid var(--sep);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
  overflow: hidden;
}

.gcat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--sep);
}

.gcat-title {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gcat-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.gcat-close:hover { color: var(--text); }

.gcat-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #020617;
}

.gcat-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.gcat-overlay[hidden] { display: none !important; }

.gcat-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, .5);
}

.gcat-meta {
  padding: 12px 16px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  border-top: 1px solid var(--sep);
}
