/* The Harmony explorer (./explorer.js): the passage's chords as a timeline, the options of the one in
 * focus as a grid, in the dock. */

.hx {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 8px 12px 12px;
  overflow: auto;
  --changed: var(--rose);
  --try: #e0a84a;
}
.hx-empty {
  padding: 10px 2px;
  color: var(--muted);
  font-size: 12px;
}

/* The header: what and where, then the loop, Try each, and Use these chords. */
.hx-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hx-title {
  font: 600 18px var(--serif);
  color: var(--champagne);
  letter-spacing: 0.02em;
}
.hx-where {
  color: var(--muted);
  font-size: 12px;
  margin-right: 6px;
}
.hx-status {
  color: var(--muted);
  font: 11px var(--mono);
}
.hx-spacer {
  flex: 1;
}
.btn.hx-play.loading {
  opacity: 0.7;
}
.btn.hx-try.on {
  background: linear-gradient(180deg, #f3cf86 0%, #d79a3c 55%, #b8792a 100%);
  color: #2a1804;
}
.btn.hx-use:not(.ghost) {
  background: var(--metal);
  color: #251a06;
  border-color: rgba(255, 230, 160, 0.7);
}

/* The timeline: the way in, then a block a chord as long as it lasts. */
.hx-line {
  position: relative;
  display: flex;
  gap: 4px;
  min-height: 74px;
  flex: none;
}
.hx-block {
  position: relative;
  flex: 1 1 0;
  min-width: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: var(--lacquer-hi);
  box-shadow: var(--inset);
  cursor: pointer;
  user-select: none;
}
.hx-block:hover {
  border-color: var(--line-3);
}
.hx-block.lead {
  cursor: default;
  opacity: 0.5;
  border-style: dashed;
  background: transparent;
}
.hx-chord {
  font: 700 22px/1.1 var(--serif);
  color: var(--ivory);
}
.hx-block.guessed .hx-chord {
  font-style: italic;
  color: var(--champagne);
}
.hx-roman {
  font: 12px var(--serif);
  color: var(--muted);
  letter-spacing: 0.04em;
}
.hx-bar {
  position: absolute;
  top: 4px;
  left: 10px;
  font: 9px var(--mono);
  color: var(--dim);
}
.hx-block .hx-chord {
  margin-top: 8px;
}
.hx-block.changed {
  border-color: var(--changed);
}
.hx-block.changed .hx-chord {
  color: #f3c6cc;
}
.hx-block.focus {
  border-color: var(--gold);
  box-shadow: var(--inset), var(--glow);
}
.hx-block.trying {
  border-color: var(--try);
  box-shadow:
    var(--inset),
    0 0 18px rgba(224, 168, 74, 0.45);
}
.hx-block.locked {
  background: repeating-linear-gradient(135deg, rgba(255, 240, 210, 0.03) 0 6px, transparent 6px 12px), var(--lacquer-hi);
}
.hx-lock {
  position: absolute;
  top: 2px;
  right: 2px;
  opacity: 0;
}
.hx-block:hover .hx-lock,
.hx-lock.on {
  opacity: 1;
}
.hx-lock.on {
  color: var(--gold);
}
/* A chord's tools, shown on hover and on the chord in focus: split it (bottom right), merge it with
 * the next (on the seam between the two). */
.hx-tool {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--lacquer);
  color: var(--champagne);
  font: 12px/1 var(--sans);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s;
}
.hx-tool:hover,
.hx-tool:focus-visible {
  border-color: var(--gold);
  color: var(--gold-hi);
}
.hx-block:hover .hx-tool,
.hx-block.focus .hx-tool,
.hx-tool:focus-visible {
  opacity: 1;
}
.hx-split {
  bottom: 3px;
  right: 3px;
}
.hx-merge {
  top: 50%;
  right: -13px;
  transform: translateY(-50%);
  border-radius: 50%;
}
@media (hover: none) {
  .hx-block.focus .hx-tool {
    opacity: 1;
  }
}
.hx-playhead {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  margin-left: -1px;
  background: var(--gold-hi);
  box-shadow: 0 0 8px rgba(245, 226, 166, 0.8);
  pointer-events: none;
}

/* Try each's trail: the levels chosen, the one going on, its keys. */
.hx-trail {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
}
.hx-crumb {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--champagne);
  font: inherit;
}
button.hx-crumb {
  cursor: pointer;
}
.hx-crumb.cur {
  border-color: var(--try);
  color: var(--try);
  font-weight: 700;
}
.hx-sep {
  color: var(--dim);
}
.hx-keys {
  color: var(--dim);
  font-size: 11px;
  margin: 0 6px;
}

/* The filters. */
.hx-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.hx-kinds {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.hx-chip {
  min-width: 30px;
  height: 24px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--muted);
  font: 600 12px var(--serif);
  cursor: pointer;
}
.hx-chip:hover {
  color: var(--gold-hi);
  border-color: var(--line-3);
}
.hx-chip.on {
  background: var(--metal);
  color: #251a06;
  border-color: transparent;
}
.hx-chip.wide {
  font: 600 11px var(--sans);
}
.text-input.hx-type {
  width: 230px;
}

/* The grid: a row a root, a column a kind. */
.hx-grid {
  display: grid;
  grid-template-columns: 30px 34px repeat(var(--cols), minmax(48px, 96px));
  justify-content: start;
  gap: 3px;
  align-items: stretch;
}
.hx-gh {
  font: 600 11px var(--serif);
  color: var(--muted);
  text-align: center;
  padding: 2px 0;
}
.hx-deg,
.hx-root {
  display: flex;
  align-items: center;
  font: 12px var(--serif);
  color: var(--dim);
}
.hx-root {
  font-weight: 700;
  font-size: 14px;
}
.hx-deg.in,
.hx-root.in {
  color: var(--champagne);
}
.hx-cell {
  height: 26px;
  padding: 0 4px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: rgba(255, 240, 210, 0.025);
  color: var(--muted);
  font: 600 13px var(--serif);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.hx-cell.in {
  color: var(--ivory);
  background: rgba(212, 175, 55, 0.08);
}
.hx-cell:hover:not(.off) {
  border-color: var(--line-3);
  color: var(--gold-hi);
}
.hx-cell.off {
  color: var(--dim);
  background: transparent;
  cursor: default;
}
.hx-cell.queued {
  border-color: rgba(224, 168, 74, 0.45);
}
.hx-cell.orig {
  box-shadow: inset 0 -2px 0 var(--changed);
}
.hx-cell.cur {
  background: var(--metal);
  color: #251a06;
  border-color: transparent;
}

/* Phase 2: the loop's controls, the block's edit, the saved progressions, Suggested. */
.hx-with,
.hx-style {
  max-width: 150px;
}
.btn.hx-tight.on {
  background: var(--metal);
  color: #251a06;
}
.btn.hx-song.on {
  background: var(--metal);
  color: #251a06;
}
.hx-saved {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.hx-saved-l {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-right: 4px;
}
.hx-layout {
  display: flex;
  gap: 2px;
  margin-right: 6px;
}
.hx-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.hx-tab {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--muted);
  font: 600 12px var(--sans);
  cursor: pointer;
}
.hx-tab.on {
  background: var(--metal);
  color: #251a06;
  border-color: transparent;
}
.hx-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 760px;
}
.hx-opt {
  display: grid;
  grid-template-columns: 96px 44px 1fr auto 44px 24px;
  align-items: center;
  gap: 8px;
  padding: 2px 6px;
  border-radius: 6px;
}
.hx-opt:hover {
  background: rgba(212, 175, 55, 0.06);
}
.hx-opt.cur .hx-opt-chord {
  background: var(--metal);
  color: #251a06;
}
.hx-opt.playing {
  box-shadow: inset 0 0 0 1px var(--try);
}
.hx-opt-chord {
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: rgba(212, 175, 55, 0.08);
  color: var(--ivory);
  font: 600 14px var(--serif);
  cursor: pointer;
}
.hx-why {
  color: var(--muted);
  font-size: 12px;
}
.hx-why.tab {
  color: var(--dim);
  font-size: 11px;
}
.hx-fit {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--gold);
}
.hx-star {
  border: none;
  background: transparent;
  color: var(--dim);
  font-size: 15px;
  cursor: pointer;
}
.hx-star.on {
  color: var(--gold-hi);
}
/* The melody's fit on the grid's cells: a line under them, gold to rose. */
.hx-cell.fit3 {
  box-shadow: inset 0 -2px 0 rgba(70, 165, 139, 0.75);
}
.hx-cell.fit2 {
  box-shadow: inset 0 -2px 0 rgba(224, 168, 74, 0.6);
}
.hx-cell.fit1 {
  box-shadow: inset 0 -2px 0 rgba(208, 138, 147, 0.6);
}
.hx-cell.starred::after {
  content: " ★";
  color: var(--gold-hi);
  font-size: 10px;
}
