/* Music page (music.org, generated by scripts/update_music.py).
   Follows the site look: serif text from style.css, uppercase headings,
   light boxes with a blue left border like .last-update. The only extra
   colours are the seven genre families. */
#music-page {
  --m-ink: #333;
  --m-ink-2: #555;
  --m-muted: #888;
  --m-line: #e6e6e6;
  --m-box: #f9f9f9;
  --m-link: #009;
  --m-accent: #007acc;
  --c-rock: #2a78d6; --c-latino: #eb6834; --c-hiphop: #1baf7a; --c-pop: #eda100;
  --c-ritmos: #e87ba4; --c-autor: #008300; --c-punk: #4a3aa7; --c-none: #a3a7b0;
  --m-sans: Arial, sans-serif;
  color: var(--m-ink);
}
#music-page h2 { margin-top: 1.8em; }
#music-page h3 { margin: 0; font-size: 1em; color: #2b2b2b; }
#music-page button, #music-page input, #music-page select { font-family: var(--m-sans); }

/* now playing */
.np { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; margin: 1.2em 0; padding: 10px 14px;
      background: var(--m-box); border-left: 4px solid var(--m-accent); border-radius: 5px; box-shadow: 0 1px 3px rgb(0 0 0 / .1); min-height: 84px; }
.np img, .np .np-ph { width: 64px; height: 64px; border-radius: 4px; object-fit: cover; background: var(--m-line); display: block; }
.np-label { font-family: var(--m-sans); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--m-muted); display: flex; align-items: center; gap: 7px; }
.np-live { width: 8px; height: 8px; border-radius: 50%; background: #0ca30c; animation: np-pulse 1.6s ease-in-out infinite; }
@keyframes np-pulse { 50% { opacity: .25; } }
.np-track { font-size: 1.25em; font-weight: 700; color: #000; line-height: 1.25; margin-top: 2px; }
.np-artist { color: var(--m-ink-2); }

/* page layout: on wide screens the recommendation form sits in a sticky
   column on the right; on phones it comes right after "now playing" */
@media (min-width: 1000px) {
  /* Top block: intro + status on the left, the form on the right, both the same
     height. Everything below (genres, charts, songs) uses the full width. */
  #music-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "top side" "main main"; column-gap: 24px; }
  #music-page .m-top { grid-area: top; min-width: 0; }
  #music-page .m-main { grid-area: main; min-width: 0; }
  .m-side { grid-area: side; margin: 1em 0 1.2em; display: flex; flex-direction: column; }
  .m-rec { grid-template-columns: 1fr 1fr; }
  .m-rec .m-rec-suggest, .m-rec button, #m-rec-msg { grid-column: 1 / -1; }
  .m-rec-list { flex: 1 1 0; min-height: 70px; overflow-y: auto; }   /* the list scrolls instead of making the block taller */
  .m-side h2 { margin-top: 0; }
}
.m-side { padding: 14px; background: var(--m-box); border: 1px solid var(--m-line); border-left: 4px solid var(--m-accent); border-radius: 6px; box-shadow: 0 1px 3px rgb(0 0 0 / .1); }
#music-page .m-side h2 { font-size: 1.15em; margin: 0 0 .35em; }
.m-side p { font-size: .95em; text-align: left; margin: 0 0 .8em; }

/* recommend a song */
.m-rec { display: grid; gap: 10px; position: relative; }
.m-rec label { display: grid; gap: 4px; font-family: var(--m-sans); font-size: 13px; color: var(--m-ink-2); }
.m-rec label small { color: var(--m-muted); font-size: 11px; }
.m-rec input { font-size: 15px; padding: 8px 10px; border: 1px solid #ccc; border-radius: 5px; background: #fff; color: var(--m-ink); min-width: 0; }
.m-rec input:focus { outline: 2px solid var(--m-accent); outline-offset: 0; border-color: var(--m-accent); }
.m-rec-suggest { list-style: none; margin: -4px 0 0; padding: 4px; background: #fff; border: 1px solid #ccc; border-radius: 5px; box-shadow: 0 4px 12px rgb(0 0 0 / .08); }
.m-rec-suggest li { padding: 6px 8px; border-radius: 4px; cursor: pointer; font-size: .95em; }
.m-rec-suggest li:hover { background: #eef5fb; }
.m-rec-suggest li span { color: var(--m-ink-2); }
.m-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.m-rec button { justify-self: start; padding: 9px 18px; font-size: 14px; font-weight: 700; border: 0; border-radius: 5px; background: var(--m-accent); color: #fff; cursor: pointer; }
.m-rec button:disabled { opacity: .6; cursor: wait; }
#m-rec-msg { font-family: var(--m-sans); font-size: 13px; }
#m-rec-msg:empty { display: none; }
#m-rec-msg.ok { color: #006300; }
#m-rec-msg.err { color: #b02a2a; }
.m-rec-list { margin-top: 12px; }
.m-rec-head { font-family: var(--m-sans); font-size: 13px; color: var(--m-muted); margin: .4em 0; }
.m-rec-row { display: grid; grid-template-columns: 18px 1fr; gap: 6px; padding: 6px 0; border-top: 1px solid var(--m-line); font-size: .95em; }
.m-rec-note-icon { color: var(--m-accent); }
.m-rec-row b { color: #000; }
.m-rec-by { font-family: var(--m-sans); font-size: 12px; color: var(--m-muted); }

/* family chips */
.m-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 1em 0; }
.m-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 9px; border-radius: 999px; border: 1px solid #ccc;
          background: #fff; color: var(--m-ink); font-size: 13px; cursor: pointer; }
.m-chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--dot); }
.m-chip small { color: var(--m-muted); }
.m-chip[aria-pressed="true"] { background: #333; border-color: #333; color: #fff; }
.m-chip[aria-pressed="true"] small { color: #ddd; }

/* panels */
.m-panel { background: #fff; border: 1px solid var(--m-line); border-radius: 6px; box-shadow: 0 2px 5px rgb(0 0 0 / .06); }
.m-graph-box { overflow-x: auto; }
#m-graph { display: block; width: 100%; min-width: 620px; height: auto; }
#m-graph .edge { stroke: #c9cbd1; stroke-linecap: round; transition: opacity .15s; }
#m-graph .node circle { stroke: #fff; stroke-width: 2; cursor: pointer; }
#m-graph .node text { font-family: var(--m-sans); font-size: 11px; fill: var(--m-ink-2); paint-order: stroke; stroke: #fff; stroke-width: 3px; pointer-events: none; }
#m-graph .node.big text { font-weight: 700; fill: #000; font-size: 12.5px; }
#m-graph.dim .edge { opacity: .08; }
#m-graph.dim .node { opacity: .18; }
#m-graph.dim .edge.on { opacity: 1; stroke: #555; }
#m-graph.dim .node.on { opacity: 1; }
.m-note, .m-sub, .m-foot { font-family: var(--m-sans); font-size: 13px; color: var(--m-muted); }
.m-note { margin: 6px 2px 0; }

.m-trio { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; }
.m-card { padding: 16px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.m-sub { margin-top: -8px; }
.m-share { display: flex; gap: 2px; height: 24px; }
.m-share div { border-radius: 4px; min-width: 3px; }
.m-share-list { display: grid; grid-template-columns: auto 1fr auto auto; gap: 5px 10px; align-items: center; font-family: var(--m-sans); font-size: 13px; font-variant-numeric: tabular-nums; }
.m-share-list i { width: 10px; height: 10px; border-radius: 3px; background: var(--dot); }
.m-share-list .n { text-align: right; color: var(--m-ink-2); }
.m-share-list .pct { text-align: right; color: var(--m-muted); min-width: 3em; }
#m-decades text { font-family: var(--m-sans); font-size: 11px; fill: var(--m-muted); }
.m-bars { display: grid; gap: 7px; font-family: var(--m-sans); font-size: 13px; }
.m-bar { display: grid; grid-template-columns: 105px 1fr 2.2em; gap: 10px; align-items: center; }
.m-bar span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-bar .fill { display: block; height: 12px; border-radius: 0 4px 4px 0; background: var(--m-accent); }
.m-bar .n { text-align: right; color: var(--m-ink-2); font-variant-numeric: tabular-nums; }

/* artists */
.m-artists { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.m-artist { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; padding: 8px; text-align: left;
            border: 1px solid var(--m-line); border-radius: 6px; background: #fff; cursor: pointer; color: inherit; font: inherit; }
.m-artist:hover { border-color: #bbb; }
.m-artist img, .m-artist .ph { width: 52px; height: 52px; border-radius: 4px; object-fit: cover; background: var(--m-line); }
.m-artist b { display: block; line-height: 1.2; color: #000; }
.m-artist small { font-family: var(--m-sans); font-size: 12px; color: var(--m-muted); }

/* song list */
.m-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 1em 0 .6em; }
.m-tools input, .m-tools select { font-size: 14px; padding: 8px 10px; border: 1px solid #ccc; border-radius: 5px; background: #fff; color: var(--m-ink); }
.m-tools input { flex: 1 1 220px; min-width: 0; }
.m-seg { display: inline-flex; border: 1px solid #ccc; border-radius: 5px; overflow: hidden; }
.m-seg button { padding: 8px 12px; border: 0; background: #fff; color: var(--m-ink-2); font-size: 13px; cursor: pointer; }
.m-seg button + button { border-left: 1px solid #ccc; }
.m-seg button[aria-pressed="true"] { background: #333; color: #fff; }
.m-status { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-family: var(--m-sans); font-size: 13px; color: var(--m-muted); min-height: 28px; }
.m-status button { font-size: 12px; border: 1px solid #ccc; background: #fff; border-radius: 999px; padding: 3px 10px; cursor: pointer; color: var(--m-ink-2); }
.m-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--m-line); }
.m-row img, .m-row .ph { width: 44px; height: 44px; border-radius: 4px; object-fit: cover; background: var(--m-line); display: grid; place-items: center; color: var(--m-muted); font-weight: 700; }
.m-row .main { min-width: 0; display: grid; }
.m-row .t { font-weight: 700; color: #000; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-row .m { color: var(--m-ink-2); font-size: .92em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-row .g { display: flex; flex-wrap: wrap; gap: 2px 10px; font-family: var(--m-sans); font-size: 12px; color: var(--m-muted); }
.m-row .g span { display: inline-flex; align-items: center; gap: 5px; }
.m-row .g i { width: 7px; height: 7px; border-radius: 50%; background: var(--dot); }
.m-row .side { display: flex; align-items: center; gap: 12px; font-family: var(--m-sans); font-size: 12px; color: var(--m-muted); text-align: right; }
.m-row .heart { color: #c0392b; font-size: 15px; }
.m-row a.sp { font-size: 12px; border: 1px solid #ccc; padding: 2px 8px; border-radius: 999px; color: var(--m-link); }
.m-empty { padding: 24px 2px; color: var(--m-muted); }
.m-foot { margin-top: 1.5em; }
@media (max-width: 560px) {
  .m-row { grid-template-columns: 40px minmax(0, 1fr); }
  .m-row .side { grid-column: 2; text-align: left; }
}

.m-tip { position: fixed; pointer-events: none; z-index: 2000; background: #222; color: #fff; font-family: Arial, sans-serif; font-size: 12.5px;
         padding: 7px 10px; border-radius: 5px; max-width: 260px; line-height: 1.35; }
.m-tip b { display: block; }
@media (prefers-reduced-motion: reduce) { .np-live { animation: none; } }
