:root {
  color-scheme: light dark;
  --accent: #1db9c3;
  --accent2: #9d8cf1;
  --accent3: #e0a548;
  --bg: #0f1115;
  --panel: #171a21;
  --text: #eef1f5;
  --muted: #9aa4b2;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  padding: 2rem 1.5rem 1rem;
  text-align: center;
}

header h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.02em;
}

.tagline {
  color: var(--muted);
  margin: 0.3rem 0 0;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

#trip-form {
  background: var(--panel);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}

.checkbox-field input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  font-size: 0.85rem;
  color: var(--muted);
}

input[type="text"],
input[type="number"],
input[type="email"],
textarea {
  background: #0f1115;
  border: 1px solid #2a2f3a;
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  padding: 0.6rem 0.9rem;
  font-weight: 600;
}

#use-location {
  align-self: flex-start;
  background: #2a2f3a;
  color: var(--text);
}

#generate {
  background: var(--accent);
  color: #04252a;
  padding: 0.75rem;
}

#status {
  min-height: 1.4em;
  color: var(--muted);
  text-align: center;
}

#map {
  height: 320px;
  border-radius: 12px;
  margin: 1rem 0;
  overflow: hidden;
  display: none;
}

#timeline {
  position: relative;
  height: 64px;
  margin: 0.5rem 0 1.5rem;
  display: none;
}

#timeline .track {
  position: absolute;
  left: 0;
  right: 0;
  top: 28px;
  height: 2px;
  background: #2a2f3a;
}

#timeline .tick {
  position: absolute;
  top: 22px;
  width: 1px;
  height: 14px;
  background: #3a4150;
  transform: translateX(-50%);
}

#timeline .tick-label {
  position: absolute;
  top: 38px;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: var(--muted);
  white-space: nowrap;
}

#timeline .song-dot {
  position: absolute;
  top: 21px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  color: #04252a;
  font-size: 0.62rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(-50%);
  border: 2px solid var(--bg);
  cursor: default;
}

.music-note-marker {
  background: var(--accent);
  color: #04252a;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  border: 2px solid var(--bg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

#results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-height: 420px;
  overflow-y: auto;
}

#results.expanded {
  max-height: none;
  overflow-y: visible;
}

#show-full-playlist {
  display: none;
  width: 100%;
  margin-top: 0.7rem;
  background: #2a2f3a;
  color: var(--text);
}

#results li.active-row {
  outline: 2px solid var(--accent2);
  outline-offset: -1px;
}

#results li {
  background: var(--panel);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.stop-info .place {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stop-info .song {
  font-size: 1.05rem;
  margin-top: 0.15rem;
}

.stop-info .rationale {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 0.2rem;
}

#results li.gap-row {
  background: transparent;
  border: 1px dashed #2a2f3a;
  opacity: 0.7;
}

#results li.gap-row .song {
  color: var(--muted);
  font-style: italic;
}

#results li.filler-section-header {
  background: transparent;
  border: none;
  padding: 0.3rem 0.2rem 0;
  color: var(--accent2);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

#results li.filler-row {
  border-left: 3px solid var(--accent2);
}

#results li.filler-row .place {
  color: var(--accent2);
}

#results li.roadtrip-row {
  border-left: 3px solid var(--accent3);
}

#results li.roadtrip-row .place {
  color: var(--accent3);
}

#results .actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

#results .actions .upvote-btn {
  background: #2a2f3a;
  color: var(--text);
  font-size: 0.85rem;
  padding: 0.5rem 0.7rem;
  white-space: nowrap;
}

#launch-buttons-row {
  display: flex;
  gap: 0.8rem;
  margin: 1rem 0;
}

#launch-tidal-section {
  flex: 1;
  text-align: center;
}

#launch-tidal-btn {
  width: 100%;
  background: #000;
  color: #fff;
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(29, 185, 195, 0.35);
}

#launch-tidal-btn:hover {
  background: var(--accent);
  color: #04252a;
}

#launch-tidal-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

#launch-tidal-status {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

#launch-tidal-status a {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
}

#launch-spotify-section {
  flex: 1;
  text-align: center;
}

#launch-spotify-btn {
  width: 100%;
  background: #000;
  color: #fff;
  border: 2px solid #1DB954;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(29, 185, 84, 0.35);
}

#launch-spotify-btn:hover {
  background: #1DB954;
  color: #04250f;
}

#launch-spotify-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

#launch-spotify-status {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

#launch-spotify-status a {
  color: #1DB954;
  font-weight: 700;
  font-size: 0.95rem;
}

#browse-section,
#contact-section {
  margin-top: 2.5rem;
  border-top: 1px solid #2a2f3a;
  padding-top: 1.5rem;
}

#contact-section h2 {
  margin: 0 0 0.2rem;
  font-size: 1.3rem;
}

#contact-form {
  background: var(--panel);
  border-radius: 12px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

#contact-form button {
  background: var(--accent);
  color: #04252a;
  align-self: flex-start;
}

#contact-status {
  min-height: 1.2em;
  color: var(--muted);
  font-size: 0.85rem;
}

#browse-section h2 {
  margin: 0 0 0.2rem;
  font-size: 1.3rem;
}

.section-note {
  color: var(--muted);
  margin: 0 0 1rem;
  font-size: 0.85rem;
}

#add-song-form {
  background: var(--panel);
  border-radius: 12px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.field-row {
  display: flex;
  gap: 0.8rem;
}

.field-row .field {
  flex: 1;
}

#add-song-form button {
  background: var(--accent);
  color: #04252a;
  align-self: flex-start;
}

#browse-status {
  min-height: 1.2em;
  color: var(--muted);
  font-size: 0.85rem;
}


footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 1rem;
}
