/* Loaded after polish.css: arrangement and existing note grids share height. */
body.zt-song-mode.zt-song-editor-open #songTimelineContainer {
  min-height: var(--song-editor-arranger-min-height, 300px) !important;
}
.zt-song-editor {
  flex: 0 0 var(--song-editor-height, 350px);
  height: var(--song-editor-height, 350px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  background: var(--surface-200, #111114);
  border-top: 1px solid rgba(139, 92, 246, .48);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, .24);
}
.zt-song-editor__resize {
  flex: 0 0 9px;
  position: relative;
  cursor: ns-resize;
  touch-action: none;
  background: rgba(139, 92, 246, .05);
}
.zt-song-editor__resize::after {
  content: '';
  position: absolute;
  top: 3px;
  left: calc(50% - 24px);
  width: 48px;
  height: 3px;
  border-radius: 3px;
  background: rgba(167, 139, 250, .5);
}
.zt-song-editor__resize:hover,
.zt-song-editor__resize:focus-visible { background: rgba(139, 92, 246, .2); }
.zt-song-editor-resizing, .zt-song-editor-resizing * { cursor: ns-resize !important; user-select: none !important; }
.zt-song-editor__header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 12px 6px;
  flex-shrink: 0;
}
.zt-song-editor__header h2 {
  flex: 0 0 auto;
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-primary, #fafafa);
}
.zt-song-editor__track {
  max-width: 170px;
  min-width: 80px;
  height: 28px;
  padding: 0 8px;
  border-radius: 5px;
  border: 1px solid var(--border-default, #ffffff1a);
  background: var(--surface-400, #1f1f23);
  color: var(--text-primary, #fafafa);
  font: inherit;
  font-size: 12px;
}
.zt-song-editor__tabs {
  display: flex;
  align-self: stretch;
  gap: 2px;
  border-left: 1px solid var(--border-default, #ffffff1a);
  padding-left: 8px;
}
.zt-song-editor__tabs button {
  min-width: 48px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 4px 4px 0 0;
  padding: 0 8px;
  background: transparent;
  color: var(--text-secondary, #a1a1aa);
  font: 11px inherit;
  cursor: pointer;
}
.zt-song-editor__tabs button:hover { color: var(--text-primary, #fafafa); background: #ffffff0d; }
.zt-song-editor__tabs button[aria-selected="true"] { color: var(--text-primary, #fafafa); border-bottom-color: var(--accent-primary, #8b5cf6); }
.zt-song-editor__position { color: var(--text-secondary, #a1a1aa); font-size: 11px; white-space: nowrap; }
.zt-song-editor__pinned {
  font-size: 10px;
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, .25);
  border-radius: 4px;
  padding: 3px 6px;
  white-space: nowrap;
}
.zt-song-editor__tools { margin-left: auto; }
.zt-song-editor__tools .zt-editor-toolbar { display: flex !important; margin: 0; }
.zt-song-editor__expand, .zt-song-editor__close {
  flex-shrink: 0;
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--border-default, #ffffff1a);
  border-radius: 5px;
  color: var(--text-secondary, #a1a1aa);
  background: transparent;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.zt-song-editor__close { width: 28px; padding: 0; font-size: 21px; line-height: 1; }
.zt-song-editor__expand:hover, .zt-song-editor__close:hover { background: #ffffff0d; color: #fafafa; }
.zt-song-editor :focus-visible { outline: 2px solid #a78bfa; outline-offset: -2px; }
body.zt-song-mode .zt-song-editor .edit-context-banner {
  display: flex !important;
  margin: 0 !important;
  border-radius: 0;
  border-bottom: 1px solid var(--border-default, #ffffff1a);
}
.zt-song-editor__context { flex-shrink: 0; }
body .zt-song-editor .edit-context-left { flex: 1 1 auto; min-width: 0; }
body .zt-song-editor .edit-context-name { min-width: 64px; }
body .zt-song-editor .edit-context-right { flex: 0 1 45%; min-width: 0; max-width: 45%; overflow: hidden; }
body .zt-song-editor .edit-context-scope { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.zt-song-editor__content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #ffffff24 transparent;
  padding: 8px 10px;
}
.zt-song-editor__content .tracks-container { margin: 0; padding: 0; }
.zt-song-editor .zt-workflow-hint { display: none; }
.zt-song-editor .track-header:focus { outline: 1px solid rgba(167, 139, 250, .6); outline-offset: -1px; }
@media (max-width: 1050px) {
  .zt-song-editor__pinned { display: none; }
  .zt-song-editor__tabs button { min-width: 42px; padding-inline: 5px; }
  .zt-song-editor .edit-context-playback { display: none; }
  .zt-song-editor .edit-context-right { min-width: 0; }
}
@media (max-width: 700px) {
  .zt-song-editor__header { gap: 6px; padding: 0 7px 5px; flex-wrap: wrap; }
  .zt-song-editor__header h2 { font-size: 11px; }
  .zt-song-editor__track { max-width: 115px; }
  .zt-song-editor__tabs { order: 3; width: 100%; height: 30px; padding-left: 0; border-left: 0; border-top: 1px solid var(--border-default, #ffffff1a); }
  .zt-song-editor__tabs button { flex: 1 1 0; }
  .zt-song-editor__position { display: none; }
  .zt-song-editor__expand { font-size: 10px; padding: 0 5px; }
  .zt-song-editor__content { padding: 5px; }
  .zt-song-editor .edit-context-banner { flex-wrap: wrap; gap: 3px; }
  .zt-song-editor .edit-context-right { width: 100%; }
}
