/* The song sheet's action bar (Edit, Notes, Organize): the first thing in the chart body, scrolling away with the chart.
   Deliberately not a row of buttons: quiet text links in the muted ink with a small icon each, no border or fill at
   rest, an underline and a tint on hover and focus, one hairline beneath. Notes on = teal text and a small dot. */
.chart-action-bar {
  /* The same column and side padding as the chart sheet below it (performance-surface width, chart-sheet padding),
     so the row and the Organize panel line up with the chart's content, not the sheet's edge. */
  width: min(84rem, 100%);
  margin: 0 auto 10px;
  padding-inline: clamp(1rem, 3vw, 2rem);
  box-sizing: border-box;
}

.chart-action-bar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 28px;
  padding: 2px 4px 4px;
  border-bottom: 1px solid var(--hairline);
}

.chart-action {
  display: inline-flex;
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font: 600 0.9rem/1 var(--font-ui);
  align-items: center;
  gap: 7px;
  text-decoration: none;
  cursor: pointer;
}

.chart-action .details-ic {
  color: inherit;
  flex: none;
}

.chart-action:hover,
.chart-action:focus-visible {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.chart-action[aria-pressed="true"],
.chart-action[aria-expanded="true"] {
  color: var(--selected-ink);
}

.chart-action__dot {
  display: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--selected-line);
  color: currentColor; /* a dot with no text: no text-on-fill pair to check */
}

.chart-action[aria-pressed="true"] .chart-action__dot {
  display: inline-block;
}

/* The inline Organize panel: plain tick-box lists under the hairline. */
.chart-organize[hidden] {
  display: none;
}

.chart-organize__body {
  display: grid;
  gap: 12px 32px;
  padding: 10px 4px 6px;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  border-bottom: 1px solid var(--hairline);
}

.chart-organize__heading {
  margin: 0 0 4px;
  color: var(--muted);
  font: 700 0.75rem/1.2 var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chart-organize__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.chart-organize__form {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
}

.chart-organize__form label {
  color: var(--ink);
  font: 500 0.95rem/1.3 var(--font-ui);
}

.chart-organize__owner,
.chart-organize__empty {
  color: var(--muted);
  font: 400 0.85rem/1.3 var(--font-ui);
}

.chart-organize__new,
.chart-organize__copy-row {
  align-items: center;
  display: flex;
  gap: .5rem;
  justify-content: space-between;
  margin-top: .65rem;
}

.chart-organize__new input {
  min-width: 0;
}

.chart-organize__alert {
  margin: 0;
  color: var(--ink);
  font: 600 0.9rem/1.3 var(--font-ui);
  grid-column: 1 / -1;
}

/* A phone keeps the words (Edit, Notes, Organize) beside their small icons; only the spacing tightens. Three short
   words fit at 390px with the 44px hit areas. */
@media screen and (max-width: 24.5rem) {
  .chart-action-bar__row {
    gap: 4px 14px;
    justify-content: space-between;
  }

  .chart-action {
    min-width: 44px;
    gap: 5px;
  }

  .chart-action .details-ic {
    width: 14px;
    height: 14px;
  }
}

@media print {
  .chart-action-bar {
    display: none !important;
  }
}
