/* The Mac app's design (mac.css), home: the chart list.

   The plan, to the macOS guidelines and design C:
   - Toolbar (52pt, as on every screen): the list's name as the window title
     (All charts, or the set's name, renamed in place) with its count under
     it; then what can be done to that list; + New chart, a pull-down menu
     (From a recording… ⌘N, Blank chart ⇧⌘N, Import…); the search field last.
   - Source list down the leading edge: Library › All charts, Setlists, each
     with its count, + New setlist at its foot. Right-click a set for View,
     Rename, Export, Delete.
   - The charts as a Mac table: star, Title, Artist, Tempo, Length (the
     recording's), sorted by clicking a heading (again to turn it round).
     Click picks a row out, double-click or Return opens it in Build, Space
     reads it, Delete deletes (in a set, takes it out); View and ⋯ show on
     hover; right-click has the rest. ⌘/shift-click starts Select.
   - A status bar under the table: the count and a word on what to do.
   - No charts: the two ways in, said plainly, in the middle. */

/* --- toolbar ------------------------------------------------------------- */
.drumchart-mac .mac-home-bar { flex-wrap: nowrap; }
.drumchart-mac .mac-home-doc { flex: 0 1 auto; max-width: 280px; }
.drumchart-mac .mac-home-doc input.mac-doc-title {
  min-width: 80px;
  width: 260px;
  max-width: 100%;
  margin: 0 0 0 -5px;
  padding: 1px 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}
.drumchart-mac .mac-home-doc input.mac-doc-title:hover { background: rgba(127, 127, 127, 0.14); }
.drumchart-mac .mac-home-doc input.mac-doc-title:focus { outline: 3px solid var(--accent-soft); background: var(--mac-control); }
.drumchart-mac .mac-home-space { flex: 1 1 auto; }
.drumchart-mac .mac-home-tools { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.drumchart-mac .mac-home-bar .btn { min-height: 28px; padding: 0 10px; font-size: 13px; }
.drumchart-mac .mac-home-bar .btn.icon-btn { min-width: 32px; padding: 0 7px; }
.drumchart-mac .mac-home-bar .btn.mac-tool { background: rgba(127, 127, 127, 0.14); box-shadow: none; }
.drumchart-mac .mac-home-bar .btn.mac-tool:hover:not(:disabled) { background: rgba(127, 127, 127, 0.26); }
.drumchart-mac .mac-home-bar .btn.mac-tool.on { background: var(--mac-seg-on); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
.drumchart-mac .mac-home-bar .btn:disabled { opacity: 0.45; }
.drumchart-mac .mac-home-bar .btn.mac-new { box-shadow: none; }
.drumchart-mac .mac-ico { display: inline-flex; line-height: 0; }
.drumchart-mac .mac-play { color: var(--accent); }
.drumchart-mac .mac-chev { display: inline-flex; line-height: 0; margin-left: 1px; opacity: 0.85; }
.drumchart-mac .mac-bar-sep { width: 1px; height: 20px; background: rgba(127, 127, 127, 0.3); margin: 0 2px; }
.drumchart-mac .mac-home-bar .set-picker { top: calc(100% + 8px); }

/* The search field, round-ended, the magnifier inside it. */
.drumchart-mac .mac-search { position: relative; display: inline-flex; align-items: center; flex: 0 1 200px; min-width: 120px; }
.drumchart-mac .mac-search-ico { position: absolute; left: 8px; display: inline-flex; color: var(--ink-soft); pointer-events: none; }
.drumchart-mac .mac-search input {
  width: 100%;
  height: 28px;
  padding: 0 8px 0 27px;
  border: 0;
  border-radius: 7px;
  background: rgba(127, 127, 127, 0.14);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
.drumchart-mac .mac-search input::placeholder { color: var(--ink-soft); }
.drumchart-mac .mac-search input:focus { outline: 3px solid var(--accent-soft); outline-offset: 0; background: var(--mac-control); }

/* --- the window under the toolbar ----------------------------------------- */
.drumchart-mac .library.mac-home { padding: 0; background: var(--paper); }
.drumchart-mac .mac-home > .library-body { max-width: none; margin: 0; gap: 0; height: 100%; }

/* --- source list --------------------------------------------------------- */
.drumchart-mac .set-nav.mac-side {
  flex: 0 0 210px;
  align-self: stretch;
  max-height: none;
  gap: 1px;
  padding: 10px 10px 0;
  background: var(--mac-sidebar);
  border-right: 1px solid rgba(0, 0, 0, 0.35);
}
.drumchart-mac .mac-side .set-nav-head { margin: 8px 8px 4px; color: var(--ink-faint); }
.drumchart-mac .mac-side .set-nav-head:first-child { margin-top: 2px; }
.drumchart-mac .mac-side .set-nav-item,
.drumchart-mac .mac-side .set-nav-new {
  min-height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 13px;
  gap: 7px;
  cursor: default;
}
.drumchart-mac .mac-side .set-nav-item:hover { background: rgba(127, 127, 127, 0.14); }
.drumchart-mac .mac-side .set-nav-item.active { background: var(--accent-fill); color: var(--accent-ink); font-weight: 400; }
.drumchart-mac .mac-side .set-nav-ico { display: inline-flex; width: 16px; justify-content: center; color: var(--accent); line-height: 0; }
.drumchart-mac .mac-side .set-nav-item.active .set-nav-ico,
.drumchart-mac .mac-side .set-nav-item.active .set-nav-count { color: var(--accent-ink); }
.drumchart-mac .mac-side .set-nav-count { font-size: 12px; color: var(--ink-soft); }
.drumchart-mac .mac-side-none { margin: 2px 8px 6px; font-size: 11px; line-height: 1.4; color: var(--ink-faint); }
/* + New setlist stays at the foot of the source list. */
.drumchart-mac .mac-side .set-nav-new {
  position: sticky;
  bottom: 0;
  margin: auto -10px 0;
  width: calc(100% + 20px);
  min-height: 36px;
  padding: 0 18px;
  background: var(--mac-sidebar);
  border-top: 1px solid rgba(127, 127, 127, 0.2);
  border-radius: 0;
  color: var(--ink-soft);
}
.drumchart-mac .mac-side .set-nav-new .set-nav-ico { font-size: 15px; line-height: 1; }
.drumchart-mac .mac-side .set-nav-new:hover { color: var(--ink); }

/* --- the main column ------------------------------------------------------- */
.drumchart-mac .mac-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.drumchart-mac .mac-main > .backup-note { width: auto; max-width: none; margin: 10px 14px 10px; padding: 8px 12px; border-radius: 8px; font-size: 12px; }
.drumchart-mac .mac-main > .sync-note { padding: 6px 14px 0; }
.drumchart-mac .mac-list { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.drumchart-mac .mac-list > .select-bar { margin: 0; padding: 6px 14px; min-height: 40px; border-bottom: 1px solid var(--line); background: var(--wash); }

/* --- the table --------------------------------------------------------------- */
.drumchart-mac .song-table.mac-table {
  flex: 1 1 auto;
  max-height: none;
  border: 0;
  background: var(--paper);
}
.drumchart-mac .mac-table .mac-row {
  --pos-w: 10px;
  display: grid;
  grid-template-columns: var(--pos-w) 24px minmax(140px, 1.3fr) minmax(100px, 1fr) 64px 64px 160px;
  column-gap: 0;
  align-items: center;
  min-height: 28px;
  font-size: 13px;
  color: var(--ink);
  cursor: default;
}
.drumchart-mac .mac-table.manual .mac-row { --pos-w: 32px; }
.drumchart-mac .mac-table.set-table .mac-row { --pos-w: 30px; }
.drumchart-mac .mac-table.set-table.manual .mac-row { --pos-w: 58px; }
.drumchart-mac .mac-table .mac-row > * { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 8px; }
.drumchart-mac .mac-table .mac-row > .mac-col-pos,
.drumchart-mac .mac-table .mac-row > .mac-col-star { padding: 0; }
.drumchart-mac .mac-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.drumchart-mac .mac-col-artist, .drumchart-mac .mac-col-tempo, .drumchart-mac .mac-col-length { color: var(--ink-soft); }
.drumchart-mac .mac-title { font-weight: 500; }

/* Headings: small, grey, a hairline between columns; the sorted one darker
   with its arrow. */
.drumchart-mac .mac-table .song-table-head.mac-row {
  min-height: 26px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.drumchart-mac .song-table-head .mac-col-title,
.drumchart-mac .song-table-head .mac-col-artist,
.drumchart-mac .song-table-head .mac-col-tempo,
.drumchart-mac .song-table-head .mac-col-length { box-shadow: inset 1px 0 0 rgba(127, 127, 127, 0.22); padding: 0; }
.drumchart-mac .song-table-head .mac-col-pos { padding: 0; }
.drumchart-mac .mac-head-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  height: 26px;
  padding: 0 8px;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 500;
  color: var(--ink-soft);
  text-align: left;
  cursor: default;
}
.drumchart-mac .num > .mac-head-btn { justify-content: flex-end; }
.drumchart-mac button.mac-head-btn:hover { color: var(--ink); background: rgba(127, 127, 127, 0.1); }
.drumchart-mac .mac-head-btn.on { color: var(--ink); font-weight: 600; }
.drumchart-mac .mac-head-arrow { display: inline-flex; line-height: 0; color: var(--ink-soft); }
.drumchart-mac .set-table .song-table-head .mac-col-pos .mac-head-btn { justify-content: flex-end; padding: 0 6px; }

/* Rows: stripes as a Mac table has, a wash under the pointer, the chosen
   one filled with the accent. */
.drumchart-mac .mac-table .song-table-body > .mac-row + .mac-row { border-top: 0; }
.drumchart-mac .mac-table .song-table-body > .mac-row:nth-child(even) { background: rgba(127, 127, 127, 0.06); }
.drumchart-mac .mac-table .song-table-body > .mac-row:hover { background: rgba(127, 127, 127, 0.14); }
.drumchart-mac .mac-table .song-table-body > .mac-row.selected,
.drumchart-mac .mac-table .song-table-body > .mac-row.pick-row.picked { background: var(--accent-fill); color: var(--accent-ink); }
.drumchart-mac .mac-row.selected > *, .drumchart-mac .mac-row.picked > * { color: var(--accent-ink); }
.drumchart-mac .mac-table.picking .mac-row { cursor: default; }

.drumchart-mac .mac-col-pos { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.drumchart-mac .mac-row .set-drag { width: 24px; height: 24px; font-size: 13px; color: var(--ink-faint); cursor: grab; box-shadow: none; }
.drumchart-mac .mac-row .set-pos { min-width: 22px; padding-right: 6px; text-align: right; font-size: 12px; color: var(--ink-soft); }
.drumchart-mac .mac-row.selected .set-drag, .drumchart-mac .mac-row.selected .set-pos { color: var(--accent-ink); }
.drumchart-mac .mac-col-star { display: flex; align-items: center; justify-content: center; }
.drumchart-mac .mac-row .song-star { padding: 2px 4px; font-size: 13px; opacity: 0; }
.drumchart-mac .mac-row:hover .song-star, .drumchart-mac .mac-row.selected .song-star, .drumchart-mac .mac-row .song-star:focus-visible { opacity: 0.7; }
.drumchart-mac .mac-row .song-star.on { opacity: 1; color: #f5b40f; }
.drumchart-mac .mac-row.selected .song-star { color: var(--accent-ink); }
.drumchart-mac .mac-row .song-pick { margin: 0; color: var(--accent-ink); }
.drumchart-mac .mac-row.picked .song-pick { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--accent-fill); }

/* View, Edit and ⋯ appear on the row under the pointer, or the one picked out. */
.drumchart-mac .mac-col-tools { display: flex; justify-content: flex-end; }
.drumchart-mac .mac-row-tools { display: inline-flex; gap: 4px; visibility: hidden; }
.drumchart-mac .mac-row:hover .mac-row-tools,
.drumchart-mac .mac-row.selected .mac-row-tools,
.drumchart-mac .mac-row-tools:focus-within { visibility: visible; }
.drumchart-mac .mac-row-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border: 0;
  border-radius: 5px;
  background: rgba(127, 127, 127, 0.18);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}
.drumchart-mac .mac-row-btn:hover { background: rgba(127, 127, 127, 0.32); }
.drumchart-mac .mac-row-btn .mac-ico { color: var(--accent); }
.drumchart-mac .mac-row-btn.more-btn { padding: 0 4px; }
.drumchart-mac .mac-row-btn.more-btn .mac-ico { color: inherit; }
.drumchart-mac .mac-row.selected .mac-row-btn { background: rgba(255, 255, 255, 0.22); color: var(--accent-ink); }
.drumchart-mac .mac-row.selected .mac-row-btn .mac-ico { color: var(--accent-ink); }

/* --- status bar and empty states ----------------------------------------- */
.drumchart-mac .mac-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 26px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  background: var(--mac-toolbar);
  font-size: 11px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.drumchart-mac .mac-foot-hint { margin-left: auto; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drumchart-mac .mac-empty {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 20px 80px;
  text-align: center;
}
.drumchart-mac .mac-empty h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.drumchart-mac .mac-empty p { margin: 0; max-width: 360px; font-size: 13px; color: var(--ink-soft); }
.drumchart-mac .mac-empty-mark { display: inline-flex; color: var(--ink-faint); margin-bottom: 6px; }
.drumchart-mac .mac-empty-mark .app-mark { width: 52px; opacity: 0.8; }
.drumchart-mac .mac-empty-mark .app-mark .beat { stroke: var(--accent); }
.drumchart-mac .mac-empty-actions { display: flex; gap: 8px; margin-top: 10px; }
.drumchart-mac .mac-empty-actions .btn { min-height: 28px; padding: 0 14px; }
.drumchart-mac .mac-link { margin-top: 6px; border: 0; background: none; font: inherit; font-size: 12px; color: var(--accent); }
.drumchart-mac .mac-link:hover { text-decoration: underline; }

/* A narrow window: the numbers give way to the names. */
@media (max-width: 860px) {
  .drumchart-mac .mac-table .mac-row { grid-template-columns: var(--pos-w) 24px minmax(120px, 1.3fr) minmax(80px, 1fr) 0 0 150px; }
  .drumchart-mac .mac-table .mac-col-tempo, .drumchart-mac .mac-table .mac-col-length { visibility: hidden; padding: 0; }
  .drumchart-mac .set-nav.mac-side { flex-basis: 170px; }
  .drumchart-mac .mac-search { flex-basis: 150px; }
}
