body {
  overflow: auto;
}

.pageMain--search {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel {
  border: 1px solid rgba(255, 255, 255, .10);
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .03));
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
  overflow: hidden;
}

.panelHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.panelHead h2 {
  margin: 0;
  font-size: 18px;
}

.panelSub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.panelBody {
  padding: 18px;
}

.advancedSearchForm {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: flex-end;
}

.searchField {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
}

.searchField--compact {
  flex: 0 0 auto;
}

.searchField--compact input,
.searchField--compact select {
  min-width: 80px;
  max-width: 110px;
}

.searchField label {
  font-size: 14px;
  opacity: 0.75;
  color: var(--muted);
  font-weight: 600;
}

.searchWrap--field {
  width: 100%;
}

.searchField input[type="search"],
.searchField input[type="number"],
.searchField select {
  width: auto;
  min-width: 110px;
  max-width: 180px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
}

/* Make main search fields wider */
#memberSearchInput,
#tuneSearchInput {
  min-width: 180px;
  max-width: 240px;
}

.searchField select option {
  color: #111827;
}

.searchField input:focus,
.searchField select:focus {
  outline: none;
  border-color: rgba(96, 165, 250, .75);
  background: rgba(255, 255, 255, .07);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, .16);
}

.searchActions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
}

#searchBtn,
#resetBtn {
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  font-weight: 600;
  border: 1px solid var(--stroke);
  cursor: pointer;
}

#searchBtn {
  background: rgba(96, 165, 250, .18);
  border-color: rgba(96, 165, 250, .35);
  color: var(--text);
}

#resetBtn {
  background: rgba(255, 255, 255, .06);
  color: var(--text);
}

#searchBtn:hover {
  background: rgba(96, 165, 250, .26);
  border-color: rgba(96, 165, 250, .55);
}

#resetBtn:hover {
  background: rgba(255, 255, 255, .12);
}

.summaryBadges--filters {
  justify-content: flex-end;
}

.summaryBadges--filters .pill {
  font-size: 11px;
}

.panelBody--results {
  padding-top: 12px;
}

.resultsList {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.resultCard {
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .04);
  border-radius: 14px;
  overflow: hidden;
}

.resultHead {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  align-items: flex-start;
}

.resultTitle {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.resultMeta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.resultBadges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.resultBadges .pill,
.tunePill,
.patternPill,
.memberLink {
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  text-decoration: none;
}

.memberLink:hover {
  background: rgba(96, 165, 250, .16);
  border-color: rgba(96, 165, 250, .28);
}

.resultToggle {
  width: 100%;
  text-align: left;
  padding: 0 16px 14px;
  border: 0;
  background: transparent;
  color: #93c5fd;
  cursor: pointer;
  font-weight: 600;
}

.resultToggle:hover {
  color: #bfdbfe;
}

.resultDetails {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.resultCard.is-open .resultDetails {
  display: block;
}

.sequenceRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.sequenceLabel {
  width: 100%;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 2px;
}

.tunesRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tunePill {
  background: rgba(96, 165, 250, .10);
  border-color: rgba(96, 165, 250, .18);
}

.patternPill {
  background: rgba(255, 255, 255, .04);
}

.emptyState,
.errorState,
.loadingState {
  padding: 10px 0;
}

html,
body {
  height: 100%;
}

body {
  overflow-y: auto;
}

.pageMain--search {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow: visible;
}

.panel {
  overflow: visible;
}

.panelBody,
.panelBody--results {
  min-height: 0;
  overflow: visible;
}

.resultsList {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: visible;
}

.resultCard {
  overflow: visible;
}



@media (max-width: 700px) {}

.panelHead,
.resultHead {
  flex-direction: column;
}

.summaryBadges--filters,
.resultBadges {
  justify-content: flex-start;
}

.panelBody,
.panelHead {
  padding-left: 14px;
  padding-right: 14px;
}

.searchField--slider {
  min-width: 170px;
}

.rangeWrap {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
}

#limitInput[type="range"] {
  width: 140px;
  min-width: 140px;
  max-width: 140px;
  height: auto;
  padding: 0;
  accent-color: #60a5fa;
  background: transparent;
  border: 0;
  box-shadow: none;
}

#limitInput[type="range"]:focus {
  outline: none;
  box-shadow: none;
}

.rangeValue {
  min-width: 28px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.searchField--wide {
  min-width: 260px;
  flex: 1 1 260px;
}

.searchField--wide input,
.searchField--wide .searchWrap--field {
  width: 100%;
}

.searchField--wide .autocompleteShell {
  min-width: 0;
}

.searchActions {
  margin-left: auto;
}

.resultsList {
  gap: 10px;
}

.resultCard {
  padding: 14px 16px;
  border-radius: 12px;
}

.resultHead {
  display: block;
  padding: 0;
}

.resultTitle {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  font-weight: 600;
}

.resultMeta {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.resultTitle .tuneItem {
  white-space: normal;
}

.resultTitle .arrowSep {
  opacity: 0.7;
}

.resultTitle .tuneName {
  font-weight: 700;
}

.resultTitle .tuneDetails {
  color: var(--muted);
  font-weight: 500;
}

.resultTitle .setLink,
.resultMeta .setLink {
  color: #93c5fd;
  text-decoration: none;
}

.resultTitle .setLink:hover,
.resultMeta .setLink:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .advancedSearchForm {
    align-items: stretch;
  }

  .searchField,
  .searchField--compact,
  .searchField--wide {
    flex: 1 1 calc(50% - 12px);
    min-width: 180px;
  }

  .searchActions {
    margin-left: 0;
  }
}

@media (max-width: 700px) {

  /* keep the two main text searches full width */
  .searchField--wide {
    flex: 1 1 100%;
    min-width: 100%;
  }

  /* let dropdown fields wrap naturally instead of taking the whole row */
  .searchField:not(.searchField--wide) {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
  }

  .searchField:not(.searchField--wide) select {
    width: auto;
    min-width: 0;
    max-width: 100%;
    inline-size: fit-content;
  }

  /* keep labels aligned nicely above compact selects */
  .searchField:not(.searchField--wide) label {
    width: fit-content;
    max-width: 100%;
  }

  .searchActions {
    flex: 1 1 100%;
    margin-left: 0;
  }

  .resultCard {
    padding: 12px 14px;
  }

  .resultTitle {
    font-size: 14px;
  }

  .searchField:not(.searchField--wide) select {
    padding-left: 10px;
    padding-right: 28px;
  }
}

.resultCard--simple .resultBody {
  padding: none;
}

.setSequenceBlock {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setSequenceNames,
.setSequenceMeta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  line-height: 1.45;
}

.setSequenceNames {
  font-size: 15px;
  font-weight: 600;
}

.setSequenceMeta {
  font-size: 13px;
  color: var(--muted);
}

.setTuneChunk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.setTuneMetaChunk {
  display: inline-flex;
  align-items: center;
}

.setTuneLink {
  color: var(--text);
  text-decoration: none;
}

.setTuneLink:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.setSequenceArrow {
  color: var(--muted);
  opacity: 0.9;
  margin: 0 2px;
}

.sessionIconLink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  transition: all 0.15s ease;
  flex: 0 0 auto;
}

.sessionIconLink:hover {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.3);
  transform: translateY(-1px);
}

.sessionIconLink img {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
}

.trackOverviewLink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
  flex: 0 0 auto;
}

.trackOverviewDot {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #fde68a, #f59e0b);
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.5),
    0 0 6px rgba(245, 158, 11, 0.6);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.trackOverviewLink:hover .trackOverviewDot {
  transform: scale(1.2);
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.7),
    0 0 10px rgba(245, 158, 11, 0.9);
}

.setMetaRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.setMetaText {
  color: var(--muted);
}

.setMetaActions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.setMetaAction {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #93c5fd;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  transition: all 0.15s ease;
}

.setMetaAction:hover {
  background: rgba(96, 165, 250, 0.14);
  border-color: rgba(96, 165, 250, 0.28);
  color: var(--text);
}

.labelWithInfo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.infoIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  cursor: help;
  position: relative;
}

.infoIcon:hover {
  color: #93c5fd;
  background: rgba(96, 165, 250, 0.15);
}

/* tooltip */
.infoIcon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  max-width: 280px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 50;
}

.infoIcon:hover::after,
.infoIcon:focus::after {
  opacity: 1;
}

.setStackTooltip {
  position: absolute;
  z-index: 200;
  width: 320px;
  max-width: min(320px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(17, 24, 39, 0.98);
  color: var(--text);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  pointer-events: none;
}

.setStackTooltipTitle {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
}

.setStackTooltipBody {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setStackTooltipItem {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setStackTooltipHead {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.setStackTooltipTune {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.setStackTooltipMeta {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.setStackTooltipRender {
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  overflow: visible;
  color: #111;
}

.setStackTooltipRender svg {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-width: 100%;
  overflow: visible;
}

.setStackTooltipRender svg text {
  fill: #111 !important;
}

.setStackTooltipRender .abcjs-staff,
.setStackTooltipRender .abcjs-bar,
.setStackTooltipRender .abcjs-note,
.setStackTooltipRender .abcjs-ledger,
.setStackTooltipRender .abcjs-clef,
.setStackTooltipRender .abcjs-key-signature,
.setStackTooltipRender .abcjs-time-signature {
  stroke: #111 !important;
  fill: #111 !important;
}

#tunebookMatchSelect,
#popularitySelect,
#sortSelect {
  min-width: 170px;
}

/* Force dark dropdowns */

.searchField select,
.searchField select option {
  background-color: #111827;
  /* dark panel */
  color: #e5e7eb;
  /* light text */
}

/* Fix for dropdown panel in Chromium browsers */
.searchField select:focus,
.searchField select:active {
  background-color: #111827;
  color: #e5e7eb;
}

/* Improve hover/selected option (Chrome/Edge only) */
.searchField select option:hover,
.searchField select option:checked {
  background-color: #1f2937;
  color: #fff;
}