/* Bit2Beat · dialogs */
dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
dialog::backdrop {
  background: rgba(14, 23, 41, 0.45);
}
.dlg-wide {
  width: min(980px, calc(100vw - 32px));
}
.dlg-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.dlg-head h2 {
  font-size: 1.15rem;
}
dialog > * + * {
  margin-top: 12px;
}
.dlg-note {
  color: var(--muted);
  font-size: 0.85rem;
}
.dlg-status {
  font-size: 0.875rem;
  min-height: 1.4em;
}
.table-wrap {
  max-height: 60vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
th,
td {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid var(--grid);
  white-space: nowrap;
}
thead th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  font-weight: 600;
}
tbody tr {
  cursor: pointer;
}
tbody tr:hover,
tbody tr:focus {
  background: var(--surface-2);
}
.score-tools {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}
.score-paper {
  background: #fff;
  color: #14213d;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px;
  max-height: 64vh;
  overflow: auto;
  scrollbar-gutter: stable;
}
/* Full score: the dialog fits the window and the paper takes the rest, scrolling, so every staff
   can be reached however many channels are on and however small the window is. */
#scoreDialog[open] {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 32px);
  overflow: hidden;
}
#scoreDialog .score-paper {
  flex: 1 1 auto;
  min-height: 120px;
  max-height: none;
  overscroll-behavior: contain;
}
#scoreDialog > * {
  flex-shrink: 0;
}
#scoreDialog > .score-paper {
  flex-shrink: 1;
}
.access-list {
  display: grid;
  gap: 12px;
}
.help-steps {
  padding-left: 20px;
  display: grid;
  gap: 8px;
}
.keys {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  margin: 8px 0 0;
}
.keys dd {
  margin: 0;
}
.save-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.save-form .field {
  flex: 1;
}
.session-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}
.session-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--grid);
  border-radius: var(--radius-sm);
}
.session-list li div {
  display: grid;
}
.session-list small {
  color: var(--muted);
}
.session-list .empty {
  color: var(--muted);
  justify-content: center;
}

/* Export: three big buttons that use your settings as they are */
.export-uses {
  color: var(--muted);
}
.export-main {
  display: grid;
  gap: 10px;
}
.export-big {
  width: 100%;
  min-width: 0;
  white-space: normal;
  justify-content: flex-start;
  text-align: left;
  min-height: 56px;
  padding: 10px 14px;
  gap: 12px;
}
.export-big span {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.export-main {
  min-width: 0;
}
.export-big small {
  font-weight: 400;
  opacity: 0.85;
  font-size: 0.82rem;
}
.export-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}
.export-progress[hidden] {
  display: none;
}
.export-progress progress {
  flex: 1;
  height: 10px;
  accent-color: var(--amber);
}
.export-more summary {
  cursor: pointer;
  font-weight: 600;
  padding: 4px 0;
}
.export-more > * + * {
  margin-top: 10px;
}
