body[data-tool='midi-editor'] #main {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}
body[data-tool='midi-editor'] .site-header {
  display: none;
}
.midi-workbench {
  background: #fff;
  height: 100dvh;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.midi-workbench:fullscreen {
  width: 100%;
  height: 100dvh;
}
.midi-workbench-home {
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  padding-right: 12px;
  border-right: 1px solid #dce4f1;
}
.midi-workbench-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-height: 40px;
  padding: 4px 12px;
  flex-shrink: 0;
  border-bottom: 1px solid #dce4f1;
}
.midi-workbench-bar h1 {
  font-size: 15px;
  margin: 0;
  white-space: nowrap;
}
.midi-workbench-bar [role='tablist'] {
  display: flex;
  gap: 4px;
}
.midi-workbench-bar button {
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 13px;
}
.midi-workbench-bar [role='tab'][aria-selected='false'] {
  background: transparent;
  color: #506179;
  border-color: transparent;
}
#midi-workbench-status {
  font-size: 12px;
  color: #62738e;
  margin-left: auto;
}
#midi-source-download {
  font-size: 12px;
}
#midi-workbench-error {
  margin: 0;
  padding: 8px 18px;
  color: #a63820;
  background: #fff3ed;
}
#midi-workbench-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
#midi-edit-panel,
#midi-inspect-panel,
#midi-video-panel {
  flex: 1;
  min-height: 0;
}
#midi-inspect-panel,
#midi-video-panel {
  overflow: auto;
  padding: 20px;
}
.midi-workbench .midi-inspection {
  max-width: 1100px;
  margin: auto;
}
.midi-workbench .midi-inspection h3 {
  margin: 0 0 8px;
}
.midi-workbench .midi-inspection p {
  font-size: 14px;
  margin: 8px 0;
}
.midi-workbench .midi-inspection fieldset {
  border: 1px solid #dce4f1;
  border-radius: 10px;
  padding: 16px;
  margin: 12px 0;
}
.midi-workbench .midi-inspection label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  font-size: 14px;
}
.midi-workbench .midi-inspection input[type='checkbox'] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.midi-workbench .midi-inspection input[type='text'],
.midi-workbench .midi-inspection input[type='number'] {
  max-width: 260px;
  padding: 6px 10px;
  min-height: 36px;
}
.midi-workbench .inspection-actions,
.midi-workbench .inspection-footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.midi-workbench .inspection-actions button,
.midi-workbench .inspection-footer-actions button {
  min-height: 36px;
  font-size: 14px;
  padding: 7px 14px;
}
.midi-workbench + .search-guide {
  margin: 24px auto;
  max-width: 1200px;
  padding: 0 20px;
}
@media (max-width: 600px) {
  .midi-workbench-bar {
    padding: 4px 8px;
    gap: 4px 8px;
  }
  #midi-workbench-status {
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .midi-workbench-home {
    padding-right: 8px;
  }
  .midi-workbench-bar h1 {
    font-size: 13px;
  }
  #midi-inspect-panel {
    padding: 12px;
  }
}

#midi-edit-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
}
#midi-workbench-frame {
  flex: 1;
  min-height: 0;
}
.midi-workbench.editor-active:not(.editor-error) .midi-workbench-bar {
  display: none;
}
body[data-tool='midi-editor'] {
  overflow: hidden;
}
body[data-tool='midi-editor'] .site-footer {
  display: none;
}
#midi-guide {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  box-sizing: border-box;
  padding: 0 20px 20px;
  border: 1px solid #dce4f1;
  border-radius: 12px;
  overflow: auto;
}
#midi-guide::backdrop {
  background: rgb(24 34 54 / 40%);
}
.midi-guide-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  position: sticky;
  top: 0;
  background: #fff;
  padding: 12px 0;
  z-index: 1;
}
.midi-guide-bar h2 {
  font-size: 16px;
  margin: 0;
}
#midi-guide .search-guide {
  margin: 0;
  padding: 12px 0;
  border: 0;
}
.midi-guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.midi-video {
  max-width: 1380px;
  margin: 0 auto;
}
.midi-video-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}
.midi-video-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.midi-video-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 14px;
  background: #f8fafd;
  border: 1px solid #dce4f1;
  border-radius: 10px;
}
.midi-video-filemeta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.midi-video-filemeta strong {
  font-size: 15px;
  color: #16233b;
}
.midi-video-filemeta span {
  font-size: 13px;
  color: #506179;
}
.midi-video-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.midi-video-actions button,
.midi-video-actions .button {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.midi-video-upload {
  cursor: pointer;
}
.midi-video-stage {
  background: #0b1020;
  border: 1px solid #dce4f1;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
#midi-video-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.midi-video-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #f8fafd;
  border: 1px solid #dce4f1;
  border-radius: 10px;
}
.midi-video-controls button {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 13px;
  white-space: nowrap;
}
#midi-video-scrub {
  flex: 1;
  min-width: 120px;
}
#midi-video-time {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: #36455d;
  white-space: nowrap;
}
.midi-video-settings {
  background: #f8fafd;
  border: 1px solid #dce4f1;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.midi-video-settings h3 {
  margin: 0;
  font-size: 16px;
}
.midi-video-settings label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #36455d;
}
.midi-video-settings select {
  width: 100%;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #c8d4e6;
  background: #fff;
  font-size: 14px;
  color: #16233b;
}
.midi-video-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #506179;
}
.midi-video-render-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.midi-video-render-actions button {
  min-height: 44px;
  width: 100%;
  font-size: 14px;
}
.midi-video-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.midi-video-progress progress {
  width: 100%;
  height: 10px;
}
.midi-video-progress span {
  font-size: 13px;
  color: #36455d;
}
.midi-video-result {
  background: #f8fafd;
  border: 1px solid #c8d4e6;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.midi-video-result-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.midi-video-result-head h3 {
  margin: 0 0 2px;
  font-size: 15px;
}
.midi-video-result-head p {
  margin: 0;
  font-size: 13px;
  color: #506179;
}
#midi-video-player {
  width: 100%;
  max-height: 420px;
  border-radius: 8px;
  background: #0b1020;
}
@media (max-width: 960px) {
  .midi-video-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 600px) {
  #midi-video-panel {
    padding: 12px;
  }
  .midi-video-actions button,
  .midi-video-actions .button {
    min-height: 44px;
  }
}
